bowties 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +4 -0
  3. data/.rspec +1 -0
  4. data/.ruby-gemset +1 -0
  5. data/.ruby-version +1 -0
  6. data/CONTRIBUTING.md +43 -0
  7. data/Gemfile +3 -0
  8. data/Gemfile.lock +129 -0
  9. data/LICENSE +21 -0
  10. data/NEWS.md +405 -0
  11. data/README.md +219 -0
  12. data/Rakefile +8 -0
  13. data/bin/bowties +18 -0
  14. data/bin/rake +16 -0
  15. data/bin/rspec +16 -0
  16. data/bin/setup +13 -0
  17. data/bowties.gemspec +34 -0
  18. data/circle.yml +6 -0
  19. data/lib/bowties.rb +4 -0
  20. data/lib/bowties/actions.rb +33 -0
  21. data/lib/bowties/app_builder.rb +499 -0
  22. data/lib/bowties/generators/app_generator.rb +238 -0
  23. data/lib/bowties/version.rb +5 -0
  24. data/spec/fakes/bin/heroku +5 -0
  25. data/spec/fakes/bin/hub +5 -0
  26. data/spec/features/github_spec.rb +15 -0
  27. data/spec/features/heroku_spec.rb +46 -0
  28. data/spec/features/new_project_spec.rb +135 -0
  29. data/spec/spec_helper.rb +20 -0
  30. data/spec/support/bowties.rb +48 -0
  31. data/spec/support/fake_github.rb +21 -0
  32. data/spec/support/fake_heroku.rb +43 -0
  33. data/templates/Gemfile.erb +58 -0
  34. data/templates/Procfile +2 -0
  35. data/templates/README.md.erb +32 -0
  36. data/templates/_analytics.html.erb +7 -0
  37. data/templates/_flashes.html.erb +7 -0
  38. data/templates/_javascript.html.erb +12 -0
  39. data/templates/action_mailer.rb +5 -0
  40. data/templates/application.scss +8 -0
  41. data/templates/bin_deploy +12 -0
  42. data/templates/bin_setup.erb +36 -0
  43. data/templates/browserslist +4 -0
  44. data/templates/bundler_audit.rake +12 -0
  45. data/templates/circle.yml.erb +8 -0
  46. data/templates/config_i18n_tasks.yml +13 -0
  47. data/templates/config_locales_en.yml.erb +19 -0
  48. data/templates/database_cleaner_rspec.rb +21 -0
  49. data/templates/development_seeds.rb +12 -0
  50. data/templates/disable_xml_params.rb +3 -0
  51. data/templates/errors.rb +34 -0
  52. data/templates/factory_girl_rspec.rb +3 -0
  53. data/templates/flashes_helper.rb +5 -0
  54. data/templates/hound.yml +17 -0
  55. data/templates/i18n.rb +3 -0
  56. data/templates/json_encoding.rb +1 -0
  57. data/templates/newrelic.yml.erb +34 -0
  58. data/templates/postgresql_database.yml.erb +12 -0
  59. data/templates/rails_helper.rb +23 -0
  60. data/templates/sample.env +6 -0
  61. data/templates/secrets.yml +14 -0
  62. data/templates/smtp.rb +9 -0
  63. data/templates/spec_helper.rb +23 -0
  64. data/templates/staging.rb +5 -0
  65. data/templates/suspenders_gitignore +14 -0
  66. data/templates/suspenders_layout.html.erb.erb +21 -0
  67. data/templates/unicorn.rb +30 -0
  68. metadata +181 -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,17 @@
