onotole 1.0.6 → 1.0.7

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: 2c4e5ff618f59d204c81a9cb49cfe976f7fb72f8
4
- data.tar.gz: 3496e8d1ecf92daf05e09cf6ca41e4956a29f350
3
+ metadata.gz: 94dbbef24ca6b52a5608611340f959fa47ac95a9
4
+ data.tar.gz: b2be95f0998cee6a2162f7c87bbb283f91409a9e
5
5
  SHA512:
6
- metadata.gz: 743b9c67aa65f211fa5ff93321d605c0eceaa48286dac7ffff5ab118d75a7a55a8a54a8097120a947dd2e7696396cc27a6b14df89beb90b5322ab5c7b2f50d6f
7
- data.tar.gz: 4672390c520bb254b4386ec33087f5f3690d99aae4784ee84784b521c724fcde3586e3e048d143e6fb414469c6b5422d9f88f4ca48a02c124fa5d01851af4948
6
+ metadata.gz: fca27009eb5b768115a7812cd140aa60961a00fba9adf6ab85527c5e9b7ae1e9740aef4d07a470a111b80a5d45231c665f301ead851e8c3392de9f7bff7da09e
7
+ data.tar.gz: 226325a5bc37b4d5fa76effb22a844bbafaab9b7b0fab760e482f0444a4a760a30dc7d53008deeb15d4fca2f07d5cbe02649dfaeb636081acf9879a9178fdc6e
data/README.md CHANGED
@@ -75,6 +75,7 @@ pack will not be installed with any gem option.
75
75
  creating elegant backends for website administration.
