suspenders 1.2.0 → 1.2.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,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ M2IxZmFiNjM0NmE0Y2IwODZiMzk3MTNiZjg5ZjEyYzI0YjQwNWRlMg==
5
+ data.tar.gz: !binary |-
6
+ NzBhZjliOWQ5YmZiNGYyYTE2NTBkZGRjNjIzMDk5NmE4NGQ3YTlmYg==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ M2MxZjFhMjY0MDU5ZTc1YWYxZjA2NTNhYTkwYzMyYmFiNWRmZTMwYzYzYTQx
10
+ ZjQwNTc3MzM0YTc4ZWU4MTVlZjdlNDJkZWJiZjA2MDNhMWU5MjI3NjdjOWMx
11
+ M2YxZmM3OGE0MjkzMTBjNzJjMWJmOTRlZTYyZTRhNjIyMzBkNDg=
12
+ data.tar.gz: !binary |-
13
+ YjM5YjNiOTg0NzgwMzNlNWQ0YzVhMmQ5ODAxYWEwMmFjNTAyZGQ2OTY3M2Ix
14
+ OGE3NTU2MTg1MGQwNzA5ZTc4MmRkMTM2OTFjNjY2NGY3NjRkY2JjOGQxYTEy
15
+ YjA0ZTFkNWNmMjBlZjUwMmE3N2IzZDNlOThkMDFkMjU0Y2RlZWM=
data/NEWS.md CHANGED
@@ -1,3 +1,12 @@
1
+ 1.2.1 (February 28, 2013)
2
+
3
+ * Use Ruby 1.9.3 and 2.0
4
+ * Update staging and production email delivery
5
+ * Remove Spork and Guard
6
+ * Add better_errors and binding_of_caller gems
7
+ * Fix ActiveRecord attributes' blacklist
8
+ * Add Flutie to Gemfile
9
+
1
10
  1.2.0 (February 13, 2013)
2
11
 
3
12
  * Upgrade Rails from 3.2.8 to 3.2.12 to keep pace with security patches.
@@ -33,11 +33,26 @@ module Suspenders
33
33
  append_file 'Rakefile', factories_spec_rake_task
34
34
  end
35
35
 
36
+ def configure_smtp
37
+ copy_file 'smtp.rb', 'config/initializers/smtp.rb'
38
+
39
+ prepend_file 'config/environments/production.rb',
40
+ "require Rails.root.join('config/initializers/smtp')"
41
+
42
+ config = <<-RUBY
43
+ config.action_mailer.delivery_method = :smtp
44
+ config.action_mailer.smtp_settings = SMTP_SETTINGS
45
+ RUBY
46
+
47
+ inject_into_file 'config/environments/production.rb', config,
48
+ :after => 'config.action_mailer.raise_delivery_errors = false'
49
+ end
50
+
36
51
  def setup_staging_environment
37
52
  run 'cp config/environments/production.rb config/environments/staging.rb'
38
- inject_into_file 'config/environments/staging.rb',
39
- "\n config.action_mailer.delivery_method = :override_recipient_smtp, to: 'staging@example.com'",
40
- :after => 'config.action_mailer.raise_delivery_errors = false'
53
+
54
+ prepend_file 'config/environments/staging.rb',
55
+ "Mail.register_interceptor RecipientInterceptor.new(ENV['EMAIL_RECIPIENTS'])"
41
56
  end
42
57
 
43
58
  def initialize_on_precompile
@@ -133,11 +148,9 @@ module Suspenders
133
148
  end
134
149
 
135
150
  def blacklist_active_record_attributes
136
- config = <<-RUBY
137
- config.active_record.whitelist_attributes = false
138
-
139
- RUBY
140
- inject_into_class 'config/application.rb', 'Application', config
151
+ replace_in_file 'config/application.rb',
152
+ 'config.active_record.whitelist_attributes = true',
153
+ 'config.active_record.whitelist_attributes = false'
141
154
  end
142
155
 
143
156
  def configure_strong_parameters
@@ -178,8 +191,8 @@ module Suspenders
178
191
  end
179
192
  end
180
193
 
181
- def setup_guard_spork
182
- copy_file 'Guardfile', 'Guardfile'
194
+ def generate_clearance
195
+ generate 'clearance:install'
183
196
  end
184
197
 
185
198
  def setup_foreman
@@ -233,10 +246,6 @@ module Suspenders
233
246
  run "#{path_addition} hub create #{repo_name}"
