suspenders 1.16.0 → 1.17.0
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/Gemfile.lock +34 -39
- data/NEWS.md +9 -0
- data/lib/suspenders/app_builder.rb +17 -15
- data/lib/suspenders/generators/app_generator.rb +2 -1
- data/lib/suspenders/version.rb +2 -2
- data/spec/features/new_project_spec.rb +23 -5
- data/templates/application.css.scss +1 -0
- data/templates/bin_setup.erb +1 -1
- data/templates/config_i18n_tasks.yml +1 -0
- data/templates/config_locales_en.yml +3 -0
- data/templates/rails_helper.rb +23 -0
- data/templates/spec_helper.rb +8 -22
- metadata +5 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d3d69233667fc34f1e795937ac85a02b7c5d6440
|
|
4
|
+
data.tar.gz: 23a405772fc9b1ae2d8e7fd5849161ace621bf44
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cb7312ccc78cc42ea226c3ac331ec0d5b4637db8fe82fab1075a903913dc8f547cec70ab4437f3496459b8dbce6e5c646e220537b1c9797ababe6b5538302088
|
|
7
|
+
data.tar.gz: 0b5d280d14550eac765f1a3b11e8a28b6054fb249d34f60054dce920698b5795dd0511da66506b0cc1a04d12dd85006f13939b5e1920c9ade8d10da9f88a576b
|
data/Gemfile.lock
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
suspenders (1.
|
|
4
|
+
suspenders (1.17.0)
|
|
5
5
|
bitters (~> 0.10.0)
|
|
6
6
|
bundler (~> 1.3)
|
|
7
|
-
rails (= 4.1.
|
|
7
|
+
rails (= 4.1.6)
|
|
8
8
|
|
|
9
9
|
GEM
|
|
10
10
|
remote: https://rubygems.org/
|
|
11
11
|
specs:
|
|
12
|
-
actionmailer (4.1.
|
|
13
|
-
actionpack (= 4.1.
|
|
14
|
-
actionview (= 4.1.
|
|
15
|
-
mail (~> 2.5.4)
|
|
16
|
-
actionpack (4.1.
|
|
17
|
-
actionview (= 4.1.
|
|
18
|
-
activesupport (= 4.1.
|
|
12
|
+
actionmailer (4.1.6)
|
|
13
|
+
actionpack (= 4.1.6)
|
|
14
|
+
actionview (= 4.1.6)
|
|
15
|
+
mail (~> 2.5, >= 2.5.4)
|
|
16
|
+
actionpack (4.1.6)
|
|
17
|
+
actionview (= 4.1.6)
|
|
18
|
+
activesupport (= 4.1.6)
|
|
19
19
|
rack (~> 1.5.2)
|
|
20
20
|
rack-test (~> 0.6.2)
|
|
21
|
-
actionview (4.1.
|
|
22
|
-
activesupport (= 4.1.
|
|
21
|
+
actionview (4.1.6)
|
|
22
|
+
activesupport (= 4.1.6)
|
|
23
23
|
builder (~> 3.1)
|
|
24
24
|
erubis (~> 2.7.0)
|
|
25
|
-
activemodel (4.1.
|
|
26
|
-
activesupport (= 4.1.
|
|
25
|
+
activemodel (4.1.6)
|
|
26
|
+
activesupport (= 4.1.6)
|
|
27
27
|
builder (~> 3.1)
|
|
28
|
-
activerecord (4.1.
|
|
29
|
-
activemodel (= 4.1.
|
|
30
|
-
activesupport (= 4.1.
|
|
28
|
+
activerecord (4.1.6)
|
|
29
|
+
activemodel (= 4.1.6)
|
|
30
|
+
activesupport (= 4.1.6)
|
|
31
31
|
arel (~> 5.0.0)
|
|
32
|
-
activesupport (4.1.
|
|
32
|
+
activesupport (4.1.6)
|
|
33
33
|
i18n (~> 0.6, >= 0.6.9)
|
|
34
34
|
json (~> 1.7, >= 1.7.7)
|
|
35
35
|
minitest (~> 5.1)
|
|
@@ -70,33 +70,31 @@ GEM
|
|
|
70
70
|
hike (1.2.3)
|
|
71
71
|
i18n (0.6.11)
|
|
72
72
|
json (1.8.1)
|
|
73
|
-
mail (2.
|
|
74
|
-
mime-types (
|
|
75
|
-
treetop (~> 1.4.8)
|
|
73
|
+
mail (2.6.1)
|
|
74
|
+
mime-types (>= 1.16, < 3)
|
|
76
75
|
mime-types (1.25.1)
|
|
77
76
|
mini_portile (0.6.0)
|
|
78
|
-
minitest (5.4.
|
|
77
|
+
minitest (5.4.2)
|
|
79
78
|
multi_json (1.10.1)
|
|
80
79
|
multi_test (0.1.1)
|
|
81
80
|
nokogiri (1.6.2.1)
|
|
82
81
|
mini_portile (= 0.6.0)
|
|
83
|
-
polyglot (0.3.5)
|
|
84
82
|
rack (1.5.2)
|
|
85
83
|
rack-test (0.6.2)
|
|
86
84
|
rack (>= 1.0)
|
|
87
|
-
rails (4.1.
|
|
88
|
-
actionmailer (= 4.1.
|
|
89
|
-
actionpack (= 4.1.
|
|
90
|
-
actionview (= 4.1.
|
|
91
|
-
activemodel (= 4.1.
|
|
92
|
-
activerecord (= 4.1.
|
|
93
|
-
activesupport (= 4.1.
|
|
85
|
+
rails (4.1.6)
|
|
86
|
+
actionmailer (= 4.1.6)
|
|
87
|
+
actionpack (= 4.1.6)
|
|
88
|
+
actionview (= 4.1.6)
|
|
89
|
+
activemodel (= 4.1.6)
|
|
90
|
+
activerecord (= 4.1.6)
|
|
91
|
+
activesupport (= 4.1.6)
|
|
94
92
|
bundler (>= 1.3.0, < 2.0)
|
|
95
|
-
railties (= 4.1.
|
|
93
|
+
railties (= 4.1.6)
|
|
96
94
|
sprockets-rails (~> 2.0)
|
|
97
|
-
railties (4.1.
|
|
98
|
-
actionpack (= 4.1.
|
|
99
|
-
activesupport (= 4.1.
|
|
95
|
+
railties (4.1.6)
|
|
96
|
+
actionpack (= 4.1.6)
|
|
97
|
+
activesupport (= 4.1.6)
|
|
100
98
|
rake (>= 0.8.7)
|
|
101
99
|
thor (>= 0.18.1, < 2.0)
|
|
102
100
|
rake (10.3.2)
|
|
@@ -108,22 +106,19 @@ GEM
|
|
|
108
106
|
rspec-expectations (2.99.0)
|
|
109
107
|
diff-lcs (>= 1.1.3, < 2.0)
|
|
110
108
|
rspec-mocks (2.99.0)
|
|
111
|
-
sass (3.3
|
|
112
|
-
sprockets (2.12.
|
|
109
|
+
sass (3.4.3)
|
|
110
|
+
sprockets (2.12.2)
|
|
113
111
|
hike (~> 1.2)
|
|
114
112
|
multi_json (~> 1.0)
|
|
115
113
|
rack (~> 1.0)
|
|
116
114
|
tilt (~> 1.1, != 1.3.0)
|
|
117
|
-
sprockets-rails (2.1.
|
|
115
|
+
sprockets-rails (2.1.4)
|
|
118
116
|
actionpack (>= 3.0)
|
|
119
117
|
activesupport (>= 3.0)
|
|
120
118
|
sprockets (~> 2.8)
|
|
121
119
|
thor (0.19.1)
|
|
122
120
|
thread_safe (0.3.4)
|
|
123
121
|
tilt (1.4.1)
|
|
124
|
-
treetop (1.4.15)
|
|
125
|
-
polyglot
|
|
126
|
-
polyglot (>= 0.3.1)
|
|
127
122
|
tzinfo (1.2.2)
|
|
128
123
|
thread_safe (~> 0.1)
|
|
129
124
|
xpath (2.0.0)
|
data/NEWS.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
1.17.0 (September 30, 2014)
|
|
2
|
+
|
|
3
|
+
* Use Rails 4.1.6.
|
|
4
|
+
* Generate a `spec/rails_helper.rb` and `spec/spec_helper.rb` following
|
|
5
|
+
RSpec 3.x's example, but using our defaults.
|
|
6
|
+
* Raise on missing i18n translations in test environment.
|
|
7
|
+
* Raise on unpermitted parameters in test environment.
|
|
8
|
+
* Provide example for using Title gem for internationalizing page title text.
|
|
9
|
+
|
|
1
10
|
1.16.0 (August 16, 2014)
|
|
2
11
|
|
|
3
12
|
* Use the 3.x series of RSpec.
|
|
@@ -12,17 +12,11 @@ module Suspenders
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def raise_on_unpermitted_parameters
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
# Raise an ActionController::UnpermittedParameters exception when
|
|
18
|
-
# a parameter is not explicitly permitted but is passed anyway.
|
|
19
|
-
config.action_controller.action_on_unpermitted_parameters = :raise
|
|
15
|
+
config = <<-RUBY
|
|
16
|
+
config.action_controller.action_on_unpermitted_parameters = :raise
|
|
20
17
|
RUBY
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
action_on_unpermitted_parameters,
|
|
24
|
-
before: "\nend"
|
|
25
|
-
)
|
|
18
|
+
|
|
19
|
+
inject_into_class "config/application.rb", "Application", config
|
|
26
20
|
end
|
|
27
21
|
|
|
28
22
|
def provide_setup_script
|
|
@@ -36,6 +30,7 @@ module Suspenders
|
|
|
36
30
|
|
|
37
31
|
def configure_generators
|
|
38
32
|
config = <<-RUBY
|
|
33
|
+
|
|
39
34
|
config.generators do |generate|
|
|
40
35
|
generate.helper false
|
|
41
36
|
generate.javascript_engine false
|
|
@@ -175,16 +170,23 @@ end
|
|
|
175
170
|
end
|
|
176
171
|
|
|
177
172
|
def configure_rspec
|
|
178
|
-
remove_file
|
|
179
|
-
|
|
173
|
+
remove_file "spec/rails_helper.rb"
|
|
174
|
+
remove_file "spec/spec_helper.rb"
|
|
175
|
+
copy_file "rails_helper.rb", "spec/rails_helper.rb"
|
|
176
|
+
copy_file "spec_helper.rb", "spec/spec_helper.rb"
|
|
180
177
|
end
|
|
181
178
|
|
|
182
179
|
def configure_travis
|
|
183
180
|
template 'travis.yml.erb', '.travis.yml'
|
|
184
181
|
end
|
|
185
182
|
|
|
186
|
-
def
|
|
183
|
+
def configure_i18n_for_test_environment
|
|
184
|
+
copy_file "i18n.rb", "spec/support/i18n.rb"
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
def configure_i18n_for_missing_translations
|
|
187
188
|
raise_on_missing_translations_in("development")
|
|
189
|
+
raise_on_missing_translations_in("test")
|
|
188
190
|
end
|
|
189
191
|
|
|
190
192
|
def configure_i18n_tasks
|
|
@@ -204,8 +206,8 @@ end
|
|
|
204
206
|
def configure_time_zone
|
|
205
207
|
config = <<-RUBY
|
|
206
208
|
config.active_record.default_timezone = :utc
|
|
207
|
-
|
|
208
209
|
RUBY
|
|
210
|
+
|
|
209
211
|
inject_into_class 'config/application.rb', 'Application', config
|
|
210
212
|
end
|
|
211
213
|
|
|
@@ -228,8 +230,8 @@ end
|
|
|
228
230
|
def fix_i18n_deprecation_warning
|
|
229
231
|
config = <<-RUBY
|
|
230
232
|
config.i18n.enforce_available_locales = true
|
|
231
|
-
|
|
232
233
|
RUBY
|
|
234
|
+
|
|
233
235
|
inject_into_class 'config/application.rb', 'Application', config
|
|
234
236
|
end
|
|
235
237
|
|
|
@@ -71,7 +71,7 @@ module Suspenders
|
|
|
71
71
|
build :provide_setup_script
|
|
72
72
|
build :provide_dev_prime_task
|
|
73
73
|
build :configure_generators
|
|
74
|
-
build :
|
|
74
|
+
build :configure_i18n_for_missing_translations
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
def setup_test_environment
|
|
@@ -83,6 +83,7 @@ module Suspenders
|
|
|
83
83
|
build :enable_database_cleaner
|
|
84
84
|
build :configure_spec_support_features
|
|
85
85
|
build :configure_travis
|
|
86
|
+
build :configure_i18n_for_test_environment
|
|
86
87
|
build :configure_i18n_tasks
|
|
87
88
|
build :configure_action_mailer_in_specs
|
|
88
89
|
end
|
data/lib/suspenders/version.rb
CHANGED
|
@@ -43,6 +43,12 @@ feature 'Suspend a new project with default configuration' do
|
|
|
43
43
|
expect(File).to exist("#{project_path}/spec/support/action_mailer.rb")
|
|
44
44
|
end
|
|
45
45
|
|
|
46
|
+
scenario "i18n support file is added" do
|
|
47
|
+
run_suspenders
|
|
48
|
+
|
|
49
|
+
expect(File).to exist("#{project_path}/spec/support/i18n.rb")
|
|
50
|
+
end
|
|
51
|
+
|
|
46
52
|
scenario 'newrelic.yml reads NewRelic license from env' do
|
|
47
53
|
run_suspenders
|
|
48
54
|
|
|
@@ -62,16 +68,28 @@ feature 'Suspend a new project with default configuration' do
|
|
|
62
68
|
to include(%{window.analytics.load("<%= ENV["SEGMENT_IO_KEY"] %>");})
|
|
63
69
|
end
|
|
64
70
|
|
|
65
|
-
scenario "raises on
|
|
71
|
+
scenario "raises on unpermitted parameters in all environments" do
|
|
66
72
|
run_suspenders
|
|
67
73
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
expect(
|
|
71
|
-
/^ +config.
|
|
74
|
+
result = IO.read("#{project_path}/config/application.rb")
|
|
75
|
+
|
|
76
|
+
expect(result).to match(
|
|
77
|
+
/^ +config.action_controller.action_on_unpermitted_parameters = :raise$/
|
|
72
78
|
)
|
|
73
79
|
end
|
|
74
80
|
|
|
81
|
+
scenario "raises on missing translations in development and test" do
|
|
82
|
+
run_suspenders
|
|
83
|
+
|
|
84
|
+
%w[development test].each do |environment|
|
|
85
|
+
environment_file =
|
|
86
|
+
IO.read("#{project_path}/config/environments/#{environment}.rb")
|
|
87
|
+
expect(environment_file).to match(
|
|
88
|
+
/^ +config.action_view.raise_on_missing_translations = true$/
|
|
89
|
+
)
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
75
93
|
scenario "specs for missing or unused translations" do
|
|
76
94
|
run_suspenders
|
|
77
95
|
|
data/templates/bin_setup.erb
CHANGED
|
@@ -24,7 +24,7 @@ mkdir -p .git/safe
|
|
|
24
24
|
echo "port: <%= config[:port_number] %>" > .foreman
|
|
25
25
|
|
|
26
26
|
# Print warning if Foreman is not installed
|
|
27
|
-
if ! command -v foreman
|
|
27
|
+
if ! command -v foreman > /dev/null; then
|
|
28
28
|
echo "foreman is not installed."
|
|
29
29
|
echo "See https://github.com/ddollar/foreman for install instructions."
|
|
30
30
|
fi
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
ENV["RAILS_ENV"] = "test"
|
|
2
|
+
|
|
3
|
+
require File.expand_path("../../config/environment", __FILE__)
|
|
4
|
+
|
|
5
|
+
require "rspec/rails"
|
|
6
|
+
require "shoulda/matchers"
|
|
7
|
+
|
|
8
|
+
Dir[Rails.root.join("spec/support/**/*.rb")].each { |file| require file }
|
|
9
|
+
|
|
10
|
+
module Features
|
|
11
|
+
# Extend this module in spec/support/features/*.rb
|
|
12
|
+
include Formulaic::Dsl
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
RSpec.configure do |config|
|
|
16
|
+
config.include Features, type: :feature
|
|
17
|
+
config.infer_base_class_for_anonymous_controllers = false
|
|
18
|
+
config.infer_spec_type_from_file_location!
|
|
19
|
+
config.use_transactional_fixtures = false
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
ActiveRecord::Migration.maintain_test_schema!
|
|
23
|
+
Capybara.javascript_driver = :webkit
|
data/templates/spec_helper.rb
CHANGED
|
@@ -1,30 +1,16 @@
|
|
|
1
|
-
ENV["RAILS_ENV"] = "test"
|
|
2
|
-
|
|
3
|
-
require File.expand_path("../../config/environment", __FILE__)
|
|
4
|
-
|
|
5
|
-
require "rspec/rails"
|
|
6
|
-
require "shoulda/matchers"
|
|
7
1
|
require "webmock/rspec"
|
|
8
2
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
module Features
|
|
12
|
-
# Extend this module in spec/support/features/*.rb
|
|
13
|
-
include Formulaic::Dsl
|
|
14
|
-
end
|
|
15
|
-
|
|
3
|
+
# http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
|
16
4
|
RSpec.configure do |config|
|
|
17
|
-
config.expect_with :rspec do |
|
|
18
|
-
|
|
5
|
+
config.expect_with :rspec do |expectations|
|
|
6
|
+
expectations.syntax = :expect
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
config.mock_with :rspec do |mocks|
|
|
10
|
+
mocks.syntax = :expect
|
|
19
11
|
end
|
|
20
12
|
|
|
21
|
-
config.
|
|
22
|
-
config.infer_base_class_for_anonymous_controllers = false
|
|
23
|
-
config.infer_spec_type_from_file_location!
|
|
24
|
-
config.order = "random"
|
|
25
|
-
config.use_transactional_fixtures = false
|
|
13
|
+
config.order = :random
|
|
26
14
|
end
|
|
27
15
|
|
|
28
|
-
ActiveRecord::Migration.maintain_test_schema!
|
|
29
|
-
Capybara.javascript_driver = :webkit
|
|
30
16
|
WebMock.disable_net_connect!(allow_localhost: true)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: suspenders
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.17.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- thoughtbot
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-
|
|
11
|
+
date: 2014-09-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bitters
|
|
@@ -44,14 +44,14 @@ dependencies:
|
|
|
44
44
|
requirements:
|
|
45
45
|
- - '='
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: 4.1.
|
|
47
|
+
version: 4.1.6
|
|
48
48
|
type: :runtime
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
52
|
- - '='
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: 4.1.
|
|
54
|
+
version: 4.1.6
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: aruba
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -176,6 +176,7 @@ files:
|
|
|
176
176
|
- templates/newrelic.yml.erb
|
|
177
177
|
- templates/postgresql_database.yml.erb
|
|
178
178
|
- templates/rack_timeout.rb
|
|
179
|
+
- templates/rails_helper.rb
|
|
179
180
|
- templates/sample.env
|
|
180
181
|
- templates/secrets.yml
|
|
181
182
|
- templates/smtp.rb
|