stirling 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: dcd4d7625d68ef9c0a952d3aaacbba7452d70594
4
+ data.tar.gz: aa8d6d986a01e2afcad03768270d22e908aef3d1
5
+ SHA512:
6
+ metadata.gz: 7c5debeab754634ca92f0abc50fb53927a17511c45c72514e59120f23815650dd529633064039cbcef4159daf293698c92e367881d8ca0e83ef33591297303c9
7
+ data.tar.gz: 5a0bda733c75e0efea0d06446c8605a94c97e07bfb606cef95840e0b9d2163b8cf540a214dc4deb0dd8874cad2875668ca367c704be61a3049ce1997fd54a163
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2015 YOURNAME
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.
data/README.md ADDED
@@ -0,0 +1,4 @@
1
+ # Stirling [![Build Status](https://travis-ci.org/framgia/stirling.svg)](https://travis-ci.org/framgia/stirling)
2
+
3
+ # Copyright
4
+ This project rocks and uses MIT-LICENSE.
data/Rakefile ADDED
@@ -0,0 +1,23 @@
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 = 'Stirling'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
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
+
22
+ Bundler::GemHelper.install_tasks
23
+
@@ -0,0 +1,54 @@
1
+ class Stirling::BaseController < ApplicationController
2
+ before_filter :build_instance, only: [:new, :create]
3
+ before_filter :set_instance, only: [:show, :destroy, :edit, :update]
4
+ before_filter :assign_params, only: [:update]
5
+
6
+ def index; end
7
+ def show; end
8
+ def new; end
9
+ def create; end
10
+ def edit; end
11
+ def update; end
12
+ def destroy; end
13
+
14
+ private
15
+ def set_instance
16
+ instance = model.find params[:id]
17
+ end
18
+
19
+ def build_instance
20
+ instance = model.new model_params
21
+ end
22
+
23
+ def instance
24
+ instance_variable_get "@#{model_name}"
25
+ end
26
+
27
+ def instance= new_instance
28
+ instance_variable_set "@#{model_name}", new_instance
29
+ end
30
+
31
+ def assign_params
32
+ instance.assign_attributes model_params
33
+ end
34
+
35
+ def model
36
+ model_name.classify.safe_constantize
37
+ end
38
+
39
+ def model_name
40
+ controller_name.singularize
41
+ end
42
+
43
+ def model_name_symbol
44
+ model_name.intern
45
+ end
46
+
47
+ def model_params
48
+ if Rails.version >= "4.0.0"
49
+ params.fetch(model_name_symbol, {}).permit model.acceptable_attributes
50
+ else
51
+ params[model_name_symbol]
52
+ end
53
+ end
54
+ end
data/config/routes.rb ADDED
@@ -0,0 +1,2 @@
1
+ Rails.application.routes.draw do
2
+ end
@@ -0,0 +1,7 @@
1
+ module Stirling
2
+ class Engine < ::Rails::Engine
3
+ config.generators do |g|
4
+ g.test_framework :rspec
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,3 @@
1
+ module Stirling
2
+ VERSION = "0.0.1"
3
+ end
data/lib/stirling.rb ADDED
@@ -0,0 +1,4 @@
1
+ require "stirling/engine"
2
+
3
+ module Stirling
4
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :stirling do
3
+ # # Task goes here
4
+ # end
metadata ADDED
@@ -0,0 +1,81 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: stirling
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Framgia
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-01-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rspec-rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: sqlite3
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Rails extension tool
42
+ email:
43
+ - oss@framgia.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - MIT-LICENSE
49
+ - README.md
50
+ - Rakefile
51
+ - app/controllers/stirling/base_controller.rb
52
+ - config/routes.rb
53
+ - lib/stirling.rb
54
+ - lib/stirling/engine.rb
55
+ - lib/stirling/version.rb
56
+ - lib/tasks/stirling_tasks.rake
57
+ homepage: https://github.com/framgia/stirling
58
+ licenses:
59
+ - MIT
60
+ metadata: {}
61
+ post_install_message:
62
+ rdoc_options: []
63
+ require_paths:
64
+ - lib
65
+ required_ruby_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ requirements: []
76
+ rubyforge_project:
77
+ rubygems_version: 2.2.2
78
+ signing_key:
79
+ specification_version: 4
80
+ summary: Rails extension tool
81
+ test_files: []