bretels 1.0.1 → 1.0.2

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: 9f3d7058249bf44bd2f659ed79719a99787685bc
4
- data.tar.gz: 6dbedd997aacbcd23393e19d7b8ad24bb14553ce
3
+ metadata.gz: 29cd2e5245cbfdae9612a5383f73e2051ee5f766
4
+ data.tar.gz: 4adc70193dcf383a5e6ffe357a775e546d1a5aa3
5
5
  SHA512:
6
- metadata.gz: 496efbb24f8eff4b8c2758b2686938f6d4ac28bacd5b1436f5a153748bc58fd51bfa78fb1c301d887f9aefdc462af3db0d395030b0e4b43fd68305f1867da1ed
7
- data.tar.gz: b9b042865639d705c08f72520b24a2611e9b600da7f6828349332404d99f43dc8e180821297648fabcf9c4c717abbacdc662900df19a5d23016e4435cefb87f4
6
+ metadata.gz: 93039e7d2b0e173e9c031c751f8e08e893fedc0811abd3c85cf1e3142fadebe812015bdfd528bcf932206a83536858f42c383fe1a40c96114a97d9f4cf16655d
7
+ data.tar.gz: ef83e9aa548ab19c576941612856fe8cf50dc24fbca72216dd6d86f6da57ed210f2fab1c0073bce16f9568198ffa3a72864d022f0c450b784e5fdcec46ebd5ae
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bretels (1.0.1)
4
+ bretels (1.0.2)
5
5
  bundler (>= 1.1)
6
6
  hub (~> 1.10.2)
7
7
  rails (= 4.0.0)
@@ -33,19 +33,19 @@ GEM
33
33
  multi_json (~> 1.3)
34
34
  thread_safe (~> 0.1)
35
35
  tzinfo (~> 0.3.37)
36
- arel (4.0.0)
37
- atomic (1.1.12)
36
+ arel (4.0.1)
37
+ atomic (1.1.14)
38
38
  builder (3.1.4)
39
39
  erubis (2.7.0)
40
40
  hike (1.2.3)
41
41
  hub (1.10.4)
42
- i18n (0.6.4)
42
+ i18n (0.6.9)
43
43
  mail (2.5.4)
44
44
  mime-types (~> 1.16)
45
45
  treetop (~> 1.4.8)
46
- mime-types (1.23)
46
+ mime-types (1.25.1)
47
47
  minitest (4.7.5)
48
- multi_json (1.7.8)
48
+ multi_json (1.8.2)
49
49
  polyglot (0.3.3)
50
50
  rack (1.5.2)
51
51
  rack-test (0.6.2)
@@ -63,24 +63,24 @@ GEM
63
63
  activesupport (= 4.0.0)
64
64
  rake (>= 0.8.7)
65
65
  thor (>= 0.18.1, < 2.0)
66
- rake (10.1.0)
67
- sprockets (2.10.0)
66
+ rake (10.1.1)
67
+ sprockets (2.10.1)
68
68
  hike (~> 1.2)
69
69
  multi_json (~> 1.0)
70
70
  rack (~> 1.0)
71
71
  tilt (~> 1.1, != 1.3.0)
72
- sprockets-rails (2.0.0)
72
+ sprockets-rails (2.0.1)
73
73
  actionpack (>= 3.0)
74
74
  activesupport (>= 3.0)
75
75
  sprockets (~> 2.8)
76
76
  thor (0.18.1)
77
- thread_safe (0.1.2)
77
+ thread_safe (0.1.3)
78
78
  atomic
79
79
  tilt (1.4.1)
80
- treetop (1.4.14)
80
+ treetop (1.4.15)
81
81
  polyglot
82
82
  polyglot (>= 0.3.1)
83
- tzinfo (0.3.37)
83
+ tzinfo (0.3.38)
84
84
 
85
85
  PLATFORMS
86
86
  ruby
@@ -6,10 +6,6 @@ module Bretels
6
6
  template 'README.md.erb', 'README.md'
7
7
  end
8
8
 
9
- def remove_public_index
10
- remove_file 'public/index.html'
11
- end
12
-
13
9
  def remove_rails_logo_image
