underwear 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +4 -0
  3. data/.ruby-version +1 -0
  4. data/.travis.yml +11 -0
  5. data/CONTRIBUTING.md +38 -0
  6. data/Gemfile +3 -0
  7. data/Gemfile.lock +123 -0
  8. data/LICENSE +21 -0
  9. data/NEWS.md +0 -0
  10. data/README.md +194 -0
  11. data/Rakefile +8 -0
  12. data/bin/rake +16 -0
  13. data/bin/rspec +16 -0
  14. data/bin/setup +13 -0
  15. data/bin/underwear +13 -0
  16. data/lib/underwear.rb +4 -0
  17. data/lib/underwear/actions.rb +33 -0
  18. data/lib/underwear/app_builder.rb +511 -0
  19. data/lib/underwear/generators/app_generator.rb +239 -0
  20. data/lib/underwear/version.rb +5 -0
  21. data/spec/fakes/bin/heroku +5 -0
  22. data/spec/fakes/bin/hub +5 -0
  23. data/spec/features/github_spec.rb +15 -0
  24. data/spec/features/heroku_spec.rb +46 -0
  25. data/spec/features/new_project_spec.rb +113 -0
  26. data/spec/spec_helper.rb +20 -0
  27. data/spec/support/fake_github.rb +21 -0
  28. data/spec/support/fake_heroku.rb +43 -0
  29. data/spec/support/underwear.rb +49 -0
  30. data/templates/Gemfile.erb +65 -0
  31. data/templates/Procfile +3 -0
  32. data/templates/README.md.erb +32 -0
  33. data/templates/_analytics.html.erb +7 -0
  34. data/templates/_flashes.html.erb +7 -0
  35. data/templates/_javascript.html.erb +12 -0
  36. data/templates/action_mailer.rb +5 -0
  37. data/templates/application.scss +1 -0
  38. data/templates/bin_deploy +12 -0
  39. data/templates/bin_setup.erb +36 -0
  40. data/templates/browserslist +4 -0
  41. data/templates/bundler_audit.rake +12 -0
  42. data/templates/circle.yml.erb +8 -0
  43. data/templates/config_i18n_tasks.yml +11 -0
  44. data/templates/config_locales_en.yml.erb +16 -0
  45. data/templates/database_cleaner_rspec.rb +21 -0
  46. data/templates/dev.rake +12 -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/flashes_helper.rb +5 -0
  51. data/templates/i18n.rb +3 -0
  52. data/templates/json_encoding.rb +1 -0
  53. data/templates/newrelic.yml.erb +34 -0
  54. data/templates/postgresql_database.yml.erb +22 -0
  55. data/templates/puma.rb +19 -0
  56. data/templates/rails_helper.rb +17 -0
  57. data/templates/sample.env +6 -0
  58. data/templates/secrets.yml +14 -0
  59. data/templates/sidekiq.rb +1 -0
  60. data/templates/smtp.rb +9 -0
  61. data/templates/spec_helper.rb +23 -0
  62. data/templates/staging.rb +5 -0
  63. data/templates/test.rb +48 -0
  64. data/templates/underwear_gitignore +14 -0
  65. data/templates/underwear_layout.html.erb.erb +21 -0
  66. data/underwear.gemspec +33 -0
  67. metadata +166 -0
