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 +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +1 -1
- data/NEWS.md +40 -1
- data/README.md +3 -10
- data/RELEASING.md +1 -1
- data/bin/voyage +25 -14
- data/lib/suspenders.rb +1 -0
- data/lib/suspenders/adapters/heroku.rb +11 -20
- data/lib/suspenders/app_builder.rb +27 -27
- data/lib/suspenders/generators/app_generator.rb +7 -33
- data/lib/suspenders/generators/static_generator.rb +1 -0
- data/lib/suspenders/generators/stylesheet_base_generator.rb +37 -0
- data/lib/suspenders/version.rb +2 -2
- data/lib/voyage.rb +2 -0
- data/lib/voyage/README.md +22 -0
- data/lib/voyage/app_builder.rb +61 -62
- data/lib/voyage/generators/app_generator.rb +11 -6
- data/lib/voyage/templates/Gemfile.erb +17 -15
- data/lib/voyage/templates/rails_helper.rb.erb +1 -1
- data/lib/voyage/version.rb +7 -6
- data/spec/features/github_spec.rb +1 -1
- data/spec/features/heroku_spec.rb +3 -3
- data/spec/features/new_project_spec.rb +65 -39
- data/spec/support/fake_heroku.rb +2 -2
- data/suspenders.gemspec +1 -1
- data/templates/Gemfile.erb +2 -7
- data/templates/app.json.erb +0 -3
- data/templates/bin_setup_review_app.erb +8 -8
- metadata +10 -8
@@ -0,0 +1,37 @@
|
|
1
|
+
require "rails/generators"
|
2
|
+
|
3
|
+
module Suspenders
|
4
|
+
class StylesheetBaseGenerator < Rails::Generators::Base
|
5
|
+
source_root File.expand_path(
|
6
|
+
File.join("..", "..", "..", "templates"),
|
7
|
+
File.dirname(__FILE__))
|
8
|
+
|
9
|
+
def add_stylesheet_gems
|
10
|
+
gem "bourbon", "~> 5.0.0.beta.7"
|
11
|
+
gem "neat", "~> 2.0.0.beta.1"
|
12
|
+
gem "refills", group: [:development, :test]
|
13
|
+
Bundler.with_clean_env { run "bundle install" }
|
14
|
+
end
|
15
|
+
|
16
|
+
def add_css_config
|
17
|
+
copy_file(
|
18
|
+
"application.scss",
|
19
|
+
"app/assets/stylesheets/application.scss",
|
20
|
+
force: true,
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
def remove_prior_config
|
25
|
+
remove_file "app/assets/stylesheets/application.css"
|
26
|
+
end
|
27
|
+
|
28
|
+
def install_refills
|
29
|
+
generate "refills:import", "flashes"
|
30
|
+
remove_dir "app/views/refills"
|
31
|
+
end
|
32
|
+
|
33
|
+
def install_bitters
|
34
|
+
run "bitters install --path app/assets/stylesheets"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
data/lib/suspenders/version.rb
CHANGED
data/lib/voyage.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require 'voyage/version'
|
2
2
|
|
3
3
|
require 'suspenders/generators/app_generator'
|
4
|
+
require 'suspenders/generators/static_generator'
|
5
|
+
require 'suspenders/generators/stylesheet_base_generator'
|
4
6
|
require 'suspenders/actions'
|
5
7
|
require "suspenders/adapters/heroku"
|
6
8
|
require 'suspenders/app_builder'
|
@@ -0,0 +1,22 @@
|
|
1
|
+
## Updating to new Thoughtbot releases
|
2
|
+
|
3
|
+
### Files that we change in the mainline of the repo:
|
4
|
+
|
5
|
+
* bin/voyage
|
6
|
+
* suspenders.gemspec
|
7
|
+
|
8
|
+
Everything else is scoped to lib/voyage, so all of those changes will always apply cleanly after rebasing to upstream/master. Then just go back through each set of commits and make sure our overrides don't need some updating.
|
9
|
+
|
10
|
+
### Here are files we're currently overriding:
|
11
|
+
|
12
|
+
* lib/suspenders/app_generator.rb => lib/voyage/app_generator.rb
|
13
|
+
* templates/config_locales_en.yml.erb => lib/voyage/templates/config_locales_en.yml.erb
|
14
|
+
* templates/Gemfile.erb => lib/voyage/templates/Gemfile.erb
|
15
|
+
* templates/rails_helper.rb.erb => lib/voyage/templates/rails_helper.rb.erb
|
16
|
+
* templates/README.md.erb => lib/voyage/templates/README.md.erb
|
17
|
+
|
18
|
+
Everything else is a new file we want to add.
|
19
|
+
|
20
|
+
## Testing
|
21
|
+
|
22
|
+
Test that the new generator works, manually for now. It'd be awesome to get some [aruba](https://github.com/cucumber/aruba) tests going to test the various command line options / generated app permutations that are possible. For example, with and without devise, which templating language we should use, etc.
|
data/lib/voyage/app_builder.rb
CHANGED
@@ -15,38 +15,43 @@ module Suspenders
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
+
def update_gemset_in_gemfile
|
19
|
+
replace_in_file 'Gemfile', '#ruby-gemset', "#ruby-gemset=#{app_name}"
|
20
|
+
end
|
21
|
+
|
18
22
|
def use_slim
|
19
23
|
if @@accept_defaults || agree?('Would you like to use slim? (Y/n)')
|
20
24
|
@@use_slim = true
|
21
25
|
run 'gem install html2slim'
|
26
|
+
update_application_layout_for_slim
|
27
|
+
else
|
28
|
+
@@use_slim = false
|
29
|
+
end
|
30
|
+
end
|
22
31
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
32
|
+
def update_application_layout_for_slim
|
33
|
+
find = <<-RUBY.gsub(/^ {8}/, '')
|
34
|
+
<%#
|
35
|
+
Configure default and controller-, and view-specific titles in
|
36
|
+
config/locales/en.yml. For more see:
|
37
|
+
https://github.com/calebthompson/title#usage
|
38
|
+
%>
|
39
|
+
RUBY
|
30
40
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
41
|
+
replace = <<-RUBY.gsub(/^ {8}/, '')
|
42
|
+
<% # Configure default and controller-, and view-specific titles in
|
43
|
+
# config/locales/en.yml. For more see:
|
44
|
+
# https://github.com/calebthompson/title#usage %>
|
45
|
+
RUBY
|
36
46
|
|
37
|
-
|
47
|
+
replace_in_file 'app/views/layouts/application.html.erb', find, replace
|
38
48
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
run "erb2slim -d '../app/views/layouts'"
|
49
|
+
inside('lib') do # arbitrary, run in context of newly generated app
|
50
|
+
run "erb2slim '../app/views/layouts' '../app/views/layouts'"
|
51
|
+
run "erb2slim -d '../app/views/layouts'"
|
43
52
|
|
44
|
-
|
45
|
-
|
46
|
-
end
|
47
|
-
end
|
48
|
-
else
|
49
|
-
@@use_slim = false
|
53
|
+
run "erb2slim '../app/views/application' '../app/views/application'"
|
54
|
+
run "erb2slim -d '../app/views/application'"
|
50
55
|
end
|
51
56
|
end
|
52
57
|
|
@@ -121,31 +126,36 @@ module Suspenders
|
|
121
126
|
protected
|
122
127
|
|
123
128
|
def configure_permitted_parameters
|
124
|
-
devise_parameter_sanitizer.
|
125
|
-
|
129
|
+
devise_parameter_sanitizer.permit(
|
130
|
+
:sign_up,
|
131
|
+
keys: [
|
126
132
|
#{':first_name,' if adding_first_and_last_name}
|
127
133
|
#{':last_name,' if adding_first_and_last_name}
|
128
134
|
:email,
|
129
135
|
:password,
|
130
136
|
:password_confirmation,
|
131
137
|
:remember_me,
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
devise_parameter_sanitizer.
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
138
|
+
]
|
139
|
+
)
|
140
|
+
|
141
|
+
devise_parameter_sanitizer.permit(
|
142
|
+
:sign_in,
|
143
|
+
keys: [
|
144
|
+
:login, :email, :password, :remember_me
|
145
|
+
]
|
146
|
+
)
|
147
|
+
|
148
|
+
devise_parameter_sanitizer.permit(
|
149
|
+
:account_update,
|
150
|
+
keys: [
|
141
151
|
#{':first_name,' if adding_first_and_last_name}
|
142
152
|
#{':last_name,' if adding_first_and_last_name}
|
143
153
|
:email,
|
144
154
|
:password,
|
145
155
|
:password_confirmation,
|
146
156
|
:current_password,
|
147
|
-
|
148
|
-
|
157
|
+
]
|
158
|
+
)
|
149
159
|
end
|
150
160
|
RUBY
|
151
161
|
end
|
@@ -237,7 +247,7 @@ module Suspenders
|
|
237
247
|
|
238
248
|
trait :admin do
|
239
249
|
roles [:admin]
|
240
|
-
|
250
|
+
email 'admin@example.com'
|
241
251
|
end
|
242
252
|
RUBY
|
243
253
|
end
|
@@ -255,7 +265,7 @@ module Suspenders
|
|
255
265
|
# ----------------
|
256
266
|
|
257
267
|
def generate_seeder_templates(using_devise:)
|
258
|
-
config = { force: true, using_devise:
|
268
|
+
config = { force: true, using_devise: using_devise }
|
259
269
|
template '../templates/seeder.rb.erb', 'lib/seeder.rb', config
|
260
270
|
template '../templates/seeds.rb.erb', 'db/seeds.rb', config
|
261
271
|
end
|
@@ -296,6 +306,18 @@ module Suspenders
|
|
296
306
|
end
|
297
307
|
end
|
298
308
|
|
309
|
+
# --------
|
310
|
+
# TEMP FIX
|
311
|
+
# https://github.com/thoughtbot/bourbon/issues/993
|
312
|
+
# https://github.com/thoughtbot/refills/issues/400
|
313
|
+
# --------
|
314
|
+
def downgrade_neat_1_8_so_refills_media_mixin_works
|
315
|
+
replace_in_file 'Gemfile', "gem 'neat', '~> 2.0.0.beta.1'", "gem 'neat', '~> 1.8.0'"
|
316
|
+
end
|
317
|
+
# ------------
|
318
|
+
# END TEMP FIX
|
319
|
+
# ------------
|
320
|
+
|
299
321
|
|
300
322
|
# -------------------------
|
301
323
|
# ADDING REFILLS COMPONENTS
|
@@ -421,7 +443,7 @@ module Suspenders
|
|
421
443
|
# setup_test_environment overrides
|
422
444
|
# --------------------------------
|
423
445
|
def generate_factories_file
|
424
|
-
# NOTE: (2016-02-03) jonk => don't want this
|
446
|
+
# NOTE: (2016-02-03) jonk => don't want this, we use individual factories
|
425
447
|
end
|
426
448
|
|
427
449
|
def configure_ci
|
@@ -439,29 +461,6 @@ module Suspenders
|
|
439
461
|
# End setup_test_environment overrides
|
440
462
|
# ------------------------------------
|
441
463
|
|
442
|
-
|
443
|
-
# -------------
|
444
|
-
# Configure App
|
445
|
-
# -------------
|
446
|
-
def configure_active_job
|
447
|
-
configure_application_file(
|
448
|
-
"config.active_job.queue_adapter = :delayed_job"
|
449
|
-
)
|
450
|
-
configure_environment "test", "config.active_job.queue_adapter = :inline"
|
451
|
-
end
|
452
|
-
|
453
|
-
def configure_puma
|
454
|
-
# NOTE: (2016-02-03) jonk => don't want this
|
455
|
-
end
|
456
|
-
|
457
|
-
def set_up_forego
|
458
|
-
# NOTE: (2016-02-03) jonk => don't want this
|
459
|
-
end
|
460
|
-
# -----------------
|
461
|
-
# End Configure App
|
462
|
-
# -----------------
|
463
|
-
|
464
|
-
|
465
464
|
def remove_config_comment_lines
|
466
465
|
# NOTE: (2016-02-09) jonk => don't want this
|
467
466
|
end
|
@@ -1,11 +1,5 @@
|
|
1
1
|
module Suspenders
|
2
2
|
class AppGenerator < Rails::Generators::AppGenerator
|
3
|
-
class_option :skip_turbolinks, type: :boolean, default: false,
|
4
|
-
desc: "Skip turbolinks gem"
|
5
|
-
|
6
|
-
class_option :skip_bundle, type: :boolean, aliases: "-B", default: true,
|
7
|
-
desc: "Don't run bundle install"
|
8
|
-
|
9
3
|
def self.start
|
10
4
|
preflight_check
|
11
5
|
accept_defaults
|
@@ -29,6 +23,7 @@ module Suspenders
|
|
29
23
|
|
30
24
|
def finish_template
|
31
25
|
invoke :suspenders_customization
|
26
|
+
invoke :update_gemset_in_gemfile
|
32
27
|
invoke :use_slim
|
33
28
|
invoke :install_devise
|
34
29
|
invoke :customize_application_js
|
@@ -36,6 +31,7 @@ module Suspenders
|
|
36
31
|
invoke :generate_ruby_version_and_gemset
|
37
32
|
invoke :generate_data_migrations
|
38
33
|
invoke :add_high_voltage_static_pages
|
34
|
+
invoke :downgrade_neat_1_8_so_refills_media_mixin_works # this should be temporary until they get refills re-written to take advantage of Neat 2.0
|
39
35
|
invoke :generate_refills
|
40
36
|
invoke :generate_test_environment
|
41
37
|
invoke :update_test_environment
|
@@ -49,6 +45,10 @@ module Suspenders
|
|
49
45
|
super
|
50
46
|
end
|
51
47
|
|
48
|
+
def update_gemset_in_gemfile
|
49
|
+
build :update_gemset_in_gemfile
|
50
|
+
end
|
51
|
+
|
52
52
|
def use_slim
|
53
53
|
build :use_slim
|
54
54
|
end
|
@@ -77,6 +77,10 @@ module Suspenders
|
|
77
77
|
build :add_high_voltage_static_pages
|
78
78
|
end
|
79
79
|
|
80
|
+
def downgrade_neat_1_8_so_refills_media_mixin_works
|
81
|
+
build :downgrade_neat_1_8_so_refills_media_mixin_works
|
82
|
+
end
|
83
|
+
|
80
84
|
def generate_refills
|
81
85
|
build :generate_refills
|
82
86
|
end
|
@@ -113,6 +117,7 @@ module Suspenders
|
|
113
117
|
|
114
118
|
def bon_voyage
|
115
119
|
say 'Congratulations! You just pulled our suspenders, Headway style!'
|
120
|
+
say honeybadger_outro
|
116
121
|
end
|
117
122
|
end
|
118
123
|
end
|
@@ -2,23 +2,24 @@
|
|
2
2
|
source "https://rubygems.org"
|
3
3
|
|
4
4
|
ruby "<%= Voyage::RUBY_VERSION %>"
|
5
|
-
#ruby-gemset
|
5
|
+
#ruby-gemset
|
6
6
|
|
7
7
|
gem "autoprefixer-rails"
|
8
|
-
gem "bourbon", "~> 4.2.0"
|
9
|
-
gem "coffee-rails", "~> 4.1.0"
|
10
8
|
gem "delayed_job_active_record"
|
11
9
|
gem "flutie"
|
12
|
-
gem "
|
10
|
+
gem "honeybadger"
|
13
11
|
gem "jquery-rails"
|
14
|
-
gem "neat", "~> 1.7.0"
|
15
12
|
gem "normalize-rails", "~> 3.0.0"
|
16
13
|
gem "pg"
|
14
|
+
gem "puma"
|
17
15
|
gem "rack-canonical-host"
|
18
16
|
gem "rails", "<%= Voyage::RAILS_VERSION %>"
|
19
17
|
gem "recipient_interceptor"
|
20
18
|
gem "sass-rails", "~> 5.0"
|
21
19
|
gem "simple_form"
|
20
|
+
gem "skylight"
|
21
|
+
gem "sprockets", ">= 3.0.0"
|
22
|
+
gem 'suspenders'
|
22
23
|
gem "title"
|
23
24
|
gem "uglifier"
|
24
25
|
|
@@ -44,12 +45,11 @@ gem 'paper_trail'
|
|
44
45
|
gem 'settingslogic' # yaml settings (project wide, non-editable), this is implemented with the model Settings.rb
|
45
46
|
|
46
47
|
# Want these here for debugging on production
|
48
|
+
gem 'pry-byebug' # stepwise debugging inside pry
|
47
49
|
gem 'pry-rails' # better REPL than irb
|
48
|
-
gem 'pry-awesome_print'
|
49
|
-
gem 'pry-byebug'
|
50
|
+
gem 'pry-awesome_print' # make pry output legible
|
50
51
|
gem 'pry-remote'
|
51
52
|
|
52
|
-
gem 'librato-rails' # general monitoring of things
|
53
53
|
gem 'nondestructive_migrations'
|
54
54
|
gem 'carrierwave'
|
55
55
|
gem 'mini_magick'
|
@@ -58,8 +58,7 @@ gem 'whenever', require: false # provides a clear syntax for writing and deployi
|
|
58
58
|
gem 'whenever-web'
|
59
59
|
|
60
60
|
group :development do
|
61
|
-
gem "
|
62
|
-
gem "refills"
|
61
|
+
gem "listen"
|
63
62
|
gem "spring"
|
64
63
|
gem "spring-commands-rspec"
|
65
64
|
gem "web-console"
|
@@ -67,26 +66,28 @@ group :development do
|
|
67
66
|
# Customizations
|
68
67
|
gem 'annotate' # annotate models automatically when rake db:migrate is called
|
69
68
|
gem 'rails-erd' # auto gen ERD Diagram of models in the app on rake db:migrate
|
70
|
-
gem 'zenflow',
|
69
|
+
gem 'zenflow', git: 'https://github.com/zencoder/zenflow.git'
|
71
70
|
gem 'better_errors' # A better error page for rails when a local 500 (or similar) is thrown
|
72
71
|
gem 'binding_of_caller' # REPL in better_errors to debug in the browser at the point at which it failed
|
73
72
|
gem 'meta_request' # for chrome rails console plugin found here: https://chrome.google.com/webstore/detail/railspanel/gjpfobpafnhjhbajcjgccbbdofdckggg?hl=en-US
|
74
|
-
gem 'bitters', '~> 1.
|
73
|
+
gem 'bitters', '~> 1.3'
|
75
74
|
gem 'redcarpet' # used to render the readme inside a static welcome page from the high_voltage gem
|
76
75
|
end
|
77
76
|
|
78
77
|
group :development, :test do
|
79
78
|
gem "awesome_print"
|
80
79
|
gem "bullet"
|
81
|
-
gem "bundler-audit", require: false
|
80
|
+
gem "bundler-audit", ">= 0.5.0", require: false
|
82
81
|
gem "dotenv-rails"
|
83
82
|
gem "factory_girl_rails"
|
84
|
-
gem "
|
83
|
+
<%# gem "pry-byebug" %>
|
84
|
+
<%# gem "pry-rails" %>
|
85
|
+
gem "rspec-rails", "~> 3.5"
|
85
86
|
|
86
87
|
# Customizations
|
87
88
|
gem 'faker' # provides auto generated names for factories, can be customized
|
88
89
|
|
89
|
-
gem 'rubocop'
|
90
|
+
gem 'rubocop'
|
90
91
|
gem 'rubocop-rspec', require: false
|
91
92
|
|
92
93
|
gem 'letter_opener' # auto-open emails when they're sent
|
@@ -97,6 +98,7 @@ group :development, :staging do
|
|
97
98
|
end
|
98
99
|
|
99
100
|
group :test do
|
101
|
+
<%# gem "capybara-webkit" # We don't want this. %>
|
100
102
|
gem "database_cleaner"
|
101
103
|
gem "formulaic"
|
102
104
|
gem "launchy"
|
data/lib/voyage/version.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
module Voyage
|
2
|
-
RAILS_VERSION =
|
3
|
-
RUBY_VERSION =
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
RAILS_VERSION = '~> 5.0.1'.freeze
|
3
|
+
RUBY_VERSION =
|
4
|
+
IO
|
5
|
+
.read("#{File.dirname(__FILE__)}/../../.ruby-version")
|
6
|
+
.strip
|
7
|
+
.freeze
|
8
|
+
VERSION = '1.44.0.1'.freeze
|
8
9
|
end
|