14
10
  remove_file 'app/assets/images/rails.png'
15
11
  end
@@ -28,7 +24,7 @@ module Bretels
28
24
  end
29
25
 
30
26
  def generate_factories_file
31
- template 'factories.rb', 'spec/factories.rb'
27
+ empty_directory 'spec/factories'
32
28
  end
33
29
 
34
30
  def add_cdn_settings
@@ -69,6 +65,23 @@ module Bretels
69
65
  )
70
66
  end
71
67
 
68
+ def enable_rack_deflater
69
+ config = <<-RUBY
70
+
71
+ # Enable deflate / gzip compression of controller-generated responses
72
+ config.middleware.use Rack::Deflater
73
+ RUBY
74
+
75
+ inject_into_file 'config/environments/production.rb', config,
76
+ :after => "config.serve_static_assets = false\n"
77
+ end
78
+
79
+ def remove_turbolinks
80
+ replace_in_file 'app/assets/javascripts/application.js',
81
+ /\/\/= require turbolinks\n/,
82
+ ''
83
+ end
84
+
72
85
  def enable_force_ssl
73
86
  replace_in_file 'config/environments/production.rb',
74
87
  '# config.force_ssl = true', 'config.force_ssl = true'
@@ -97,10 +110,6 @@ module Bretels
97
110
  copy_file '_flashes.html.erb', 'app/views/application/_flashes.html.erb'
98
111
  end
99
112
 
100
- def create_shared_javascripts
101
- copy_file '_javascript.html.erb', 'app/views/application/_javascript.html.erb'
102
- end
103
-
104
113
  def create_application_layout
105
114
  template 'suspenders_layout.html.erb.erb',
106
115
  'app/views/layouts/application.html.erb',
@@ -122,10 +131,6 @@ module Bretels
122
131
  after: /source 'https:\/\/rubygems.org'/
123
132
  end
124
133
 
125
- def enable_database_cleaner
126
- copy_file 'database_cleaner_rspec.rb', 'spec/support/database_cleaner.rb'
127
- end
128
-
129
134
  def configure_rspec
130
135
  config = <<-RUBY
131
136
 
@@ -139,16 +144,11 @@ module Bretels
139
144
  generate.routing_specs false
140
145
  generate.view_specs false
141
146
  end
142
-
143
147
  RUBY
144
148
 
145
149
  inject_into_class 'config/application.rb', 'Application', config
146
150
  end
147
151
 
148
- def configure_strong_parameters
149
- copy_file 'strong_parameters.rb', 'config/initializers/strong_parameters.rb'
150
- end
151
-
152
152
  def configure_time_zone
153
153
  replace_in_file 'config/application.rb',
154
154
  "# config.time_zone = 'Central Time (US & Canada)'",
@@ -172,6 +172,7 @@ module Bretels
172
172
  def configure_action_mailer
173
173
  action_mailer_host 'development', "#{app_name}.dev"
174
174
  action_mailer_host 'test', 'www.example.com'
175
+ action_mailer_host 'staging', "#{app_name}-staging.herokuapp.com"
175
176
  action_mailer_host 'production', "#{app_name}.nl"
176
177
  end
177
178
 
@@ -195,7 +196,6 @@ module Bretels
195
196
  [
196
197
  'spec/support',
197
198
  'spec/lib',
198
- 'spec/features',
199
199
  'spec/models',
200
200
  ].each do |dir|
201
201
  empty_directory(dir)
@@ -215,14 +215,6 @@ module Bretels
215
215
  run "#{path_addition} heroku config:add RACK_ENV=staging RAILS_ENV=staging --remote=staging"
216
216
  end
217
217
 
218
- def create_github_repo(repo_name)
219
- run "#{path_addition} hub create #{repo_name}"
220
- end
221
-
222
- def copy_miscellaneous_files
223
- copy_file 'errors.rb', 'config/initializers/errors.rb'
224
- end
225
-
226
218
  def customize_error_pages
227
219
  meta_tags =<<-EOS
228
220
  <meta charset='utf-8' />
@@ -249,8 +241,8 @@ module Bretels
249
241
  copy_file 'email_validator.rb', 'app/validators/email_validator.rb'