@@ -0,0 +1,3 @@
1
+ RSpec.configure do |config|
2
+ config.include FactoryGirl::Syntax::Methods
3
+ end
@@ -0,0 +1,5 @@
1
+ module FlashesHelper
2
+ def user_facing_flashes
3
+ flash.to_hash.slice("alert", "error", "notice", "success")
4
+ end
5
+ 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,22 @@
1
+ development: &default
2
+ adapter: postgresql
3
+ database: <%= app_name %>_development
4
+ encoding: utf8
5
+ host: localhost
6
+ min_messages: warning
7
+ pool: <%%= ENV.fetch("DB_POOL", 5) %>
8
+ reaping_frequency: <%%= ENV.fetch("DB_REAPING_FREQUENCY", 10) %>
9
+ timeout: 5000
10
+
11
+ test:
12
+ <<: *default
13
+ database: <%= app_name %>_test
14
+
15
+ production: &deploy
16
+ encoding: utf8
17
+ min_messages: warning
18
+ pool: <%%= [ENV.fetch("MAX_THREADS", 5), ENV.fetch("DB_POOL", 5)].max %>
19
+ timeout: 5000
20
+ url: <%%= ENV.fetch("DATABASE_URL", "") %>
21
+
22
+ staging: *deploy
@@ -0,0 +1,19 @@
1
+ # https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server
2
+
3
+ # The environment variable WEB_CONCURRENCY may be set to a default value based
4
+ # on dyno size. To manually configure this value use heroku config:set
5
+ # WEB_CONCURRENCY.
6
+ workers Integer(ENV.fetch("WEB_CONCURRENCY", 3))
7
+ threads_count = Integer(ENV.fetch("MAX_THREADS", 5))
8
+ threads(threads_count, threads_count)
9
+
10
+ preload_app!
11
+
12
+ rackup DefaultRackup
13
+ environment ENV.fetch("RACK_ENV", "development")
14
+
15
+ on_worker_boot do
16
+ # Worker specific setup for Rails 4.1+
17
+ # See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot
18
+ ActiveRecord::Base.establish_connection
19
+ end
@@ -0,0 +1,17 @@
1
+ ENV["RAILS_ENV"] = "test"
2
+
3
+ require File.expand_path("../../config/environment", __FILE__)
4
+
5
+ require "rspec/rails"
6
+ require "shoulda/matchers"
7
+
8
+ Dir[Rails.root.join("spec/support/**/*.rb")].sort.each { |file| require file }
9
+
10
+ RSpec.configure do |config|
11
+ config.infer_base_class_for_anonymous_controllers = false
12
+ config.infer_spec_type_from_file_location!
13
+ config.use_transactional_fixtures = false
14
+ end
15
+
16
+ ActiveRecord::Migration.maintain_test_schema!
17
+ Capybara.javascript_driver = :webkit
@@ -0,0 +1,6 @@
1
+ # http://ddollar.github.com/foreman/
2
+ ASSET_HOST=localhost:5000
3
+ HOST=localhost:5000
4
+ RACK_ENV=development
5
+ SECRET_KEY_BASE=development_secret
6
+ EXECJS_RUNTIME=Node
@@ -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 @@
1
+ Sidekiq.default_worker_options = { 'backtrace' => true, 'retry' => false }
@@ -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,23 @@
1
+ if ENV.fetch("COVERAGE", false)
2
+ require "simplecov"
3
+ SimpleCov.start "rails"
4
+ end
5
+
6
+ require "webmock/rspec"
7
+
8
+ # http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
9
+ RSpec.configure do |config|
10
+ config.expect_with :rspec do |expectations|
11
+ expectations.syntax = :expect
12
+ end
13
+
14
+ config.mock_with :rspec do |mocks|
15
+ mocks.syntax = :expect
16
+ mocks.verify_partial_doubles = true
17
+ end
18
+
19
+ config.example_status_persistence_file_path = "tmp/rspec_examples.txt"
20
+ config.order = :random
21
+ end
22
+
23
+ WebMock.disable_net_connect!(allow_localhost: true)
@@ -0,0 +1,5 @@
1
+ require_relative "production"
2
+
3
+ Mail.register_interceptor(
4
+ RecipientInterceptor.new(ENV.fetch("EMAIL_RECIPIENTS"))
5
+ )
@@ -0,0 +1,48 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Do not eager load code on boot. This avoids loading your whole application
11
+ # just for the purpose of running a single test. If you are using a tool that
12
+ # preloads Rails for running tests, you may have to set it to true.
13
+ config.eager_load = false
14
+
15
+ # Configure static file server for tests with Cache-Control for performance.
16
+ config.serve_static_files = true
17
+ config.static_cache_control = 'public, max-age=3600'
18
+
19
+ # Show full error reports and disable caching.
20
+ config.consider_all_requests_local = true
21
+ config.action_controller.perform_caching = false
22
+
23
+ # Raise exceptions instead of rendering exception templates.
24
+ config.action_dispatch.show_exceptions = false
25
+
26
+ # Disable request forgery protection in test environment.
27
+ config.action_controller.allow_forgery_protection = false
28
+
29
+ # Tell Action Mailer not to deliver emails to the real world.
30
+ # The :test delivery method accumulates sent emails in the
31
+ # ActionMailer::Base.deliveries array.
32
+ config.action_mailer.delivery_method = :test
33
+
34
+ # Randomize the order test cases are executed.
35
+ config.active_support.test_order = :random
36
+
37
+ # Print deprecation notices to the stderr.
38
+ config.active_support.deprecation = :stderr
39
+
40
+ # Raises error for missing translations
41
+ # config.action_view.raise_on_missing_translations = true
42
+
43
+ config.after_initialize do
44
+ Bullet.enable = true
45
+ Bullet.bullet_logger = true
46
+ Bullet.raise = true # raise an error if n+1 query occurs
47
+ end
48
+ end
@@ -0,0 +1,14 @@
1
+ !.keep
2
+ *.DS_Store
3
+ *.swo
4
+ *.swp
5
+ /.bundle
6
+ /.env
7
+ /.foreman
8
+ /coverage/*
9
+ /db/*.sqlite3
10
+ /log/*
11
+ /public/system
12
+ /public/assets
13
+ /tags
14
+ /tmp/*
@@ -0,0 +1,21 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="ROBOTS" content="NOODP" />
6
+ <meta name="viewport" content="initial-scale=1" />
7
+ <%%#
8
+ Configure default and controller-, and view-specific titles in
9
+ config/locales/en.yml. For more see:
10
+ https://github.com/calebthompson/title#usage
11
+ %>
12
+ <title><%%= %></title>
13
+ <%%= stylesheet_link_tag :application, media: "all" %>
14
+ <%%= csrf_meta_tags %>
15
+ </head>
16
+ <body>
17
+ <%%= render "flashes" -%>
18
+ <%%= yield %>
19
+ <%%= render "javascript" %>
20
+ </body>
21
+ </html>
@@ -0,0 +1,33 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path('../lib', __FILE__)
3
+ require 'underwear/version'
4
+ require 'date'
5
+
6
+ Gem::Specification.new do |s|
7
+ s.required_ruby_version = ">= #{Underwear::RUBY_VERSION}"
8
+ s.authors = ['thoughtbot', 'proletarian']
9
+ s.date = Date.today.strftime('%Y-%m-%d')
10
+
11
+ s.description = <<-HERE
12
+ Underwear is based on Underwear by Thoughtbot, a base Rails project that you can upgrade. Underwear is used by
13
+ thoughtbot to get a jump start on a working app.
14
+ HERE
15
+
16
+ s.email = 'adeel.rb@gmail.com'
17
+ s.executables = ['underwear']
18
+ s.extra_rdoc_files = %w[README.md LICENSE]
19
+ s.files = `git ls-files`.split("\n")
20
+ s.homepage = 'http://github.com/proletarian/underwear'
21
+ s.license = 'MIT'
22
+ s.name = 'underwear'
23
+ s.rdoc_options = ['--charset=UTF-8']
24
+ s.require_paths = ['lib']
25
+ s.summary = "Generate a Rails app using thoughtbot's best practices and Adeel's preferences."
26
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
27
+ s.version = Underwear::VERSION
28
+
29
+ s.add_dependency 'bundler', '~> 1.3'
30
+ s.add_dependency 'rails', Underwear::RAILS_VERSION
31
+
32
+ s.add_development_dependency 'rspec', '~> 3.2'
33
+ end
metadata ADDED
@@ -0,0 +1,166 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: underwear
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - thoughtbot
8
+ - proletarian
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2015-10-05 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: bundler
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '1.3'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: '1.3'
28
+ - !ruby/object:Gem::Dependency
29
+ name: rails
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: 4.2.4
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: 4.2.4
42
+ - !ruby/object:Gem::Dependency
43
+ name: rspec
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '3.2'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '3.2'
56
+ description: |
57
+ Underwear is based on Underwear by Thoughtbot, a base Rails project that you can upgrade. Underwear is used by
58
+ thoughtbot to get a jump start on a working app.
59
+ email: adeel.rb@gmail.com
60
+ executables:
61
+ - underwear
62
+ extensions: []
63
+ extra_rdoc_files:
64
+ - README.md
65
+ - LICENSE
66
+ files:
67
+ - ".gitignore"
68
+ - ".ruby-version"
69
+ - ".travis.yml"
70
+ - CONTRIBUTING.md
71
+ - Gemfile
72
+ - Gemfile.lock
73
+ - LICENSE
74
+ - NEWS.md
75
+ - README.md
76
+ - Rakefile
77
+ - bin/rake
78
+ - bin/rspec
79
+ - bin/setup
80
+ - bin/underwear
81
+ - lib/underwear.rb
82
+ - lib/underwear/actions.rb
83
+ - lib/underwear/app_builder.rb
84
+ - lib/underwear/generators/app_generator.rb
85
+ - lib/underwear/version.rb
86
+ - spec/fakes/bin/heroku
87
+ - spec/fakes/bin/hub
88
+ - spec/features/github_spec.rb
89
+ - spec/features/heroku_spec.rb
90
+ - spec/features/new_project_spec.rb
91
+ - spec/spec_helper.rb
92
+ - spec/support/fake_github.rb
93
+ - spec/support/fake_heroku.rb
94
+ - spec/support/underwear.rb
95
+ - templates/Gemfile.erb
96
+ - templates/Procfile
97
+ - templates/README.md.erb
98
+ - templates/_analytics.html.erb
99
+ - templates/_flashes.html.erb
100
+ - templates/_javascript.html.erb
101
+ - templates/action_mailer.rb
102
+ - templates/application.scss
103
+ - templates/bin_deploy
104
+ - templates/bin_setup.erb
105
+ - templates/browserslist
106
+ - templates/bundler_audit.rake
107
+ - templates/circle.yml.erb
108
+ - templates/config_i18n_tasks.yml
109
+ - templates/config_locales_en.yml.erb
110
+ - templates/database_cleaner_rspec.rb
111
+ - templates/dev.rake
112
+ - templates/disable_xml_params.rb
113
+ - templates/errors.rb
114
+ - templates/factory_girl_rspec.rb
115
+ - templates/flashes_helper.rb
116
+ - templates/i18n.rb
117
+ - templates/json_encoding.rb
118
+ - templates/newrelic.yml.erb
119
+ - templates/postgresql_database.yml.erb
120
+ - templates/puma.rb
121
+ - templates/rails_helper.rb
122
+ - templates/sample.env
123
+ - templates/secrets.yml
124
+ - templates/sidekiq.rb
125
+ - templates/smtp.rb
126
+ - templates/spec_helper.rb
127
+ - templates/staging.rb
128
+ - templates/test.rb
129
+ - templates/underwear_gitignore
130
+ - templates/underwear_layout.html.erb.erb
131
+ - underwear.gemspec
132
+ homepage: http://github.com/proletarian/underwear
133
+ licenses:
134
+ - MIT
135
+ metadata: {}
136
+ post_install_message:
137
+ rdoc_options:
138
+ - "--charset=UTF-8"
139
+ require_paths:
140
+ - lib
141
+ required_ruby_version: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: 2.2.3
146
+ required_rubygems_version: !ruby/object:Gem::Requirement
147
+ requirements:
148
+ - - ">="
149
+ - !ruby/object:Gem::Version
150
+ version: '0'
151
+ requirements: []
152
+ rubyforge_project:
153
+ rubygems_version: 2.4.5.1
154
+ signing_key:
155
+ specification_version: 4
156
+ summary: Generate a Rails app using thoughtbot's best practices and Adeel's preferences.
157
+ test_files:
158
+ - spec/fakes/bin/heroku
159
+ - spec/fakes/bin/hub
160
+ - spec/features/github_spec.rb
161
+ - spec/features/heroku_spec.rb
162
+ - spec/features/new_project_spec.rb
163
+ - spec/spec_helper.rb
164
+ - spec/support/fake_github.rb
165
+ - spec/support/fake_heroku.rb
166
+ - spec/support/underwear.rb