brace 0.0.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.
Files changed (65) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +4 -0
  3. data/.ruby-version +1 -0
  4. data/CONTRIBUTING.md +43 -0
  5. data/Gemfile +3 -0
  6. data/Gemfile.lock +139 -0
  7. data/LICENSE +21 -0
  8. data/NEWS.md +351 -0
  9. data/README.md +166 -0
  10. data/Rakefile +8 -0
  11. data/bin/brace +18 -0
  12. data/bin/rake +16 -0
  13. data/bin/rspec +16 -0
  14. data/bin/setup +13 -0
  15. data/brace.gemspec +35 -0
  16. data/lib/brace.rb +4 -0
  17. data/lib/brace/actions.rb +25 -0
  18. data/lib/brace/app_builder.rb +469 -0
  19. data/lib/brace/generators/app_generator.rb +248 -0
  20. data/lib/brace/version.rb +6 -0
  21. data/spec/fakes/bin/heroku +5 -0
  22. data/spec/fakes/bin/hub +5 -0
  23. data/spec/features/github_spec.rb +10 -0
  24. data/spec/features/heroku_spec.rb +40 -0
  25. data/spec/features/new_project_spec.rb +115 -0
  26. data/spec/spec_helper.rb +24 -0
  27. data/spec/support/braces.rb +49 -0
  28. data/spec/support/fake_github.rb +21 -0
  29. data/spec/support/fake_heroku.rb +43 -0
  30. data/templates/Gemfile.erb +88 -0
  31. data/templates/Procfile +2 -0
  32. data/templates/README.md.erb +32 -0
  33. data/templates/_analytics.html.erb +7 -0
  34. data/templates/_javascript.html.erb +12 -0
  35. data/templates/action_mailer.rb +5 -0
  36. data/templates/application.css.scss +8 -0
  37. data/templates/bin_deploy +12 -0
  38. data/templates/bin_setup.erb +36 -0
  39. data/templates/brace_gitignore +14 -0
  40. data/templates/brace_layout.html.slim.erb +15 -0
  41. data/templates/bundler_audit.rake +12 -0
  42. data/templates/config_i18n_tasks.yml +13 -0
  43. data/templates/config_locales_en.yml.erb +19 -0
  44. data/templates/database_cleaner_rspec.rb +21 -0
  45. data/templates/development_seeds.rb +12 -0
  46. data/templates/devise_rspec.rb +3 -0
  47. data/templates/disable_xml_params.rb +3 -0
  48. data/templates/errors.rb +34 -0
  49. data/templates/factory_girl_rspec.rb +3 -0
  50. data/templates/i18n.rb +3 -0
  51. data/templates/json_encoding.rb +1 -0
  52. data/templates/newrelic.yml.erb +34 -0
  53. data/templates/postgresql_database.yml.erb +12 -0
  54. data/templates/rack_timeout.rb +1 -0
  55. data/templates/rails_helper.rb +22 -0
  56. data/templates/redis.rb +10 -0
  57. data/templates/sample.env +5 -0
  58. data/templates/secrets.yml +14 -0
  59. data/templates/sidekiq.rb +7 -0
  60. data/templates/sidekiq_rspec.rb +7 -0
  61. data/templates/smtp.rb +9 -0
  62. data/templates/spec_helper.rb +16 -0
  63. data/templates/stripe.rb +1 -0
  64. data/templates/vcr_helper.rb +12 -0
  65. metadata +197 -0
