voyage 1.0 → 1.44.0.1

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: 93b2d519b1167c66745f3cde36115fbe2d6b47b2
4
- data.tar.gz: 85d75aaef00c54918529794748be6b3e7aa7e089
3
+ metadata.gz: ffbb065bd31fb43879ca2cf48aef345dcd64f5c6
4
+ data.tar.gz: 76125833cc10fc3a49f2272caf765c13edd60796
5
5
  SHA512:
6
- metadata.gz: 871a09f641d0a7534be22c3c0f8fd408d49a8aa2946f668bd41a3bc58830dfca07a0faf3f2eca1fcc971d0499a2107549cdb6e4a08ae5f7e33b939cfd7b89128
7
- data.tar.gz: db8014dbb5363b68e2ee50b77112828dd15dc0c77656625c2dab3d959231345fbbbfd5d53ff748e3230b69fc686a41131ac3c43abc57c4ca522113aa18b14914
6
+ metadata.gz: 2dc5b63b2a953254ce32367bd3c9bf45976f8ea9184fa43aeb8c72bc820a6b485f6d6102699dda7f44c374c9c223cbfc5a613397e50a3051662986b5afd829dc
7
+ data.tar.gz: ca0aa81041d38481db639bbea81c42484802019561dd953e2c3bb00867a052c944ec97f92b32700b066108d879328d5eae5ef4e8e93e189b113e025453087bfa
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.3.1
1
+ 2.4.0
data/.travis.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  language: ruby
2
- rvm: 2.3.1
2
+ rvm: 2.4.0
3
3
  cache: bundler
4
4
  sudo: false
5
5
  before_install:
