suspenders 1.41.0 → 1.42.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 72448ddabb6379077f02f41bc65d4dc8a112d4f0
4
- data.tar.gz: 3c56de92f55a3d7984a6dd8a011dd9001934ba10
3
+ metadata.gz: 5e05970d5749f52683a2dfdfa61a235ad491d845
4
+ data.tar.gz: dc6f0b8a74087e93f439d58201403b054ac750cb
5
5
  SHA512:
6
- metadata.gz: bbc752c4b28b8b6dd86270c3d2986c58574fa684b8750ce854c2f7a981c076f5c9104b4b903a5322d04179412c68dab4b498d4a9dcc26eba4c05af678a2b67c7
7
- data.tar.gz: 48226bb6d42963e7b0c6bd6bb39e8ab732c9455a2c619fea3618a785aedfea2b3f5b76f4242fbc3ebd7f3687a1510d91887371ebe2fbb5b040043954ada8e1ac
6
+ metadata.gz: 4037ab32f9b62c91360f7eac64c0de6a2e9e9ad90dea32ed13f2abd5b8964c5dbde5260d4845f713880d6c4e40a65d5e5ea13187a5f99dd65aa850c535d3e97e
7
+ data.tar.gz: db11125739ae1d52c4edf0be9b49baa8a531824dbc2c4510e87c0be9a8b4cf2512f1208a5641c2fb13d4091d4c34f3eba98ce499df7104478c268f61df93293b
data/NEWS.md CHANGED
@@ -1,5 +1,12 @@
1
1
  master
2
2
 
