Skip to content

Commit 617f79a

Browse files
committed
add skeleton for API-only rails engine
0 parents  commit 617f79a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1090
-0
lines changed

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.bundle/
2+
log/*.log
3+
pkg/
4+
spec/dummy/db/*.sqlite3
5+
spec/dummy/db/*.sqlite3-journal
6+
spec/dummy/log/*.log
7+
spec/dummy/tmp/
8+
coverage/

.rspec

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
--color
2+
--format documentation
3+
#--format Fuubar

.rubocop

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--display-cop-names

.rubocop.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
inherit_from: .rubocop_todo.yml
2+
Rails:
3+
Enabled: true
4+
require:
5+
- rubocop-rspec

Gemfile

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
source 'https://rubygems.org'
2+
3+
# Declare your gem's dependencies in ontological.gemspec.
4+
# Bundler will treat runtime dependencies like base dependencies, and
5+
# development dependencies will be added by default to the :development group.
6+
gemspec
7+
8+
# Declare any dependencies that are still in development here instead of in
9+
# your gemspec. These might include edge Rails or gems from your path or
10+
# Git. Remember to move these dependencies to your gemspec before releasing
11+
# your gem to rubygems.org.
12+
13+
# To use a debugger
14+
# gem 'byebug', group: [:development, :test]

Gemfile.lock

+172
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
PATH
2+
remote: .
3+
specs:
4+
ontological (0.1.0)
5+
rails (~> 5.0.0, >= 5.0.0.1)
6+
7+
GEM
8+
remote: https://rubygems.org/
9+
specs:
10+
actioncable (5.0.0.1)
11+
actionpack (= 5.0.0.1)
12+
nio4r (~> 1.2)
13+
websocket-driver (~> 0.6.1)
14+
actionmailer (5.0.0.1)
15+
actionpack (= 5.0.0.1)
16+
actionview (= 5.0.0.1)
17+
activejob (= 5.0.0.1)
18+
mail (~> 2.5, >= 2.5.4)
19+
rails-dom-testing (~> 2.0)
20+
actionpack (5.0.0.1)
21+
actionview (= 5.0.0.1)
22+
activesupport (= 5.0.0.1)
23+
rack (~> 2.0)
24+
rack-test (~> 0.6.3)
25+
rails-dom-testing (~> 2.0)
26+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
27+
actionview (5.0.0.1)
28+
activesupport (= 5.0.0.1)
29+
builder (~> 3.1)
30+
erubis (~> 2.7.0)
31+
rails-dom-testing (~> 2.0)
32+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
33+
activejob (5.0.0.1)
34+
activesupport (= 5.0.0.1)
35+
globalid (>= 0.3.6)
36+
activemodel (5.0.0.1)
37+
activesupport (= 5.0.0.1)
38+
activerecord (5.0.0.1)
39+
activemodel (= 5.0.0.1)
40+
activesupport (= 5.0.0.1)
41+
arel (~> 7.0)
42+
activesupport (5.0.0.1)
43+
concurrent-ruby (~> 1.0, >= 1.0.2)
44+
i18n (~> 0.7)
45+
minitest (~> 5.1)
46+
tzinfo (~> 1.1)
47+
arel (7.1.4)
48+
ast (2.3.0)
49+
builder (3.2.2)
50+
concurrent-ruby (1.0.2)
51+
diff-lcs (1.2.5)
52+
docile (1.1.5)
53+
erubis (2.7.0)
54+
factory_girl (4.7.0)
55+
activesupport (>= 3.0.0)
56+
factory_girl_rails (4.7.0)
57+
factory_girl (~> 4.7.0)
58+
railties (>= 3.0.0)
59+
fuubar (2.2.0)
60+
rspec-core (~> 3.0)
61+
ruby-progressbar (~> 1.4)
62+
globalid (0.3.7)
63+
activesupport (>= 4.1.0)
64+
i18n (0.7.0)
65+
json (2.0.2)
66+
loofah (2.0.3)
67+
nokogiri (>= 1.5.9)
68+
mail (2.6.4)
69+
mime-types (>= 1.16, < 4)
70+
method_source (0.8.2)
71+
mime-types (3.1)
72+
mime-types-data (~> 3.2015)
73+
mime-types-data (3.2016.0521)
74+
mini_portile2 (2.1.0)
75+
minitest (5.9.1)
76+
nio4r (1.2.1)
77+
nokogiri (1.6.8.1)
78+
mini_portile2 (~> 2.1.0)
79+
parser (2.3.1.4)
80+
ast (~> 2.2)
81+
powerpack (0.1.1)
82+
rack (2.0.1)
83+
rack-test (0.6.3)
84+
rack (>= 1.0)
85+
rails (5.0.0.1)
86+
actioncable (= 5.0.0.1)
87+
actionmailer (= 5.0.0.1)
88+
actionpack (= 5.0.0.1)
89+
actionview (= 5.0.0.1)
90+
activejob (= 5.0.0.1)
91+
activemodel (= 5.0.0.1)
92+
activerecord (= 5.0.0.1)
93+
activesupport (= 5.0.0.1)
94+
bundler (>= 1.3.0, < 2.0)
95+
railties (= 5.0.0.1)
96+
sprockets-rails (>= 2.0.0)
97+
rails-dom-testing (2.0.1)
98+
activesupport (>= 4.2.0, < 6.0)
99+
nokogiri (~> 1.6.0)
100+
rails-html-sanitizer (1.0.3)
101+
loofah (~> 2.0)
102+
railties (5.0.0.1)
103+
actionpack (= 5.0.0.1)
104+
activesupport (= 5.0.0.1)
105+
method_source
106+
rake (>= 0.8.7)
107+
thor (>= 0.18.1, < 2.0)
108+
rainbow (2.1.0)
109+
rake (11.3.0)
110+
rspec-core (3.5.4)
111+
rspec-support (~> 3.5.0)
112+
rspec-expectations (3.5.0)
113+
diff-lcs (>= 1.2.0, < 2.0)
114+
rspec-support (~> 3.5.0)
115+
rspec-mocks (3.5.0)
116+
diff-lcs (>= 1.2.0, < 2.0)
117+
rspec-support (~> 3.5.0)
118+
rspec-rails (3.5.2)
119+
actionpack (>= 3.0)
120+
activesupport (>= 3.0)
121+
railties (>= 3.0)
122+
rspec-core (~> 3.5.0)
123+
rspec-expectations (~> 3.5.0)
124+
rspec-mocks (~> 3.5.0)
125+
rspec-support (~> 3.5.0)
126+
rspec-support (3.5.0)
127+
rubocop (0.45.0)
128+
parser (>= 2.3.1.1, < 3.0)
129+
powerpack (~> 0.1)
130+
rainbow (>= 1.99.1, < 3.0)
131+
ruby-progressbar (~> 1.7)
132+
unicode-display_width (~> 1.0, >= 1.0.1)
133+
rubocop-rspec (1.8.0)
134+
rubocop (>= 0.42.0)
135+
ruby-progressbar (1.8.1)
136+
simplecov (0.12.0)
137+
docile (~> 1.1.0)
138+
json (>= 1.8, < 3)
139+
simplecov-html (~> 0.10.0)
140+
simplecov-html (0.10.0)
141+
sprockets (3.7.0)
142+
concurrent-ruby (~> 1.0)
143+
rack (> 1, < 3)
144+
sprockets-rails (3.2.0)
145+
actionpack (>= 4.0)
146+
activesupport (>= 4.0)
147+
sprockets (>= 3.0.0)
148+
sqlite3 (1.3.12)
149+
thor (0.19.1)
150+
thread_safe (0.3.5)
151+
tzinfo (1.2.2)
152+
thread_safe (~> 0.1)
153+
unicode-display_width (1.1.1)
154+
websocket-driver (0.6.4)
155+
websocket-extensions (>= 0.1.0)
156+
websocket-extensions (0.1.2)
157+
158+
PLATFORMS
159+
ruby
160+
161+
DEPENDENCIES
162+
factory_girl_rails
163+
fuubar
164+
ontological!
165+
rspec-rails
166+
rubocop
167+
rubocop-rspec
168+
simplecov
169+
sqlite3
170+
171+
BUNDLED WITH
172+
1.13.6

MIT-LICENSE

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright 2016 Moritz E. Beber
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Ontological
2+
Short description and motivation.
3+
4+
## Usage
5+
How to use my plugin.
6+
7+
## Installation
8+
Add this line to your application's Gemfile:
9+
10+
```ruby
11+
gem 'ontological'
12+
```
13+
14+
And then execute:
15+
```bash
16+
$ bundle
17+
```
18+
19+
Or install it yourself as:
20+
```bash
21+
$ gem install ontological
22+
```
23+
24+
## Contributing
25+
Contribution directions go here.
26+
27+
## License
28+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

Rakefile

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
begin
2+
require 'bundler/setup'
3+
rescue LoadError
4+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5+
end
6+
7+
require 'rdoc/task'
8+
9+
RDoc::Task.new(:rdoc) do |rdoc|
10+
rdoc.rdoc_dir = 'rdoc'
11+
rdoc.title = 'Ontological'
12+
rdoc.options << '--line-numbers'
13+
rdoc.rdoc_files.include('README.md')
14+
rdoc.rdoc_files.include('lib/**/*.rb')
15+
end
16+
17+
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
18+
load 'rails/tasks/engine.rake'
19+
20+
21+
load 'rails/tasks/statistics.rake'
22+
23+
24+
25+
require 'bundler/gem_tasks'
26+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module Ontological
2+
class ApplicationRecord < ActiveRecord::Base
3+
self.abstract_class = true
4+
end
5+
end