data/NEWS.md CHANGED
@@ -1,4 +1,43 @@
1
- master
1
+ 1.44.0 (January 25, 2017)
2
+
3
+ * Improve readability of `bin/setup-review-app` (#819)
4
+ * Update scripts to be `sh`-compatible (#820)
5
+ * Remove `rails_stdout_logging` gem (#818)
6
+ * Remove `12factor` gem (#817)
7
+ * Update Ruby to 2.4.0 (#814)
8
+
9
+ 1.43.0 (November 8, 2016)
10
+
11
+ * Update Bourbon to 5.0.0.beta.7
12
+ * Update Neat to 2.0.0.beta.1
13
+ * Update Bitters to 1.5.0
14
+ * Drop sprockets-es6
15
+ * Bugfix: doesn’t generate unused `test/` directory
16
+
17
+ 1.42.0 (July 23, 2016)
18
+
19
+ * [#784] Require refills once
20
+ * [#790] Ensure stylesheet_base generator runs with a clean bundle
21
+ * [#791] Use Rails' 5 syntax for `public_file_server.headers`
22
+ * [#792] Remove turbolinks from application.js file
23
+
24
+ 1.41.0 (July 1, 2016)
25
+
26
+ * Update to Rails 5
27
+ * Drop quiet_assets
28
+ * Drop unneeded `suspenders` aliases: `--skip-test-unit`, `--skip-turbolinks`,
29
+ `--skip-bundle`. Drops `-G` that clashes with Rails’ `--skip-git` alias.
30
+
31
+ 1.40.0 (June 25, 2016)
32
+
33
+ * Upgrade bourbon to 5.0.0.beta.6
34
+ * Update Neat to 1.8.0
35
+ * `APPLICATION_HOST` bug fix in production environment (was used before it was
36
+ defined)
37
+ * Update comment around Pipelines: it is now a Heroku core plugin
38
+ * Drop unneeded `WEB_CONCURRENCY` from `app.json` file
39
+ * Introduce a `suspenders:stylesheet_base` generator. The `application.scss`
40
+ must list the imports in a specific order. This removes the `application.css`.
2
41
 
3
42
  1.39.0 (May 25, 2016)
4
43
 
data/README.md CHANGED
@@ -74,13 +74,11 @@ And development gems like:
74
74
  pre-loading
75
75
  * [Web Console](https://github.com/rails/web-console) for better debugging via
76
76
  in-browser IRB consoles.
77
- * [Quiet Assets](https://github.com/evrone/quiet_assets) for muting assets
78
- pipeline log messages
79
77
 
80
78
  And testing gems like:
81
79
 
82
80
  * [Capybara](https://github.com/jnicklas/capybara) and
83
- [Capybara Webkit](https://github.com/thoughtbot/capybara-webkit) for
81
+ [Capybara WebKit](https://github.com/thoughtbot/capybara-webkit) for
84
82
  integration testing
85
83
  * [Factory Girl](https://github.com/thoughtbot/factory_girl) for test data
86
84
  * [Formulaic](https://github.com/thoughtbot/formulaic) for integration testing
@@ -131,13 +129,8 @@ This:
131
129
  * Sets them as `staging` and `production` Git remotes
132
130
  * Configures staging with `RACK_ENV` environment variable set
133
131
  to `staging`
134
- * Adds the [Rails Stdout Logging][logging-gem] gem
135
- to configure the app to log to standard out,
136
- which is how [Heroku's logging][heroku-logging] works.
137
132
  * Creates a [Heroku Pipeline] for review apps
138
133
 
139
- [logging-gem]: https://github.com/heroku/rails_stdout_logging
140
- [heroku-logging]: https://devcenter.heroku.com/articles/logging#writing-to-your-log
141
134
  [Heroku Pipeline]: https://devcenter.heroku.com/articles/pipelines
142
135
 
143
136
  You can optionally specify alternate Heroku flags:
@@ -187,10 +180,10 @@ installed on your machine before generating an app with Suspenders.
187
180
  Use [OS X GCC Installer](https://github.com/kennethreitz/osx-gcc-installer/) for
188
181
  Snow Leopard (OS X 10.6).
189
182
 
190
- Use [Command Line Tools for XCode](https://developer.apple.com/downloads/index.action)
183
+ Use [Command Line Tools for Xcode](https://developer.apple.com/downloads/index.action)
191
184
  for Lion (OS X 10.7) or Mountain Lion (OS X 10.8).
192
185
 
193
- We use [Capybara Webkit](https://github.com/thoughtbot/capybara-webkit) for
186
+ We use [Capybara WebKit](https://github.com/thoughtbot/capybara-webkit) for
194
187
  full-stack JavaScript integration testing. It requires QT. Instructions for
195
188
  installing QT are
196
189
  [here](https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit).
data/RELEASING.md CHANGED
@@ -4,7 +4,7 @@
4
4
  2. Update `NEWS.md` to reflect the changes since last release.
5
5
  3. Commit changes. There shouldn't be code changes, and thus CI doesn't need to
6
6
  run, you can then add `[ci skip]` to the commit message.
7
- 4. Tag the release: `git tag vVERSION -a`. The tag message should contain the
7
+ 4. Tag the release: `git tag vVERSION -a -s`. The tag message should contain the
8
8
  appropriate `NEWS.md` subsection.
9
9
  5. Push changes: `git push --tags`
10
10
  6. Build and publish to rubygems:
data/bin/voyage CHANGED
@@ -1,20 +1,31 @@
1
1
  #!/usr/bin/env ruby
2
- require 'pathname'
3
2
 
4
- source_path = (Pathname.new(__FILE__).dirname + '../lib').expand_path
5
- $LOAD_PATH << source_path
3
+ rails_installed=`gem query --name-matches '^rails$' --installed`
6
4
 
7
- require 'suspenders'
8
- require 'voyage'
5
+ if rails_installed.chomp == 'true'
6
+ require 'pathname'
9
7
 
10
- if ['-v', '--version'].include? ARGV[0]
11
- puts Voyage::VERSION
12
- exit 0
13
- end
8
+ source_path = (Pathname.new(__FILE__).dirname + '../lib').expand_path
9
+ $LOAD_PATH << source_path
10
+
11
+ require 'voyage'
14
12
 
15
- templates_root = File.expand_path(File.join("..", "templates"), File.dirname(__FILE__))
16
- template_additions = File.expand_path(File.join("..", "lib/voyage/templates"), File.dirname(__FILE__))
17
- Suspenders::AppGenerator.source_root templates_root
18
- Suspenders::AppGenerator.source_paths << Rails::Generators::AppGenerator.source_root << template_additions << templates_root
13
+ if ARGV.empty?
14
+ puts "Please provide a path for the new application"
15
+ puts
16
+ puts "See --help for more info"
17
+ exit 0
18
+ elsif ['-v', '--version'].include? ARGV[0]
19
+ puts Voyage::VERSION
20
+ exit 0
21
+ end
19
22
 
20
- Suspenders::AppGenerator.start
23
+ templates_root = File.expand_path(File.join("..", "templates"), File.dirname(__FILE__))
24
+ template_additions = File.expand_path(File.join("..", "lib/voyage/templates"), File.dirname(__FILE__))
25
+ Suspenders::AppGenerator.source_root templates_root
26
+ Suspenders::AppGenerator.source_paths << Rails::Generators::AppGenerator.source_root << template_additions << templates_root
27
+
28
+ Suspenders::AppGenerator.start
29
+ else
30
+ puts "Please install Rails in the desired gemset before continuing..."
31
+ end
data/lib/suspenders.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'suspenders/version'
2
2
  require 'suspenders/generators/app_generator'
3
3
  require 'suspenders/generators/static_generator'
4
+ require 'suspenders/generators/stylesheet_base_generator'
4
5
  require 'suspenders/actions'
5
6
  require "suspenders/adapters/heroku"
6
7
  require 'suspenders/app_builder'
@@ -6,7 +6,7 @@ module Suspenders
6
6
  end
7
7
 
8
8
  def set_heroku_remotes
9
- remotes = <<-SHELL.strip_heredoc
9
+ remotes = <<~SHELL
10
10
  #{command_to_join_heroku_app('staging')}
11
11
  #{command_to_join_heroku_app('production')}
12
12
 
@@ -51,9 +51,9 @@ module Suspenders
51
51
  end
52
52
 
53
53
  def create_heroku_pipeline
54
- pipelines_plugin = `heroku plugins | grep pipelines`
54
+ pipelines_plugin = `heroku help | grep pipelines`
55
55
  if pipelines_plugin.empty?
56
- puts "You need heroku pipelines plugin. Run: heroku plugins:install heroku-pipelines"
56
+ puts "You need heroku pipelines plugin. Run: brew upgrade heroku-toolbelt"
57
57
  exit 1
58
58
  end
59
59
 
@@ -70,15 +70,6 @@ module Suspenders
70
70
  )
71
71
  end
72
72
 
73
- def set_heroku_serve_static_files
74
- %w(staging production).each do |environment|
75
- run_toolbelt_command(
76
- "config:add RAILS_SERVE_STATIC_FILES=true",
77
- environment,
78
- )
79
- end
80
- end
81
-
82
73
  def set_heroku_application_host
83
74
  %w(staging production).each do |environment|
84
75
  run_toolbelt_command(
@@ -94,14 +85,14 @@ module Suspenders
94
85
 
95
86
  def command_to_join_heroku_app(environment)
96
87
  heroku_app_name = heroku_app_name_for(environment)
97
- <<-SHELL
98
-
99
- if heroku join --app #{heroku_app_name} &> /dev/null; then
100
- git remote add #{environment} git@heroku.com:#{heroku_app_name}.git || true
101
- printf 'You are a collaborator on the "#{heroku_app_name}" Heroku app\n'
102
- else
103
- printf 'Ask for access to the "#{heroku_app_name}" Heroku app\n'
104
- fi
88
+ <<~SHELL
89
+
90
+ if heroku join --app #{heroku_app_name} > /dev/null 2>&1; then
91
+ git remote add #{environment} git@heroku.com:#{heroku_app_name}.git || true
92
+ printf 'You are a collaborator on the "#{heroku_app_name}" Heroku app\n'
93
+ else
94
+ printf 'Ask for access to the "#{heroku_app_name}" Heroku app\n'
95
+ fi
105
96
  SHELL
106
97
  end
107
98
 
@@ -13,8 +13,7 @@ module Suspenders
13
13
  :create_review_apps_setup_script,
14
14
  :set_heroku_rails_secrets,
15
15
  :set_heroku_remotes,
16
- :set_heroku_application_host,
17
- :set_heroku_serve_static_files
16
+ :set_heroku_application_host
18
17
 
19
18
  def readme
20
19
  template 'README.md.erb', 'README.md'
@@ -44,6 +43,14 @@ module Suspenders
44
43
  'raise_delivery_errors = false', 'raise_delivery_errors = true'
45
44
  end
46
45
 
46
+ def remove_turbolinks
47
+ replace_in_file(
48
+ "app/assets/javascripts/application.js",
49
+ "//= require turbolinks",
50
+ ""
51
+ )
52
+ end
53
+
47
54
  def set_test_delivery_method
48
55
  inject_into_file(
49
56
  "config/environments/development.rb",
@@ -79,7 +86,7 @@ module Suspenders
79
86
 
80
87
  def configure_quiet_assets
81
88
  config = <<-RUBY
82
- config.quiet_assets = true
89
+ config.assets.quiet = true
83
90
  RUBY
84
91
 
85
92
  inject_into_class "config/application.rb", "Application", config
@@ -99,7 +106,7 @@ module Suspenders
99
106
 
100
107
  config.generators do |generate|
101
108
  generate.helper false
102
- generate.javascript_engine false
109
+ generate.javascripts false
103
110
  generate.request_specs false
104
111
  generate.routing_specs false
105
112
  generate.stylesheets false
@@ -142,14 +149,19 @@ module Suspenders
142
149
 
143
150
  def enable_rack_canonical_host
144
151
  config = <<-RUBY
145
- if ENV.fetch("HEROKU_APP_NAME", "").include?("staging-pr-")
152
+
153
+ if ENV.fetch("HEROKU_APP_NAME", "").include?("staging-pr-")
146
154
  ENV["APPLICATION_HOST"] = ENV["HEROKU_APP_NAME"] + ".herokuapp.com"
147
155
  end
148
156
 
149
157
  config.middleware.use Rack::CanonicalHost, ENV.fetch("APPLICATION_HOST")
150
158
  RUBY
151
159
 
152
- configure_environment "production", config
160
+ inject_into_file(
161
+ "config/environments/production.rb",
162
+ config,
163
+ after: "Rails.application.configure do",
164
+ )
153
165
  end
154
166
 
155
167
  def enable_rack_deflater
@@ -165,10 +177,13 @@ if ENV.fetch("HEROKU_APP_NAME", "").include?("staging-pr-")
165
177
  "config.assets.version = '1.0'",
166
178
  'config.assets.version = (ENV["ASSETS_VERSION"] || "1.0")'
167
179
 
168
- configure_environment(
169
- "production",
170
- 'config.static_cache_control = "public, max-age=31557600"',
171
- )
180
+ config = <<-EOD
181
+ config.public_file_server.headers = {
182
+ "Cache-Control" => "public, max-age=31557600",
183
+ }
184
+ EOD
185
+
186
+ configure_environment("production", config)
172
187
  end
173
188
 
174
189
  def setup_secret_token
@@ -310,29 +325,14 @@ Rack::Timeout.timeout = (ENV["RACK_TIMEOUT"] || 10).to_i
310
325
  generate 'rspec:install'
311
326
  end
312
327
 
313
- def configure_puma
314
- copy_file "puma.rb", "config/puma.rb"
328
+ def replace_default_puma_configuration
329
+ copy_file "puma.rb", "config/puma.rb", force: true
315
330
  end
316
331
 
317
332
  def set_up_forego
318
333
  copy_file "Procfile", "Procfile"
319
334
  end
320
335
 
321
- def setup_stylesheets
322
- remove_file "app/assets/stylesheets/application.css"
323
- copy_file "application.scss",
324
- "app/assets/stylesheets/application.scss"
325
- end
326
-
327
- def install_refills
328
- generate "refills:import", "flashes"
329
- remove_dir "app/views/refills"
330
- end
331
-
332
- def install_bitters
333
- run "bitters install --path app/assets/stylesheets"
334
- end
335
-
336
336
  def setup_default_directories
337
337
  [
338
338
  'app/views/pages',
@@ -14,18 +14,9 @@ module Suspenders
14
14
  class_option :heroku_flags, type: :string, default: "",
15
15
  desc: "Set extra Heroku flags"
16
16
 
17
- class_option :github, type: :string, aliases: "-G", default: nil,
17
+ class_option :github, type: :string, default: nil,
18
18
  desc: "Create Github repository and add remote origin pointed to repo"
19
19
 
20
- class_option :skip_test_unit, type: :boolean, aliases: "-T", default: true,
21
- desc: "Skip Test::Unit files"
22
-
23
- class_option :skip_turbolinks, type: :boolean, default: true,
24
- desc: "Skip turbolinks gem"
25
-
26
- class_option :skip_bundle, type: :boolean, aliases: "-B", default: true,
27
- desc: "Don't run bundle install"
28
-
29
20
  class_option :version, type: :boolean, aliases: "-v", group: :suspenders,
30
21
  desc: "Show Suspenders version number and quit"
31
22
 
@@ -35,6 +26,9 @@ module Suspenders
35
26
  class_option :path, type: :string, default: nil,
36
27
  desc: "Path to the gem"
37
28
 
29
+ class_option :skip_test, type: :boolean, default: true,
30
+ desc: "Skip Test Unit"
31
+
38
32
  def finish_template
39
33
  invoke :suspenders_customization
40
34
  super
@@ -48,9 +42,6 @@ module Suspenders
48
42
  invoke :setup_secret_token
49
43
  invoke :create_suspenders_views
50
44
  invoke :configure_app
51
- invoke :setup_stylesheets
52
- invoke :install_bitters
53
- invoke :install_refills
54
45
  invoke :copy_miscellaneous_files
55
46
  invoke :customize_error_pages
56
47
  invoke :remove_config_comment_lines
@@ -89,6 +80,7 @@ module Suspenders
89
80
  say 'Setting up the development environment'
90
81
  build :raise_on_missing_assets_in_test
91
82
  build :raise_on_delivery_errors
83
+ build :remove_turbolinks
92
84
  build :set_test_delivery_method
93
85
  build :add_bullet_gem_configuration
94
86
  build :raise_on_unpermitted_parameters
@@ -145,26 +137,11 @@ module Suspenders
145
137
  build :configure_active_job
146
138
  build :configure_time_formats
147
139
  build :setup_default_rake_task
148
- build :configure_puma
140
+ build :replace_default_puma_configuration
149
141
  build :set_up_forego
150
142
  build :setup_rack_mini_profiler
151
143
  end
152
144
 
153
- def setup_stylesheets
154
- say 'Set up stylesheets'
155
- build :setup_stylesheets
156
- end
157
-
158
- def install_bitters
159
- say 'Install Bitters'
160
- build :install_bitters
161
- end
162
-
163
- def install_refills
164
- say "Install Refills"
165
- build :install_refills
166
- end
167
-
168
145
  def setup_git
169
146
  if !options[:skip_git]
170
147
  say "Initializing git"
@@ -184,7 +161,6 @@ module Suspenders
184
161
  if options[:heroku]
185
162
  say "Creating Heroku apps"
186
163
  build :create_heroku_apps, options[:heroku_flags]
187
- build :set_heroku_serve_static_files
188
164
  build :set_heroku_remotes
189
165
  build :set_heroku_rails_secrets
190
166
  build :set_heroku_application_host
@@ -247,10 +223,8 @@ module Suspenders
247
223
 
248
224
  def generate_default
249
225
  run("spring stop")
250
-
251
226
  generate("suspenders:static")
252
-
253
- bundle_command "install"
227
+ generate("suspenders:stylesheet_base")
254
228
  end
255
229
 
256
230
  def outro
@@ -4,6 +4,7 @@ module Suspenders
4
4
  class StaticGenerator < Rails::Generators::Base
5
5
  def add_high_voltage
6
6
  gem "high_voltage"
7
+ Bundler.with_clean_env { run "bundle install" }
7
8
  end
8
9
  end
9
10
  end