thredded_create_app 0.1.11 → 0.1.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +38 -4
  3. data/exe/thredded_create_app +1 -0
  4. data/lib/thredded_create_app/cli.rb +7 -7
  5. data/lib/thredded_create_app/command_error.rb +1 -0
  6. data/lib/thredded_create_app/generator.rb +5 -0
  7. data/lib/thredded_create_app/logging.rb +1 -0
  8. data/lib/thredded_create_app/tasks/add_devise.rb +1 -0
  9. data/lib/thredded_create_app/tasks/add_display_name_to_users/add_display_name_to_users.rb +1 -0
  10. data/lib/thredded_create_app/tasks/add_display_name_to_users.rb +1 -0
  11. data/lib/thredded_create_app/tasks/add_memcached_support.rb +1 -0
  12. data/lib/thredded_create_app/tasks/add_rails_email_preview/_rails_email_preview-custom.scss +7 -0
  13. data/lib/thredded_create_app/tasks/add_rails_email_preview.rb +36 -0
  14. data/lib/thredded_create_app/tasks/add_roadie.rb +61 -0
  15. data/lib/thredded_create_app/tasks/add_simple_form.rb +1 -0
  16. data/lib/thredded_create_app/tasks/add_thredded/_thredded-custom.scss +12 -0
  17. data/lib/thredded_create_app/tasks/add_thredded/{_myapp-thredded.scss → _thredded-variables.scss} +0 -11
  18. data/lib/thredded_create_app/tasks/add_thredded/add_admin_to_users.rb +1 -0
  19. data/lib/thredded_create_app/tasks/add_thredded/spec/features/thredded_spec.rb +1 -0
  20. data/lib/thredded_create_app/tasks/add_thredded/thredded_initializer_controller.rb +1 -0
  21. data/lib/thredded_create_app/tasks/add_thredded.rb +69 -4
  22. data/lib/thredded_create_app/tasks/base.rb +24 -4
  23. data/lib/thredded_create_app/tasks/create_rails_app.rb +1 -0
  24. data/lib/thredded_create_app/tasks/docker.rb +1 -0
  25. data/lib/thredded_create_app/tasks/production_configs/puma.production.rb +1 -0
  26. data/lib/thredded_create_app/tasks/production_configs.rb +1 -0
  27. data/lib/thredded_create_app/tasks/setup_app_skeleton/_variables.scss.erb +1 -0
  28. data/lib/thredded_create_app/tasks/setup_app_skeleton/spec/controllers/users_controller_spec.rb +1 -0
  29. data/lib/thredded_create_app/tasks/setup_app_skeleton/spec/features/homepage_spec.rb +1 -0
  30. data/lib/thredded_create_app/tasks/setup_app_skeleton.rb +10 -4
  31. data/lib/thredded_create_app/tasks/setup_database.rb +1 -0
  32. data/lib/thredded_create_app/version.rb +2 -1
  33. data/lib/thredded_create_app.rb +1 -0
  34. metadata +8 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2284ab111024646a880d29a4a6e1f201d4a0f51e
4
- data.tar.gz: e17c9d44ce2a7057d78d9b259b5d96e4c52b9b80
3
+ metadata.gz: 513368c529e15ea3dc4754fca05f14bc9079f6ea
4
+ data.tar.gz: fa5a72dd4db36c920ca536a7c4ac1953bf627e63
5
5
  SHA512:
6
- metadata.gz: ffdaa145bfb1ed4507d84264a6e85b953cf2fb297a369854f3549cfea2900acbc3949a2e34c6c2f7a32f6684a525e16f2e196289433ce0e72ca0741b15250fc7
7
- data.tar.gz: dbfa8dfcdba2fb1f2b0463a2f2421394c6a58a4fcb2101efe6e3bfbd0c932146b6ed15eb1d939a2af0b7dbb9b261df9e7ede961e6daa1df09cd760dc9fb3724c
6
+ metadata.gz: 7ef614456503b8c591ff0e34e4ddce7bda63e0bfd96d962975a28e1587d5bda8bfd519d106702d4529938e4dd67aca961435584853626b0afc4324ed3e375856
7
+ data.tar.gz: cfc159231d9edd498a86138cde95f4e10988cbc125eac7c75bc2381e4ae4c11975e78a046a9c356b001619b19132b9863d3a487356374192346d69aebed6199f
data/README.md CHANGED
@@ -118,7 +118,11 @@ development and test databases. Then, the database is created, the migrations
118
118
  are run, and the database is seeded with an admin user and a messageboard.