3
+ 1.42.0 (July 23, 2016)
4
+
5
+ * [#784] Require refills once
6
+ * [#790] Ensure stylesheet_base generator runs with a clean bundle
7
+ * [#791] Use Rails' 5 syntax for `public_file_server.headers`
8
+ * [#792] Remove turbolinks from application.js file
9
+
3
10
  1.41.0 (July 1, 2016)
4
11
 
5
12
  * Update to Rails 5
@@ -43,6 +43,14 @@ module Suspenders
43
43
  'raise_delivery_errors = false', 'raise_delivery_errors = true'
44
44
  end
45
45
 
46
+ def remove_turbolinks
47
+ replace_in_file(
48
+ "app/assets/javascripts/application.js",
49
+ "//= require turbolinks",
50
+ ""
51
+ )
52
+ end
53
+
46
54
  def set_test_delivery_method
47
55
  inject_into_file(
48
56
  "config/environments/development.rb",
@@ -169,10 +177,13 @@ module Suspenders
169
177
  "config.assets.version = '1.0'",
170
178
  'config.assets.version = (ENV["ASSETS_VERSION"] || "1.0")'
171
179
 
172
- configure_environment(
173
- "production",
174
- 'config.static_cache_control = "public, max-age=31557600"',
175
- )
180
+ config = <<-EOD
181
+ config.public_file_server.headers = {
182
+ "Cache-Control" => "public, max-age=31557600",
183
+ }
184
+ EOD
185
+
186
+ configure_environment("production", config)
176
187
  end
177
188
 
178
189
  def setup_secret_token
@@ -322,15 +333,6 @@ Rack::Timeout.timeout = (ENV["RACK_TIMEOUT"] || 10).to_i
322
333
  copy_file "Procfile", "Procfile"
323
334
  end
324
335
 
325
- def install_refills
326
- generate "refills:import", "flashes"
327
- remove_dir "app/views/refills"
328
- end
329
-
330
- def install_bitters
331
- run "bitters install --path app/assets/stylesheets"
332
- end
333
-
334
336
  def setup_default_directories
335
337
  [
336
338
  'app/views/pages',
@@ -39,9 +39,6 @@ module Suspenders
39
39
  invoke :setup_secret_token
40
40
  invoke :create_suspenders_views
41
41
  invoke :configure_app
42
- invoke :setup_stylesheets
43
- invoke :install_bitters
44
- invoke :install_refills
45
42
  invoke :copy_miscellaneous_files
46
43
  invoke :customize_error_pages
47
44
  invoke :remove_config_comment_lines
@@ -80,6 +77,7 @@ module Suspenders
80
77
  say 'Setting up the development environment'
81
78
  build :raise_on_missing_assets_in_test
82
79
  build :raise_on_delivery_errors
80
+ build :remove_turbolinks
83
81
  build :set_test_delivery_method
84
82
  build :add_bullet_gem_configuration
85
83
  build :raise_on_unpermitted_parameters
@@ -141,21 +139,6 @@ module Suspenders
141
139
  build :setup_rack_mini_profiler
142
140
  end
143
141
 
144
- def setup_stylesheets
145
- say 'Set up stylesheets'
146
- build :setup_stylesheets
147
- end
148
-
149
- def install_bitters
150
- say 'Install Bitters'
151
- build :install_bitters
152
- end
153
-
154
- def install_refills
155
- say "Install Refills"
156
- build :install_refills
157
- end
158
-
159
142
  def setup_git
160
143
  if !options[:skip_git]
161
144
  say "Initializing git"
@@ -237,11 +220,8 @@ module Suspenders
237
220
 
238
221
  def generate_default
239
222
  run("spring stop")
240
-
241
223
  generate("suspenders:static")
242
224
  generate("suspenders:stylesheet_base")
243
-
244
- bundle_command "install"
245
225
  end
246
226
 
247
227
  def outro
@@ -4,6 +4,7 @@ module Suspenders
4
4
  class StaticGenerator < Rails::Generators::Base
5
5
  def add_high_voltage
6
6
  gem "high_voltage"
7
+ Bundler.with_clean_env { run "bundle install" }
7
8
  end
8
9
  end
9
10
  end
@@ -10,6 +10,7 @@ module Suspenders
10
10
  gem "bourbon", "5.0.0.beta.6"
11
11
  gem "neat", "~> 1.8.0"
12
12
  gem "refills", group: [:development, :test]
13
+ Bundler.with_clean_env { run "bundle install" }
13
14
  end
14
15
 
15
16
  def add_css_config
@@ -23,5 +24,14 @@ module Suspenders
23
24
  def remove_prior_config
24
25
  remove_file "app/assets/stylesheets/application.css"
25
26
  end
27
+
28
+ def install_refills
29
+ generate "refills:import", "flashes"
30
+ remove_dir "app/views/refills"
31
+ end
32
+
33
+ def install_bitters
34
+ run "bitters install --path app/assets/stylesheets"
35
+ end
26
36
  end
27
37
  end
@@ -4,5 +4,5 @@ module Suspenders
4
4
  read("#{File.dirname(__FILE__)}/../../.ruby-version").
5
5
  strip.
6
6
  freeze
7
- VERSION = "1.41.0".freeze
7
+ VERSION = "1.42.0".freeze
8
8
  end
@@ -114,9 +114,10 @@ RSpec.describe "Suspend a new project with default configuration" do
114
114
  expect(result).to match(/^ +config.assets.quiet = true$/)
115
115
  end
116
116
 
117
- it "configures static_cache_control in production" do
117
+ it "configures public_file_server.headers in production" do
118
+ IO.write("production_config.rb", production_config)
118
119
  expect(production_config).to match(
119
- /config.static_cache_control = "public, max-age=.+"/,
120
+ /^ +config.public_file_server.headers = {\n +"Cache-Control" => "public,/,
120
121
  )
121
122
  end
122
123
 
@@ -262,10 +263,18 @@ RSpec.describe "Suspend a new project with default configuration" do
262
263
  end
263
264
 
264
265
  it "configures bourbon, neat, and refills" do
266
+ flashes_path = %w(app assets stylesheets refills _flashes.scss)
267
+ expect(read_project_file(flashes_path)).to match(/mixin/m)
268
+
265
269
  app_css = read_project_file(%w(app assets stylesheets application.scss))
266
270
  expect(app_css).to match(/normalize-rails.*bourbon.*neat.*base.*refills/m)
267
271
  end
268
272
 
273
+ it "doesn't use turbolinks" do
274
+ app_js = read_project_file(%w(app assets javascripts application.js))
275
+ expect(app_js).not_to match(/turbolinks/)
276
+ end
277
+
269
278
  def development_config
270
279
  @_development_config ||=
271
280
  read_project_file %w(config environments development.rb)
@@ -37,7 +37,6 @@ group :development, :test do
37
37
  gem "factory_girl_rails"
38
38
  gem "pry-byebug"
39
39
  gem "pry-rails"
40
- gem "refills"
41
40
  gem "rspec-rails", "~> 3.5.0.beta4"
42
41
  end
43
42
 
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.41.0
4
+ version: 1.42.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - thoughtbot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-01 00:00:00.000000000 Z
11
+ date: 2016-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bitters