bin/rails

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env ruby
2+
# This command will automatically be run when you run "rails" with Rails gems
3+
# installed from the root of your application.
4+
5+
ENGINE_ROOT = File.expand_path('../..', __FILE__)
6+
ENGINE_PATH = File.expand_path('../../lib/ontological/engine', __FILE__)
7+
8+
# Set up gems listed in the Gemfile.
9+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
10+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
11+
12+
require 'rails/all'
13+
require 'rails/engine/commands'

config/routes.rb

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Ontological::Engine.routes.draw do
2+
end

lib/ontological.rb

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
require "ontological/engine"
2+
3+
module Ontological
4+
# Your code goes here...
5+
end

lib/ontological/engine.rb

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module Ontological
2+
class Engine < ::Rails::Engine
3+
isolate_namespace Ontological
4+
5+
config.generators do |g|
6+
g.api_only = true
7+
g.test_framework :rspec, fixture: false
8+
g.fixture_replacement :factory_girl, dir: 'spec/factories'
9+
end
10+
end
11+
end

lib/ontological/version.rb

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module Ontological
2+
VERSION = '0.1.0'
3+
end

lib/tasks/ontological_tasks.rake

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# desc "Explaining what the task does"
2+
# task :ontological do
3+
# # Task goes here
4+
# end

