onotole 1.2.9 → 1.2.10
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.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/goodies/form_builder_extension.md +27 -0
- data/goodies/seeds_organization.md +2 -0
- data/goodies/tests_speed_up_hack.md +2 -0
- data/lib/onotole/add_user_gems/before_bundle_patch.rb +9 -5
- data/lib/onotole/add_user_gems/edit_menu_questions.rb +21 -20
- data/lib/onotole/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ec30876887c33df594cb2c08d5666ef22d50d7a
|
4
|
+
data.tar.gz: f7f20671fed43c2df1b61a0999695c8abf58984d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9160c733cadb3d78e844e2bd13111000049f2b17e0ffe472fd953ebf12a10b4bf53925a8fa169f352f92760e7b5435ae891e59f21af5bfffefa84239a08ac6c7
|
7
|
+
data.tar.gz: 6accac85e3d7052b1eca2ceaca961038efdc08d873114253e3a9ff0253535456af5eab881150e0cd927acd4e2b5803934e1f8b47ae385efb614dee0f900c686b
|
data/README.md
CHANGED
@@ -154,6 +154,8 @@ it through a dream. http://mailcatcher.me
|
|
154
154
|
support (awesome performance graphics)
|
155
155
|
* [stackprof](https://github.com/tmm1/stackprof) A sampling call-stack profiler
|
156
156
|
for ruby 2.1+
|
157
|
+
* [active_record_doctor](https://github.com/gregnavis/active_record_doctor)
|
158
|
+
Active Record Doctor helps to index unindexed foreign keys
|
157
159
|
|
158
160
|
|
159
161
|
#### Misc
|
@@ -0,0 +1,27 @@
|
|
1
|
+
## Custom FormBuilder methods
|
2
|
+
|
3
|
+
In some moment you may catch yourself on understanding breaking DRY principles,
|
4
|
+
when you make you views. Some functionality can be easily moved to helpers, some
|
5
|
+
may be beautify by `Formtastic` or `SimpleForm`, but some stuff anyway will be
|
6
|
+
undone, like adding some default classes to your forms or buttons or making
|
7
|
+
some own form methods. I'll implement in `Onotole` root for `FormBuilder`
|
8
|
+
methods at `app/helpers/`, so now it is easy to extend. Here I post some chunk
|
9
|
+
of code, like example:
|
10
|
+
|
11
|
+
```
|
12
|
+
class FormBuilderExtension < ActionView::Helpers::FormBuilder
|
13
|
+
|
14
|
+
delegate :select_tag, to: :@template
|
15
|
+
delegate :options_for_select, to: :@template
|
16
|
+
|
17
|
+
|
18
|
+
def select_for_user field, select_options, user
|
19
|
+
selected = user ? user.send(field) : ''
|
20
|
+
options = options_for_select( select_options, selected: selected)
|
21
|
+
select_tag field, options, include_blank: I18n.t("activerecord.attributes.user.#{field}")
|
22
|
+
end
|
23
|
+
end
|
24
|
+
```
|
25
|
+
|
26
|
+
also, this [article](http://likeawritingdesk.com/posts/very-custom-form-builders-in-rails/)
|
27
|
+
will be very useful for digging deeper
|
@@ -1,3 +1,5 @@
|
|
1
|
+
## Make RSpec faster
|
2
|
+
|
1
3
|
There are 2 tricky methods to speed up your tests in Onotole. It made up to 25%
|
2
4
|
boost. At first you need to disable logging in tests (usually you do not read
|
3
5
|
it). [see](http://blog.plataformatec.com.br/2011/12/three-tips-to-improve-the-performance-of-your-test-suite/)
|
@@ -283,8 +283,8 @@ module Onotole
|
|
283
283
|
end
|
284
284
|
|
285
285
|
def add_image_optim_gem
|
286
|
-
inject_into_file('Gemfile', "\
|
287
|
-
inject_into_file('Gemfile', "\
|
286
|
+
inject_into_file('Gemfile', "\n gem 'image_optim_pack'", after: 'group :development do')
|
287
|
+
inject_into_file('Gemfile', "\n gem 'image_optim'", after: 'group :development do')
|
288
288
|
end
|
289
289
|
|
290
290
|
def add_mailcatcher_gem
|
@@ -309,11 +309,11 @@ module Onotole
|
|
309
309
|
end
|
310
310
|
|
311
311
|
def add_flamegraph_gem
|
312
|
-
inject_into_file('Gemfile', "\
|
312
|
+
inject_into_file('Gemfile', "\n gem 'flamegraph'", after: 'group :development do')
|
313
313
|
end
|
314
314
|
|
315
315
|
def add_stackprof_gem
|
316
|
-
inject_into_file('Gemfile', "\
|
316
|
+
inject_into_file('Gemfile', "\n gem 'stackprof'", after: 'group :development do')
|
317
317
|
end
|
318
318
|
|
319
319
|
def add_redis_gem
|
@@ -340,11 +340,15 @@ module Onotole
|
|
340
340
|
end
|
341
341
|
|
342
342
|
def add_sitemap_generator_gem
|
343
|
-
inject_into_file('Gemfile', "\
|
343
|
+
inject_into_file('Gemfile', "\n gem 'sitemap_generator', :require => false", after: 'group :development do')
|
344
344
|
end
|
345
345
|
|
346
346
|
def add_materialize_sass_gem
|
347
347
|
inject_into_file('Gemfile', "\ngem 'materialize-sass'", after: '# user_choice')
|
348
348
|
end
|
349
|
+
|
350
|
+
def add_active_record_doctor_gem
|
351
|
+
inject_into_file('Gemfile', "\n gem 'active_record_doctor'", after: 'group :development do')
|
352
|
+
end
|
349
353
|
end
|
350
354
|
end
|
@@ -73,27 +73,28 @@ module Onotole
|
|
73
73
|
end
|
74
74
|
|
75
75
|
def choose_develoder_tools
|
76
|
-
variants = { none:
|
77
|
-
faker:
|
78
|
-
rubocop:
|
79
|
-
rubycritic:
|
80
|
-
guard:
|
81
|
-
guard_rubocop:
|
82
|
-
bundler_audit:
|
83
|
-
airbrake:
|
84
|
-
annotate:
|
85
|
-
overcommit:
|
86
|
-
railroady:
|
87
|
-
hirbunicode:
|
88
|
-
dotenv_heroku:
|
89
|
-
image_optim:
|
90
|
-
mailcatcher:
|
91
|
-
rack_mini_profiler:
|
92
|
-
flamegraph:
|
93
|
-
stackprof:
|
94
|
-
meta_request:
|
76
|
+
variants = { none: 'None',
|
77
|
+
faker: 'Gem for generate fake data in testing',
|
78
|
+
rubocop: 'Code inspector and code formatting tool',
|
79
|
+
rubycritic: 'A Ruby code quality reporter',
|
80
|
+
guard: 'Guard (with RSpec, livereload, rails, migrate, bundler)',
|
81
|
+
guard_rubocop: 'Auto-declare code miss in guard',
|
82
|
+
bundler_audit: 'Extra possibilities for gems version control',
|
83
|
+
airbrake: 'Airbrake error logging',
|
84
|
+
annotate: 'Annotate Rails classes with schema and routes info',
|
85
|
+
overcommit: 'A fully configurable and extendable Git hook manager',
|
86
|
+
railroady: 'Model and controller UML class diagram generator',
|
87
|
+
hirbunicode: 'Hirb unicode support',
|
88
|
+
dotenv_heroku: 'dotenv-heroku support',
|
89
|
+
image_optim: 'Optimize images (jpeg, png, gif, svg) using external utilities',
|
90
|
+
mailcatcher: 'Catches mail and serves it through a dream. http://mailcatcher.me',
|
91
|
+
rack_mini_profiler: 'Middleware that displays speed badge for every html page.',
|
92
|
+
flamegraph: 'Rack_mini_profiler awesome graphics generator. Need stackprof gem',
|
93
|
+
stackprof: 'A sampling call-stack profiler for ruby 2.1+',
|
94
|
+
meta_request: 'Rails meta panel in chrome console.'\
|
95
95
|
" Very usefull in\n#{' ' * 24}AJAX debugging. Link for chrome"\
|
96
|
-
" add-on in Gemfile.\n#{' ' * 24}Do not delete comments if you need this link"
|
96
|
+
" add-on in Gemfile.\n#{' ' * 24}Do not delete comments if you need this link",
|
97
|
+
active_record_doctor: 'Active Record Doctor helps to index unindexed foreign keys'
|
97
98
|
}
|
98
99
|
multiple_choice('Write numbers of all preferred gems.', variants).each do |gem|
|
99
100
|
add_to_user_choise gem
|
data/lib/onotole/version.rb
CHANGED
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.2.
|
4
|
+
version: 1.2.10
|
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-05-
|
12
|
+
date: 2016-05-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -85,6 +85,7 @@ files:
|
|
85
85
|
- bin/setup
|
86
86
|
- bin/t
|
87
87
|
- goodies/custom_404_and_others_in_1_minute.md
|
88
|
+
- goodies/form_builder_extension.md
|
88
89
|
- goodies/mailcatcher_loading_patch.md
|
89
90
|
- goodies/seeds_organization.md
|
90
91
|
- goodies/tests_speed_up_hack.md
|