250
242
  end
251
243
 
252
- def disable_xml_params
253
- copy_file 'disable_xml_params.rb', 'config/initializers/disable_xml_params.rb'
244
+ def add_airbrake_configuration
245
+ copy_file 'airbrake.rb', 'config/initializers/airbrake.rb'
254
246
  end
255
247
 
256
248
  def setup_default_rake_task
@@ -9,18 +9,15 @@ module Bretels
9
9
  class_option :heroku, :type => :boolean, :aliases => '-H', :default => false,
10
10
  :desc => 'Create staging and production Heroku apps'
11
11
 
12
- class_option :github, :type => :string, :aliases => '-G', :default => nil,
13
- :desc => 'Create Github repository and add remote origin pointed to repo'
14
-
15
12
  class_option :skip_test_unit, :type => :boolean, :aliases => '-T', :default => true,
16
13
  :desc => 'Skip Test::Unit files'
17
14
 
18
15
  def finish_template
19
- invoke :suspenders_customization
16
+ invoke :bretels_customization
20
17
  super
21
18
  end
22
19
 
23
- def suspenders_customization
20
+ def bretels_customization
24
21
  invoke :remove_files_we_dont_need
25
22
  invoke :customize_gemfile
26
23
  invoke :setup_development_environment
@@ -31,17 +28,15 @@ module Bretels
31
28
  invoke :setup_database
32
29
  invoke :configure_app
33
30
  invoke :setup_stylesheets
34
- invoke :copy_miscellaneous_files
35
31
  invoke :customize_error_pages
36
32
  invoke :remove_routes_comment_lines
33
+ invoke :remove_turbolinks
37
34
  invoke :setup_git
38
35
  invoke :create_heroku_apps
39
- invoke :create_github_repo
40
36
  invoke :outro
41
37
  end
42
38
 
43
39
  def remove_files_we_dont_need
44
- build :remove_public_index
45
40
  build :remove_rails_logo_image
46
41
  end
47
42
 
@@ -58,7 +53,6 @@ module Bretels
58
53
  build :test_factories_first
59
54
  build :generate_rspec
60
55
  build :configure_rspec
61
- build :enable_database_cleaner
62
56
  build :generate_factories_file
63
57
  end
64
58
 
@@ -67,6 +61,7 @@ module Bretels
67
61
  build :configure_smtp
68
62
  build :enable_force_ssl
69
63
  build :add_cdn_settings
64
+ build :enable_rack_deflater
70
65
  end
71
66
 
72
67
  def setup_staging_environment
@@ -78,7 +73,6 @@ module Bretels
78
73
  say 'Creating suspenders views'
79
74
  build :create_partials_directory
80
75
  build :create_shared_flashes
81
- build :create_shared_javascripts
82
76
  build :create_application_layout
83
77
  end
84
78
 
@@ -98,13 +92,12 @@ module Bretels
98
92
  def configure_app
99
93
  say 'Configuring app'
100
94
  build :configure_action_mailer
101
- build :configure_strong_parameters
102
95
  build :raise_unpermitted_params
103
96
  build :configure_time_zone
104
97
  build :configure_time_formats
105
98
  build :configure_dutch_language
106
99
  build :configure_rack_timeout
107
- build :disable_xml_params
100
+ build :add_airbrake_configuration
108
101
  build :add_email_validator
109
102
  build :setup_default_rake_task
110
103
  build :setup_foreman
@@ -116,7 +109,7 @@ module Bretels
116
109
  end
117
110
 
118
111
  def setup_git
119
- say 'Initializing git'
112
+ say 'initializing git'
120
113
  invoke :setup_gitignore
121
114
  invoke :init_git
122
115
  end
@@ -128,13 +121,6 @@ module Bretels
128
121
  end
129
122
  end
130
123
 
131
- def create_github_repo
132
- if options[:github]
133
- say 'Creating Github repo'
134
- build :create_github_repo, options[:github]
135
- end
136
- end
137
-
138
124
  def setup_gitignore
139
125
  build :gitignore_files
140
126
  end
@@ -143,16 +129,15 @@ module Bretels
143
129
  build :init_git