234
247
  end
235
248
 
236
- def copy_libraries
237
- copy_file 'override_recipient_smtp.rb', 'lib/override_recipient_smtp.rb'
238
- end
239
-
240
249
  def copy_miscellaneous_files
241
250
  copy_file 'errors.rb', 'config/initializers/errors.rb'
242
251
  end
@@ -25,6 +25,7 @@ module Suspenders
25
25
  invoke :customize_gemfile
26
26
  invoke :setup_development_environment
27
27
  invoke :setup_test_environment
28
+ invoke :setup_production_environment
28
29
  invoke :setup_staging_environment
29
30
  invoke :create_suspenders_views
30
31
  invoke :create_common_javascripts
@@ -32,7 +33,6 @@ module Suspenders
32
33
  invoke :setup_database
33
34
  invoke :configure_app
34
35
  invoke :setup_stylesheets
35
- invoke :copy_libraries
36
36
  invoke :copy_miscellaneous_files
37
37
  invoke :customize_error_pages
38
38
  invoke :remove_routes_comment_lines
@@ -64,6 +64,11 @@ module Suspenders
64
64
  build :setup_guard_spork
65
65
  end
66
66
 
67
+ def setup_production_environment
68
+ say 'Setting up the production environment'
69
+ build :configure_smtp
70
+ end
71
+
67
72
  def setup_staging_environment
68
73
  say 'Setting up the staging environment'
69
74
  build :setup_staging_environment
@@ -1,3 +1,3 @@
1
1
  module Suspenders
2
- VERSION = '1.2.0'
2
+ VERSION = '1.2.1'
3
3
  end
data/suspenders.gemspec CHANGED
@@ -1,12 +1,13 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
- require "suspenders/version"
3
+ require 'suspenders/version'
4
+ require 'date'
4
5
 
5
6
  Gem::Specification.new do |s|
6
7
  s.name = 'suspenders'
7
8
  s.version = Suspenders::VERSION
8
9
  s.date = Date.today.strftime('%Y-%m-%d')
9
- s.authors = ["thoughtbot"]
10
+ s.authors = ['thoughtbot']
10
11
  s.email = 'support@thoughtbot.com'
11
12
  s.homepage = 'http://github.com/thoughtbot/suspenders'
12
13
 
@@ -2,29 +2,31 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem 'airbrake'
4
4
  gem 'bourbon'
5
+ gem 'flutie'
5
6
  gem 'high_voltage'
6
7
  gem 'jquery-rails'
7
8
  gem 'pg'
8
9
  gem 'psych'
9
10
  gem 'rack-timeout'
10
11
  gem 'rails', '>= 3.2.11'
12
+ gem 'recipient_interceptor'
11
13
  gem 'simple_form'
12
14
  gem 'strong_parameters'
13
15
  gem 'thin'
14
16
 
15
17
  group :assets do
16
- gem 'sass-rails'
17
18
  gem 'coffee-rails'
19
+ gem 'sass-rails'
18
20
  gem 'uglifier'
19
21
  end
20
22
 
21
23
  group :development do
22
24
  gem 'foreman'
25
+ gem 'better_errors'
26
+ gem 'binding_of_caller'
23
27
  end
24
28
 
25
29
  group :development, :test do
26
- gem 'guard'
27
- gem 'guard-spork'
28
30
  gem 'rspec-rails'
29
31
  gem 'sham_rack'
30
32
  end
data/templates/smtp.rb ADDED
@@ -0,0 +1,10 @@
1
+ if Rails.env.staging? || Rails.env.production?
2
+ SMTP_SETTINGS = {
3
+ address: ENV['SMTP_ADDRESS'], # example: 'smtp.sendgrid.net'
4
+ authentication: :plain,
5
+ domain: ENV['SMTP_DOMAIN'], # example: 'this-app.com'
6
+ password: ENV['SMTP_PASSWORD'],
7
+ port: '587',
8
+ user_name: ENV['SMTP_USERNAME']
9
+ }
10
+ end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: suspenders
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
5
- prerelease:
4
+ version: 1.2.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - thoughtbot
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-02-13 00:00:00.000000000 Z
11
+ date: 2013-03-01 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rails
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - '='
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - '='
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: bundler
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ! '>='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ! '>='
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: hub
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ~>
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ~>
60
53
  - !ruby/object:Gem::Version
