suspenders 1.5.1 → 1.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0cf8c934b629cd1178398903fbefd834490bd26e
4
- data.tar.gz: 4feb8c8d3aaef6e7a701a1379c6ec56cb2b77480
3
+ metadata.gz: 9143fdabbeb2429e35b159d7d05ebd723ca630f9
4
+ data.tar.gz: 3dda26b01f294506f39591fc5e9399fed50c3c4f
5
5
  SHA512:
6
- metadata.gz: 0132c92a271cc4b7cf220118479ba742299167352cf479295c720c2e702407d596241c7bfe541ed2f5bffb11afc22b675332f47e8bc24f31ce5c632f65eeeec9
7
- data.tar.gz: cf235a2266d97ded4b691c47f28c025c21a9f9352d853f9e1a70767610a0eb73853f9fe7a963191af7d8244d9a85f4f8b651b5d121409d554db73f019deb4c87
6
+ metadata.gz: 3728b65694bec8e195af833a2eaf0be99939c5e8d918e0d5f7eace2fa06ab5a435369542d5402d3d831e9b611f49888a8a5654476b6aa4f661a2865e91788338
7
+ data.tar.gz: 57fa6bab849dd3df3ee5af8c6173faeb0de308e12d65fc57dfdf15abab8b7031e41e49c6d05f7a087ca6da0cf4530c5d5b38e2808a7510a8f1b8d77201679a2a
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- suspenders (1.5.1)
4
+ suspenders (1.6.0)
5
5
  bundler (~> 1.3)
6
6
  rails (= 4.0.0)
7
7
 
@@ -32,12 +32,12 @@ GEM
32
32
  multi_json (~> 1.3)
33
33
  thread_safe (~> 0.1)
34
34
  tzinfo (~> 0.3.37)
35
- arel (4.0.0)
35
+ arel (4.0.1)
36
36
  aruba (0.5.3)
37
37
  childprocess (>= 0.3.6)
38
38
  cucumber (>= 1.1.1)
39
39
  rspec-expectations (>= 2.7.0)
40
- atomic (1.1.13)
40
+ atomic (1.1.14)
41
41
  builder (3.1.4)
42
42
  childprocess (0.3.9)
43
43
  ffi (~> 1.0, >= 1.0.11)
@@ -60,7 +60,7 @@ GEM
60
60
  mail (2.5.4)
61
61
  mime-types (~> 1.16)
62
62
  treetop (~> 1.4.8)
63
- mime-types (1.25)
63
+ mime-types (1.25.1)
64
64
  minitest (4.7.5)
65
65
  multi_json (1.7.7)
66
66
  multi_test (0.0.1)
@@ -84,12 +84,12 @@ GEM
84
84
  rake (10.1.0)
85
85
  rspec-expectations (2.14.0)
86
86
  diff-lcs (>= 1.1.3, < 2.0)
87
- sprockets (2.10.0)
87
+ sprockets (2.10.1)
88
88
  hike (~> 1.2)
89
89
  multi_json (~> 1.0)
90
90
  rack (~> 1.0)
91
91
  tilt (~> 1.1, != 1.3.0)
92
- sprockets-rails (2.0.0)
92
+ sprockets-rails (2.0.1)
93
93
  actionpack (>= 3.0)
94
94
  activesupport (>= 3.0)
95
95
  sprockets (~> 2.8)
@@ -100,7 +100,7 @@ GEM
100
100
  treetop (1.4.15)
101
101
  polyglot
102
102
  polyglot (>= 0.3.1)
103
- tzinfo (0.3.37)
103
+ tzinfo (0.3.38)
104
104
 
105
105
  PLATFORMS
106
106
  ruby
data/NEWS.md CHANGED
@@ -1,3 +1,13 @@
1
+ 1.6.0 (November 28, 2013)
2
+
3
+ * Do not create `.rspec` file as the settings are not project-specific.
4
+ * Generate RSpec binstub at `bin/rspec`.
5
+ * Fix stylesheet error on 500, 404, and 422 static pages.
6
+ * Add `--skip-git` option.
7
+ * Disable jQuery animations in Rails integration tests that execute JavaScript.
8
+ * Fix git remote bug.
9
+ * Add `Rack::Timeout` to compress responses with Gzip.
10
+
1
11
  1.5.1 (September 10, 2013)
2
12
 
3
13
  * Remove Turbolinks.
data/README.md CHANGED
@@ -15,8 +15,10 @@ Then run:
15
15
 
16
16
  suspenders projectname
17
17
 
18
- This will create a Rails 4.0 app in `projectname`. This script creates a
19
- new git repository. It is not meant to be used against an existing repo.
18
+ This will create a Rails 4.0 app in `projectname`.
19
+
20
+ By default this script creates a new git repository. See below if you
21
+ want to use it against an existing repo.
20
22
 
21
23
  Gemfile
22
24
  -------
@@ -70,11 +72,15 @@ Other goodies
70
72
 
71
73
  Suspenders also comes with:
72
74
 
73
- * Override recipient emails in staging environment.
74
- * Rails' flashes set up and in application layout.
75
- * A few nice time formats set up for localization.
76
- * [Heroku-recommended
77
- settings](https://devcenter.heroku.com/articles/rails4-getting-started).
75
+ * The [`./bin/setup`][bin] convention for new developer setup
76
+ * Rails' flashes set up and in application layout
77
+ * A few nice time formats set up for localization
78
+ * `Rack::Timeout` to [compress responses with Gzip][compress]
79
+ * [Fast-failing factories][fast]
80
+
81
+ [bin]: http://robots.thoughtbot.com/bin-setup
82
+ [compress]: http://robots.thoughtbot.com/content-compression-with-rack-deflater/
83
+ [fast]: http://robots.thoughtbot.com/testing-your-factories-first
78
84
 
79
85
  Heroku
80
86
  ------
@@ -83,15 +89,25 @@ You can optionally create Heroku staging and production apps:
83
89
 
84
90
  suspenders app --heroku true
85
91
 
86
- This has the same effect as running:
92
+ This:
93
+
94
+ * Creates a staging and production Heroku app
95
+ * Sets them as `staging` and `production` Git remotes
96
+ * Configures staging with `RACK_ENV` and `RAILS_ENV` environment variables set
97
+ to `staging`
98
+
99
+ Git
100
+ ---
101
+
102
+ This will initialize a new git repository for your Rails app. You can
103
+ bypass this with the `--skip-git` option:
87
104
 
88
- heroku create app-staging --remote staging
89
- heroku create app-production --remote production
105
+ suspenders app --skip-git true
90
106
 
91
- Github
107
+ GitHub
92
108
  ------
93
109
 
94
- You can optionally create a Github repository for the suspended Rails app. It
110
+ You can optionally create a GitHub repository for the suspended Rails app. It
95
111
  requires that you have [Hub](https://github.com/github/hub) on your system:
96
112
 
97
113
  curl http://hub.github.com/standalone -sLo ~/bin/hub && chmod +x ~/bin/hub
@@ -1,10 +1,5 @@
1
1
  module Suspenders
2
2
  module Actions
3
- def concat_file(source, destination)
4
- contents = IO.read(find_in_source_paths(source))
5
- append_file destination, contents
6
- end
7
-
8
3
  def replace_in_file(relative_path, find, replace)
9
4
  path = File.join(destination_root, relative_path)
10
5
  contents = IO.read(path)
@@ -20,8 +20,17 @@ module Suspenders
20
20
  end
21
21
 
22
22
  def raise_on_unpermitted_parameters
23
- configure_environment 'development',
24
- 'config.action_controller.action_on_unpermitted_parameters = :raise'
23
+ action_on_unpermitted_parameters = <<-RUBY
24
+
25
+ # Raise an ActionController::UnpermittedParameters exception when
26
+ # a parameter is not explcitly permitted but is passed anyway.
27
+ config.action_controller.action_on_unpermitted_parameters = :raise
28
+ RUBY
29
+ inject_into_file(
30
+ "config/environments/development.rb",
31
+ action_on_unpermitted_parameters,
32
+ before: "\nend"
33
+ )
25
34
  end
26
35
 
27
36
  def provide_setup_script
@@ -31,15 +40,15 @@ module Suspenders
31
40
 
32
41
  def configure_generators
33
42
  config = <<-RUBY
34
- config.generators do |generate|
35
- generate.helper false
36
- generate.javascript_engine false
37
- generate.request_specs false
38
- generate.routing_specs false
39
- generate.stylesheets false
40
- generate.test_framework :rspec
41
- generate.view_specs false
42
- end
43
+ config.generators do |generate|
44
+ generate.helper false
45
+ generate.javascript_engine false
46
+ generate.request_specs false
47
+ generate.routing_specs false
48
+ generate.stylesheets false
49
+ generate.test_framework :rspec
50
+ generate.view_specs false
51
+ end
43
52
 
44
53
  RUBY
45
54
 
@@ -71,6 +80,17 @@ module Suspenders
71
80
  :after => 'config.action_mailer.raise_delivery_errors = false'
72
81
  end
73
82
 
83
+ def enable_rack_deflater
84
+ config = <<-RUBY
85
+
86
+ # Enable deflate / gzip compression of controller-generated responses
87
+ config.middleware.use Rack::Deflater
88
+ RUBY
89
+
90
+ inject_into_file 'config/environments/production.rb', config,
91
+ :after => "config.serve_static_assets = false\n"
92
+ end
93
+
74
94
  def setup_staging_environment
75
95
  run 'cp config/environments/production.rb config/environments/staging.rb'
76
96
 
@@ -130,12 +150,15 @@ module Suspenders
130
150
  end
131
151
 
132
152
  def configure_rspec
133
- remove_file '.rspec'
134
- copy_file 'rspec', '.rspec'
135
153
  remove_file 'spec/spec_helper.rb'
136
154
  copy_file 'spec_helper.rb', 'spec/spec_helper.rb'
137
155
  end
138
156
 
157
+ def use_rspec_binstub
158
+ run 'bundle binstub rspec-core'
159
+ run 'rm bin/autospec'
160
+ end
161
+
139
162
  def configure_background_jobs_for_rspec
140
163
  copy_file 'background_jobs_rspec.rb', 'spec/support/background_jobs.rb'
141
164
  run 'rails g delayed_job:active_record'
@@ -217,12 +240,14 @@ module Suspenders
217
240
  end
218
241
 
219
242
  def set_heroku_remotes
220
- concat_file(
221
- 'templates/bin_setup',
222
- "# Set up staging and production git remotes\r
223
- git remote add staging git@heroku.com: #{app_name}-staging.git\r
224
- git remote add production git@heroku.com: #{app_name}-production.git"
225
- )
243
+ remotes = <<-RUBY
244
+
245
+ # Set up staging and production git remotes
246
+ git remote add staging git@heroku.com:#{app_name}-staging.git
247
+ git remote add production git@heroku.com:#{app_name}-production.git
248
+ RUBY
249
+
250
+ append_file 'bin/setup', remotes
226
251
  end
227
252
 
228
253
  def create_github_repo(repo_name)
@@ -239,13 +264,9 @@ module Suspenders
239
264
  <meta charset='utf-8' />
240
265
  <meta name='ROBOTS' content='NOODP' />
241
266
  EOS
242
- style_tags =<<-EOS
243
- <link href='/assets/application.css' media='all' rel='stylesheet' type='text/css' />
244
- EOS
245
267
 
246
268
  %w(500 404 422).each do |page|
247
269
  inject_into_file "public/#{page}.html", meta_tags, :after => "<head>\n"
248
- replace_in_file "public/#{page}.html", /<style.+>.+<\/style>/mi, style_tags.strip
249
270
  replace_in_file "public/#{page}.html", /<!--.+-->\n/, ''
250
271
  end
251
272
  end
@@ -49,7 +49,7 @@ module Suspenders
49
49
  def customize_gemfile
50
50
  build :replace_gemfile
51
51
  build :set_ruby_to_version_being_used
52
- bundle_command 'install --binstubs=bin/stubs'
52
+ bundle_command 'install'
53
53
  end
54
54
 
55
55
  def setup_database
@@ -76,6 +76,7 @@ module Suspenders
76
76
  build :test_factories_first
77
77
  build :generate_rspec
78
78
  build :configure_rspec
79
+ build :use_rspec_binstub
79
80
  build :configure_background_jobs_for_rspec
80
81
  build :enable_database_cleaner
81
82
  build :configure_capybara_webkit
@@ -84,6 +85,7 @@ module Suspenders
84
85
  def setup_production_environment
85
86
  say 'Setting up the production environment'
86
87
  build :configure_smtp
88
+ build :enable_rack_deflater
87
89
  end
88
90
 
89
91
  def setup_staging_environment
@@ -125,9 +127,11 @@ module Suspenders
125
127
  end
126
128
 
127
129
  def setup_git
128
- say 'Initializing git'
129
- invoke :setup_gitignore
130
- invoke :init_git
130
+ if !options[:skip_git]
131
+ say 'Initializing git'
132
+ invoke :setup_gitignore
133
+ invoke :init_git
134
+ end
131
135
  end
132
136
 
133
137
  def create_heroku_apps
@@ -139,7 +143,7 @@ module Suspenders
139
143
  end
140
144
 
141
145
  def create_github_repo
142
- if options[:github]
146
+ if !options[:skip_git] && options[:github]
143
147
  say 'Creating Github repo'
144
148
  build :create_github_repo, options[:github]
145
149
  end
@@ -1,3 +1,3 @@
1
1
  module Suspenders
2
- VERSION = '1.5.1'
2
+ VERSION = '1.6.0'
3
3
  end
@@ -4,6 +4,7 @@
4
4
 
5
5
  <% if Rails.env.test? %>
6
6
  <%= javascript_tag do %>
7
+ $.fx.off = true;
7
8
  $.ajaxSetup({ async: false });
8
9
  <% end %>
9
10
  <% end %>
@@ -4,7 +4,6 @@
4
4
  *.swp
5
5
  .bundle
6
6
  .sass-cache/
7
- bin/stubs
8
7
  coverage/*
9
8
  db/*.sqlite3
10
9
  db/schema.rb
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.5.1
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - thoughtbot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-10 00:00:00.000000000 Z
11
+ date: 2013-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -120,7 +120,6 @@ files:
120
120
  - templates/javascripts/prefilled_input.js
121
121
  - templates/postgresql_database.yml.erb
122
122
  - templates/rack_timeout.rb
123
- - templates/rspec
124
123
  - templates/sample.env
125
124
  - templates/smtp.rb
126
125
  - templates/spec_helper.rb
@@ -1,2 +0,0 @@
1
- --colour
2
- --profile