144
130
  end
145
131
 
146
- def copy_miscellaneous_files
147
- say 'Copying miscellaneous support files'
148
- build :copy_miscellaneous_files
149
- end
150
-
151
132
  def customize_error_pages
152
133
  say 'Customizing the 500/404/422 pages'
153
134
  build :customize_error_pages
154
135
  end
155
136
 
137
+ def remove_turbolinks
138
+ build :remove_turbolinks
139
+ end
140
+
156
141
  def remove_routes_comment_lines
157
142
  build :remove_routes_comment_lines
158
143
  end
@@ -161,7 +146,7 @@ module Bretels
161
146
  say 'Done. Congratulations!'
162
147
  say '1. Run bundle install'
163
148
  say '2. Run rake db:create'
164
- say "3. Run exceptional install <api-key>"
149
+ say "3. Update config/initializers/airbrake.rb"
165
150
  end
166
151
 
167
152
  def run_bundle
@@ -1,3 +1,3 @@
1
1
  module Bretels
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
3
3
  end
@@ -1,6 +1,8 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'rails', '4.0.0'
3
+ ruby '2.0.0'
4
+
5
+ gem 'rails', '~> 4.0.0'
4
6
  gem 'coffee-rails'
5
7
  gem 'jquery-rails'
6
8
  gem 'pg'
@@ -8,14 +10,17 @@ gem 'rack-timeout'
8
10
  gem 'rails-i18n'
9
11
  gem 'sass-rails'
10
12
  gem 'uglifier'
11
- gem 'unicorn'
13
+ gem 'airbrake'
12
14
 
13
15
  group :development do
14
- gem 'foreman'
15
16
  gem 'better_errors'
16
17
  gem 'binding_of_caller'
17
- gem 'quiet_assets'
18
18
  gem 'letter_opener'
19
+ gem 'quiet_assets'
20
+ end
21
+
22
+ group :staging do
23
+ gem 'recipient_interceptor'
19
24
  end
20
25
 
21
26
  group :development, :test do
@@ -24,13 +29,11 @@ group :development, :test do
24
29
  end
25
30
 
26
31
  group :test do
27
- gem 'capybara-webkit', '>= 0.14.1'
28
- gem 'database_cleaner'
29
32
  gem 'launchy'
30
33
  end
31
34
 
32
35
  group :staging, :production do
33
- gem 'rails_12factor'
34
- gem 'exceptional'
35
36
  gem 'newrelic_rpm'
37
+ gem 'rails_12factor'
38
+ gem 'unicorn'
36
39
  end
@@ -0,0 +1,6 @@
1
+ Airbrake.configure do |config|
2
+ config.api_key = ''
3
+ config.host = ''
4
+ config.port = 443
5
+ config.secure = true
6
+ end
@@ -2,9 +2,6 @@ ENV["RAILS_ENV"] ||= 'test'
2
2
  require File.expand_path("../../config/environment", __FILE__)
3
3
  require 'rspec/rails'
4
4
  require 'rspec/autorun'
5
- require 'capybara/rspec'
6
-
7
- Capybara.javascript_driver = :webkit
8
5
 
9
6
  Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
10
7
 
@@ -13,4 +10,7 @@ RSpec.configure do |config|
13
10
  config.use_transactional_fixtures = false
14
11
  config.infer_base_class_for_anonymous_controllers = false
15
12
  config.order = "random"
13
+ config.expect_with :rspec do |c|
14
+ c.syntax = :expect
15
+ end
16
16
  end
@@ -1,4 +1,5 @@
1
1
  load "config/environments/production.rb"
2
2
 
3
3
  <%=app_const%>.configure do
4
+ Mail.register_interceptor RecipientInterceptor.new(ENV['EMAIL_RECEIVERS'])
4
5
  end
