slining 1.0.0

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 (66) 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 +48 -0
  6. data/Gemfile +3 -0
  7. data/Gemfile.lock +120 -0
  8. data/LICENSE +40 -0
  9. data/NEWS.md +2 -0
  10. data/README.md +207 -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/slining +18 -0
  16. data/lib/slining.rb +4 -0
  17. data/lib/slining/actions.rb +33 -0
  18. data/lib/slining/app_builder.rb +499 -0
  19. data/lib/slining/generators/app_generator.rb +238 -0
  20. data/lib/slining/version.rb +5 -0
  21. data/slining.gemspec +34 -0
  22. data/spec/fakes/bin/heroku +5 -0
  23. data/spec/fakes/bin/hub +5 -0
  24. data/spec/features/github_spec.rb +15 -0
  25. data/spec/features/heroku_spec.rb +46 -0
  26. data/spec/features/new_project_spec.rb +135 -0
  27. data/spec/spec_helper.rb +20 -0
  28. data/spec/support/fake_github.rb +21 -0
  29. data/spec/support/fake_heroku.rb +43 -0
  30. data/spec/support/slining.rb +49 -0
  31. data/templates/Gemfile.erb +58 -0
  32. data/templates/Procfile +2 -0
  33. data/templates/README.md.erb +32 -0
  34. data/templates/_analytics.html.erb +7 -0
  35. data/templates/_flashes.html.erb +7 -0
  36. data/templates/_javascript.html.erb +12 -0
  37. data/templates/action_mailer.rb +5 -0
  38. data/templates/application.scss +8 -0
  39. data/templates/bin_deploy +12 -0
  40. data/templates/bin_setup.erb +36 -0
  41. data/templates/browserslist +4 -0
  42. data/templates/bundler_audit.rake +12 -0
  43. data/templates/config_i18n_tasks.yml +13 -0
  44. data/templates/config_locales_en.yml.erb +19 -0
  45. data/templates/database_cleaner_rspec.rb +21 -0
  46. data/templates/development_seeds.rb +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/hound.yml +17 -0
  52. data/templates/i18n.rb +3 -0
  53. data/templates/json_encoding.rb +1 -0
  54. data/templates/newrelic.yml.erb +34 -0
  55. data/templates/postgresql_database.yml.erb +12 -0
  56. data/templates/rails_helper.rb +23 -0
  57. data/templates/sample.env +6 -0
  58. data/templates/secrets.yml +14 -0
  59. data/templates/slining_gitignore +14 -0
  60. data/templates/slining_layout.html.erb.erb +21 -0
  61. data/templates/smtp.rb +9 -0
  62. data/templates/spec_helper.rb +22 -0
  63. data/templates/staging.rb +5 -0
  64. data/templates/travis.yml.erb +21 -0
  65. data/templates/unicorn.rb +30 -0
  66. metadata +156 -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,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,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,22 @@
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.order = :random
20
+ end
21
+
22
+ 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,21 @@
1
+ before_install:
2
+ - "echo '--colour' > ~/.rspec"
3
+ - "echo 'gem: --no-document' > ~/.gemrc"
4
+ - export DISPLAY=:99.0
5
+ - sh -e /etc/init.d/xvfb start
6
+ install:
7
+ - bin/setup
8
+ branches:
9
+ only:
10
+ - master
11
+ cache:
12
+ - bundler
13
+ language:
14
+ - ruby
15
+ notifications:
16
+ email: false
17
+ rvm:
18
+ - <%= Slining::RUBY_VERSION %>
19
+ addons:
20
+ postgresql: "9.3"
21
+ sudo: false
@@ -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,156 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: slining
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - vaporware
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-06-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rails
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: 4.2.1
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: 4.2.1
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.2'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.2'
55
+ description: |
56
+ Slining is a base Rails project that you can upgrade. It is used by
57
+ vaporware to get a jump start on a working app. Use Slining if you're in a
58
+ rush to build something amazing; don't use it if you like missing deadlines.
59
+ email: support@vaporwa.re
60
+ executables:
61
+ - slining
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/slining
81
+ - lib/slining.rb
82
+ - lib/slining/actions.rb
83
+ - lib/slining/app_builder.rb
84
+ - lib/slining/generators/app_generator.rb
85
+ - lib/slining/version.rb
86
+ - slining.gemspec
87
+ - spec/fakes/bin/heroku
88
+ - spec/fakes/bin/hub
89
+ - spec/features/github_spec.rb
90
+ - spec/features/heroku_spec.rb
91
+ - spec/features/new_project_spec.rb
92
+ - spec/spec_helper.rb
93
+ - spec/support/fake_github.rb
94
+ - spec/support/fake_heroku.rb
95
+ - spec/support/slining.rb
96
+ - templates/Gemfile.erb
97
+ - templates/Procfile
98
+ - templates/README.md.erb
99
+ - templates/_analytics.html.erb
100
+ - templates/_flashes.html.erb
101
+ - templates/_javascript.html.erb
102
+ - templates/action_mailer.rb
103
+ - templates/application.scss
104
+ - templates/bin_deploy
105
+ - templates/bin_setup.erb
106
+ - templates/browserslist
107
+ - templates/bundler_audit.rake
108
+ - templates/config_i18n_tasks.yml
109
+ - templates/config_locales_en.yml.erb
110
+ - templates/database_cleaner_rspec.rb
111
+ - templates/development_seeds.rb
112
+ - templates/disable_xml_params.rb
113
+ - templates/errors.rb
114
+ - templates/factory_girl_rspec.rb
115
+ - templates/flashes_helper.rb
116
+ - templates/hound.yml
117
+ - templates/i18n.rb
118
+ - templates/json_encoding.rb
119
+ - templates/newrelic.yml.erb
120
+ - templates/postgresql_database.yml.erb
121
+ - templates/rails_helper.rb
122
+ - templates/sample.env
123
+ - templates/secrets.yml
124
+ - templates/slining_gitignore
125
+ - templates/slining_layout.html.erb.erb
126
+ - templates/smtp.rb
127
+ - templates/spec_helper.rb
128
+ - templates/staging.rb
129
+ - templates/travis.yml.erb
130
+ - templates/unicorn.rb
131
+ homepage: http://github.com/vaporware/slining
132
+ licenses:
133
+ - MIT
134
+ metadata: {}
135
+ post_install_message:
136
+ rdoc_options:
137
+ - "--charset=UTF-8"
138
+ require_paths:
139
+ - lib
140
+ required_ruby_version: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: 2.2.2
145
+ required_rubygems_version: !ruby/object:Gem::Requirement
146
+ requirements:
147
+ - - ">="
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
150
+ requirements: []
151
+ rubyforge_project:
152
+ rubygems_version: 2.4.5
153
+ signing_key:
154
+ specification_version: 4
155
+ summary: Generate a Rails app using vaporware's best practices.
156
+ test_files: []