Skip to content

Commit 823b92d

Browse files
committed
New rails engine
0 parents  commit 823b92d

11 files changed

+156
-0
lines changed

.gitignore

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

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 sortable_by.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]

MIT-LICENSE

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright 2017 Greg Woods
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+
# SortableBy
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 'sortable_by'
12+
```
13+
14+
And then execute:
15+
```bash
16+
$ bundle
17+
```
18+
19+
Or install it yourself as:
20+
```bash
21+
$ gem install sortable_by
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

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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 = 'SortableBy'
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("../test/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+
27+
require 'rake/testtask'
28+
29+
Rake::TestTask.new(:test) do |t|
30+
t.libs << 'test'
31+
t.pattern = 'test/**/*_test.rb'
32+
t.verbose = false
33+
end
34+
35+
36+
task default: :test

bin/rails

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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/sortable_by/engine', __FILE__)
7+
APP_PATH = File.expand_path('../../test/dummy/config/application', __FILE__)
8+
9+
# Set up gems listed in the Gemfile.
10+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
11+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
12+
13+
require 'rails/all'
14+
require 'rails/engine/commands'

lib/sortable_by.rb

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
require "sortable_by/engine"
2+
3+
module SortableBy
4+
end

lib/sortable_by/engine.rb

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module SortableBy
2+
class Engine < ::Rails::Engine
3+
end
4+
end

lib/sortable_by/version.rb

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

lib/tasks/sortable_by_tasks.rake

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

sortable_by.gemspec

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
$:.push File.expand_path("../lib", __FILE__)
2+
3+
# Maintain your gem's version:
4+
require "sortable_by/version"
5+
6+
# Describe your gem and declare its dependencies:
7+
Gem::Specification.new do |s|
8+
s.name = "sortable_by"
9+
s.version = SortableBy::VERSION
10+
s.authors = ["Greg Woods"]
11+
s.email = ["greg.woods@moserit.com"]
12+
s.homepage = "TODO"
13+
s.summary = "TODO: Summary of SortableBy."
14+
s.description = "TODO: Description of SortableBy."
15+
s.license = "MIT"
16+
17+
s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"]
18+
19+
s.add_dependency "rails", "~> 5.1.2"
20+
21+
s.add_development_dependency "sqlite3"
22+
end

0 commit comments

Comments
 (0)