@@ -11,4 +11,3 @@ coverage/*
11
11
  public/system
12
12
  rerun.txt
13
13
  tags
14
- vendor/bundler_gems
@@ -3,7 +3,6 @@
3
3
 
4
4
  <head>
5
5
  <meta charset="utf-8" />
6
- <meta name="robots" content="noopd" />
7
6
  <title></title>
8
7
  <%%= stylesheet_link_tag :application, :media => 'all' %>
9
8
  <%%= javascript_include_tag :application %>
@@ -13,7 +12,6 @@
13
12
  <body>
14
13
  <%%= render 'flashes' %>
15
14
  <%%= yield %>
16
- <%%= render 'javascript' %>
17
15
  </body>
18
16
 
19
17
  </html>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bretels
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - brightin
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-08 00:00:00.000000000 Z
12
+ date: 2013-12-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -78,20 +78,15 @@ files:
78
78
  - templates/Procfile
79
79
  - templates/README.md.erb
80
80
  - templates/_flashes.html.erb
81
- - templates/_javascript.html.erb
81
+ - templates/airbrake.rb
82
82
  - templates/config_locales_nl.yml
83
- - templates/database_cleaner_rspec.rb
84
- - templates/disable_xml_params.rb
85
83
  - templates/email_validator.rb
86
- - templates/errors.rb
87
- - templates/factories.rb
88
84
  - templates/factories_spec.rb
89
85
  - templates/factory_girl_syntax_rspec.rb
90
86
  - templates/postgresql_database.yml.erb
91
87
  - templates/rack_timeout.rb
92
88
  - templates/spec_helper.rb
93
89
  - templates/staging.rb.erb
94
- - templates/strong_parameters.rb
95
90
  - templates/suspenders_gitignore
96
91
  - templates/suspenders_layout.html.erb.erb
97
92
  - templates/unicorn.rb
@@ -1,7 +0,0 @@
1
- <%= yield :javascript %>
2
-
3
- <% if Rails.env.test? %>
4
- <%= javascript_tag do %>
5
- $.ajaxSetup({ async: false });
6
- <% end %>
7
- <% end %>
@@ -1,21 +0,0 @@
1
- RSpec.configure do |config|
2
- config.before(:suite) do
3
- DatabaseCleaner.clean_with(:deletion)
4
- end
5
-
6
- config.before(:each) do
7
- DatabaseCleaner.strategy = :transaction
8
- end
9
-
10
- config.before(:each, :js => true) do
11
- DatabaseCleaner.strategy = :deletion
12
- end
13
-
14
- config.before(:each) do
15
- DatabaseCleaner.start
16
- end
17
-
18
- config.after(:each) do
19
- DatabaseCleaner.clean
20
- end
21
- end
@@ -1,3 +0,0 @@
1
- # Protect against injection attacks
2
- # http://www.kb.cert.org/vuls/id/380039
3
- ActionDispatch::ParamsParser::DEFAULT_PARSERS.delete(Mime::XML)
@@ -1,28 +0,0 @@
1
- require 'net/http'
2
- require 'net/smtp'
3
-
4
- # Example:
5
- # begin
6
- # some http call
7
- # rescue *HTTP_ERRORS => error
8
- # notify_hoptoad error
9
- # end
10
-
11
- HTTP_ERRORS = [Timeout::Error,
12
- Errno::EINVAL,
13
- Errno::ECONNRESET,
14
- EOFError,
15
- Net::HTTPBadResponse,
16
- Net::HTTPHeaderSyntaxError,
17
- Net::ProtocolError]
18
-
19
- SMTP_SERVER_ERRORS = [TimeoutError,
20
- IOError,
21
- Net::SMTPUnknownError,
22
- Net::SMTPServerBusy,
23
- Net::SMTPAuthenticationError]
24
-
25
- SMTP_CLIENT_ERRORS = [Net::SMTPFatalError,
26
- Net::SMTPSyntaxError]
27
-
28
- SMTP_ERRORS = SMTP_SERVER_ERRORS + SMTP_CLIENT_ERRORS
@@ -1,9 +0,0 @@
1
- FactoryGirl.define do
2
- # factory :user do
3
- # sequence :email do |n|
4
- # "user#{n}@factory.com"
5
- # end
6
- # password "password123"
7
- # password_confirmation "password123"
8
- # end
9
- end
@@ -1 +0,0 @@
1
- ActiveRecord::Base.send :include, ActiveModel::ForbiddenAttributesProtection