active_leonardo 0.6.1 → 0.7.0
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/CHANGELOG.md +7 -0
- data/README.md +45 -1
- data/active_template.rb +2 -3
- data/lib/generators/leolay/leolay_generator.rb +4 -4
- data/lib/generators/leolay/templates/config/locales/devise.it.yml +57 -57
- data/lib/generators/leolay/templates/config/locales/en.yml +229 -229
- data/lib/generators/leolay/templates/styles/active/stylesheets/app/{_enviroment.css.scss → _enviroment.scss} +0 -0
- data/lib/generators/leolay/templates/styles/active/stylesheets/app/{custom_active_admin.css.scss → custom_active_admin.scss} +4 -0
- data/lib/generators/leolay/templates/styles/active/stylesheets/app/{stylesheet.css.scss → stylesheet.scss} +0 -0
- data/lib/generators/leosca/massive_generator.rb +86 -0
- data/lib/generators/rails/leosca_controller/leosca_controller_generator.rb +39 -34
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ed1b7e0a9371e0891efc8975e0b73cc63932c72
|
4
|
+
data.tar.gz: bea921b9be90778fb47dc2d868da9af91ba8c8c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de5bb6c9ddfc1fe7059dc42b27ee4f26213ef31789b0832a455212a128cdc77949dd6cbf85db055447d50a8a78f0930fe78f7e279ddc89f897333eb456af859b
|
7
|
+
data.tar.gz: c4aab0fbaf1450a0a40a5b32767b91dee1f772290019975bc8a31885aeb606ef9602441fb0925c7f61f0c8aab055d12039230edef151c2131e73929b82cc42eb
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
0.7.0 [☰](https://github.com/marcomd/Active_Leonardo/compare/v0.6.1...v0.7.0) February 16th, 2016
|
2
|
+
------------------------------
|
3
|
+
* resources are now being created with dsl activeadmin like boilerplate parameter
|
4
|
+
* new generator leosca:massive to create multiple resources from scaffold.txt file, check the documentation for more details
|
5
|
+
* improved the documentation
|
6
|
+
* several little improvements
|
7
|
+
|
1
8
|
0.6.1 [☰](https://github.com/marcomd/Active_Leonardo/compare/v0.6.0...v0.6.1) February 9th, 2016
|
2
9
|
------------------------------
|
3
10
|
* Removed Rails 3.2 from tests
|
data/README.md
CHANGED
@@ -13,7 +13,7 @@ This version has been tested on Rails `3.2` to `5.0.beta2` and Ruby `1.9.3`+ on
|
|
13
13
|
For previous version go to the bottom of this read me.
|
14
14
|
Click on Travis badge for more details.
|
15
15
|
|
16
|
-
**
|
16
|
+
**Rails `3.2` and Ruby <= `2.2.2` tested until 0.6.x version**
|
17
17
|
|
18
18
|
|
19
19
|
## Install
|
@@ -155,6 +155,50 @@ if you made a mistake and want to start from scratch just replace generate with
|
|
155
155
|
|
156
156
|
Of course, these options are in addition to those provided by the original scaffold
|
157
157
|
|
158
|
+
### Massive resources generation's
|
159
|
+
|
160
|
+
Write the resources you want to generate into the file scaffold.txt in the root app.
|
161
|
+
A line for every resource, starting from the beginning with the name as you would with the scaffold.
|
162
|
+
If the line is not a resource but another generator, you can simply starting with the full rails command.
|
163
|
+
Example:
|
164
|
+
|
165
|
+
# This is the main resource... i think
|
166
|
+
activity user:references name:string{100} body:text completed:boolean percentage_progression:integer{1}
|
167
|
+
#completed: when all tasks are completed
|
168
|
+
# Any other comments about fields
|
169
|
+
|
170
|
+
# This table acts as...
|
171
|
+
task user:references activity:references name:string{100} body:text completed:boolean percentage_progression:integer{1} deadline_date:date
|
172
|
+
|
173
|
+
# I decided to add this because...
|
174
|
+
rails g migration AddFooToActivity foo:boolean
|
175
|
+
|
176
|
+
# I need this because...
|
177
|
+
rails g migration AddBarToTask bar:boolean
|
178
|
+
|
179
|
+
|
180
|
+
then let active leonardo work for you:
|
181
|
+
|
182
|
+
rails generate leosca:massive
|
183
|
+
|
184
|
+
and check the report:
|
185
|
+
|
186
|
+
create ...
|
187
|
+
insert ...
|
188
|
+
append ...
|
189
|
+
etc ...
|
190
|
+
---------------------------------------------
|
191
|
+
Generations started at 18:07:45
|
192
|
+
18:07:46 - generations ended in 1 second(s)
|
193
|
+
4 generations executed
|
194
|
+
9 lines discarded (comments etc.)
|
195
|
+
---------------------------------------------
|
196
|
+
|
197
|
+
of course you can even revert:
|
198
|
+
|
199
|
+
rails destroy leosca:massive
|
200
|
+
|
201
|
+
This is very useful for a rapid prototyping and if you keep it updated you can use it as information center about the database.
|
158
202
|
|
159
203
|
### Available layout
|
160
204
|
|
data/active_template.rb
CHANGED
@@ -49,8 +49,7 @@ if use_git
|
|
49
49
|
EOS
|
50
50
|
end
|
51
51
|
|
52
|
-
|
53
|
-
gem 'activeadmin', git: 'https://github.com/activeadmin/activeadmin', branch: 'rails-5-rspec'
|
52
|
+
gem 'activeadmin', git: 'https://github.com/activeadmin/activeadmin'
|
54
53
|
|
55
54
|
if test_mode
|
56
55
|
gem "active_leonardo", path: "../../."
|
@@ -95,7 +94,7 @@ if authentication
|
|
95
94
|
p stdout
|
96
95
|
end
|
97
96
|
if /^5/ === rails_version
|
98
|
-
gem "devise", git: "https://github.com/plataformatec/devise
|
97
|
+
gem "devise", git: "https://github.com/plataformatec/devise"
|
99
98
|
else
|
100
99
|
gem "devise"
|
101
100
|
end
|
@@ -18,9 +18,9 @@ class LeolayGenerator < Rails::Generators::Base
|
|
18
18
|
class_option :verbose, :type => :boolean, :default => true, :desc => "Run interactive mode"
|
19
19
|
|
20
20
|
def generate_layout
|
21
|
-
template "styles/#{style_name}/stylesheets/app/stylesheet.
|
22
|
-
template "styles/#{style_name}/stylesheets/app/custom_active_admin.
|
23
|
-
template "styles/#{style_name}/stylesheets/app/_enviroment.
|
21
|
+
template "styles/#{style_name}/stylesheets/app/stylesheet.scss", "app/assets/stylesheets/#{style_name}.scss"
|
22
|
+
template "styles/#{style_name}/stylesheets/app/custom_active_admin.scss", "app/assets/stylesheets/custom_active_admin.scss"
|
23
|
+
template "styles/#{style_name}/stylesheets/app/_enviroment.scss", "app/assets/stylesheets/_enviroment.scss"
|
24
24
|
|
25
25
|
copy_file "app/helpers/layout_helper.rb", "app/helpers/layout_helper.rb", :force => !options.verbose?
|
26
26
|
directory "styles/#{style_name}/images", "app/assets/images/styles/#{style_name}", :force => !options.verbose?
|
@@ -279,7 +279,7 @@ class LeolayGenerator < Rails::Generators::Base
|
|
279
279
|
end
|
280
280
|
|
281
281
|
|
282
|
-
file = "app/assets/stylesheets/active_admin.
|
282
|
+
file = "app/assets/stylesheets/active_admin.scss"
|
283
283
|
append_file file do
|
284
284
|
<<-FILE.gsub(/^ /, '')
|
285
285
|
|
@@ -1,58 +1,58 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
it:
|
4
|
-
devise:
|
5
|
-
confirmations:
|
6
|
-
confirmed: "Il tuo account è stato correttamente confermato. Ora sei collegato."
|
7
|
-
send_instructions: "Riceverai un messaggio email con le istruzioni per confermare il tuo account entro qualche minuto."
|
8
|
-
send_paranoid_instructions: "Se il tuo indirizzo email esiste nel nostro database, fra pochi minuti riceverai un link con le istruzioni per confermare il tuo account."
|
9
|
-
failure:
|
10
|
-
already_authenticated: "Sei già autenticato"
|
11
|
-
inactive: "Il tuo account non è stato ancora attivato."
|
12
|
-
invalid: "%{authentication_keys} o password non validi."
|
13
|
-
locked: "Il tuo account è bloccato."
|
14
|
-
last_attempt: "You have one more attempt before your account is locked."
|
15
|
-
not_found_in_database: "Invalid %{authentication_keys} or password."
|
16
|
-
timeout: "Sessione scaduta, accedere nuovamente per continuare."
|
17
|
-
unauthenticated: "Devi accedere o registrarti per continuare."
|
18
|
-
unconfirmed: "Devi confermare il tuo account per continuare."
|
19
|
-
mailer:
|
20
|
-
confirmation_instructions:
|
21
|
-
subject: "Istruzioni per la conferma"
|
22
|
-
reset_password_instructions:
|
23
|
-
subject: "Istruzioni per reimpostare la password"
|
24
|
-
unlock_instructions:
|
25
|
-
subject: "Istruzioni per sbloccare l'account"
|
26
|
-
omniauth_callbacks:
|
27
|
-
failure: "Non siamo riusciti ad autoruzzarti da %{kind} perchè '%{reason}'."
|
28
|
-
success: "Sei stato autorizzato dall'account di %{kind}."
|
29
|
-
passwords:
|
30
|
-
no_token: "Non è possibile accedere a questa pagina se non hai effettuato una reimpostazione della password in tal caso assicurati di aver usato l'URL completo fornito."
|
31
|
-
send_instructions: "Riceverai un messaggio email con le istruzioni per reimpostare la tua password entro qualche minuto."
|
32
|
-
send_paranoid_instructions: "Se il tuo indirizzo e-mail esiste nel nostro database, riceverai un link per il recupero della password."
|
33
|
-
updated: "La tua password è stata cambiata. Ora sei collegato."
|
34
|
-
updated_not_active: "La tua password è stata cambiata."
|
35
|
-
registrations:
|
36
|
-
signed_up: "Iscrizione correttamente eseguita."
|
37
|
-
signed_up_but_unconfirmed: "Un messaggio con il link di conferma è stato inviato al tuo indirizzo email. Dovresti cliccare su quel link per attivare il tuo account."
|
38
|
-
signed_up_but_inactive: "Ti sei registrato con successo. Tuttavia, non è stato possibile effettuare il login perché il tuo account non è ancora stato attivato."
|
39
|
-
signed_up_but_locked: "Ti sei registrato con successo. Tuttavia, non è stato possibile effettuare il login perché il tuo account è bloccato."
|
40
|
-
updated: "Il tuo account è stato aggiornato."
|
41
|
-
update_needs_confirmation: "È stato aggiornato il tuo account con successo, ma abbiamo bisogno di verificare il tuo nuovo indirizzo email. Controlla la tua email e clicca sul link per confermare il nuovo indirizzo email."
|
42
|
-
destroyed: "Arrivederci! L'account è stato cancellato. Speriamo di rivederti presto."
|
43
|
-
sessions:
|
44
|
-
signed_in: "Accesso effettuato con successo."
|
45
|
-
signed_out: "Sei uscito correttamente."
|
46
|
-
unlocks:
|
47
|
-
send_instructions: "Riceverai un messaggio email con le istruzioni per sbloccare il tuo account entro qualche minuto."
|
48
|
-
unlocked: "Il tuo account è stato correttamente sbloccato. Ora sei collegato."
|
49
|
-
send_paranoid_instructions: "Se il tuo indirizzo e-mail esiste nel nostro database, fra pochi minuti riceverai un link con le istruzioni per sbloccare il tuo account."
|
50
|
-
errors:
|
51
|
-
messages:
|
52
|
-
expired: "è scaduto ed è necessario richiederne uno nuovo"
|
53
|
-
not_found: "non trovato"
|
54
|
-
already_confirmed: "è già stato confermato, riprova a collegarti"
|
55
|
-
not_locked: "non era bloccato"
|
56
|
-
not_saved:
|
57
|
-
one: "un errore ha impedito il salvataggio di %{resource}:"
|
1
|
+
|
2
|
+
|
3
|
+
it:
|
4
|
+
devise:
|
5
|
+
confirmations:
|
6
|
+
confirmed: "Il tuo account è stato correttamente confermato. Ora sei collegato."
|
7
|
+
send_instructions: "Riceverai un messaggio email con le istruzioni per confermare il tuo account entro qualche minuto."
|
8
|
+
send_paranoid_instructions: "Se il tuo indirizzo email esiste nel nostro database, fra pochi minuti riceverai un link con le istruzioni per confermare il tuo account."
|
9
|
+
failure:
|
10
|
+
already_authenticated: "Sei già autenticato"
|
11
|
+
inactive: "Il tuo account non è stato ancora attivato."
|
12
|
+
invalid: "%{authentication_keys} o password non validi."
|
13
|
+
locked: "Il tuo account è bloccato."
|
14
|
+
last_attempt: "You have one more attempt before your account is locked."
|
15
|
+
not_found_in_database: "Invalid %{authentication_keys} or password."
|
16
|
+
timeout: "Sessione scaduta, accedere nuovamente per continuare."
|
17
|
+
unauthenticated: "Devi accedere o registrarti per continuare."
|
18
|
+
unconfirmed: "Devi confermare il tuo account per continuare."
|
19
|
+
mailer:
|
20
|
+
confirmation_instructions:
|
21
|
+
subject: "Istruzioni per la conferma"
|
22
|
+
reset_password_instructions:
|
23
|
+
subject: "Istruzioni per reimpostare la password"
|
24
|
+
unlock_instructions:
|
25
|
+
subject: "Istruzioni per sbloccare l'account"
|
26
|
+
omniauth_callbacks:
|
27
|
+
failure: "Non siamo riusciti ad autoruzzarti da %{kind} perchè '%{reason}'."
|
28
|
+
success: "Sei stato autorizzato dall'account di %{kind}."
|
29
|
+
passwords:
|
30
|
+
no_token: "Non è possibile accedere a questa pagina se non hai effettuato una reimpostazione della password in tal caso assicurati di aver usato l'URL completo fornito."
|
31
|
+
send_instructions: "Riceverai un messaggio email con le istruzioni per reimpostare la tua password entro qualche minuto."
|
32
|
+
send_paranoid_instructions: "Se il tuo indirizzo e-mail esiste nel nostro database, riceverai un link per il recupero della password."
|
33
|
+
updated: "La tua password è stata cambiata. Ora sei collegato."
|
34
|
+
updated_not_active: "La tua password è stata cambiata."
|
35
|
+
registrations:
|
36
|
+
signed_up: "Iscrizione correttamente eseguita."
|
37
|
+
signed_up_but_unconfirmed: "Un messaggio con il link di conferma è stato inviato al tuo indirizzo email. Dovresti cliccare su quel link per attivare il tuo account."
|
38
|
+
signed_up_but_inactive: "Ti sei registrato con successo. Tuttavia, non è stato possibile effettuare il login perché il tuo account non è ancora stato attivato."
|
39
|
+
signed_up_but_locked: "Ti sei registrato con successo. Tuttavia, non è stato possibile effettuare il login perché il tuo account è bloccato."
|
40
|
+
updated: "Il tuo account è stato aggiornato."
|
41
|
+
update_needs_confirmation: "È stato aggiornato il tuo account con successo, ma abbiamo bisogno di verificare il tuo nuovo indirizzo email. Controlla la tua email e clicca sul link per confermare il nuovo indirizzo email."
|
42
|
+
destroyed: "Arrivederci! L'account è stato cancellato. Speriamo di rivederti presto."
|
43
|
+
sessions:
|
44
|
+
signed_in: "Accesso effettuato con successo."
|
45
|
+
signed_out: "Sei uscito correttamente."
|
46
|
+
unlocks:
|
47
|
+
send_instructions: "Riceverai un messaggio email con le istruzioni per sbloccare il tuo account entro qualche minuto."
|
48
|
+
unlocked: "Il tuo account è stato correttamente sbloccato. Ora sei collegato."
|
49
|
+
send_paranoid_instructions: "Se il tuo indirizzo e-mail esiste nel nostro database, fra pochi minuti riceverai un link con le istruzioni per sbloccare il tuo account."
|
50
|
+
errors:
|
51
|
+
messages:
|
52
|
+
expired: "è scaduto ed è necessario richiederne uno nuovo"
|
53
|
+
not_found: "non trovato"
|
54
|
+
already_confirmed: "è già stato confermato, riprova a collegarti"
|
55
|
+
not_locked: "non era bloccato"
|
56
|
+
not_saved:
|
57
|
+
one: "un errore ha impedito il salvataggio di %{resource}:"
|
58
58
|
other: "%{count} errori hanno impedito il salvataggio di %{resource}:"
|
@@ -1,230 +1,230 @@
|
|
1
|
-
en:
|
2
|
-
date:
|
3
|
-
formats:
|
4
|
-
# Use the strftime parameters for formats.
|
5
|
-
# When no format has been given, it uses default.
|
6
|
-
# You can provide other formats here if you like!
|
7
|
-
default: "%d-%m-%Y"
|
8
|
-
short: "%d %b"
|
9
|
-
long: "%d %B %Y"
|
10
|
-
only_day: "%e"
|
11
|
-
day_names: [Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday]
|
12
|
-
abbr_day_names: [Sun, Mon, Tue, Wed, Thu, Fri, Sat]
|
13
|
-
# Don't forget the nil at the beginning; there's no such thing as a 0th month
|
14
|
-
month_names: [~, January, February, March, April, May, June, July, August, September, October, November, December]
|
15
|
-
abbr_month_names: [~, Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec]
|
16
|
-
# Used in date_select and datetime_select.
|
17
|
-
order:
|
18
|
-
- :year
|
19
|
-
- :month
|
20
|
-
- :day
|
21
|
-
time:
|
22
|
-
formats:
|
23
|
-
default: "%a, %d %b %Y %H:%M:%S %z"
|
24
|
-
short: "%d %b %H:%M"
|
25
|
-
long: "%B %d, %Y %H:%M"
|
26
|
-
am: "am"
|
27
|
-
pm: "pm"
|
28
|
-
# Used in array.to_sentence.
|
29
|
-
support:
|
30
|
-
array:
|
31
|
-
words_connector: ", "
|
32
|
-
two_words_connector: " and "
|
33
|
-
last_word_connector: ", and "
|
34
|
-
number:
|
35
|
-
# Used in number_with_delimiter()
|
36
|
-
# These are also the defaults for 'currency', 'percentage', 'precision', and 'human'
|
37
|
-
format:
|
38
|
-
# Sets the separator between the units, for more precision (e.g. 1.0 / 2.0 == 0.5)
|
39
|
-
separator: "."
|
40
|
-
# Delimits thousands (e.g. 1,000,000 is a million) (always in groups of three)
|
41
|
-
delimiter: ","
|
42
|
-
# Number of decimals, behind the separator (the number 1 with a precision of 2 gives: 1.00)
|
43
|
-
precision: 3
|
44
|
-
# If set to true, precision will mean the number of significant digits instead
|
45
|
-
# of the number of decimal digits (1234 with precision 2 becomes 1200, 1.23543 becomes 1.2)
|
46
|
-
significant: false
|
47
|
-
# If set, the zeros after the decimal separator will always be stripped (eg.: 1.200 will be 1.2)
|
48
|
-
strip_insignificant_zeros: false
|
49
|
-
|
50
|
-
# Used in number_to_currency()
|
51
|
-
currency:
|
52
|
-
format:
|
53
|
-
# Where is the currency sign? %u is the currency unit, %n the number (default: $5.00)
|
54
|
-
format: "%u %n"
|
55
|
-
unit: "$"
|
56
|
-
# These five are to override number.format and are optional
|
57
|
-
separator: "."
|
58
|
-
delimiter: ","
|
59
|
-
precision: 2
|
60
|
-
significant: false
|
61
|
-
strip_insignificant_zeros: false
|
62
|
-
|
63
|
-
# Used in number_to_percentage()
|
64
|
-
percentage:
|
65
|
-
format:
|
66
|
-
# These five are to override number.format and are optional
|
67
|
-
# separator:
|
68
|
-
delimiter: ""
|
69
|
-
# precision:
|
70
|
-
# significant: false
|
71
|
-
# strip_insignificant_zeros: false
|
72
|
-
|
73
|
-
# Used in number_to_precision()
|
74
|
-
precision:
|
75
|
-
format:
|
76
|
-
# These five are to override number.format and are optional
|
77
|
-
# separator:
|
78
|
-
delimiter: ""
|
79
|
-
# precision:
|
80
|
-
# significant: false
|
81
|
-
# strip_insignificant_zeros: false
|
82
|
-
|
83
|
-
# Used in number_to_human_size() and number_to_human()
|
84
|
-
human:
|
85
|
-
format:
|
86
|
-
# These five are to override number.format and are optional
|
87
|
-
# separator:
|
88
|
-
delimiter: ""
|
89
|
-
precision: 3
|
90
|
-
significant: true
|
91
|
-
strip_insignificant_zeros: true
|
92
|
-
# Used in number_to_human_size()
|
93
|
-
storage_units:
|
94
|
-
# Storage units output formatting.
|
95
|
-
# %u is the storage unit, %n is the number (default: 2 MB)
|
96
|
-
format: "%n %u"
|
97
|
-
units:
|
98
|
-
byte:
|
99
|
-
one: "Byte"
|
100
|
-
other: "Bytes"
|
101
|
-
kb: "KB"
|
102
|
-
mb: "MB"
|
103
|
-
gb: "GB"
|
104
|
-
tb: "TB"
|
105
|
-
# Used in number_to_human()
|
106
|
-
decimal_units:
|
107
|
-
format: "%n %u"
|
108
|
-
# Decimal units output formatting
|
109
|
-
# By default we will only quantify some of the exponents
|
110
|
-
# but the commented ones might be defined or overridden
|
111
|
-
# by the user.
|
112
|
-
units:
|
113
|
-
# femto: Quadrillionth
|
114
|
-
# pico: Trillionth
|
115
|
-
# nano: Billionth
|
116
|
-
# micro: Millionth
|
117
|
-
# mili: Thousandth
|
118
|
-
# centi: Hundredth
|
119
|
-
# deci: Tenth
|
120
|
-
unit: ""
|
121
|
-
# ten:
|
122
|
-
# one: Ten
|
123
|
-
# other: Tens
|
124
|
-
# hundred: Hundred
|
125
|
-
thousand: "Thousand"
|
126
|
-
million: "Million"
|
127
|
-
billion: "Billion"
|
128
|
-
trillion: "Trillion"
|
129
|
-
quadrillion: "Quadrillion"
|
130
|
-
|
131
|
-
# Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words()
|
132
|
-
datetime:
|
133
|
-
distance_in_words:
|
134
|
-
half_a_minute: "half a minute"
|
135
|
-
less_than_x_seconds:
|
136
|
-
one: "less than 1 second"
|
137
|
-
other: "less than %{count} seconds"
|
138
|
-
x_seconds:
|
139
|
-
one: "1 second"
|
140
|
-
other: "%{count} seconds"
|
141
|
-
less_than_x_minutes:
|
142
|
-
one: "less than a minute"
|
143
|
-
other: "less than %{count} minutes"
|
144
|
-
x_minutes:
|
145
|
-
one: "1 minute"
|
146
|
-
other: "%{count} minutes"
|
147
|
-
about_x_hours:
|
148
|
-
one: "about 1 hour"
|
149
|
-
other: "about %{count} hours"
|
150
|
-
x_days:
|
151
|
-
one: "1 day"
|
152
|
-
other: "%{count} days"
|
153
|
-
about_x_months:
|
154
|
-
one: "about 1 month"
|
155
|
-
other: "about %{count} months"
|
156
|
-
x_months:
|
157
|
-
one: "1 month"
|
158
|
-
other: "%{count} months"
|
159
|
-
about_x_years:
|
160
|
-
one: "about 1 year"
|
161
|
-
other: "about %{count} years"
|
162
|
-
over_x_years:
|
163
|
-
one: "over 1 year"
|
164
|
-
other: "over %{count} years"
|
165
|
-
almost_x_years:
|
166
|
-
one: "almost 1 year"
|
167
|
-
other: "almost %{count} years"
|
168
|
-
prompts:
|
169
|
-
year: "Year"
|
170
|
-
month: "Month"
|
171
|
-
day: "Day"
|
172
|
-
hour: "Hour"
|
173
|
-
minute: "Minute"
|
174
|
-
second: "Seconds"
|
175
|
-
|
176
|
-
helpers:
|
177
|
-
select:
|
178
|
-
# Default value for :prompt => true in FormOptionsHelper
|
179
|
-
prompt: "Please select"
|
180
|
-
# Default translation keys for submit FormHelper
|
181
|
-
submit: &actions
|
182
|
-
create: "Create %{model}"
|
183
|
-
update: "Update"
|
184
|
-
submit: "Proceed"
|
185
|
-
|
186
|
-
activerecord: &activerecord
|
187
|
-
models: &models
|
188
|
-
attributes: &attributes
|
189
|
-
id: "Id"
|
190
|
-
created_at: "Created at"
|
191
|
-
updated_at: "Updated at"
|
192
|
-
#Attributes zone - do not remove
|
193
|
-
|
194
|
-
formtastic:
|
195
|
-
titles:
|
196
|
-
labels:
|
197
|
-
<<: *attributes
|
198
|
-
hints:
|
199
|
-
actions:
|
200
|
-
<<: *actions
|
201
|
-
authentication:
|
202
|
-
sign_in: "Sign in"
|
203
|
-
sign_in_with: "Sign in with"
|
204
|
-
sign_out: "Sign out"
|
205
|
-
sign_up: "Sign up"
|
206
|
-
signed_in_as: "Signed in as"
|
207
|
-
not_you: "Not you?"
|
208
|
-
remember_me: "Remember me"
|
209
|
-
password_confirmation: "Password confirmation"
|
210
|
-
forgot_password?: "Forgot your password?"
|
211
|
-
didnt_receive_confirmation_instruction?: "Didn't receive confirmation instructions?"
|
212
|
-
didnt_receive_unlock_instruction?: "Didn't receive unlock instructions?"
|
213
|
-
cancel_my_account: "Cancel my account"
|
214
|
-
send_me_reset_password_instruction: "Send me reset password instructions"
|
215
|
-
change_password: "Change password"
|
216
|
-
current_password: "Current password"
|
217
|
-
new_password: "New password"
|
218
|
-
unauthorized:
|
219
|
-
default: "You are not authorized to access this page."
|
220
|
-
states:
|
221
|
-
generic:
|
222
|
-
new: "New"
|
223
|
-
waiting: "Waiting"
|
224
|
-
working: "Working"
|
225
|
-
canceled: "Canceled"
|
226
|
-
completed: "Completed"
|
227
|
-
closed: "Closed"
|
228
|
-
|
229
|
-
<<: *activerecord
|
1
|
+
en:
|
2
|
+
date:
|
3
|
+
formats:
|
4
|
+
# Use the strftime parameters for formats.
|
5
|
+
# When no format has been given, it uses default.
|
6
|
+
# You can provide other formats here if you like!
|
7
|
+
default: "%d-%m-%Y"
|
8
|
+
short: "%d %b"
|
9
|
+
long: "%d %B %Y"
|
10
|
+
only_day: "%e"
|
11
|
+
day_names: [Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday]
|
12
|
+
abbr_day_names: [Sun, Mon, Tue, Wed, Thu, Fri, Sat]
|
13
|
+
# Don't forget the nil at the beginning; there's no such thing as a 0th month
|
14
|
+
month_names: [~, January, February, March, April, May, June, July, August, September, October, November, December]
|
15
|
+
abbr_month_names: [~, Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec]
|
16
|
+
# Used in date_select and datetime_select.
|
17
|
+
order:
|
18
|
+
- :year
|
19
|
+
- :month
|
20
|
+
- :day
|
21
|
+
time:
|
22
|
+
formats:
|
23
|
+
default: "%a, %d %b %Y %H:%M:%S %z"
|
24
|
+
short: "%d %b %H:%M"
|
25
|
+
long: "%B %d, %Y %H:%M"
|
26
|
+
am: "am"
|
27
|
+
pm: "pm"
|
28
|
+
# Used in array.to_sentence.
|
29
|
+
support:
|
30
|
+
array:
|
31
|
+
words_connector: ", "
|
32
|
+
two_words_connector: " and "
|
33
|
+
last_word_connector: ", and "
|
34
|
+
number:
|
35
|
+
# Used in number_with_delimiter()
|
36
|
+
# These are also the defaults for 'currency', 'percentage', 'precision', and 'human'
|
37
|
+
format:
|
38
|
+
# Sets the separator between the units, for more precision (e.g. 1.0 / 2.0 == 0.5)
|
39
|
+
separator: "."
|
40
|
+
# Delimits thousands (e.g. 1,000,000 is a million) (always in groups of three)
|
41
|
+
delimiter: ","
|
42
|
+
# Number of decimals, behind the separator (the number 1 with a precision of 2 gives: 1.00)
|
43
|
+
precision: 3
|
44
|
+
# If set to true, precision will mean the number of significant digits instead
|
45
|
+
# of the number of decimal digits (1234 with precision 2 becomes 1200, 1.23543 becomes 1.2)
|
46
|
+
significant: false
|
47
|
+
# If set, the zeros after the decimal separator will always be stripped (eg.: 1.200 will be 1.2)
|
48
|
+
strip_insignificant_zeros: false
|
49
|
+
|
50
|
+
# Used in number_to_currency()
|
51
|
+
currency:
|
52
|
+
format:
|
53
|
+
# Where is the currency sign? %u is the currency unit, %n the number (default: $5.00)
|
54
|
+
format: "%u %n"
|
55
|
+
unit: "$"
|
56
|
+
# These five are to override number.format and are optional
|
57
|
+
separator: "."
|
58
|
+
delimiter: ","
|
59
|
+
precision: 2
|
60
|
+
significant: false
|
61
|
+
strip_insignificant_zeros: false
|
62
|
+
|
63
|
+
# Used in number_to_percentage()
|
64
|
+
percentage:
|
65
|
+
format:
|
66
|
+
# These five are to override number.format and are optional
|
67
|
+
# separator:
|
68
|
+
delimiter: ""
|
69
|
+
# precision:
|
70
|
+
# significant: false
|
71
|
+
# strip_insignificant_zeros: false
|
72
|
+
|
73
|
+
# Used in number_to_precision()
|
74
|
+
precision:
|
75
|
+
format:
|
76
|
+
# These five are to override number.format and are optional
|
77
|
+
# separator:
|
78
|
+
delimiter: ""
|
79
|
+
# precision:
|
80
|
+
# significant: false
|
81
|
+
# strip_insignificant_zeros: false
|
82
|
+
|
83
|
+
# Used in number_to_human_size() and number_to_human()
|
84
|
+
human:
|
85
|
+
format:
|
86
|
+
# These five are to override number.format and are optional
|
87
|
+
# separator:
|
88
|
+
delimiter: ""
|
89
|
+
precision: 3
|
90
|
+
significant: true
|
91
|
+
strip_insignificant_zeros: true
|
92
|
+
# Used in number_to_human_size()
|
93
|
+
storage_units:
|
94
|
+
# Storage units output formatting.
|
95
|
+
# %u is the storage unit, %n is the number (default: 2 MB)
|
96
|
+
format: "%n %u"
|
97
|
+
units:
|
98
|
+
byte:
|
99
|
+
one: "Byte"
|
100
|
+
other: "Bytes"
|
101
|
+
kb: "KB"
|
102
|
+
mb: "MB"
|
103
|
+
gb: "GB"
|
104
|
+
tb: "TB"
|
105
|
+
# Used in number_to_human()
|
106
|
+
decimal_units:
|
107
|
+
format: "%n %u"
|
108
|
+
# Decimal units output formatting
|
109
|
+
# By default we will only quantify some of the exponents
|
110
|
+
# but the commented ones might be defined or overridden
|
111
|
+
# by the user.
|
112
|
+
units:
|
113
|
+
# femto: Quadrillionth
|
114
|
+
# pico: Trillionth
|
115
|
+
# nano: Billionth
|
116
|
+
# micro: Millionth
|
117
|
+
# mili: Thousandth
|
118
|
+
# centi: Hundredth
|
119
|
+
# deci: Tenth
|
120
|
+
unit: ""
|
121
|
+
# ten:
|
122
|
+
# one: Ten
|
123
|
+
# other: Tens
|
124
|
+
# hundred: Hundred
|
125
|
+
thousand: "Thousand"
|
126
|
+
million: "Million"
|
127
|
+
billion: "Billion"
|
128
|
+
trillion: "Trillion"
|
129
|
+
quadrillion: "Quadrillion"
|
130
|
+
|
131
|
+
# Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words()
|
132
|
+
datetime:
|
133
|
+
distance_in_words:
|
134
|
+
half_a_minute: "half a minute"
|
135
|
+
less_than_x_seconds:
|
136
|
+
one: "less than 1 second"
|
137
|
+
other: "less than %{count} seconds"
|
138
|
+
x_seconds:
|
139
|
+
one: "1 second"
|
140
|
+
other: "%{count} seconds"
|
141
|
+
less_than_x_minutes:
|
142
|
+
one: "less than a minute"
|
143
|
+
other: "less than %{count} minutes"
|
144
|
+
x_minutes:
|
145
|
+
one: "1 minute"
|
146
|
+
other: "%{count} minutes"
|
147
|
+
about_x_hours:
|
148
|
+
one: "about 1 hour"
|
149
|
+
other: "about %{count} hours"
|
150
|
+
x_days:
|
151
|
+
one: "1 day"
|
152
|
+
other: "%{count} days"
|
153
|
+
about_x_months:
|
154
|
+
one: "about 1 month"
|
155
|
+
other: "about %{count} months"
|
156
|
+
x_months:
|
157
|
+
one: "1 month"
|
158
|
+
other: "%{count} months"
|
159
|
+
about_x_years:
|
160
|
+
one: "about 1 year"
|
161
|
+
other: "about %{count} years"
|
162
|
+
over_x_years:
|
163
|
+
one: "over 1 year"
|
164
|
+
other: "over %{count} years"
|
165
|
+
almost_x_years:
|
166
|
+
one: "almost 1 year"
|
167
|
+
other: "almost %{count} years"
|
168
|
+
prompts:
|
169
|
+
year: "Year"
|
170
|
+
month: "Month"
|
171
|
+
day: "Day"
|
172
|
+
hour: "Hour"
|
173
|
+
minute: "Minute"
|
174
|
+
second: "Seconds"
|
175
|
+
|
176
|
+
helpers:
|
177
|
+
select:
|
178
|
+
# Default value for :prompt => true in FormOptionsHelper
|
179
|
+
prompt: "Please select"
|
180
|
+
# Default translation keys for submit FormHelper
|
181
|
+
submit: &actions
|
182
|
+
create: "Create %{model}"
|
183
|
+
update: "Update"
|
184
|
+
submit: "Proceed"
|
185
|
+
|
186
|
+
activerecord: &activerecord
|
187
|
+
models: &models
|
188
|
+
attributes: &attributes
|
189
|
+
id: "Id"
|
190
|
+
created_at: "Created at"
|
191
|
+
updated_at: "Updated at"
|
192
|
+
#Attributes zone - do not remove
|
193
|
+
|
194
|
+
formtastic:
|
195
|
+
titles:
|
196
|
+
labels:
|
197
|
+
<<: *attributes
|
198
|
+
hints:
|
199
|
+
actions:
|
200
|
+
<<: *actions
|
201
|
+
authentication:
|
202
|
+
sign_in: "Sign in"
|
203
|
+
sign_in_with: "Sign in with"
|
204
|
+
sign_out: "Sign out"
|
205
|
+
sign_up: "Sign up"
|
206
|
+
signed_in_as: "Signed in as"
|
207
|
+
not_you: "Not you?"
|
208
|
+
remember_me: "Remember me"
|
209
|
+
password_confirmation: "Password confirmation"
|
210
|
+
forgot_password?: "Forgot your password?"
|
211
|
+
didnt_receive_confirmation_instruction?: "Didn't receive confirmation instructions?"
|
212
|
+
didnt_receive_unlock_instruction?: "Didn't receive unlock instructions?"
|
213
|
+
cancel_my_account: "Cancel my account"
|
214
|
+
send_me_reset_password_instruction: "Send me reset password instructions"
|
215
|
+
change_password: "Change password"
|
216
|
+
current_password: "Current password"
|
217
|
+
new_password: "New password"
|
218
|
+
unauthorized:
|
219
|
+
default: "You are not authorized to access this page."
|
220
|
+
states:
|
221
|
+
generic:
|
222
|
+
new: "New"
|
223
|
+
waiting: "Waiting"
|
224
|
+
working: "Working"
|
225
|
+
canceled: "Canceled"
|
226
|
+
completed: "Completed"
|
227
|
+
closed: "Closed"
|
228
|
+
|
229
|
+
<<: *activerecord
|
230
230
|
<<: *actions
|
File without changes
|
File without changes
|
@@ -0,0 +1,86 @@
|
|
1
|
+
module Leosca
|
2
|
+
module Generators
|
3
|
+
class Thor
|
4
|
+
attr_reader :_initializer
|
5
|
+
end
|
6
|
+
class MassiveGenerator < Rails::Generators::Base
|
7
|
+
source_root File.expand_path('../../', __FILE__)
|
8
|
+
class_option :seeds, :type => :boolean, :default => true, :desc => "Create seeds to run with rake db:seed"
|
9
|
+
class_option :seeds_elements, :type => :string, :default => "30", :banner => "NUMBER", :desc => "Choose seeds elements"
|
10
|
+
class_option :auth_class, :type => :string, :default => 'User', :desc => "Set the authentication class name"
|
11
|
+
class_option :activeadmin, :type => :boolean, :default => true, :desc => "Add code to manage activeadmin gem"
|
12
|
+
|
13
|
+
def scaffold
|
14
|
+
# puts "args #{self.args}"
|
15
|
+
# puts "options #{self.options}"
|
16
|
+
puts "behavior #{self.behavior}"
|
17
|
+
# puts "shell #{self.shell}"
|
18
|
+
# puts "in_group #{self.instance_variable_get(:@in_group)}"
|
19
|
+
# puts "_invocations #{self.instance_variable_get(:@_invocations)}"
|
20
|
+
# puts "_initializer #{self.instance_variable_get(:@_initializer)}"
|
21
|
+
# return nil
|
22
|
+
|
23
|
+
num_ok, num_ko, num_discards = 0, 0, 0
|
24
|
+
time = Time.now
|
25
|
+
begin
|
26
|
+
filename = "scaffold.txt"
|
27
|
+
raise "Write all your resources into #{filename} in the app root" unless File.exist? filename
|
28
|
+
puts "#{time.strftime("%H:%M:%S")} - Starting generations, please wait..."
|
29
|
+
puts "-" * 45
|
30
|
+
File.open(filename, "r") do |file|
|
31
|
+
while (line = file.gets)
|
32
|
+
begin
|
33
|
+
case generate line
|
34
|
+
when true
|
35
|
+
num_ok += 1
|
36
|
+
when false
|
37
|
+
num_ko += 1
|
38
|
+
when nil
|
39
|
+
num_discards += 1
|
40
|
+
end
|
41
|
+
rescue
|
42
|
+
num_ko += 1
|
43
|
+
puts "*** #{$!.message} ***"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
rescue
|
48
|
+
puts "Oh oh, generation interrupted! #{$!.message} ***"
|
49
|
+
end
|
50
|
+
|
51
|
+
puts "-" * 45
|
52
|
+
puts "Generations started at #{time.strftime("%H:%M:%S")}"
|
53
|
+
puts "#{Time.now.strftime("%H:%M:%S")} - generations ended in #{(Time.now-time).to_i} second(s)"
|
54
|
+
puts "#{num_ok} generation#{'s' unless num_ok == 1} executed"
|
55
|
+
puts "#{num_discards} line#{'s' unless num_discards == 1} discarded (comments etc.)" if num_discards>0
|
56
|
+
puts "#{num_ko} generation#{'s' unless num_ko == 1} *** FAILED ***" if num_ko>0
|
57
|
+
puts "-" * 45
|
58
|
+
end
|
59
|
+
|
60
|
+
private
|
61
|
+
|
62
|
+
def generate line
|
63
|
+
regexp_rails_g = 'rails [dg][a-z]*\s'
|
64
|
+
line.strip!
|
65
|
+
unless line.empty? or line[0..0]=="#"
|
66
|
+
if /#{regexp_rails_g}/i === line
|
67
|
+
# Will invoke a custom generator specified in the line
|
68
|
+
line.sub! /#{regexp_rails_g}/i, ''
|
69
|
+
generator_name = line.match(/\w+/).to_s
|
70
|
+
line.sub! /#{generator_name}/, ''
|
71
|
+
line.strip!
|
72
|
+
else
|
73
|
+
generator_name = 'leosca'
|
74
|
+
end
|
75
|
+
raise "Generator not recognized! #{line[0..20]}..." if /^rails/ === line
|
76
|
+
puts "#{generator_name} #{line}"
|
77
|
+
Rails::Generators.invoke generator_name, line.split(' '), :behavior => self.behavior
|
78
|
+
true
|
79
|
+
else
|
80
|
+
nil
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
@@ -99,51 +99,56 @@ module Rails
|
|
99
99
|
|
100
100
|
def invoke_active_admin
|
101
101
|
return unless activeadmin? and options[:activeadmin]
|
102
|
-
|
102
|
+
|
103
103
|
invoke "active_admin:resource", [singular_table_name]
|
104
104
|
file = "app/admin/#{singular_table_name}.rb"
|
105
105
|
|
106
|
+
indent_spaces = 25
|
106
107
|
inject_into_file file, :after => "ActiveAdmin.register #{class_name} do" do
|
107
108
|
<<-FILE.gsub(/^ /, '')
|
108
|
-
|
109
|
-
index do
|
110
|
-
|
111
|
-
|
112
|
-
#{attributes.
|
113
|
-
|
114
|
-
end
|
115
|
-
|
116
|
-
show do |#{singular_table_name}|
|
117
|
-
|
118
|
-
#{attributes.map{|attr| "
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
109
|
+
# ActiveLeonardo: Remove comments where you need it
|
110
|
+
#index do
|
111
|
+
# selectable_column
|
112
|
+
# id_column
|
113
|
+
#{attributes.map{|attr| " # column(:#{attr.name})#{' ' * (indent_spaces-attr.name.size).abs}{|#{singular_table_name}| #{singular_table_name}.#{attr.name}}"}.join("\n")}
|
114
|
+
# actions
|
115
|
+
#end
|
116
|
+
|
117
|
+
#show do |#{singular_table_name}|
|
118
|
+
# attributes_table do
|
119
|
+
#{attributes.map{|attr| " # row(:#{attr.name})#{' ' * (indent_spaces-attr.name.size).abs}{|#{singular_table_name}| #{singular_table_name}.#{attr.name}}"}.join("\n")}
|
120
|
+
# row :created_at
|
121
|
+
# row :updated_at
|
122
|
+
# end
|
123
|
+
# # Insert here child tables
|
124
|
+
# panel I18n.t('models.your_child_tables') do
|
125
|
+
# table_for #{singular_table_name}.your_child_tables do
|
126
|
+
# column(:id) {|your_child_tables| link_to your_child_tables.id, [:admin, your_child_tables]}
|
127
|
+
# end
|
128
|
+
# end
|
129
|
+
# active_admin_comments
|
130
|
+
#end
|
131
|
+
|
132
|
+
#{attributes.map{|attr| " #filter :#{attr.name}"}.join("\n")}
|
133
|
+
|
134
|
+
#form do |f|
|
135
|
+
# f.inputs do
|
136
|
+
#{attributes.map{|attr| " # f.input :#{attr.name}"}.join("\n")}
|
137
|
+
# end
|
138
|
+
# #For date use as: :datepicker, input_html: { class: 'calendar' }
|
139
|
+
# #For state machine data field as: :select, collection: (f.object.class.state_machine.states.collect { |state| [state.human_name.underscore.capitalize, state.value] }.sort_by { |name| name }), :for => :states, :include_blank => false
|
140
|
+
# f.actions
|
141
|
+
#end
|
142
|
+
|
143
|
+
#csv do
|
144
|
+
#{attributes.map{|attr| " # column(:#{attr.name})#{' ' * (indent_spaces-attr.name.size).abs}{|#{singular_table_name}| #{singular_table_name}.#{attr.name}}"}.join("\n")}
|
145
|
+
#end
|
140
146
|
FILE
|
141
147
|
end if File.exists?(file)
|
142
148
|
|
143
149
|
if /^[4-5]/ === Rails.version
|
144
150
|
inject_into_file file, :after => "ActiveAdmin.register #{class_name} do" do
|
145
151
|
<<-FILE.gsub(/^ /, '')
|
146
|
-
|
147
152
|
permit_params do
|
148
153
|
permitted = [:id, #{attributes.map{|attr| ":#{attr.name}"}.join(', ')}, :created_at, :updated_at]
|
149
154
|
permitted
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_leonardo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marco Mastrodonato
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-02-
|
12
|
+
date: 2016-02-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -63,14 +63,15 @@ files:
|
|
63
63
|
- lib/generators/leolay/templates/styles/active/images/ico_v.png
|
64
64
|
- lib/generators/leolay/templates/styles/active/images/ico_x.png
|
65
65
|
- lib/generators/leolay/templates/styles/active/images/logo.png
|
66
|
-
- lib/generators/leolay/templates/styles/active/stylesheets/app/_enviroment.
|
67
|
-
- lib/generators/leolay/templates/styles/active/stylesheets/app/custom_active_admin.
|
68
|
-
- lib/generators/leolay/templates/styles/active/stylesheets/app/stylesheet.
|
66
|
+
- lib/generators/leolay/templates/styles/active/stylesheets/app/_enviroment.scss
|
67
|
+
- lib/generators/leolay/templates/styles/active/stylesheets/app/custom_active_admin.scss
|
68
|
+
- lib/generators/leolay/templates/styles/active/stylesheets/app/stylesheet.scss
|
69
69
|
- lib/generators/leolay/templates/styles/active/views/layout/_message.html.erb
|
70
70
|
- lib/generators/leolay/templates/styles/active/views/layout/_session.html.erb
|
71
71
|
- lib/generators/leolay/templates/styles/active/views/layout/application.html.erb
|
72
72
|
- lib/generators/leosca/USAGE
|
73
73
|
- lib/generators/leosca/install_generator.rb
|
74
|
+
- lib/generators/leosca/massive_generator.rb
|
74
75
|
- lib/generators/rails/leosca/USAGE
|
75
76
|
- lib/generators/rails/leosca/leosca_generator.rb
|
76
77
|
- lib/generators/rails/leosca/templates/leosca.css
|