inline_forms 1.6.25 → 1.6.26
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/bin/inline_forms +28 -30
- data/lib/inline_forms/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc5d27fe76c0187936f29e9d6cd1825a902cc92d
|
4
|
+
data.tar.gz: 92ebb67c3342f09ad7e3ed81a9ede9dd1867e0c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2d82cb5802ae040c82d04fa217322e3fae4aa0f29784e8d86730f25fa55c11cc0c98bf5138f8ea3056003f2a95e27ac5197c07a3ffb1474e73adba90aae5812
|
7
|
+
data.tar.gz: 4e34858b8f4723eb715210c457d4e237e59ddf030fc602526f4ab3a13b9178f8a86a55cf6f00ccca81ef15ee983d817b58faeb588d496f3f6e61894d11c4b745
|
data/bin/inline_forms
CHANGED
@@ -17,12 +17,12 @@ module InlineForms
|
|
17
17
|
class Creator < Thor
|
18
18
|
include Thor::Actions
|
19
19
|
|
20
|
-
String.class_eval do
|
21
|
-
def strip_heredoc_with_indent(indent=0)
|
22
|
-
new_indent = ( self.empty? ? 0 : ( scan(/^[ \t]*(?=\S)/).min.size - indent ) )
|
23
|
-
gsub(/^[ \t]{#{new_indent}}/, '')
|
24
|
-
end
|
25
|
-
end
|
20
|
+
# String.class_eval do
|
21
|
+
# def strip_heredoc_with_indent(indent=0)
|
22
|
+
# new_indent = ( self.empty? ? 0 : ( scan(/^[ \t]*(?=\S)/).min.size - indent ) )
|
23
|
+
# gsub(/^[ \t]{#{new_indent}}/, '')
|
24
|
+
# end
|
25
|
+
# end
|
26
26
|
|
27
27
|
def self.source_root
|
28
28
|
File.dirname(__FILE__)+"/.."
|
@@ -91,7 +91,7 @@ module InlineForms
|
|
91
91
|
if dry_run?
|
92
92
|
empty_directory(app_name)
|
93
93
|
else
|
94
|
-
if !
|
94
|
+
if ! run("rails new #{app_name}").successful?
|
95
95
|
say "Rails could not create the app '#{app_name}', maybe because it is a reserved word...", :red
|
96
96
|
exit 1
|
97
97
|
end
|
@@ -101,13 +101,11 @@ module InlineForms
|
|
101
101
|
ruby_version = (%x[rvm current]).gsub(/@.*/,'')
|
102
102
|
create_file "#{app_name}/.ruby-version", "#{ruby_version.chop}"
|
103
103
|
|
104
|
-
say "- Changing to '#{app_name}'
|
105
|
-
|
104
|
+
say "- Changing to '#{app_name}'..."
|
105
|
+
chdir(app_name) do
|
106
106
|
|
107
107
|
say "- Working directory is now #{`pwd`}"
|
108
|
-
RVM
|
109
|
-
rvm_gemset = %x[rvm current]
|
110
|
-
say "- RVM gemset is now #{rvm_gemset}"
|
108
|
+
say "- RVM gemset is now #{%x[rvm current]}"
|
111
109
|
|
112
110
|
say "- Recreating Gemfile..."
|
113
111
|
|
@@ -193,10 +191,10 @@ module InlineForms
|
|
193
191
|
END_DATABASEYML
|
194
192
|
|
195
193
|
say "- Devise install..."
|
196
|
-
|
194
|
+
run "bundle exec rails g devise:install" unless dry_run?
|
197
195
|
|
198
196
|
say "- Devise User model install with added name and locale field..."
|
199
|
-
|
197
|
+
run "bundle exec rails g devise User name:string locale:string" unless dry_run?
|
200
198
|
|
201
199
|
say "- Replace Devise route and add path_prefix..."
|
202
200
|
gsub_file "#{app_name}/config/routes.rb", /devise_for :users/, "devise_for :users, :path_prefix => 'auth'"
|
@@ -279,7 +277,7 @@ module InlineForms
|
|
279
277
|
USER_MODEL
|
280
278
|
|
281
279
|
say "- Install ckeditor..."
|
282
|
-
|
280
|
+
run "bundle exec rails g ckeditor:install" unless dry_run?
|
283
281
|
|
284
282
|
say "- Create ckeditor config.js"
|
285
283
|
copy_file "lib/app/assets/javascripts/ckeditor/config.js", "#{app_name}/app/assets/javascripts/ckeditor/config.js"
|
@@ -289,12 +287,12 @@ module InlineForms
|
|
289
287
|
insert_into_file "#{app_name}/app/assets/javascripts/application.js", "//= require jquery.remotipart\n", :before => "//= require_tree .\n"
|
290
288
|
|
291
289
|
say "- Paper_trail install..."
|
292
|
-
|
290
|
+
run "bundle exec rails g paper_trail:install" unless dry_run?
|
293
291
|
|
294
292
|
say "- Generate models and tables and views for translations..."
|
295
|
-
|
296
|
-
|
297
|
-
|
293
|
+
run 'rails g inline_forms InlineFormsLocale name:string inline_forms_translations:belongs_to _enabled:yes _presentation:\'#{name}\''
|
294
|
+
run 'rails g inline_forms InlineFormsKey name:string inline_forms_translations:has_many inline_forms_translations:associated _enabled:yes _presentation:\'#{name}\''
|
295
|
+
run 'rails g inline_forms InlineFormsTranslation inline_forms_key:belongs_to inline_forms_locale:dropdown value:text interpolations:text is_proc:boolean _presentation:\'#{value}\''
|
298
296
|
|
299
297
|
sleep 1 # to get unique migration number
|
300
298
|
create_file "#{app_name}/db/migrate/" +
|
@@ -323,13 +321,13 @@ module InlineForms
|
|
323
321
|
VIEW_MIGRATION
|
324
322
|
|
325
323
|
say "- Migrating Database"
|
326
|
-
|
324
|
+
run "bundle exec rake db:migrate" unless (dry_run? || !using_sqlite?)
|
327
325
|
|
328
326
|
say "- Adding admin user with email: #{email}, password: #{password} to seeds.rb"
|
329
327
|
append_to_file "#{app_name}/db/seeds.rb", "User.new({ :email => '#{email}', :name => 'Admin', :password => '#{password}', :password_confirmation => '#{password}'}).save"
|
330
328
|
|
331
329
|
say "- Seeding the database"
|
332
|
-
|
330
|
+
run "bundle exec rake db:seed" unless (dry_run? || !using_sqlite?)
|
333
331
|
|
334
332
|
say "- Creating header in app/views/inline_forms/_header.html.erb..."
|
335
333
|
create_file "#{app_name}/app/views/inline_forms/_header.html.erb", <<-END_HEADER.strip_heredoc_with_indent
|
@@ -446,7 +444,7 @@ module InlineForms
|
|
446
444
|
gsub_file "#{app_name}/config/environments/production.rb", /config.assets.compile = false/, "config.assets.compile = true"
|
447
445
|
|
448
446
|
say "- Capify..."
|
449
|
-
|
447
|
+
run 'capify .'
|
450
448
|
remove_file "#{app_name}/config/deploy.rb" # remove the file capify created!
|
451
449
|
copy_file "lib/generators/templates/deploy.rb", "#{app_name}/config/deploy.rb"
|
452
450
|
|
@@ -454,7 +452,7 @@ module InlineForms
|
|
454
452
|
copy_file "lib/generators/templates/unicorn.rb", "#{app_name}/config/unicorn.rb"
|
455
453
|
|
456
454
|
say "- Initializing git..."
|
457
|
-
|
455
|
+
run 'git init'
|
458
456
|
create_file "#{app_name}/.gitignore", "/tmp\n" if dry_run?
|
459
457
|
insert_into_file "#{app_name}/.gitignore", <<-GITIGNORE.strip_heredoc_with_indent, :after => "/tmp\n"
|
460
458
|
# netbeans
|
@@ -463,18 +461,18 @@ module InlineForms
|
|
463
461
|
public/uploads
|
464
462
|
GITIGNORE
|
465
463
|
|
466
|
-
|
467
|
-
|
464
|
+
run 'git add .'
|
465
|
+
run 'git commit -a -m " * Initial"'
|
468
466
|
|
469
467
|
if install_example?
|
470
468
|
say "\nInstalling example application..."
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
469
|
+
run 'rails g inline_forms Picture name:string caption:string image:image_field description:text apartment:belongs_to _presentation:\'#{name}\''
|
470
|
+
run 'rails generate uploader Image'
|
471
|
+
run 'rails g inline_forms Apartment name:string title:string description:text pictures:has_many pictures:associated _enabled:yes _presentation:\'#{name}\''
|
472
|
+
run 'bundle exec rake db:migrate'
|
475
473
|
say "\nDone! Now point your browser to http://localhost:3000/apartments !", :yellow
|
476
474
|
say "\nPress ctlr-C to quit...", :yellow
|
477
|
-
|
475
|
+
run 'rails s'
|
478
476
|
else
|
479
477
|
say "\nDone! Now make your tables with 'rails g inline_forms ...", :yellow
|
480
478
|
#say "- Don't forget: edit .rvmrc, config/{routes.rb, deploy.rb}, .git/config, delete public/index.html\n"
|
data/lib/inline_forms/version.rb
CHANGED