inline_forms 1.3.30 → 1.3.31

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.
data/bin/inline_forms CHANGED
@@ -45,18 +45,19 @@ if !ARGV.empty? || app_name.nil? || !/^[a-zA-Z][0-9a-zA-Z_-]+/.match(app_name) |
45
45
  end
46
46
 
47
47
  puts "\nGenerating Rails app '#{app_name}'...\n"
48
+ ruby_version = %x[rvm current]
48
49
  RVM.run "rails new #{app_name}"
49
50
 
50
- RVM.chdir(app_name) do
51
- puts "\nWorking directory is now #{`pwd`}"
51
+ Dir.chdir(app_name)
52
+ puts "\nWorking directory is now #{`pwd`}"
52
53
 
53
- puts "\nInstalling Gemfile...\n"
54
+ puts "\nInstalling Gemfile...\n"
54
55
 
55
- gemfile_sources = "
56
+ gemfile_sources = "
56
57
  source 'http://rubygems.org'
57
58
 
58
- "
59
- gemfile_gems = "
59
+ "
60
+ gemfile_gems = "
60
61
 
61
62
  gem 'test-unit'
62
63
  gem 'rails'
@@ -79,8 +80,8 @@ gem 'rails-i18n'
79
80
  gem 'unicorn'
80
81
  gem 'rvm-capistrano'
81
82
 
82
- "
83
- gemfile_development_group ="
83
+ "
84
+ gemfile_development_group ="
84
85
 
85
86
  # Include everything needed to run rake, tests, features, etc.
86
87
  group :development do
@@ -92,8 +93,8 @@ group :development do
92
93
  # gem 'rcov', '>= 0'
93
94
  end
94
95
 
95
- "
96
- gemfile_production_group ="
96
+ "
97
+ gemfile_production_group ="
97
98
  # these are just for production
98
99
  group :production do
99
100
  gem 'mysql2'
@@ -101,60 +102,61 @@ group :production do
101
102
  gem 'uglifier'
102
103
  end
103
104
 
104
- "
105
+ "
105
106
 
106
- File.open( 'Gemfile', 'w') {|f| f.write(gemfile_sources + gemfile_gems + gemfile_development_group + gemfile_production_group ) }
107
+ File.open( 'Gemfile', 'w') {|f| f.write(gemfile_sources + gemfile_gems + gemfile_development_group + gemfile_production_group ) }
107
108
 
108
- puts "\nCreating and trusting rvmrc...\n"
109
- RVM.run "echo rvm use `rvm current`@#{app_name} --create > .rvmrc"
110
- RVM.run "rvm rvmrc trust .rvmrc"
109
+ puts "\nCreating and trusting .rvmrc...\n"
110
+ system "echo rvm use #{ruby_version.chop}@#{app_name} --create > .rvmrc"
111
111
 
112
- end
113
- RVM.chdir "#{app_name}" do
114
112
 
115
- puts "\nRunning bundle...\n"
116
- RVM.run "bundle install"
113
+ system "rvm rvmrc trust .rvmrc"
114
+
115
+ RVM.use "#{ruby_version.chop}@#{app_name}"
117
116
 
118
- puts "\nDatabase setup: creating config/database.yml\n"
119
- development_stanza = "
117
+ puts "\nRunning bundle...\n"
118
+ RVM.run "bundle install"
119
+
120
+ puts "\nDatabase setup: creating config/database.yml\n"
121
+ development_stanza = "
120
122
  development:
121
123
  adapter: sqlite3
122
124
  database: db/development.sqlite3
123
125
  pool: 5
124
126
  timeout: 5000
125
- "
126
- production_stanza = "
127
+ "
128
+ production_stanza = "
127
129
  production:
128
130
  adapter: mysql2
129
131
  database: #{app_name}_p
130
132
  username: #{app_name}
131
133
  password: #{app_name}444
132
134
 
133
- "
134
- File.open( 'config/database.yml', 'w') {|f| f.write(development_stanza + production_stanza) }
135
-
136
- puts "\nDevise install..."
137
- system('bundle exec rails g devise:install')
138
- puts "\nDevise User model install with added name field..."
139
- system('bundle exec rails g devise User name:string')
140
- puts "\nInstall ckeditor..."
141
- system('bundle exec rails g ckeditor:install')
142
- puts "Create config file in app/assets/javascripts/ckeditor/config.js"
143
- FileUtils.mkdir_p 'app/assets/javascripts/ckeditor'
144
- system("cp #{src}/lib/app/assets/javascripts/ckeditor/config.js app/assets/javascripts/ckeditor")
145
- puts "Add remotipart to app/assets/javascripts/application.js..."
146
- system('echo >> app/assets/javascripts/application.js')
147
- system('echo "//= require jquery.remotipart" >> app/assets/javascripts/application.js')
148
- system('echo >> app/assets/javascripts/application.js')
149
- puts "Paper_trail install..."
150
- system('bundle exec rails g paper_trail:install')
151
-
152
-
153
- puts "Migrating Devise and Versions"
154
- system('bundle exec rake db:migrate')
155
-
156
- puts "Creating header in app/views/inline_forms/_header.html.erb...\n"
157
- header_src = "
135
+ "
136
+ File.open( 'config/database.yml', 'w') {|f| f.write(development_stanza + production_stanza) }
137
+
138
+ puts "\nDevise install..."
139
+ RVM.run "bundle exec rails g devise:install"
140
+ puts "\nDevise User model install with added name field..."
141
+ RVM.run "bundle exec rails g devise User name:string"
142
+ puts "\nInstall ckeditor..."
143
+ RVM.run "bundle exec rails g ckeditor:install"
144
+ puts "Create config file in app/assets/javascripts/ckeditor/config.js"
145
+ FileUtils.mkdir_p 'app/assets/javascripts/ckeditor'
146
+ system("cp #{src}/lib/app/assets/javascripts/ckeditor/config.js app/assets/javascripts/ckeditor")
147
+ puts "Add remotipart to app/assets/javascripts/application.js..."
148
+ system('echo >> app/assets/javascripts/application.js')
149
+ system('echo "//= require jquery.remotipart" >> app/assets/javascripts/application.js')
150
+ system('echo >> app/assets/javascripts/application.js')
151
+ puts "Paper_trail install..."
152
+ RVM.run "bundle exec rails g paper_trail:install"
153
+
154
+
155
+ puts "Migrating Devise and Versions"
156
+ system('bundle exec rake db:migrate')
157
+
158
+ puts "Creating header in app/views/inline_forms/_header.html.erb...\n"
159
+ header_src = "
158
160
  <div id='Header'>