ontological.gemspec

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
$:.push File.expand_path('../lib', __FILE__)
2+
3+
# Maintain your gem's version:
4+
require 'ontological/version'
5+
6+
# Describe your gem and declare its dependencies:
7+
Gem::Specification.new do |s|
8+
s.name = 'ontological'
9+
s.version = Ontological::VERSION
10+
s.authors = ['Moritz E. Beber']
11+
s.email = ['[email protected]']
12+
s.homepage = 'https://github.com/metacollect-org/'
13+
s.summary = 'The ontological rails engine provides models and logic for working with categories similar to an RDF triple store.'
14+
s.description = 'Insert README here.'
15+
s.license = 'MIT'
16+
17+
s.files = Dir['{app,config,db,lib}/**/*', 'spec/factories/**/*', 'MIT-LICENSE', 'Rakefile', 'README.md']
18+
s.test_files = Dir['spec/**/*']
19+
20+
s.add_dependency 'rails', '~> 5.0.0', '>= 5.0.0.1'
21+
22+
s.add_development_dependency 'sqlite3'
23+
s.add_development_dependency 'rspec-rails'
24+
s.add_development_dependency 'factory_girl_rails'
25+
s.add_development_dependency 'rubocop'
26+
s.add_development_dependency 'rubocop-rspec'
27+
s.add_development_dependency 'simplecov'
28+
s.add_development_dependency 'fuubar'
29+
end

spec/dummy/Rakefile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Add your own tasks in files placed in lib/tasks ending in .rake,
2+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3+
4+
require_relative 'config/application'
5+
6+
Rails.application.load_tasks
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
//= link_directory ../javascripts .js
3+
//= link_directory ../stylesheets .css
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// This is a manifest file that'll be compiled into application.js, which will include all the files
2+
// listed below.
3+
//
4+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5+
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6+
//
7+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8+
// compiled file. JavaScript code in this file should be added after the last require_* statement.
9+
//
10+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11+
// about supported directives.
12+
//
13+
//= require_tree .

0 commit comments

Comments
 (0)