@@ -0,0 +1,3 @@
1
+ RSpec.configure do |config|
2
+ config.include Devise::TestHelpers, type: :controller
3
+ end
@@ -0,0 +1,3 @@
1
+ # Protect against injection attacks
2
+ # http://www.kb.cert.org/vuls/id/380039
3
+ ActionDispatch::ParamsParser::DEFAULT_PARSERS.delete(Mime::XML)
@@ -0,0 +1,34 @@
1
+ require "net/http"
2
+ require "net/smtp"
3
+
4
+ # Example:
5
+ # begin
6
+ # some http call
7
+ # rescue *HTTP_ERRORS => error
8
+ # notify_airbrake error
9
+ # end
10
+
11
+ HTTP_ERRORS = [
12
+ EOFError,
13
+ Errno::ECONNRESET,
14
+ Errno::EINVAL,
15
+ Net::HTTPBadResponse,
16
+ Net::HTTPHeaderSyntaxError,
17
+ Net::ProtocolError,
18
+ Timeout::Error
19
+ ]
20
+
21
+ SMTP_SERVER_ERRORS = [
22
+ IOError,
23
+ Net::SMTPAuthenticationError,
24
+ Net::SMTPServerBusy,
25
+ Net::SMTPUnknownError,
26
+ TimeoutError
27
+ ]
28
+
29
+ SMTP_CLIENT_ERRORS = [
30
+ Net::SMTPFatalError,
31
+ Net::SMTPSyntaxError
32
+ ]
33
+
34
+ SMTP_ERRORS = SMTP_SERVER_ERRORS + SMTP_CLIENT_ERRORS
@@ -0,0 +1,3 @@
1
+ RSpec.configure do |config|
2
+ config.include FactoryGirl::Syntax::Methods
3
+ end
@@ -0,0 +1,3 @@
1
+ RSpec.configure do |config|
2
+ config.include AbstractController::Translation
3
+ end
@@ -0,0 +1 @@
1
+ ActiveSupport::JSON::Encoding.time_precision = 0
@@ -0,0 +1,34 @@
1
+ common: &default_settings
2
+ app_name: "<%= app_name %>"
3
+ audit_log:
4
+ enabled: false
5
+ browser_monitoring:
6
+ auto_instrument: true
7
+ capture_params: false
8
+ developer_mode: false
9
+ error_collector:
10
+ capture_source: true
11
+ enabled: true
12
+ ignore_errors: "ActionController::RoutingError,Sinatra::NotFound"
13
+ license_key: "<%%= ENV["NEW_RELIC_LICENSE_KEY"] %>"
14
+ log_level: info
15
+ monitor_mode: true
16
+ transaction_tracer:
17
+ enabled: true
18
+ record_sql: obfuscated
19
+ stack_trace_threshold: 0.500
20
+ transaction_threshold: apdex_f
21
+ development:
22
+ <<: *default_settings
23
+ monitor_mode: false
24
+ developer_mode: true
25
+ test:
26
+ <<: *default_settings
27
+ monitor_mode: false
28
+ production:
29
+ <<: *default_settings
30
+ monitor_mode: true
31
+ staging:
32
+ <<: *default_settings
33
+ app_name: "<%= app_name %> (Staging)"
34
+ monitor_mode: true
@@ -0,0 +1,12 @@
1
+ development: &default
2
+ adapter: postgresql
3
+ database: <%= app_name %>_development
4
+ encoding: utf8
5
+ host: localhost
6
+ min_messages: warning
7
+ pool: 2
8
+ timeout: 5000
9
+
10
+ test:
11
+ <<: *default
12
+ database: <%= app_name %>_test
@@ -0,0 +1 @@
1
+ Rack::Timeout.timeout = (ENV["RACK_TIMEOUT"] || 10).to_i
@@ -0,0 +1,22 @@
1
+ ENV["RAILS_ENV"] = "test"
2
+
3
+ require File.expand_path("../../config/environment", __FILE__)
4
+
5
+ require "rspec/rails"
6
+ require "shoulda/matchers"
7
+ require "sidekiq/testing"
8
+
9
+ Dir[Rails.root.join("spec/support/**/*.rb")].each { |file| require file }
10
+
11
+ module Features
12
+ # Extend this module in spec/support/features/*.rb
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!
@@ -0,0 +1,10 @@
1
+ if Rails.env.test?
2
+ $redis = MockRedis.new
3
+ else
4
+ if ENV["REDIS_URL"]
5
+ uri = URI.parse(ENV["REDIS_URL"])
6
+ $redis = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password)
7
+ else
8
+ $redis = Redis.new
9
+ end
10
+ end
@@ -0,0 +1,5 @@
1
+ # http://ddollar.github.com/foreman/
2
+ ASSET_HOST=localhost:3000
3
+ HOST=localhost:3000
4
+ RACK_ENV=development
5
+ SECRET_KEY_BASE=development_secret
@@ -0,0 +1,14 @@
1
+ default: &default
2
+ secret_key_base: <%%= ENV["SECRET_KEY_BASE"] %>
3
+
4
+ development:
5
+ <<: *default
6
+
7
+ test:
8
+ <<: *default
9
+
10
+ staging:
11
+ <<: *default
12
+
13
+ production:
14
+ <<: *default
@@ -0,0 +1,7 @@
1
+ if Rails.env.test?
2
+ sidekiq_redis = ConnectionPool.new { MockRedis.new }
3
+ else
4
+ sidekiq_redis = { :namespace => '#{app_name}' }
5
+ end
6
+ Sidekiq.configure_client { |config| config.redis = sidekiq_redis }
7
+ Sidekiq.configure_server { |config| config.redis = sidekiq_redis }
@@ -0,0 +1,7 @@
1
+ RSpec.configure do |config|
2
+ config.around(:each, type: :feature) do |example|
3
+ Sidekiq::Testing.inline! do
4
+ example.run
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ SMTP_SETTINGS = {
2
+ address: ENV.fetch("SMTP_ADDRESS"), # example: "smtp.sendgrid.net"
3
+ authentication: :plain,
4
+ domain: ENV.fetch("SMTP_DOMAIN"), # example: "heroku.com"
5
+ enable_starttls_auto: true,
6
+ password: ENV.fetch("SMTP_PASSWORD"),
7
+ port: "587",
8
+ user_name: ENV.fetch("SMTP_USERNAME")
9
+ }
@@ -0,0 +1,16 @@
1
+ require "webmock/rspec"
2
+
3
+ # http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
4
+ RSpec.configure do |config|
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
11
+ end
12
+
13
+ config.order = :random
14
+ end
15
+
16
+ WebMock.disable_net_connect!(allow_localhost: true)
@@ -0,0 +1 @@
1
+ Stripe.api_key = ENV['STRIPE_SECRET']
@@ -0,0 +1,12 @@
1
+ require "vcr"
2
+
3
+ VCR.configure do |c|
4
+ c.cassette_library_dir = "spec/cassettes"
5
+ c.hook_into :webmock
6
+ c.default_cassette_options = { :record => :once }
7
+ c.configure_rspec_metadata!
8
+
9
+ c.before_playback do |interaction|
10
+ interaction.response.body.force_encoding("utf-8")
11
+ end
12
+ end
metadata ADDED
@@ -0,0 +1,197 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: brace
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Harry Whelchel
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-02-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bitters
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.10.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.10.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.3'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rails
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '='
46
+ - !ruby/object:Gem::Version
47
+ version: 4.2.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '='
53
+ - !ruby/object:Gem::Version
54
+ version: 4.2.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: capybara
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '2.2'
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: 2.2.0
79
+ type: :development
80
+ prerelease: false
81
+ version_requirements: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - "~>"
84
+ - !ruby/object:Gem::Version
85
+ version: '2.2'
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: 2.2.0
89
+ description: |
90
+ Brace is a base Rails API project that you can upgrade. It is used by
91
+ me to get a jump start on a working app. Thanks thoughtbot for making Suspenders (https://github.com/thoughtbot/suspenders)!
92
+ email: harrywhelchel@gmail.com
93
+ executables:
94
+ - brace
95
+ extensions: []
96
+ extra_rdoc_files:
97
+ - README.md
98
+ - LICENSE
99
+ files:
100
+ - ".gitignore"
101
+ - ".ruby-version"
102
+ - CONTRIBUTING.md
103
+ - Gemfile
104
+ - Gemfile.lock
105
+ - LICENSE
106
+ - NEWS.md
107
+ - README.md
108
+ - Rakefile
109
+ - bin/brace
110
+ - bin/rake
111
+ - bin/rspec
112
+ - bin/setup
113
+ - brace.gemspec
114
+ - lib/brace.rb
115
+ - lib/brace/actions.rb
116
+ - lib/brace/app_builder.rb
117
+ - lib/brace/generators/app_generator.rb
118
+ - lib/brace/version.rb
119
+ - spec/fakes/bin/heroku
120
+ - spec/fakes/bin/hub
121
+ - spec/features/github_spec.rb
122
+ - spec/features/heroku_spec.rb
123
+ - spec/features/new_project_spec.rb
124
+ - spec/spec_helper.rb
125
+ - spec/support/braces.rb
126
+ - spec/support/fake_github.rb
127
+ - spec/support/fake_heroku.rb
128
+ - templates/Gemfile.erb
129
+ - templates/Procfile
130
+ - templates/README.md.erb
131
+ - templates/_analytics.html.erb
132
+ - templates/_javascript.html.erb
133
+ - templates/action_mailer.rb
134
+ - templates/application.css.scss
135
+ - templates/bin_deploy
136
+ - templates/bin_setup.erb
137
+ - templates/brace_gitignore
138
+ - templates/brace_layout.html.slim.erb
139
+ - templates/bundler_audit.rake
140
+ - templates/config_i18n_tasks.yml
141
+ - templates/config_locales_en.yml.erb
142
+ - templates/database_cleaner_rspec.rb
143
+ - templates/development_seeds.rb
144
+ - templates/devise_rspec.rb
145
+ - templates/disable_xml_params.rb
146
+ - templates/errors.rb
147
+ - templates/factory_girl_rspec.rb
148
+ - templates/i18n.rb
149
+ - templates/json_encoding.rb
150
+ - templates/newrelic.yml.erb
151
+ - templates/postgresql_database.yml.erb
152
+ - templates/rack_timeout.rb
153
+ - templates/rails_helper.rb
154
+ - templates/redis.rb
155
+ - templates/sample.env
156
+ - templates/secrets.yml
157
+ - templates/sidekiq.rb
158
+ - templates/sidekiq_rspec.rb
159
+ - templates/smtp.rb
160
+ - templates/spec_helper.rb
161
+ - templates/stripe.rb
162
+ - templates/vcr_helper.rb
163
+ homepage: https://github.com/hwhelchel/brace
164
+ licenses:
165
+ - MIT
166
+ metadata: {}
167
+ post_install_message:
168
+ rdoc_options:
169
+ - "--charset=UTF-8"
170
+ require_paths:
171
+ - lib
172
+ required_ruby_version: !ruby/object:Gem::Requirement
173
+ requirements:
174
+ - - ">="
175
+ - !ruby/object:Gem::Version
176
+ version: 2.2.0
177
+ required_rubygems_version: !ruby/object:Gem::Requirement
178
+ requirements:
179
+ - - ">="
180
+ - !ruby/object:Gem::Version
181
+ version: '0'
182
+ requirements: []
183
+ rubyforge_project:
184
+ rubygems_version: 2.4.5
185
+ signing_key:
186
+ specification_version: 4
187
+ summary: Rails API template adapted from thoughtbot's Suspenders.
188
+ test_files:
189
+ - spec/fakes/bin/heroku
190
+ - spec/fakes/bin/hub
191
+ - spec/features/github_spec.rb
192
+ - spec/features/heroku_spec.rb
193
+ - spec/features/new_project_spec.rb
194
+ - spec/spec_helper.rb
195
+ - spec/support/braces.rb
196
+ - spec/support/fake_github.rb
197
+ - spec/support/fake_heroku.rb