159
161
  <div id='title'>
160
162
  #{app_name} v<%= inline_forms_version -%>
@@ -166,12 +168,12 @@ production:
166
168
  <% end -%>
167
169
  <div style='clear: both;'></div>
168
170
  </div>
169
- "
170
- FileUtils.mkdir_p 'app/views/inline_forms'
171
- File.open( 'app/views/inline_forms/_header.html.erb', 'w') {|f| f.write(header_src) }
171
+ "
172
+ FileUtils.mkdir_p 'app/views/inline_forms'
173
+ File.open( 'app/views/inline_forms/_header.html.erb', 'w') {|f| f.write(header_src) }
172
174
 
173
- puts "Set application_name and _title in ApplicationHelper...\n"
174
- app_helper = "
175
+ puts "Set application_name and _title in ApplicationHelper...\n"
176
+ app_helper = "
175
177
  module ApplicationHelper
176
178
  def application_name
177
179
  #{app_name}
@@ -180,12 +182,12 @@ module ApplicationHelper
180
182
  #{app_name}
181
183
  end
182
184
  end
183
- "
184
- File.open( 'app/helpers/application_helper.rb', 'w') {|f| f.write(app_helper) }
185
+ "
186
+ File.open( 'app/helpers/application_helper.rb', 'w') {|f| f.write(app_helper) }
185
187
 
186
188
 
187
- puts "Injecting precompile assets stuff in production.rb...\n"
188
- precomp = "
189
+ puts "Injecting precompile assets stuff in production.rb...\n"
190
+ precomp = "
189
191
  \n
190
192
  \n
191
193
  # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
@@ -193,27 +195,26 @@ end
193
195
  config.assets.precompile += %w( inline_forms_application.js inline_forms_application.css devise.css )
194
196
  end
195
197
  \n"
196
- File.open( 'config/environments/production.rb', 'a') {|f| f.write(precomp) }
198
+ File.open( 'config/environments/production.rb', 'a') {|f| f.write(precomp) }
197
199
 
198
- puts "Capify...\n"
199
- system('capify .')
200
- system("cp #{src}/lib/generators/templates/deploy.rb config/deploy.rb")
200
+ puts "Capify...\n"
201
+ system('capify .')
202
+ system("cp #{src}/lib/generators/templates/deploy.rb config/deploy.rb")
201
203
 
202
- puts "Unicorn Config...\n"
203
- system("cp #{src}/lib/generators/templates/unicorn.rb config/unicorn.rb")
204
+ puts "Unicorn Config...\n"
205
+ system("cp #{src}/lib/generators/templates/unicorn.rb config/unicorn.rb")
204
206
 
205
- puts "Initializing git...\n"
206
- system('git init')
207
- system('echo >> .gitignore')
208
- system('echo "nbproject" >> .gitignore')
209
- system('echo "public/uploads" >> .gitignore')
210
- system('echo >> .gitignore')
211
- system('git add .')
212
- system('git commit -a -m " * Initial"')
207
+ puts "Initializing git...\n"
208
+ system('git init')
209
+ system('echo >> .gitignore')
210
+ system('echo "nbproject" >> .gitignore')
211
+ system('echo "public/uploads" >> .gitignore')
212
+ system('echo >> .gitignore')
213
+ system('git add .')
214
+ system('git commit -a -m " * Initial"')
213
215
 
214
- puts "\n\nDone! Now make your tables with 'rails g inline_forms ...\n"
215
- puts "\nDon't forget: edit .rvmrc, config/{routes.rb, deploy.rb}, .git/config, delete public/index.html\n\n"
216
+ puts "\n\nDone! Now make your tables with 'rails g inline_forms ...\n"
217
+ puts "\nDon't forget: edit .rvmrc, config/{routes.rb, deploy.rb}, .git/config, delete public/index.html\n\n"
216
218
 
217
219
 
218
220
 
219
- end
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module InlineForms
3
- VERSION = "1.3.30"
3
+ VERSION = "1.3.31"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inline_forms
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.30
4
+ version: 1.3.31
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-16 00:00:00.000000000 Z
12
+ date: 2012-05-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec-rails