76
76
  * `*`[rubycritic](https://github.com/whitesmith/rubycritic) A Ruby code quality
77
77
  reporter
78
+ * [railroady](https://github.com/preston/railroady) Model and controller UML class diagram generator. Originally based on the "railroad" plugin
78
79
 
79
80
 
80
81
  Mandatory installation gem list you will find in `Gemfile` section
@@ -187,5 +187,10 @@ module Onotole
187
187
  inject_into_file('Gemfile', "\n gem 'rubycritic', :require => false",
188
188
  after: 'group :development do')
189
189
  end
190
+
191
+ def add_railroady_gem
192
+ inject_into_file('Gemfile', "\n gem 'railroady', :require => false",
193
+ after: 'group :development do')
194
+ end
190
195
  end
191
196
  end
@@ -53,6 +53,7 @@ module Onotole
53
53
  annotate: 'Annotate Rails classes with schema and routes info',
54
54
  overcommit: 'A fully configurable and extendable Git hook manager',
55
55
  activerecord_import: 'A library for bulk inserting data using ActiveRecord.',
56
+ railroady: 'Model and controller UML class diagram generator.',
56
57
  meta_request: 'Rails meta panel in chrome console.'\
57
58
  " Very usefull in\n#{' ' * 24}AJAX debugging. Link for chrome"\
58
59
  " add-on in Gemfile.\n#{' ' * 24}Do not delete comments if you need this link"
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+ module Onotole
3
+ module Goodbye
4
+ def show_goodbye_message
5
+ github_check
6
+ airbrake_check
7
+ graphviz_check
8
+ say_color BOLDGREEN, "Congratulations! Onotole gives you: 'Intellect+= 1'"
9
+ end
10
+
11
+ def github_check
12
+ return unless user_choose? :create_github_repo
13
+ say_color BOLDGREEN, "You can 'git push -u origin master' to your new repo
14
+ #{app_name} or check log for errors"
15
+ end
16
+
17
+ def graphviz_check
18
+ return unless user_choose?(:railroady)
19
+ return if system('dot -? > /dev/null && neato -? > /dev/null')
20
+ say_color YELLOW, 'Install graphviz for Railroady gem'
21
+ end
22
+
23
+ def airbrake_check
24
+ return unless user_choose? :airbrake
25
+ say_color YELLOW, "Remember to run 'rails generate airbrake' with your API key."
26
+ end
27
+ end
28
+ end
@@ -1,13 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  require 'forwardable'
3
- require 'onotole/add_user_gems/user_gems_menu_questions'
4
- require 'onotole/add_user_gems/edit_menu_questions'
5
- require 'onotole/add_user_gems/before_bundle_patch'
6
- require 'onotole/add_user_gems/after_install_patch'
7
- require 'onotole/helpers'
8
- require 'onotole/git'
9
- require 'onotole/tests'
10
- require 'onotole/mail'
3
+ # require 'pry'
4
+ Dir['lib/onotole/**/*.rb'].each { |file| require file.slice(4..-4) }
11
5
 
12
6
  module Onotole
13
7
  class AppBuilder < Rails::AppBuilder
@@ -20,6 +14,8 @@ module Onotole
20
14
  include Onotole::Git
21
15
  include Onotole::Tests
22
16
  include Onotole::Mail
17
+ include Onotole::Goodbye
18
+ include Onotole::FrontendDefault
23
19
  extend Forwardable
24
20
 
25
21
  @use_asset_pipelline = true
@@ -49,11 +45,6 @@ module Onotole
49
45
  template 'README.md.erb', 'README.md'
50
46
  end
51
47
 
52
- def raise_on_delivery_errors
53
- replace_in_file 'config/environments/development.rb',
54
- 'raise_delivery_errors = false', 'raise_delivery_errors = true'
55
- end
56
-
57
48
  def add_bullet_gem_configuration
58
49
  config = <<-RUBY
59
50
  config.after_initialize do
@@ -76,11 +67,6 @@ module Onotole
76
67
  inject_into_class 'config/application.rb', 'Application', config
77
68
  end
78
69
 
79
- def configure_quiet_assets
80
- config = "\n config.quiet_assets = true\n"
81
- inject_into_class 'config/application.rb', 'Application', config
82
- end
83
-
84
70
  def provide_setup_script
85
71
  template 'bin_setup', 'bin/setup', force: true
86
72
  run 'chmod a+x bin/setup'
@@ -130,22 +116,6 @@ module Onotole
130
116
  )
131
117
  end
132
118
 
133
- def setup_asset_host
134
- replace_in_file 'config/environments/production.rb',
135
- "# config.action_controller.asset_host = 'http://assets.example.com'",
136
- 'config.action_controller.asset_host = ENV.fetch("ASSET_HOST", ENV.fetch("APPLICATION_HOST"))'
137
-
138
- replace_in_file 'config/initializers/assets.rb',
139
- "config.assets.version = '1.0'",
140
- 'config.assets.version = (ENV["ASSETS_VERSION"] || "1.0")'
141
-
142
- inject_into_file(
143
- 'config/environments/production.rb',
144
- ' config.static_cache_control = "public, max-age=#{1.year.to_i}"',
145
- after: serve_static_files_line
146
- )
147
- end
148
-
149
119
  def setup_staging_environment
150
120
  staging_file = 'config/environments/staging.rb'
151
121
  copy_file 'staging.rb', staging_file
@@ -168,25 +138,10 @@ end
168
138
  remove_file 'config/initializers/wrap_parameters.rb'
169
139
  end
170
140
 
171
- def create_partials_directory
172
- empty_directory 'app/views/application'
173
- end
174
-
175
- def create_shared_flashes
176
- copy_file '_flashes.html.erb', 'app/views/application/_flashes.html.erb'
177
- copy_file 'flashes_helper.rb', 'app/helpers/flashes_helper.rb'
178
- end
179
-
180
141
  def create_shared_javascripts
181
142
  copy_file '_javascript.html.erb', 'app/views/application/_javascript.html.erb'
182
143
  end
183
144
 
184
- def create_application_layout
185
- template 'onotole_layout.html.erb.erb',
186
- 'app/views/layouts/application.html.erb',
187
- force: true
188
- end
189
-
190
145
  def use_postgres_config_template
191
146
  template 'postgresql_database.yml.erb', 'config/database.yml',
192
147
  force: true
@@ -258,22 +213,12 @@ end
258
213
  copy_file 'Procfile', 'Procfile'
259
214
  end
260
215
 
261
- def setup_stylesheets
262
- remove_file 'app/assets/stylesheets/application.css'
263
- copy_file 'application.scss',
264
- 'app/assets/stylesheets/application.scss'
265
- end
266
-
267
216
  def install_refills
268
217
  rails_generator 'refills:import flashes'
269
218
  run 'rm app/views/refills/_flashes.html.erb'
270
219
  run 'rmdir app/views/refills'
271
220
  end
272
221
 
273
- def install_bitters
274
- bundle_command 'exec bitters install --path app/assets/stylesheets'
275
- end
276
-
277
222
  def copy_dotfiles
278
223
  directory 'dotfiles', '.', force: true
279
224
  end
@@ -313,11 +258,6 @@ you can deploy to staging and production with:
313
258
  append_file 'circle.yml', deploy_command
314
259
  end
315
260
 
316
- def setup_segment
317
- copy_file '_analytics.html.erb',
318
- 'app/views/application/_analytics.html.erb'
319
- end
320
-
321
261
  def setup_spring
322
262
  bundle_command 'exec spring binstub --all'
323
263
  bundle_command 'exec spring stop'
@@ -329,19 +269,6 @@ you can deploy to staging and production with:
329
269
  copy_file 'json_encoding.rb', 'config/initializers/json_encoding.rb'
330
270
  end
331
271
 
332
- def customize_error_pages
333
- meta_tags = <<-EOS
334
- <meta charset="utf-8" />
335
- <meta name="ROBOTS" content="NOODP" />
336
- <meta name="viewport" content="initial-scale=1" />
337
- EOS
338
-
339
- %w(500 404 422).each do |page|
340
- inject_into_file "public/#{page}.html", meta_tags, after: "<head>\n"
341
- replace_in_file "public/#{page}.html", /<!--.+-->\n/, ''
342
- end
343
- end
344
-
345
272
  def remove_config_comment_lines
346
273
  config_files = [
347
274
  'application.rb',
@@ -402,19 +329,11 @@ end
402
329
  add_user_gems
403
330
  end
404
331
 
405
- def show_goodbye_message
406
- say_color BOLDGREEN, "Congratulations! Onotole gives you: 'Intellect+= 1'"
407
- say_color BOLDGREEN, "You can 'git push -u origin master' to your new repo
408
- #{app_name} or check log for errors" if user_choose? :create_github_repo
409
- say_color YELLOW, "Remember to run 'rails generate airbrake' with your API key." if user_choose? :airbrake
410
- end
411
-
412
332
  def delete_comments
413
- if options[:clean_comments] || user_choose?(:clean_comments)
414
- cleanup_comments 'Gemfile'
415
- remove_config_comment_lines
416
- remove_routes_comment_lines
417
- end
333
+ return unless options[:clean_comments] || user_choose?(:clean_comments)
334
+ cleanup_comments 'Gemfile'
335
+ remove_config_comment_lines
336
+ remove_routes_comment_lines
418
337
  end
419
338
 
420
339
  def prevent_double_usage
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+ module Onotole
3
+ module FrontendDefault
4
+ def configure_quiet_assets
5
+ config = "\n config.quiet_assets = true\n"
6
+ inject_into_class 'config/application.rb', 'Application', config
7
+ end
8
+
9
+ def setup_asset_host
10
+ replace_in_file 'config/environments/production.rb',
11
+ "# config.action_controller.asset_host = 'http://assets.example.com'",
12
+ 'config.action_controller.asset_host = ENV.fetch("ASSET_HOST", ENV.fetch("APPLICATION_HOST"))'
13
+
14
+ replace_in_file 'config/initializers/assets.rb',
15
+ "config.assets.version = '1.0'",
16
+ 'config.assets.version = (ENV["ASSETS_VERSION"] || "1.0")'
17
+
18
+ inject_into_file(
19
+ 'config/environments/production.rb',
20
+ ' config.static_cache_control = "public, max-age=#{1.year.to_i}"',
21
+ after: serve_static_files_line
22
+ )
23
+ end
24
+
25
+ def create_shared_flashes
26
+ copy_file '_flashes.html.erb', 'app/views/application/_flashes.html.erb'
27
+ copy_file 'flashes_helper.rb', 'app/helpers/flashes_helper.rb'
28
+ end
29
+
30
+ def create_application_layout
31
+ template 'onotole_layout.html.erb.erb',
32
+ 'app/views/layouts/application.html.erb',
33
+ force: true
34
+ end
35
+
36
+ def setup_stylesheets
37
+ remove_file 'app/assets/stylesheets/application.css'
38
+ copy_file 'application.scss',
39
+ 'app/assets/stylesheets/application.scss'
40
+ end
41
+
42
+ def install_bitters
43
+ bundle_command 'exec bitters install --path app/assets/stylesheets'
44
+ end
45
+
46
+ def customize_error_pages
47
+ meta_tags = <<-EOS
48
+ <meta charset="utf-8" />
49
+ <meta name="ROBOTS" content="NOODP" />
50
+ <meta name="viewport" content="initial-scale=1" />
51
+ EOS
52
+
53
+ %w(500 404 422).each do |page|
54
+ inject_into_file "public/#{page}.html", meta_tags, after: "<head>\n"
55
+ replace_in_file "public/#{page}.html", /<!--.+-->\n/, ''
56
+ end
57
+ end
58
+
59
+ def setup_segment
60
+ copy_file '_analytics.html.erb',
61
+ 'app/views/application/_analytics.html.erb'
62
+ end
63
+
64
+ def create_partials_directory
65
+ empty_directory 'app/views/application'
66
+ end
67
+ end
68
+ end
@@ -121,7 +121,8 @@ module Onotole
121
121
  end
122
122
 
123
123
  def clean_by_rubocop
124
- bundle_command 'exec rubocop --auto-correct' if user_choose?(:rubocop)
124
+ return unless user_choose?(:rubocop)
125
+ bundle_command 'exec rubocop --auto-correct'
125
126
  end
126
127
  end
127
128
  end
data/lib/onotole/mail.rb CHANGED
@@ -34,5 +34,10 @@ module Onotole
34
34
  after: 'config.action_mailer.raise_delivery_errors = true'
35
35
  )
36
36
  end
37
+
38
+ def raise_on_delivery_errors
39
+ replace_in_file 'config/environments/development.rb',
40
+ 'raise_delivery_errors = false', 'raise_delivery_errors = true'
41
+ end
37
42
  end
38
43
  end
data/lib/onotole/tests.rb CHANGED
@@ -13,7 +13,7 @@ module Onotole
13
13
  run "mkdir #{dir}"
14
14
  run "touch #{dir}/.keep"
15
15
  end
16
- bundle_command 'exec rails generate rspec:install'
16
+ rails_generator 'rspec:install'
17
17
  end
18
18
 
19
19
  def configure_capybara_webkit
@@ -2,5 +2,5 @@
2
2
  module Onotole
3
3
  RAILS_VERSION = '~> 4.2.0'
4
4
  RUBY_VERSION = IO.read("#{File.dirname(__FILE__)}/../../.ruby-version").strip
5
- VERSION = '1.0.6'
5
+ VERSION = '1.0.7'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onotole
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - kvokka
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-02-12 00:00:00.000000000 Z
12
+ date: 2016-02-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -86,9 +86,11 @@ files:
86
86
  - lib/onotole/add_user_gems/after_install_patch.rb
87
87
  - lib/onotole/add_user_gems/before_bundle_patch.rb
88
88
  - lib/onotole/add_user_gems/edit_menu_questions.rb
89
+ - lib/onotole/add_user_gems/goodbye_message.rb
89
90
  - lib/onotole/add_user_gems/user_gems_menu_questions.rb
90
91
  - lib/onotole/app_builder.rb
91
92
  - lib/onotole/colors.rb
93
+ - lib/onotole/frontend_default.rb
92
94
  - lib/onotole/generators/app_generator.rb
93
95
  - lib/onotole/git.rb
94
96
  - lib/onotole/helpers.rb