1
+ # See https://houndci.com/configuration for help.
2
+ coffeescript:
3
+ # config_file: .coffeescript-style.json
4
+ enabled: true
5
+ haml:
6
+ # config_file: .haml-style.yml
7
+ enabled: true
8
+ javascript:
9
+ # config_file: .javascript-style.json
10
+ enabled: true
11
+ # ignore_file: .javascript_ignore
12
+ ruby:
13
+ # config_file: .ruby-style.yml
14
+ enabled: true
15
+ scss:
16
+ # config_file: .scss-style.yml
17
+ enabled: true
@@ -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,23 @@
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
+ module Features
11
+ # Extend this module in spec/support/features/*.rb
12
+ include Formulaic::Dsl
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!
23
+ Capybara.javascript_driver = :webkit
@@ -0,0 +1,6 @@
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
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,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,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 %></title>
13
+ <%%= stylesheet_link_tag :application, media: "all" %>
14
+ <%%= csrf_meta_tags %>
15
+ </head>
16
+ <body class="<%%= body_class %>">
17
+ <%%= render "flashes" -%>
18
+ <%%= yield %>
19
+ <%%= render "javascript" %>
20
+ </body>
21
+ </html>
@@ -0,0 +1,30 @@
1
+ # https://devcenter.heroku.com/articles/rails-unicorn
2
+
3
+ worker_processes (ENV["UNICORN_WORKERS"] || 3).to_i
4
+ timeout (ENV["UNICORN_TIMEOUT"] || 15).to_i
5
+ preload_app true
6
+
7
+ before_fork do |_server, _worker|
8
+ Signal.trap "TERM" do
9
+ puts "Unicorn master intercepting TERM, sending myself QUIT instead"
10
+ Process.kill "QUIT", Process.pid
11
+ end
12
+
13
+ if defined? ActiveRecord::Base
14
+ ActiveRecord::Base.connection.disconnect!
15
+ end
16
+ end
17
+
18
+ after_fork do |_server, _worker|
19
+ Signal.trap "TERM" do
20
+ puts "Unicorn worker intercepting TERM, waiting for master to send QUIT"
21
+ end
22
+
23
+ if defined? ActiveRecord::Base
24
+ config = ActiveRecord::Base.configurations[Rails.env] ||
25
+ Rails.application.config.database_configuration[Rails.env]
26
+ config["reaping_frequency"] = (ENV["DB_REAPING_FREQUENCY"] || 10).to_i
27
+ config["pool"] = (ENV["DB_POOL"] || 2).to_i
28
+ ActiveRecord::Base.establish_connection(config)
29
+ end
30
+ end
metadata ADDED
@@ -0,0 +1,181 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bowties
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Wizard Development
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-07-28 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: 1.0.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 1.0.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: '3.2'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.2'
69
+ description: |
70
+ Bowties is a base Rails project that you can upgrade. It is used by
71
+ Wizard Development to get a jump start on a working app.
72
+ email: admin@wizarddevelopment.com
73
+ executables:
74
+ - bowties
75
+ extensions: []
76
+ extra_rdoc_files:
77
+ - README.md
78
+ - LICENSE
79
+ files:
80
+ - ".gitignore"
81
+ - ".rspec"
82
+ - ".ruby-gemset"
83
+ - ".ruby-version"
84
+ - CONTRIBUTING.md
85
+ - Gemfile
86
+ - Gemfile.lock
87
+ - LICENSE
88
+ - NEWS.md
89
+ - README.md
90
+ - Rakefile
91
+ - bin/bowties
92
+ - bin/rake
93
+ - bin/rspec
94
+ - bin/setup
95
+ - bowties.gemspec
96
+ - circle.yml
97
+ - lib/bowties.rb
98
+ - lib/bowties/actions.rb
99
+ - lib/bowties/app_builder.rb
100
+ - lib/bowties/generators/app_generator.rb
101
+ - lib/bowties/version.rb
102
+ - spec/fakes/bin/heroku
103
+ - spec/fakes/bin/hub
104
+ - spec/features/github_spec.rb
105
+ - spec/features/heroku_spec.rb
106
+ - spec/features/new_project_spec.rb
107
+ - spec/spec_helper.rb
108
+ - spec/support/bowties.rb
109
+ - spec/support/fake_github.rb
110
+ - spec/support/fake_heroku.rb
111
+ - templates/Gemfile.erb
112
+ - templates/Procfile
113
+ - templates/README.md.erb
114
+ - templates/_analytics.html.erb
115
+ - templates/_flashes.html.erb
116
+ - templates/_javascript.html.erb
117
+ - templates/action_mailer.rb
118
+ - templates/application.scss
119
+ - templates/bin_deploy
120
+ - templates/bin_setup.erb
121
+ - templates/browserslist
122
+ - templates/bundler_audit.rake
123
+ - templates/circle.yml.erb
124
+ - templates/config_i18n_tasks.yml
125
+ - templates/config_locales_en.yml.erb
126
+ - templates/database_cleaner_rspec.rb
127
+ - templates/development_seeds.rb
128
+ - templates/disable_xml_params.rb
129
+ - templates/errors.rb
130
+ - templates/factory_girl_rspec.rb
131
+ - templates/flashes_helper.rb
132
+ - templates/hound.yml
133
+ - templates/i18n.rb
134
+ - templates/json_encoding.rb
135
+ - templates/newrelic.yml.erb
136
+ - templates/postgresql_database.yml.erb
137
+ - templates/rails_helper.rb
138
+ - templates/sample.env
139
+ - templates/secrets.yml
140
+ - templates/smtp.rb
141
+ - templates/spec_helper.rb
142
+ - templates/staging.rb
143
+ - templates/suspenders_gitignore
144
+ - templates/suspenders_layout.html.erb.erb
145
+ - templates/unicorn.rb
146
+ - tmp/.keep
147
+ homepage: http://github.com/wizarddevelopment/bowties
148
+ licenses:
149
+ - MIT
150
+ metadata: {}
151
+ post_install_message:
152
+ rdoc_options:
153
+ - "--charset=UTF-8"
154
+ require_paths:
155
+ - lib
156
+ required_ruby_version: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - ">="
159
+ - !ruby/object:Gem::Version
160
+ version: 2.2.2
161
+ required_rubygems_version: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - ">="
164
+ - !ruby/object:Gem::Version
165
+ version: '0'
166
+ requirements: []
167
+ rubyforge_project:
168
+ rubygems_version: 2.4.6
169
+ signing_key:
170
+ specification_version: 4
171
+ summary: Generate a Rails app using Wizard Development's best practices.
172
+ test_files:
173
+ - spec/fakes/bin/heroku
174
+ - spec/fakes/bin/hub
175
+ - spec/features/github_spec.rb
176
+ - spec/features/heroku_spec.rb
177
+ - spec/features/new_project_spec.rb
178
+ - spec/spec_helper.rb
179
+ - spec/support/bowties.rb
180
+ - spec/support/fake_github.rb
181
+ - spec/support/fake_heroku.rb