@@ -62,7 +55,6 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: cucumber
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ~>
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ~>
76
67
  - !ruby/object:Gem::Version
@@ -78,7 +69,6 @@ dependencies:
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: aruba
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
73
  - - ~>
84
74
  - !ruby/object:Gem::Version
@@ -86,7 +76,6 @@ dependencies:
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
80
  - - ~>
92
81
  - !ruby/object:Gem::Version
@@ -130,7 +119,6 @@ files:
130
119
  - lib/suspenders/version.rb
131
120
  - suspenders.gemspec
132
121
  - templates/Gemfile_clean
133
- - templates/Guardfile
134
122
  - templates/Procfile
135
123
  - templates/README.md.erb
136
124
  - templates/_flashes.html.erb
@@ -146,39 +134,38 @@ files:
146
134
  - templates/factory_girl_syntax_rspec.rb
147
135
  - templates/import_scss_styles
148
136
  - templates/javascripts/prefilled_input.js
149
- - templates/override_recipient_smtp.rb
150
137
  - templates/postgresql_database.yml.erb
151
138
  - templates/rack_timeout.rb
152
139
  - templates/rspec
153
140
  - templates/sample.env
154
141
  - templates/simplecov_init.rb
142
+ - templates/smtp.rb
155
143
  - templates/strong_parameters.rb
156
144
  - templates/suspenders_gitignore
157
145
  - templates/suspenders_layout.html.erb.erb
158
146
  homepage: http://github.com/thoughtbot/suspenders
159
147
  licenses: []
148
+ metadata: {}
160
149
  post_install_message:
161
150
  rdoc_options:
162
151
  - --charset=UTF-8
163
152
  require_paths:
164
153
  - lib
165
154
  required_ruby_version: !ruby/object:Gem::Requirement
166
- none: false
167
155
  requirements:
168
156
  - - ! '>='
169
157
  - !ruby/object:Gem::Version
170
158
  version: '0'
171
159
  required_rubygems_version: !ruby/object:Gem::Requirement
172
- none: false
173
160
  requirements:
174
161
  - - ! '>='
175
162
  - !ruby/object:Gem::Version
176
163
  version: '0'
177
164
  requirements: []
178
165
  rubyforge_project:
179
- rubygems_version: 1.8.23
166
+ rubygems_version: 2.0.0
180
167
  signing_key:
181
- specification_version: 3
168
+ specification_version: 4
182
169
  summary: Generate a Rails app using thoughtbot's best practices.
183
170
  test_files:
184
171
  - features/github_repo.feature
data/templates/Guardfile DELETED
@@ -1,12 +0,0 @@
1
- guard 'spork' do
2
- watch 'config/application.rb'
3
- watch 'config/environment.rb'
4
- watch %r{^config/environments/.*\.rb$}
5
- watch %r{^config/initializers/.*\.rb$}
6
- watch 'config/routes.rb'
7
- watch 'Gemfile.lock'
8
- watch 'spec/factories.rb'
9
- watch 'spec/spec_helper.rb'
10
- watch %r{^spec/support/.*\.rb$}
11
- watch 'config/locales/.*'
12
- end
@@ -1,38 +0,0 @@
1
- module Mail
2
- # == Sending Email with Override Recipient SMTP
3
- #
4
- # Use the OverrideRecipientSMTP delivery method when you don't want your app
5
- # to accidentally send emails to addresses other than the overridden recipient
6
- # which you configure.
7
- #
8
- # An typical use case is in your app's staging environment, your development
9
- # team will receive all staging emails without accidentally emailing users with
10
- # active email addresses in the database.
11
- #
12
- # === Sending via OverrideRecipientSMTP
13
- #
14
- # config.action_mailer.delivery_method = :override_recipient_smtp,
15
- # to: 'staging@example.com'
16
- #
17
- # === Sending to multiple email addresses
18
- #
19
- # config.action_mailer.delivery_method = :override_recipient_smtp,
20
- # to: ['dan@example.com', 'harlow@example.com']
21
- class OverrideRecipientSMTP < Mail::SMTP
22
- def initialize(values)
23
- unless values[:to]
24
- raise ArgumentError.new('A :to option is required when using :override_recipient_smtp')
25
- end
26
-
27
- super(values)
28
- end
29
-
30
- def deliver!(mail)
31
- mail.to = settings[:to]
32
- mail.cc = nil
33
- mail.bcc = nil
34
-
35
- super(mail)
36
- end
37
- end
38
- end