119
119
 
120
120
  Finally, the tests are run, and the development web server is started at
121
- <http://localhost:3000>.
121
+ <http://localhost:3000>. To start the server yourself afterwards with:
122
+
123
+ ```bash
124
+ bundle exec rails s
125
+ ```
122
126
 
123
127
  [`async`]: https://developer.mozilla.org/en/docs/Web/HTML/Element/script
124
128
  [`defer`]: https://developer.mozilla.org/en/docs/Web/HTML/Element/script
@@ -179,9 +183,39 @@ heroku open
179
183
  You can log in as the admin user with email `admin@<app name>.com`, password
180
184
  `123456`.
181
185
 
182
- The app is now deployed, but you'll also need to set up emailing, either by
183
- using one of the Heroku add-ons (there are some free ones), or by
184
- [configuring it yourself](http://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration).
186
+ ### E-mails
187
+
188
+ The app is now deployed, but you'll also need to set up emailing.
189
+
190
+ The easiest way to do this is via the Mailgun Heroku add-on.
191
+
192
+ 1. Enable the Mailgun add-on:
193
+
194
+ ```bash
195
+ heroku addons:create mailgun:starter # Enable Mailgun with the free plan
196
+ ```
197
+
198
+ 2. Copy the following snippet into `config/environments/production.rb`:
199
+
200
+ ```ruby
201
+ config.action_mailer.perform_deliveries = true
202
+ config.action_mailer.raise_delivery_errors = true
203
+ config.action_mailer.delivery_method = :smtp
204
+ config.action_mailer.smtp_settings = {
205
+ domain: '[SET ME] myapp.herokuapp.com',
206
+ port: ENV['MAILGUN_SMTP_PORT'],
207
+ address: ENV['MAILGUN_SMTP_SERVER'],
208
+ user_name: ENV['MAILGUN_SMTP_LOGIN'],
209
+ password: ENV['MAILGUN_SMTP_PASSWORD'],
210
+ authentication: :plain,
211
+ }
212
+ ```
213
+
214
+ Set the `domain` in the snippet above to your domain.
215
+
216
+ 3. Commit and push to Heroku.
217
+
218
+ ### Performance
185
219
 
186
220
  You may also want to set the Ruby GC variables for maximum performance.
187
221
  You can either do so by profiling the app with the
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
+
3
4
  if ENV['THREDDED_CREATE_APP_BIN_SIMPLECOV_COVERAGE']
4
5
  require_relative '../spec/simplecov_bin_helper'
5
6
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'thredded_create_app/command_error'
3
4
  require 'thredded_create_app/generator'
4
5
  require 'thredded_create_app/logging'
@@ -110,15 +111,14 @@ module ThreddedCreateApp
110
111
  STDERR.puts op
111
112
  exit
112
113
  end
113
- op.separator Term::ANSIColor.bright_blue <<-TEXT
114
-
115
- For more information, see the readme at:
116
- #{File.expand_path('../../README.md', File.dirname(__FILE__))}
117
- https://github.com/thredded/thredded_create_app
114
+ op.separator Term::ANSIColor.bright_blue <<~TEXT
115
+ For more information, see the readme at:
116
+ #{File.expand_path('../../README.md', File.dirname(__FILE__))}
117
+ https://github.com/thredded/thredded_create_app
118
118
  TEXT
119
119
  end.parse!(argv)
120
120
  if positional_args.length != 1
121
- raise ArgvError, 'Expected 1 positional argument, ' \
121
+ fail ArgvError, 'Expected 1 positional argument, ' \
122
122
  "got #{positional_args.length}."
123
123
  end
124
124
  options.update(app_path: argv[0])
@@ -153,7 +153,7 @@ TEXT
153
153
 
154
154
  def error(message, exit_code)
155
155
  log_error message
156
- raise ExecutionError.new(message, exit_code)
156
+ fail ExecutionError.new(message, exit_code)
157
157
  end
158
158
 
159
159
  def auto_output_coloring(coloring = STDOUT.isatty)
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module ThreddedCreateApp
3
4
  # When this type of error is caught:
4
5
  # 1. show error message of the backtrace
@@ -1,10 +1,13 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'fileutils'
3
4
  require 'shellwords'
4
5
  require 'thredded_create_app/tasks/base'
5
6
  require 'thredded_create_app/tasks/create_rails_app'
6
7
  require 'thredded_create_app/tasks/add_simple_form'
7
8
  require 'thredded_create_app/tasks/add_devise'
9
+ require 'thredded_create_app/tasks/add_roadie'
10
+ require 'thredded_create_app/tasks/add_rails_email_preview'
8
11
  require 'thredded_create_app/tasks/add_thredded'
9
12
  require 'thredded_create_app/tasks/add_display_name_to_users'
10
13
  require 'thredded_create_app/tasks/setup_database'
@@ -62,6 +65,8 @@ module ThreddedCreateApp
62
65
  Tasks::CreateRailsApp,
63
66
  (Tasks::AddSimpleForm if @options[:simple_form]),
64
67
  Tasks::AddDevise,
68
+ Tasks::AddRailsEmailPreview,
69
+ Tasks::AddRoadie,
65
70
  Tasks::AddThredded,
66
71
  Tasks::AddDisplayNameToUsers,
67
72
  Tasks::SetupAppSkeleton,
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'term/ansicolor'
3
4
  module ThreddedCreateApp
4
5
  module Logging
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'thredded_create_app/tasks/base'
3
4
  module ThreddedCreateApp
4
5
  module Tasks
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  class AddDisplayNameToUsers < ActiveRecord::Migration[5.0]
3
4
  def up
4
5
  case connection.adapter_name.to_s
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'thredded_create_app/tasks/base'
3
4
  module ThreddedCreateApp
4
5
  module Tasks
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'thredded_create_app/tasks/base'
3
4
  module ThreddedCreateApp
4
5
  module Tasks
@@ -0,0 +1,7 @@
1
+ @import "variables";
2
+ $rep-brand-color: $brand-primary;
3
+ $rep-font-family: $base-font-family;
4
+ $rep-text-color: $text-color;
5
+ $rep-text-color-secondary: $secondary-text-color;
6
+ $rep-gray-lighter: $light-gray;
7
+ @import "rails_email_preview/application";
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'thredded_create_app/tasks/base'
4
+ module ThreddedCreateApp
5
+ module Tasks
6
+ class AddRailsEmailPreview < Base
7
+ def summary
8
+ 'Add and configure RailsEmailPreview'
9
+ end
10
+
11
+ def before_bundle
12
+ add_gem 'rails_email_preview'
13
+ end
14
+
15
+ def after_bundle
16
+ run_generator 'rails_email_preview:install'
17
+ add_styles
18
+ git_commit 'rails g rails_email_preview:install'
19
+ end
20
+
21
+ private
22
+
23
+ def add_styles
24
+ if File.file? 'app/assets/stylesheets/application.css'
25
+ File.delete 'app/assets/stylesheets/application.css'
26
+ end
27
+ copy 'add_rails_email_preview/_rails_email_preview-custom.scss',
28
+ 'app/assets/stylesheets/_rails_email_preview-custom.scss'
29
+
30
+ File.write 'app/assets/stylesheets/application.scss', <<~SCSS, mode: 'a'
31
+ @import "rails_email_preview-custom";
32
+ SCSS
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'thredded_create_app/tasks/base'
4
+ module ThreddedCreateApp
5
+ module Tasks
6
+ class AddRoadie < Base
7
+ def summary
8
+ 'Add and configure the Roadie email pre-processor'
9
+ end
10
+
11
+ def before_bundle
12
+ add_gem 'roadie-rails'
13
+ add_gem 'plain-david' # for plain text email generation
14
+ end
15
+
16
+ def after_bundle
17
+ inject_into_file 'app/mailers/application_mailer.rb',
18
+ after: "ActionMailer::Base\n",
19
+ content: " include Roadie::Rails::Automatic\n"
20
+ inject_into_file 'config/environments/test.rb',
21
+ before: /\nend\n\z$/,
22
+ content: indent(2, "\n" + roadie_development_config)
23
+ inject_into_file 'config/environments/development.rb',
24
+ before: /\nend\n\z$/,
25
+ content: indent(2, "\n" + roadie_development_config)
26
+ inject_into_file 'config/environments/production.rb',
27
+ before: /\nend\n\z$/,
28
+ content: indent(2, "\n" + roadie_production_config)
29
+ replace 'app/views/layouts/mailer.html.erb',
30
+ %r{<style>.*?</style>}m,
31
+ "<%= stylesheet_link_tag 'email' %>"
32
+ git_commit 'Add Roadie configuration'
33
+ end
34
+
35
+ private
36
+
37
+ def roadie_development_config
38
+ <<~'RUBY'
39
+ # Set the default URL options for both Roadie and ActionMailer:
40
+ config.roadie.url_options = config.action_mailer.default_url_options = {
41
+ host: 'localhost',
42
+ port: 3000,
43
+ }
44
+ RUBY
45
+ end
46
+
47
+ def roadie_production_config
48
+ <<~'RUBY'
49
+ # Roadie requires that action_mailer.asset_host is nil, see:
50
+ # https://github.com/Mange/roadie-rails/blob/9e3cb2ed59f4ec9fda252ad016b23e106983a440/README.md#known-issues
51
+ config.action_mailer.asset_host = nil
52
+ # Set the default URL options for both Roadie and ActionMailer:
53
+ config.roadie.url_options = config.action_mailer.default_url_options = {
54
+ host: ENV['APP_HOST'] || '[SET ME] myapp.herokuapp.com',
55
+ protocol: 'https',
56
+ }
57
+ RUBY
58
+ end
59
+ end
60
+ end
61
+ end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'thredded_create_app/tasks/base'
3
4
  module ThreddedCreateApp
4
5
  module Tasks
@@ -0,0 +1,12 @@
1
+ @import "variables";
2
+ @import "thredded-variables";
3
+ @import "thredded";
4
+
5
+ .thredded--main-container {
6
+ // The padding and max-width are handled by the app's container.
7
+ max-width: none;
8
+ padding: 0;
9
+ @include thredded-media-tablet-and-up {
10
+ padding: 0;
11
+ }
12
+ }
@@ -1,5 +1,4 @@
1
1
  @import "variables";
2
-
3
2
  $thredded-brand: $brand-primary;
4
3
  $thredded-text-color: $text-color;
5
4
  $thredded-secondary-text-color: $secondary-text-color;
@@ -7,13 +6,3 @@ $thredded-base-font-family: $base-font-family;
7
6
  $thredded-base-font-size: $base-font-size;
8
7
  $thredded-base-line-height: $base-line-height;
9
8
  $thredded-grid-container-max-width: $grid-container-max-width;
10
- @import "thredded";
11
-
12
- .thredded--main-container {
13
- // The padding and max-width are handled by the app's container.
14
- max-width: none;
15
- padding: 0;
16
- @include thredded-media-tablet-and-up {
17
- padding: 0;
18
- }
19
- }
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  class AddAdminToUsers < ActiveRecord::Migration[5.0]
3
4
  def up
4
5
  add_column :users, :admin, :boolean, null: false, default: false
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'rails_helper'
3
4
 
4
5
  RSpec.feature 'Thredded', type: :feature do
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Rails.application.config.to_prepare do
3
4
  Thredded::ApplicationController.module_eval do
4
5
  rescue_from Thredded::Errors::LoginRequired do |exception|
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'thredded_create_app/tasks/base'
3
4
  module ThreddedCreateApp
4
5
  module Tasks
@@ -11,7 +12,7 @@ module ThreddedCreateApp
11
12
  add_gem 'thredded'
12
13
  end
13
14
 
14
- def after_bundle
15
+ def after_bundle # rubocop:disable Metrics/AbcSize
15
16
  install_thredded
16
17
  git_commit 'Install thredded (rails g thredded:install)'
17
18
  add_thredded_routes
@@ -25,6 +26,10 @@ module ThreddedCreateApp
25
26
  git_commit 'Configure Thredded (routes, assets, behaviour, tests)'
26
27
  add_admin_column_to_users
27
28
  git_commit 'Add the admin column to users'
29
+ add_thredded_email_styles
30
+ git_commit 'Configure Thredded email styles with Roadie'
31
+ configure_rails_email_preview
32
+ git_commit 'Configure RailsEmailPreview with Thredded and Roadie'
28
33
  run 'bundle exec rails thredded:install:emoji'
29
34
  git_commit 'Copied emoji to public/emoji'
30
35
  end
@@ -54,13 +59,15 @@ module ThreddedCreateApp
54
59
  end
55
60
 
56
61
  def add_thredded_styles
57
- copy 'add_thredded/_myapp-thredded.scss',
58
- "app/assets/stylesheets/_#{app_name}-thredded.scss"
62
+ copy 'add_thredded/_thredded-variables.scss',
63
+ 'app/assets/stylesheets/_thredded-variables.scss'
64
+ copy 'add_thredded/_thredded-custom.scss',
65
+ 'app/assets/stylesheets/_thredded-custom.scss'
59
66
  if File.file? 'app/assets/stylesheets/application.css'
60
67
  File.delete 'app/assets/stylesheets/application.css'
61
68
  end
62
69
  File.write 'app/assets/stylesheets/application.scss',
63
- "@import \"#{app_name}-thredded\";\n",
70
+ "@import \"thredded-custom\";\n",
64
71
  mode: 'a'
65
72
  end
66
73
 
@@ -74,6 +81,64 @@ module ThreddedCreateApp
74
81
  copy 'add_thredded/add_admin_to_users.rb',
75
82
  Dir['db/migrate/*_add_admin_to_users.rb'][0]
76
83
  end
84
+
85
+ def add_thredded_email_styles
86
+ File.write 'app/assets/stylesheets/email.scss', <<~'SCSS', mode: 'a'
87
+ @import "variables";
88
+ @import "thredded-variables";
89
+ @import "thredded/email";
90
+ SCSS
91
+
92
+ replace 'config/initializers/thredded.rb',
93
+ "# Thredded.parent_mailer = 'ActionMailer::Base'",
94
+ "Thredded.parent_mailer = 'ApplicationMailer'"
95
+
96
+ add_precompile_asset 'email.css'
97
+
98
+ File.write 'config/initializers/roadie.rb', <<~'RUBY', mode: 'a'
99
+ Rails.application.config.roadie.before_transformation = Thredded::EmailTransformer
100
+ RUBY
101
+ end
102
+
103
+ # rubocop:disable Metrics/MethodLength,Metrics/AbcSize
104
+ def configure_rails_email_preview
105
+ replace 'config/routes.rb',
106
+ /\s*mount RailsEmailPreview::Engine.*/,
107
+ indent(2, "\n" + <<~'RUBY' + "\n")
108
+ scope path: 'admin' do
109
+ authenticate :user, lambda { |u| u.admin? } do
110
+ mount RailsEmailPreview::Engine, at: 'emails'
111
+ end
112
+ end
113
+ RUBY
114
+ replace 'config/initializers/rails_email_preview.rb',
115
+ /#\s?(RailsEmailPreview\.setup.*?\n)(.*?)#\s?end/m do |m|
116
+ content = m[2]
117
+ content.gsub!(/^#( {2}#|$)/, '\1') || fail
118
+ content.gsub!(/^#/, ' #')
119
+ content.gsub!(/ *# *config.before_render.*?end\n/m,
120
+ indent(2, <<~'RUBY')) || fail
121
+ config.before_render do |message, preview_class_name, mailer_action|
122
+ Roadie::Rails::MailInliner.new(message, message.roadie_options).execute
123
+ end
124
+ RUBY
125
+ content.gsub!(/ *# *config.enable_send_email =.*\n/,
126
+ indent(2, <<~'RUBY')) || fail
127
+ config.enable_send_email = Rails.env.production?
128
+ RUBY
129
+ content.gsub!(/# do not show send email button/i,
130
+ '# Only show Send Email button in production')
131
+ "#{m[1]}#{content}end"
132
+ end
133
+ replace 'config/initializers/rails_email_preview.rb',
134
+ /#\s*RailsEmailPreview.layout =.*/,
135
+ "RailsEmailPreview.layout = 'application'"
136
+ replace 'config/initializers/rails_email_preview.rb',
137
+ /RailsEmailPreview.preview_classes = /,
138
+ 'RailsEmailPreview.preview_classes = ' \
139
+ 'Thredded::BaseMailerPreview.preview_classes + '
140
+ end
141
+ # rubocop:enable Metrics/MethodLength,Metrics/AbcSize
77
142
  end
78
143
  end
79
144
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'shellwords'
3
4
  require 'fileutils'
4
5
  require 'erb'
@@ -52,15 +53,34 @@ module ThreddedCreateApp
52
53
  File.write target_path, src, mode: mode
53
54
  end
54
55
 
55
- def replace(path, pattern, replacement = nil, optional: false, &block)
56
+ def replace(path, pattern, replacement = nil, optional: false)
56
57
  src = File.read(path)
57
- unless src.gsub!(pattern, replacement, &block) || optional
58
- raise ThreddedCreateApp::CommandError,
59
- "No match found for #{pattern} in #{path}"
58
+ changed = if block_given?
59
+ src.gsub!(pattern) { |_| yield Regexp.last_match }
60
+ else
61
+ src.gsub!(pattern, replacement)
62
+ end
63
+ unless changed || optional
64
+ fail ThreddedCreateApp::CommandError,
65
+ "No match found for #{pattern} in #{path}"
60
66
  end
61
67
  File.write path, src
62
68
  end
63
69
 
70
+ def add_precompile_asset(asset)
71
+ log_verbose "Add precompile asset: #{asset}"
72
+ assets_conf = File.read('config/initializers/assets.rb')
73
+ if assets_conf.include?('# Rails.application.config.assets.precompile')
74
+ replace 'config/initializers/assets.rb',
75
+ /# Rails\.application\.config\.assets\.precompile.*/,
76
+ "Rails.application.config.assets.precompile += %w(#{asset})"
77
+ else
78
+ replace 'config/initializers/assets.rb',
79
+ /config\.assets\.precompile += %w\((.*?)\)/,
80
+ "config.assets.precompile += %w(\\1 #{asset})"
81
+ end
82
+ end
83
+
64
84
  def add_route(route_str, prepend: false)
65
85
  log_verbose "Add route: #{route_str}"
66
86
  inject_into_file 'config/routes.rb',
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'thredded_create_app/tasks/base'
3
4
  module ThreddedCreateApp
4
5
  module Tasks
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'thredded_create_app/tasks/base'
3
4
  module ThreddedCreateApp
4
5
  module Tasks
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  workers Integer(ENV.fetch('WEB_CONCURRENCY', 3))
3
4
  threads_count = Integer(ENV.fetch('MAX_THREADS', 5))
4
5
  threads(threads_count, threads_count)
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'thredded_create_app/tasks/base'
3
4
  module ThreddedCreateApp
4
5
  module Tasks
@@ -1,6 +1,7 @@
1
1
  $brand-primary: <%= brand_primary %>;
2
2
  $text-color: #575d6b;
3
3
  $secondary-text-color: lighten($text-color, 30%);
4
+ $light-gray: #eee;
4
5
  $base-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif;
5
6
  $base-font-size: 1rem;
6
7
  $base-line-height: 1.5;
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'rails_helper'
3
4
 
4
5
  RSpec.describe UsersController, type: :controller do
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'rails_helper'
3
4
 
4
5
  RSpec.feature 'Homepage', type: :feature do
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'thredded_create_app/tasks/base'
3
4
  module ThreddedCreateApp
4
5
  module Tasks
@@ -49,9 +50,9 @@ module ThreddedCreateApp
49
50
  inject_into_file 'app/views/layouts/application.html.erb',
50
51
  before: ' <%= csrf_meta_tags %>',
51
52
  content: indent(4, <<~ERB)
52
- <%= favicon_link_tag 'favicon.ico' %>
53
- <%= favicon_link_tag 'apple-touch-icon.png',
54
- rel: 'apple-touch-icon', type: 'image/png' %>
53
+ <%= favicon_link_tag 'favicon.ico' %>
54
+ <%= favicon_link_tag 'apple-touch-icon.png',
55
+ rel: 'apple-touch-icon', type: 'image/png' %>
55
56
  ERB
56
57
  end
57
58
 
@@ -84,6 +85,11 @@ module ThreddedCreateApp
84
85
  def add_i18n
85
86
  copy_template 'setup_app_skeleton/en.yml.erb',
86
87
  'config/locales/en.yml'
88
+ inject_into_file'config/application.rb',
89
+ before: / *end\nend\n\z/,
90
+ content: indent(4, <<~'RUBY')
91
+ config.i18n.available_locales = %w(en)
92
+ RUBY
87
93
  end
88
94
 
89
95
  def add_app_layout # rubocop:disable Metrics/MethodLength
@@ -140,7 +146,7 @@ module ThreddedCreateApp
140
146
  inject_into_file 'config/routes.rb',
141
147
  before: /^\s*mount Thredded::Engine/,
142
148
  content: indent(2, <<~'RUBY')
143
- resources :users, only: [:show]
149
+ resources :users, only: [:show]
144
150
  RUBY
145
151
  end
146
152
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'thredded_create_app/tasks/base'
3
4
  module ThreddedCreateApp
4
5
  module Tasks
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module ThreddedCreateApp
3
- VERSION = '0.1.11'
4
+ VERSION = '0.1.12'
4
5
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'thredded_create_app/version'
3
4
 
4
5
  module ThreddedCreateApp
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thredded_create_app
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gleb Mazovetskiy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-12 00:00:00.000000000 Z
11
+ date: 2017-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: term-ansicolor
@@ -114,9 +114,13 @@ files:
114
114
  - lib/thredded_create_app/tasks/add_display_name_to_users.rb
115
115
  - lib/thredded_create_app/tasks/add_display_name_to_users/add_display_name_to_users.rb
116
116
  - lib/thredded_create_app/tasks/add_memcached_support.rb
117
+ - lib/thredded_create_app/tasks/add_rails_email_preview.rb
118
+ - lib/thredded_create_app/tasks/add_rails_email_preview/_rails_email_preview-custom.scss
119
+ - lib/thredded_create_app/tasks/add_roadie.rb
117
120
  - lib/thredded_create_app/tasks/add_simple_form.rb
118
121
  - lib/thredded_create_app/tasks/add_thredded.rb
119
- - lib/thredded_create_app/tasks/add_thredded/_myapp-thredded.scss
122
+ - lib/thredded_create_app/tasks/add_thredded/_thredded-custom.scss
123
+ - lib/thredded_create_app/tasks/add_thredded/_thredded-variables.scss
120
124
  - lib/thredded_create_app/tasks/add_thredded/add_admin_to_users.rb
121
125
  - lib/thredded_create_app/tasks/add_thredded/myapp_thredded.js
122
126
  - lib/thredded_create_app/tasks/add_thredded/spec/features/thredded_spec.rb
@@ -171,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
171
175
  version: '0'
172
176
  requirements: []
173
177
  rubyforge_project:
174
- rubygems_version: 2.6.10
178
+ rubygems_version: 2.6.11
175
179
  signing_key:
176
180
  specification_version: 4
177
181
  summary: Rails app generator for Thredded.