rows_controller 1.0.3 → 1.1.6
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 +4 -4
- data/.travis.yml +14 -0
- data/Gemfile +6 -4
- data/Gemfile.lock +82 -84
- data/README.md +7 -5
- data/Rakefile +2 -4
- data/SNIPPETS +9 -0
- data/app/controllers/rows_controller.rb +1 -1
- data/lib/rows_controller/engine.rb +1 -1
- data/lib/rows_controller/version.rb +1 -1
- data/rows_controller.gemspec +8 -9
- data/spec/controllers/orders_spec.rb +4 -4
- data/spec/dummy/Rakefile +0 -1
- data/spec/dummy/app/assets/javascripts/application.js +10 -6
- data/spec/dummy/config.ru +1 -1
- data/spec/dummy/config/application.rb +4 -25
- data/spec/dummy/config/boot.rb +1 -4
- data/spec/dummy/config/database.yml +3 -0
- data/spec/dummy/config/environment.rb +2 -2
- data/spec/dummy/config/environments/development.rb +13 -14
- data/spec/dummy/config/environments/production.rb +44 -24
- data/spec/dummy/config/environments/test.rb +16 -20
- data/spec/dummy/config/initializers/secret_token.rb +4 -1
- data/spec/dummy/config/initializers/session_store.rb +1 -6
- data/spec/dummy/db/schema.rb +5 -5
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/.keep +0 -0
- data/spec/spec_helper.rb +2 -0
- metadata +20 -16
- data/spec/dummy/db/seeds.rb +0 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3e1d6baf7d16e5d303e0de6d2773d38c332d10f5
|
|
4
|
+
data.tar.gz: 82489180b3ffdf6e8e9c94012a307173b65244ea
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 42ca7f93249f7b006c9cc35e4b19bb12d57644882cdb490ed301388a23e01cca4d359d3b802f14f9cfb696a4837ed818405b27eb4abb6cbd59e21281f395a36c
|
|
7
|
+
data.tar.gz: c966c57032615fa24ed7b69b36132cbb976236f9025e1232f487eccca5cc71577f5990c65a3e99ff9571e039d64d3c439b968a4c60f4f5b4cc62908d39069342
|
data/.travis.yml
ADDED
data/Gemfile
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
source "
|
|
1
|
+
source "https://rubygems.org"
|
|
2
|
+
##gemspec
|
|
3
|
+
|
|
4
|
+
version = ENV["RAILS_VERSION"]
|
|
5
|
+
gem 'rails', version ? "~> #{version}" : ">= 4.0.2"
|
|
2
6
|
|
|
3
|
-
gem 'rails'
|
|
4
|
-
#gem 'rails', '4.0.0.rc1'
|
|
5
|
-
gem 'jquery-rails'
|
|
6
7
|
gem 'slim'
|
|
7
8
|
|
|
8
9
|
group :test do
|
|
@@ -15,4 +16,5 @@ group :development, :test do
|
|
|
15
16
|
gem 'watchr'
|
|
16
17
|
gem 'spork'
|
|
17
18
|
gem 'simplecov', require: false
|
|
19
|
+
gem 'gem-release'
|
|
18
20
|
end
|
data/Gemfile.lock
CHANGED
|
@@ -1,114 +1,112 @@
|
|
|
1
1
|
GEM
|
|
2
|
-
remote:
|
|
2
|
+
remote: https://rubygems.org/
|
|
3
3
|
specs:
|
|
4
|
-
actionmailer (
|
|
5
|
-
actionpack (=
|
|
6
|
-
mail (~> 2.5.
|
|
7
|
-
actionpack (
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
builder (~> 3.0.0)
|
|
4
|
+
actionmailer (4.0.2)
|
|
5
|
+
actionpack (= 4.0.2)
|
|
6
|
+
mail (~> 2.5.4)
|
|
7
|
+
actionpack (4.0.2)
|
|
8
|
+
activesupport (= 4.0.2)
|
|
9
|
+
builder (~> 3.1.0)
|
|
11
10
|
erubis (~> 2.7.0)
|
|
12
|
-
|
|
13
|
-
rack (~>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
capybara (2.1.0)
|
|
11
|
+
rack (~> 1.5.2)
|
|
12
|
+
rack-test (~> 0.6.2)
|
|
13
|
+
activemodel (4.0.2)
|
|
14
|
+
activesupport (= 4.0.2)
|
|
15
|
+
builder (~> 3.1.0)
|
|
16
|
+
activerecord (4.0.2)
|
|
17
|
+
activemodel (= 4.0.2)
|
|
18
|
+
activerecord-deprecated_finders (~> 1.0.2)
|
|
19
|
+
activesupport (= 4.0.2)
|
|
20
|
+
arel (~> 4.0.0)
|
|
21
|
+
activerecord-deprecated_finders (1.0.3)
|
|
22
|
+
activesupport (4.0.2)
|
|
23
|
+
i18n (~> 0.6, >= 0.6.4)
|
|
24
|
+
minitest (~> 4.2)
|
|
25
|
+
multi_json (~> 1.3)
|
|
26
|
+
thread_safe (~> 0.1)
|
|
27
|
+
tzinfo (~> 0.3.37)
|
|
28
|
+
arel (4.0.1)
|
|
29
|
+
atomic (1.1.14)
|
|
30
|
+
builder (3.1.4)
|
|
31
|
+
capybara (2.2.1)
|
|
34
32
|
mime-types (>= 1.16)
|
|
35
33
|
nokogiri (>= 1.3.3)
|
|
36
34
|
rack (>= 1.0.0)
|
|
37
35
|
rack-test (>= 0.5.4)
|
|
38
36
|
xpath (~> 2.0)
|
|
39
|
-
diff-lcs (1.2.
|
|
37
|
+
diff-lcs (1.2.5)
|
|
38
|
+
docile (1.1.2)
|
|
40
39
|
erubis (2.7.0)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
jquery-rails (3.0.0)
|
|
45
|
-
railties (>= 3.0, < 5.0)
|
|
46
|
-
thor (>= 0.14, < 2.0)
|
|
47
|
-
json (1.8.0)
|
|
40
|
+
gem-release (0.7.1)
|
|
41
|
+
hike (1.2.3)
|
|
42
|
+
i18n (0.6.9)
|
|
48
43
|
mail (2.5.4)
|
|
49
44
|
mime-types (~> 1.16)
|
|
50
45
|
treetop (~> 1.4.8)
|
|
51
|
-
mime-types (1.
|
|
52
|
-
|
|
53
|
-
|
|
46
|
+
mime-types (1.25.1)
|
|
47
|
+
mini_portile (0.5.2)
|
|
48
|
+
minitest (4.7.5)
|
|
49
|
+
multi_json (1.8.4)
|
|
50
|
+
nokogiri (1.6.1)
|
|
51
|
+
mini_portile (~> 0.5.0)
|
|
54
52
|
polyglot (0.3.3)
|
|
55
|
-
rack (1.
|
|
56
|
-
rack-cache (1.2)
|
|
57
|
-
rack (>= 0.4)
|
|
58
|
-
rack-ssl (1.3.3)
|
|
59
|
-
rack
|
|
53
|
+
rack (1.5.2)
|
|
60
54
|
rack-test (0.6.2)
|
|
61
55
|
rack (>= 1.0)
|
|
62
|
-
rails (
|
|
63
|
-
actionmailer (=
|
|
64
|
-
actionpack (=
|
|
65
|
-
activerecord (=
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
railties (
|
|
71
|
-
actionpack (=
|
|
72
|
-
activesupport (=
|
|
73
|
-
rack-ssl (~> 1.3.2)
|
|
56
|
+
rails (4.0.2)
|
|
57
|
+
actionmailer (= 4.0.2)
|
|
58
|
+
actionpack (= 4.0.2)
|
|
59
|
+
activerecord (= 4.0.2)
|
|
60
|
+
activesupport (= 4.0.2)
|
|
61
|
+
bundler (>= 1.3.0, < 2.0)
|
|
62
|
+
railties (= 4.0.2)
|
|
63
|
+
sprockets-rails (~> 2.0.0)
|
|
64
|
+
railties (4.0.2)
|
|
65
|
+
actionpack (= 4.0.2)
|
|
66
|
+
activesupport (= 4.0.2)
|
|
74
67
|
rake (>= 0.8.7)
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
json (~> 1.4)
|
|
80
|
-
rspec-core (2.13.1)
|
|
81
|
-
rspec-expectations (2.13.0)
|
|
68
|
+
thor (>= 0.18.1, < 2.0)
|
|
69
|
+
rake (10.1.1)
|
|
70
|
+
rspec-core (2.14.7)
|
|
71
|
+
rspec-expectations (2.14.5)
|
|
82
72
|
diff-lcs (>= 1.1.3, < 2.0)
|
|
83
|
-
rspec-mocks (2.
|
|
84
|
-
rspec-rails (2.
|
|
73
|
+
rspec-mocks (2.14.5)
|
|
74
|
+
rspec-rails (2.14.1)
|
|
85
75
|
actionpack (>= 3.0)
|
|
76
|
+
activemodel (>= 3.0)
|
|
86
77
|
activesupport (>= 3.0)
|
|
87
78
|
railties (>= 3.0)
|
|
88
|
-
rspec-core (~> 2.
|
|
89
|
-
rspec-expectations (~> 2.
|
|
90
|
-
rspec-mocks (~> 2.
|
|
91
|
-
simplecov (0.
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
79
|
+
rspec-core (~> 2.14.0)
|
|
80
|
+
rspec-expectations (~> 2.14.0)
|
|
81
|
+
rspec-mocks (~> 2.14.0)
|
|
82
|
+
simplecov (0.8.2)
|
|
83
|
+
docile (~> 1.1.0)
|
|
84
|
+
multi_json
|
|
85
|
+
simplecov-html (~> 0.8.0)
|
|
86
|
+
simplecov-html (0.8.0)
|
|
87
|
+
slim (2.0.2)
|
|
88
|
+
temple (~> 0.6.6)
|
|
89
|
+
tilt (>= 1.3.3, < 2.1)
|
|
98
90
|
spork (0.9.2)
|
|
99
|
-
sprockets (2.
|
|
91
|
+
sprockets (2.10.1)
|
|
100
92
|
hike (~> 1.2)
|
|
101
93
|
multi_json (~> 1.0)
|
|
102
94
|
rack (~> 1.0)
|
|
103
95
|
tilt (~> 1.1, != 1.3.0)
|
|
104
|
-
|
|
105
|
-
|
|
96
|
+
sprockets-rails (2.0.1)
|
|
97
|
+
actionpack (>= 3.0)
|
|
98
|
+
activesupport (>= 3.0)
|
|
99
|
+
sprockets (~> 2.8)
|
|
100
|
+
sqlite3 (1.3.8)
|
|
101
|
+
temple (0.6.7)
|
|
106
102
|
thor (0.18.1)
|
|
103
|
+
thread_safe (0.1.3)
|
|
104
|
+
atomic
|
|
107
105
|
tilt (1.4.1)
|
|
108
|
-
treetop (1.4.
|
|
106
|
+
treetop (1.4.15)
|
|
109
107
|
polyglot
|
|
110
108
|
polyglot (>= 0.3.1)
|
|
111
|
-
tzinfo (0.3.
|
|
109
|
+
tzinfo (0.3.38)
|
|
112
110
|
watchr (0.7)
|
|
113
111
|
xpath (2.0.0)
|
|
114
112
|
nokogiri (~> 1.3)
|
|
@@ -118,8 +116,8 @@ PLATFORMS
|
|
|
118
116
|
|
|
119
117
|
DEPENDENCIES
|
|
120
118
|
capybara
|
|
121
|
-
|
|
122
|
-
rails
|
|
119
|
+
gem-release
|
|
120
|
+
rails (>= 4.0.2)
|
|
123
121
|
rspec-rails
|
|
124
122
|
simplecov
|
|
125
123
|
slim
|
data/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
RowsController
|
|
2
|
+
==============
|
|
3
|
+
[](http://badge.fury.io/rb/rows_controller)
|
|
4
|
+
[](https://travis-ci.org/matique/rows_controller)
|
|
3
5
|
|
|
4
6
|
DRYs Rails controllers. Imagine replacing that @order by 'resource' in the
|
|
5
7
|
controllers/views and, imho, an area for DRYing appears.
|
|
@@ -38,7 +40,7 @@ overwrites the default Rows view as Rails will first look
|
|
|
38
40
|
into the directory "#{Rails.root}/app/views" before looking
|
|
39
41
|
into the RowsController.
|
|
40
42
|
|
|
41
|
-
Similarly, partials '
|
|
43
|
+
Similarly, partials '\_row\_buttons' and '\_list\_footer' may be overwritten
|
|
42
44
|
as well.
|
|
43
45
|
|
|
44
46
|
|
|
@@ -58,7 +60,7 @@ Rails 4
|
|
|
58
60
|
-------
|
|
59
61
|
|
|
60
62
|
This gem is intended for Rails 4.
|
|
61
|
-
For older Rails versions feel free to switch to "gem 'rows_controller', '0.4.4'".
|
|
63
|
+
For older Rails versions feel free to switch to "gem 'rows_controller', '= 0.4.4'".
|
|
62
64
|
|
|
63
65
|
Rails 4 introduced strong parameters.
|
|
64
66
|
To support them a private method 'resource_whitelist' is required
|
|
@@ -110,4 +112,4 @@ Look for:
|
|
|
110
112
|
- decent_exposure
|
|
111
113
|
|
|
112
114
|
|
|
113
|
-
Copyright (c) 2009-
|
|
115
|
+
Copyright (c) 2009-2014 [Dittmar Krall], released under the MIT license
|
data/Rakefile
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
# encoding: UTF-8
|
|
2
|
-
|
|
3
1
|
begin
|
|
4
|
-
require 'bundler'
|
|
5
2
|
require 'bundler/setup'
|
|
6
3
|
rescue LoadError
|
|
7
4
|
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
|
8
5
|
end
|
|
9
6
|
|
|
7
|
+
|
|
10
8
|
require 'rspec/core'
|
|
11
9
|
require 'rspec/core/rake_task'
|
|
12
10
|
|
|
13
11
|
Bundler::GemHelper.install_tasks
|
|
14
12
|
RSpec::Core::RakeTask.new(:spec)
|
|
15
13
|
|
|
16
|
-
task :
|
|
14
|
+
task default: :spec
|
|
17
15
|
|
|
18
16
|
|
|
19
17
|
desc "Clean automatically generated files"
|
data/SNIPPETS
ADDED
|
@@ -88,7 +88,7 @@ class RowsController < ApplicationController
|
|
|
88
88
|
else
|
|
89
89
|
pars = params[model_symbol] || {}
|
|
90
90
|
pars.keys.each { |x|
|
|
91
|
-
unless permits.include?(x)
|
|
91
|
+
unless permits.include?(x) || permits.include?({x.to_sym => []})
|
|
92
92
|
pars.delete(x)
|
|
93
93
|
p "** WARNING: model <#{model_name}> dropping params <#{x}>"
|
|
94
94
|
end
|
data/rows_controller.gemspec
CHANGED
|
@@ -3,25 +3,24 @@ $:.unshift lib unless $:.include?(lib)
|
|
|
3
3
|
|
|
4
4
|
require 'rows_controller/version'
|
|
5
5
|
|
|
6
|
+
# Describe your gem and declare its dependencies:
|
|
6
7
|
Gem::Specification.new do |s|
|
|
7
8
|
s.name = "rows_controller"
|
|
8
9
|
s.version = Rows::VERSION
|
|
10
|
+
s.licenses = ['MIT']
|
|
9
11
|
s.platform = Gem::Platform::RUBY
|
|
10
|
-
s.summary = "
|
|
12
|
+
s.summary = "RowsController DRYs your controllers."
|
|
11
13
|
s.description = "YourController < RowsController ( < ApplicationController)."
|
|
12
14
|
s.authors = ['Dittmar Krall']
|
|
13
15
|
s.email = ['dittmar.krall@matique.de']
|
|
14
|
-
s.homepage =
|
|
16
|
+
s.homepage = "http://matique.de"
|
|
17
|
+
|
|
15
18
|
s.files = `git ls-files`.split("\n")
|
|
16
19
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
17
20
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
|
18
21
|
s.require_paths = ["lib"]
|
|
19
22
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
s.add_development_dependency "sqlite3" # for testing
|
|
25
|
-
s.add_development_dependency "rspec-rails"
|
|
26
|
-
s.add_development_dependency "capybara"
|
|
23
|
+
s.add_development_dependency 'sqlite3', '~> 0' # for testing
|
|
24
|
+
s.add_development_dependency 'rspec-rails', '~> 0'
|
|
25
|
+
s.add_development_dependency 'capybara', '~> 0'
|
|
27
26
|
end
|
|
@@ -36,8 +36,8 @@ describe OrdersController, ':' do
|
|
|
36
36
|
|
|
37
37
|
it 'checking resources' do
|
|
38
38
|
get :index
|
|
39
|
-
subject.send(:resources).should be_a_kind_of(Array)
|
|
40
|
-
assigns(:orders).should be_a_kind_of(Array)
|
|
39
|
+
subject.send(:resources).to_a.should be_a_kind_of(Array)
|
|
40
|
+
assigns(:orders).to_a.should be_a_kind_of(Array)
|
|
41
41
|
assigns(:orders).should == Order.all
|
|
42
42
|
assigns(:rows).should == Order.all
|
|
43
43
|
end
|
|
@@ -51,13 +51,13 @@ describe OrdersController, ':' do
|
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
it 'should update' do
|
|
54
|
-
put :update, { id: order.id }
|
|
54
|
+
put :update, { id: order.id, order: {name: 'name'} }
|
|
55
55
|
response.should be_true
|
|
56
56
|
response.should redirect_to(action: :edit)
|
|
57
57
|
end
|
|
58
58
|
|
|
59
59
|
it 'should update #2' do
|
|
60
|
-
put :update, { id: order.id, commit: 'OK' }
|
|
60
|
+
put :update, { id: order.id, commit: 'OK', order: {name: 'name'} }
|
|
61
61
|
response.should be_true
|
|
62
62
|
response.should redirect_to(action: :index)
|
|
63
63
|
end
|
data/spec/dummy/Rakefile
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
// This is a manifest file that'll be compiled into
|
|
2
|
-
//
|
|
3
|
-
//
|
|
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 vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
|
6
|
+
//
|
|
4
7
|
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
|
5
|
-
//
|
|
8
|
+
// compiled file.
|
|
9
|
+
//
|
|
10
|
+
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
|
|
11
|
+
// about supported directives.
|
|
6
12
|
//
|
|
7
|
-
//= require jquery
|
|
8
|
-
//= require jquery_ujs
|
|
9
13
|
//= require_tree .
|
data/spec/dummy/config.ru
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
require File.expand_path('../boot', __FILE__)
|
|
2
2
|
|
|
3
3
|
require 'rails/all'
|
|
4
|
-
require 'rows_controller'
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Bundler.require(*Rails.groups(:assets => %w(development test)))
|
|
9
|
-
# If you want your assets lazily compiled in production, use this line
|
|
10
|
-
# Bundler.require(:default, :assets, Rails.env)
|
|
11
|
-
end
|
|
5
|
+
Bundler.require(*Rails.groups(:assets => %w(development test)))
|
|
6
|
+
require "rows_controller"
|
|
12
7
|
|
|
13
8
|
module Dummy
|
|
14
9
|
class Application < Rails::Application
|
|
@@ -16,16 +11,6 @@ module Dummy
|
|
|
16
11
|
# Application configuration should go into files in config/initializers
|
|
17
12
|
# -- all .rb files in that directory are automatically loaded.
|
|
18
13
|
|
|
19
|
-
# Custom directories with classes and modules you want to be autoloadable.
|
|
20
|
-
# config.autoload_paths += %W(#{config.root}/extras)
|
|
21
|
-
|
|
22
|
-
# Only load the plugins named here, in the order given (default is alphabetical).
|
|
23
|
-
# :all can be used as a placeholder for all plugins not explicitly named.
|
|
24
|
-
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
|
25
|
-
|
|
26
|
-
# Activate observers that should always be running.
|
|
27
|
-
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
|
28
|
-
|
|
29
14
|
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
|
30
15
|
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
|
31
16
|
# config.time_zone = 'Central Time (US & Canada)'
|
|
@@ -34,16 +19,10 @@ module Dummy
|
|
|
34
19
|
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
|
35
20
|
# config.i18n.default_locale = :de
|
|
36
21
|
|
|
37
|
-
# Configure the default encoding used in templates for Ruby 1.9.
|
|
38
|
-
config.encoding = "utf-8"
|
|
39
|
-
|
|
40
|
-
# Configure sensitive parameters which will be filtered from the log file.
|
|
41
|
-
config.filter_parameters += [:password]
|
|
42
22
|
|
|
43
|
-
#
|
|
23
|
+
# Old stuff
|
|
24
|
+
config.encoding = "utf-8"
|
|
44
25
|
config.assets.enabled = true
|
|
45
|
-
|
|
46
|
-
# Version of your assets, change this if you want to expire all your assets
|
|
47
26
|
config.assets.version = '1.0'
|
|
48
27
|
end
|
|
49
28
|
end
|
data/spec/dummy/config/boot.rb
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
require 'rubygems'
|
|
2
|
-
|
|
3
1
|
# Set up gems listed in the Gemfile.
|
|
4
|
-
#ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
|
5
2
|
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
|
|
6
3
|
|
|
7
4
|
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
|
|
8
5
|
|
|
9
|
-
|
|
6
|
+
$LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
|
|
@@ -1,30 +1,29 @@
|
|
|
1
1
|
Dummy::Application.configure do
|
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
|
3
3
|
|
|
4
4
|
# In the development environment your application's code is reloaded on
|
|
5
|
-
# every request.
|
|
5
|
+
# every request. This slows down response time but is perfect for development
|
|
6
6
|
# since you don't have to restart the web server when you make code changes.
|
|
7
7
|
config.cache_classes = false
|
|
8
8
|
|
|
9
|
-
#
|
|
10
|
-
config.
|
|
9
|
+
# Do not eager load code on boot.
|
|
10
|
+
config.eager_load = false
|
|
11
11
|
|
|
12
|
-
# Show full error reports and disable caching
|
|
12
|
+
# Show full error reports and disable caching.
|
|
13
13
|
config.consider_all_requests_local = true
|
|
14
14
|
config.action_controller.perform_caching = false
|
|
15
15
|
|
|
16
|
-
# Don't care if the mailer can't send
|
|
16
|
+
# Don't care if the mailer can't send.
|
|
17
17
|
config.action_mailer.raise_delivery_errors = false
|
|
18
18
|
|
|
19
|
-
# Print deprecation notices to the Rails logger
|
|
19
|
+
# Print deprecation notices to the Rails logger.
|
|
20
20
|
config.active_support.deprecation = :log
|
|
21
21
|
|
|
22
|
-
#
|
|
23
|
-
config.
|
|
22
|
+
# Raise an error on page load if there are pending migrations
|
|
23
|
+
config.active_record.migration_error = :page_load
|
|
24
24
|
|
|
25
|
-
#
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
config.assets.debug = false
|
|
25
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
|
26
|
+
# This option may cause significant delays in view rendering with a large
|
|
27
|
+
# number of complex assets.
|
|
28
|
+
config.assets.debug = true
|
|
30
29
|
end
|
|
@@ -1,60 +1,80 @@
|
|
|
1
1
|
Dummy::Application.configure do
|
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
|
3
3
|
|
|
4
|
-
# Code is not reloaded between requests
|
|
4
|
+
# Code is not reloaded between requests.
|
|
5
5
|
config.cache_classes = true
|
|
6
6
|
|
|
7
|
-
#
|
|
7
|
+
# Eager load code on boot. This eager loads most of Rails and
|
|
8
|
+
# your application in memory, allowing both thread web servers
|
|
9
|
+
# and those relying on copy on write to perform better.
|
|
10
|
+
# Rake tasks automatically ignore this option for performance.
|
|
11
|
+
config.eager_load = true
|
|
12
|
+
|
|
13
|
+
# Full error reports are disabled and caching is turned on.
|
|
8
14
|
config.consider_all_requests_local = false
|
|
9
15
|
config.action_controller.perform_caching = true
|
|
10
16
|
|
|
11
|
-
#
|
|
17
|
+
# Enable Rack::Cache to put a simple HTTP cache in front of your application
|
|
18
|
+
# Add `rack-cache` to your Gemfile before enabling this.
|
|
19
|
+
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
|
|
20
|
+
# config.action_dispatch.rack_cache = true
|
|
21
|
+
|
|
22
|
+
# Disable Rails's static asset server (Apache or nginx will already do this).
|
|
12
23
|
config.serve_static_assets = false
|
|
13
24
|
|
|
14
|
-
# Compress JavaScripts and CSS
|
|
15
|
-
config.assets.
|
|
25
|
+
# Compress JavaScripts and CSS.
|
|
26
|
+
config.assets.js_compressor = :uglifier
|
|
27
|
+
# config.assets.css_compressor = :sass
|
|
16
28
|
|
|
17
|
-
#
|
|
29
|
+
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
|
18
30
|
config.assets.compile = false
|
|
19
31
|
|
|
20
|
-
# Generate digests for assets URLs
|
|
32
|
+
# Generate digests for assets URLs.
|
|
21
33
|
config.assets.digest = true
|
|
22
34
|
|
|
23
|
-
#
|
|
24
|
-
|
|
35
|
+
# Version of your assets, change this if you want to expire all your assets.
|
|
36
|
+
config.assets.version = '1.0'
|
|
25
37
|
|
|
26
|
-
# Specifies the header that your server uses for sending files
|
|
38
|
+
# Specifies the header that your server uses for sending files.
|
|
27
39
|
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
|
28
40
|
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
|
29
41
|
|
|
30
42
|
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
|
31
43
|
# config.force_ssl = true
|
|
32
44
|
|
|
33
|
-
#
|
|
34
|
-
|
|
45
|
+
# Set to :debug to see everything in the log.
|
|
46
|
+
config.log_level = :info
|
|
47
|
+
|
|
48
|
+
# Prepend all log lines with the following tags.
|
|
49
|
+
# config.log_tags = [ :subdomain, :uuid ]
|
|
35
50
|
|
|
36
|
-
# Use a different logger for distributed setups
|
|
37
|
-
# config.logger = SyslogLogger.new
|
|
51
|
+
# Use a different logger for distributed setups.
|
|
52
|
+
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
|
38
53
|
|
|
39
|
-
# Use a different cache store in production
|
|
54
|
+
# Use a different cache store in production.
|
|
40
55
|
# config.cache_store = :mem_cache_store
|
|
41
56
|
|
|
42
|
-
# Enable serving of images, stylesheets, and JavaScripts from an asset server
|
|
57
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
|
43
58
|
# config.action_controller.asset_host = "http://assets.example.com"
|
|
44
59
|
|
|
45
|
-
# Precompile additional assets
|
|
60
|
+
# Precompile additional assets.
|
|
61
|
+
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
|
46
62
|
# config.assets.precompile += %w( search.js )
|
|
47
63
|
|
|
48
|
-
#
|
|
64
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
|
65
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
|
49
66
|
# config.action_mailer.raise_delivery_errors = false
|
|
50
67
|
|
|
51
|
-
# Enable threaded mode
|
|
52
|
-
# config.threadsafe!
|
|
53
|
-
|
|
54
68
|
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
|
55
|
-
# the I18n.default_locale when a translation can not be found)
|
|
69
|
+
# the I18n.default_locale when a translation can not be found).
|
|
56
70
|
config.i18n.fallbacks = true
|
|
57
71
|
|
|
58
|
-
# Send deprecation notices to registered listeners
|
|
72
|
+
# Send deprecation notices to registered listeners.
|
|
59
73
|
config.active_support.deprecation = :notify
|
|
74
|
+
|
|
75
|
+
# Disable automatic flushing of the log to improve performance.
|
|
76
|
+
# config.autoflush_log = false
|
|
77
|
+
|
|
78
|
+
# Use default logging formatter so that PID and timestamp are not suppressed.
|
|
79
|
+
config.log_formatter = ::Logger::Formatter.new
|
|
60
80
|
end
|
|
@@ -1,40 +1,36 @@
|
|
|
1
1
|
Dummy::Application.configure do
|
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
|
3
3
|
|
|
4
4
|
# The test environment is used exclusively to run your application's
|
|
5
|
-
# test suite.
|
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
|
6
6
|
# your test database is "scratch space" for the test suite and is wiped
|
|
7
|
-
# and recreated between test runs.
|
|
8
|
-
|
|
9
|
-
config.cache_classes = false
|
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
|
8
|
+
config.cache_classes = true
|
|
10
9
|
|
|
11
|
-
#
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
# Do not eager load code on boot. This avoids loading your whole application
|
|
11
|
+
# just for the purpose of running a single test. If you are using a tool that
|
|
12
|
+
# preloads Rails for running tests, you may have to set it to true.
|
|
13
|
+
config.eager_load = false
|
|
14
14
|
|
|
15
|
-
#
|
|
16
|
-
config.
|
|
15
|
+
# Configure static asset server for tests with Cache-Control for performance.
|
|
16
|
+
config.serve_static_assets = true
|
|
17
|
+
config.static_cache_control = "public, max-age=3600"
|
|
17
18
|
|
|
18
|
-
# Show full error reports and disable caching
|
|
19
|
+
# Show full error reports and disable caching.
|
|
19
20
|
config.consider_all_requests_local = true
|
|
20
21
|
config.action_controller.perform_caching = false
|
|
21
22
|
|
|
22
|
-
# Raise exceptions instead of rendering exception templates
|
|
23
|
+
# Raise exceptions instead of rendering exception templates.
|
|
23
24
|
config.action_dispatch.show_exceptions = false
|
|
24
25
|
|
|
25
|
-
# Disable request forgery protection in test environment
|
|
26
|
-
config.action_controller.allow_forgery_protection
|
|
26
|
+
# Disable request forgery protection in test environment.
|
|
27
|
+
config.action_controller.allow_forgery_protection = false
|
|
27
28
|
|
|
28
29
|
# Tell Action Mailer not to deliver emails to the real world.
|
|
29
30
|
# The :test delivery method accumulates sent emails in the
|
|
30
31
|
# ActionMailer::Base.deliveries array.
|
|
31
32
|
config.action_mailer.delivery_method = :test
|
|
32
33
|
|
|
33
|
-
#
|
|
34
|
-
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
|
35
|
-
# like if you have constraints or database-specific column types
|
|
36
|
-
# config.active_record.schema_format = :sql
|
|
37
|
-
|
|
38
|
-
# Print deprecation notices to the stderr
|
|
34
|
+
# Print deprecation notices to the stderr.
|
|
39
35
|
config.active_support.deprecation = :stderr
|
|
40
36
|
end
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
# Make sure your secret_key_base is kept private
|
|
2
|
+
# if you're sharing your code publicly.
|
|
3
|
+
Dummy::Application.config.secret_token = '937a92d6932bff76ce073df95330b64d1df95bb11505bc24ebda6f103ca567a0fedf45811d459ac97b24901f0650da5280cdf82e7de21e86ebfc35586bb06f32'
|
|
4
|
+
Dummy::Application.config.secret_key_base = '37421d339a6f4537257761951a3849a456e4d0f3ac8eac2ae1363bef2b412de777bbf4eb5783deab111020664014e00224a81d3b018306601992593e2dfed803'
|
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
# Be sure to restart your server when you modify this file.
|
|
2
2
|
|
|
3
|
-
Dummy::Application.config.session_store :cookie_store, key: '
|
|
4
|
-
|
|
5
|
-
# Use the database for sessions instead of the cookie-based default,
|
|
6
|
-
# which shouldn't be used to store highly confidential information
|
|
7
|
-
# (create the session table with "rails generate session_migration")
|
|
8
|
-
# Dummy::Application.config.session_store :active_record_store
|
|
3
|
+
Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
|
data/spec/dummy/db/schema.rb
CHANGED
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
|
10
10
|
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
|
11
11
|
#
|
|
12
|
-
# It's strongly recommended
|
|
12
|
+
# It's strongly recommended that you check this file into your version control system.
|
|
13
13
|
|
|
14
|
-
ActiveRecord::Schema.define(:
|
|
14
|
+
ActiveRecord::Schema.define(version: 1) do
|
|
15
15
|
|
|
16
|
-
create_table "orders", :
|
|
16
|
+
create_table "orders", force: true do |t|
|
|
17
17
|
t.string "name"
|
|
18
18
|
t.string "qty"
|
|
19
|
-
t.datetime "created_at"
|
|
20
|
-
t.datetime "updated_at"
|
|
19
|
+
t.datetime "created_at"
|
|
20
|
+
t.datetime "updated_at"
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
end
|
|
Binary file
|
|
File without changes
|
data/spec/spec_helper.rb
CHANGED
|
@@ -7,6 +7,8 @@ require 'spork'
|
|
|
7
7
|
require 'bundler'
|
|
8
8
|
Bundler.setup :default, :development, :test
|
|
9
9
|
|
|
10
|
+
ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)
|
|
11
|
+
|
|
10
12
|
Spork.prefork do
|
|
11
13
|
ENV["RAILS_ENV"] ||= 'test'
|
|
12
14
|
# require File.expand_path("../../config/environment", __FILE__)
|
metadata
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rows_controller
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.1.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dittmar Krall
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2014-02-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: sqlite3
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- -
|
|
17
|
+
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
19
|
version: '0'
|
|
20
20
|
type: :development
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
|
-
- -
|
|
24
|
+
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '0'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: rspec-rails
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- -
|
|
31
|
+
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
33
|
version: '0'
|
|
34
34
|
type: :development
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
|
-
- -
|
|
38
|
+
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: '0'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: capybara
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
|
-
- -
|
|
45
|
+
- - "~>"
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
47
|
version: '0'
|
|
48
48
|
type: :development
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
|
-
- -
|
|
52
|
+
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
54
|
version: '0'
|
|
55
55
|
description: YourController < RowsController ( < ApplicationController).
|
|
@@ -59,13 +59,15 @@ executables: []
|
|
|
59
59
|
extensions: []
|
|
60
60
|
extra_rdoc_files: []
|
|
61
61
|
files:
|
|
62
|
-
- .rspec
|
|
63
|
-
- .
|
|
62
|
+
- ".rspec"
|
|
63
|
+
- ".travis.yml"
|
|
64
|
+
- ".watchr"
|
|
64
65
|
- Gemfile
|
|
65
66
|
- Gemfile.lock
|
|
66
67
|
- MIT-LICENSE
|
|
67
68
|
- README.md
|
|
68
69
|
- Rakefile
|
|
70
|
+
- SNIPPETS
|
|
69
71
|
- app/controllers/rows_controller.rb
|
|
70
72
|
- app/controllers/rows_controller/helpers.rb
|
|
71
73
|
- app/controllers/rows_ext_controller.rb
|
|
@@ -113,14 +115,16 @@ files:
|
|
|
113
115
|
- spec/dummy/config/routes.rb
|
|
114
116
|
- spec/dummy/db/migrate/001_create_orders.rb
|
|
115
117
|
- spec/dummy/db/schema.rb
|
|
116
|
-
- spec/dummy/db/
|
|
118
|
+
- spec/dummy/db/test.sqlite3
|
|
119
|
+
- spec/dummy/log/.keep
|
|
117
120
|
- spec/dummy/public/favicon.ico
|
|
118
121
|
- spec/dummy/script/rails
|
|
119
122
|
- spec/features/order_spec.rb
|
|
120
123
|
- spec/models/order_spec.rb
|
|
121
124
|
- spec/spec_helper.rb
|
|
122
125
|
homepage: http://matique.de
|
|
123
|
-
licenses:
|
|
126
|
+
licenses:
|
|
127
|
+
- MIT
|
|
124
128
|
metadata: {}
|
|
125
129
|
post_install_message:
|
|
126
130
|
rdoc_options: []
|
|
@@ -128,18 +132,18 @@ require_paths:
|
|
|
128
132
|
- lib
|
|
129
133
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
130
134
|
requirements:
|
|
131
|
-
- -
|
|
135
|
+
- - ">="
|
|
132
136
|
- !ruby/object:Gem::Version
|
|
133
137
|
version: '0'
|
|
134
138
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
139
|
requirements:
|
|
136
|
-
- -
|
|
140
|
+
- - ">="
|
|
137
141
|
- !ruby/object:Gem::Version
|
|
138
142
|
version: '0'
|
|
139
143
|
requirements: []
|
|
140
144
|
rubyforge_project:
|
|
141
|
-
rubygems_version: 2.
|
|
145
|
+
rubygems_version: 2.2.1
|
|
142
146
|
signing_key:
|
|
143
147
|
specification_version: 4
|
|
144
|
-
summary:
|
|
148
|
+
summary: RowsController DRYs your controllers.
|
|
145
149
|
test_files: []
|
data/spec/dummy/db/seeds.rb
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# This file should contain all the record creation needed to seed the database with its default values.
|
|
2
|
-
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
|
|
3
|
-
#
|
|
4
|
-
# Examples:
|
|
5
|
-
#
|
|
6
|
-
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
|
|
7
|
-
# Mayor.create(name: 'Emanuel', city: cities.first)
|