inline_forms 1.3.47 → 1.3.48
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +3 -13
- data/bin/inline_forms +273 -240
- data/lib/inline_forms/version.rb +1 -1
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -5,11 +5,11 @@ Inline Forms is almost a complete admin application. You can try it out easily.
|
|
5
5
|
= Usage
|
6
6
|
|
7
7
|
gem install inline_forms
|
8
|
-
inline_forms MyAppName
|
8
|
+
inline_forms create MyAppName
|
9
9
|
cd MyAppName
|
10
|
-
rails g inline_forms Picture name:string caption:string image:image_field description:text apartment:belongs_to _presentation:'#{name}'
|
10
|
+
rails g inline_forms Picture name:string caption:string image:image_field description:text apartment:belongs_to _presentation:'#{name}'
|
11
11
|
rails generate uploader Image
|
12
|
-
rails g inline_forms Apartment name:string title:string description:text pictures:has_many pictures:associated _enabled:yes _presentation:'#{name}'
|
12
|
+
rails g inline_forms Apartment name:string title:string description:text pictures:has_many pictures:associated _enabled:yes _presentation:'#{name}'
|
13
13
|
bundle exec rake db:migrate
|
14
14
|
rails s
|
15
15
|
|
@@ -18,16 +18,6 @@ point your browser to http://localhost:3000/apartments (make sure JavaScript is
|
|
18
18
|
It's work in progress.
|
19
19
|
|
20
20
|
|
21
|
-
== Contributing to inline_forms
|
22
|
-
|
23
|
-
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
24
|
-
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
25
|
-
* Fork the project
|
26
|
-
* Start a feature/bugfix branch
|
27
|
-
* Commit and push until you are happy with your contribution
|
28
|
-
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
29
|
-
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
30
|
-
|
31
21
|
== Copyright
|
32
22
|
|
33
23
|
Copyright (c) 2011 Ace Suares. See LICENSE.txt for
|
data/bin/inline_forms
CHANGED
@@ -1,248 +1,281 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
module InlineForms
|
2
3
|
|
3
|
-
require
|
4
|
+
require File.join(File.dirname(__FILE__), "../lib/inline_forms/version.rb")
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
# what is this?
|
11
|
-
Signal.trap("INT") { puts; exit }
|
12
|
-
|
13
|
-
# require the version file
|
14
|
-
src = File.join(File.dirname(__FILE__), "..")
|
15
|
-
require "#{src}/lib/inline_forms/version.rb"
|
16
|
-
|
17
|
-
USAGE = "
|
18
|
-
USAGE: inline_forms <options> <app-name>
|
19
|
-
|
20
|
-
'inline_forms MyApp' will create a rails app in directory MyApp.
|
21
|
-
|
22
|
-
Options:
|
23
|
-
--help # show this message
|
24
|
-
|
25
|
-
VERSION: #{InlineForms::VERSION}
|
26
|
-
"
|
27
|
-
|
28
|
-
|
29
|
-
while true
|
30
|
-
case arg_name = ARGV.shift
|
31
|
-
when "--help"
|
32
|
-
puts USAGE
|
33
|
-
exit
|
34
|
-
else
|
35
|
-
app_name = arg_name
|
36
|
-
break
|
6
|
+
require 'rvm'
|
7
|
+
if not RVM.current
|
8
|
+
puts "ruby or rvm not found"
|
9
|
+
exit 2
|
37
10
|
end
|
38
|
-
end
|
39
|
-
|
40
|
-
if !ARGV.empty? || app_name.nil? || !/^[a-zA-Z][0-9a-zA-Z_-]+/.match(app_name) || File.exists?(app_name)
|
41
|
-
puts USAGE
|
42
|
-
exit 1
|
43
|
-
end
|
44
|
-
|
45
|
-
puts "\nGenerating Rails app '#{app_name}'...\n"
|
46
|
-
RVM.run "rails new #{app_name}"
|
47
|
-
|
48
|
-
puts "\nCreating and trusting .rvmrc...\n"
|
49
|
-
ruby_version = %x[rvm current]
|
50
|
-
system "echo rvm use #{ruby_version.chop}@#{app_name} --create > #{app_name}/.rvmrc"
|
51
|
-
system "cd #{app_name} && rvm rvmrc trust .rvmrc"
|
52
|
-
|
53
|
-
puts "\nChanging to '#{app_name}' with RVM...\n"
|
54
|
-
RVM.chdir(app_name) do
|
55
|
-
puts "\nWorking directory is now #{`pwd`}"
|
56
|
-
RVM.use_from_path! '.'
|
57
|
-
rvm_gemset = %x[rvm current]
|
58
|
-
puts "\nRVM gemset is now #{rvm_gemset}"
|
59
|
-
|
60
|
-
puts "\nInstalling Gemfile...\n"
|
61
|
-
gemfile_sources = "
|
62
|
-
source 'http://rubygems.org'
|
63
|
-
|
64
|
-
"
|
65
|
-
gemfile_gems = "
|
66
|
-
|
67
|
-
gem 'test-unit'
|
68
|
-
gem 'rails'
|
69
|
-
gem 'rake'
|
70
|
-
gem 'jquery-rails'
|
71
|
-
gem 'capistrano'
|
72
|
-
gem 'will_paginate', :git => 'git://github.com/acesuares/will_paginate.git'
|
73
|
-
gem 'tabs_on_rails' # , :git => 'git://github.com/acesuares/tabs_on_rails.git', :branch => 'add_remote'
|
74
|
-
gem 'ckeditor', :git => 'git://github.com/acesuares/ckeditor.git', :branch => 'master'
|
75
|
-
gem 'carrierwave'
|
76
|
-
gem 'remotipart', '~> 1.0'
|
77
|
-
gem 'paper_trail'
|
78
|
-
gem 'devise'
|
79
|
-
gem 'cancan'
|
80
|
-
gem 'inline_forms'
|
81
|
-
gem 'mini_magick'
|
82
|
-
gem 'jquery_datepicker'
|
83
|
-
gem 'yaml_db'
|
84
|
-
gem 'rails-i18n'
|
85
|
-
gem 'unicorn'
|
86
|
-
gem 'rvm'
|
87
|
-
gem 'rvm-capistrano'
|
88
|
-
|
89
|
-
"
|
90
|
-
gemfile_development_group ="
|
91
|
-
|
92
|
-
# Include everything needed to run rake, tests, features, etc.
|
93
|
-
group :development do
|
94
|
-
gem 'sqlite3'
|
95
|
-
gem 'rspec-rails'
|
96
|
-
gem 'shoulda', '>= 0'
|
97
|
-
gem 'bundler'
|
98
|
-
gem 'jeweler'
|
99
|
-
# gem 'rcov', '>= 0'
|
100
|
-
end
|
101
|
-
|
102
|
-
"
|
103
|
-
gemfile_production_group ="
|
104
|
-
# these are just for production
|
105
|
-
group :production do
|
106
|
-
gem 'mysql2'
|
107
|
-
gem 'therubyracer'
|
108
|
-
gem 'uglifier'
|
109
|
-
end
|
110
|
-
|
111
|
-
"
|
112
11
|
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
12
|
+
# what is this?
|
13
|
+
Signal.trap("INT") { puts; exit }
|
14
|
+
|
15
|
+
require 'thor'
|
16
|
+
|
17
|
+
class Creator < Thor
|
18
|
+
include Thor::Actions
|
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
|
26
|
+
|
27
|
+
def self.source_root
|
28
|
+
File.dirname(__FILE__)+"/.."
|
29
|
+
end
|
30
|
+
|
31
|
+
desc "create APP", "create an application with inline_forms v#{VERSION}"
|
32
|
+
DATABASE_OPTIONS = %w(sqlite mysql)
|
33
|
+
method_option :database, :aliases => "-d", :default => DATABASE_OPTIONS.first, :banner => DATABASE_OPTIONS.join('|'), :desc => 'specify development database'
|
34
|
+
method_option :dry, :type => :boolean, :desc => 'dry run. Do not do most things. Only useful for development of inline_forms'
|
35
|
+
|
36
|
+
def create(app_name)
|
37
|
+
|
38
|
+
def dry_run?
|
39
|
+
options[:dry]
|
40
|
+
end
|
41
|
+
|
42
|
+
options_database = DATABASE_OPTIONS.include?(options[:database]) ? options[:database] : DATABASE_OPTIONS.first
|
43
|
+
|
44
|
+
say "This is a dry run. I hope you know what you are doing...", :red if dry_run?
|
45
|
+
say "Creating #{app_name} with inline_forms v#{VERSION} and development database #{options_database}...", :green
|
46
|
+
|
47
|
+
regex = /\A[0-9a-zA-Z][0-9a-zA-Z_-]+[0-9a-zA-Z]\Z/
|
48
|
+
if ! regex.match(app_name)
|
49
|
+
say "Error: APP must match #{regex.source}", :red
|
50
|
+
exit 1
|
51
|
+
end
|
52
|
+
|
53
|
+
if File.exists?(app_name)
|
54
|
+
say "Error: APP exists", :red
|
55
|
+
exit 1
|
56
|
+
end
|
57
|
+
|
58
|
+
say "- Generating Rails app '#{app_name}'..."
|
59
|
+
dry_run? ? empty_directory(app_name) : RVM.run("rails new #{app_name}")
|
60
|
+
|
61
|
+
|
62
|
+
say "- Creating and trusting .rvmrc..."
|
63
|
+
ruby_version = %x[rvm current]
|
64
|
+
create_file "#{app_name}/.rvmrc", "rvm use #{ruby_version.chop}@#{app_name} --create"
|
65
|
+
say ("- " + %x[cd #{app_name} && rvm rvmrc trust .rvmrc]).chop, :green
|
66
|
+
|
67
|
+
say "- Changing to '#{app_name}' with RVM..."
|
68
|
+
RVM.chdir(app_name) do
|
69
|
+
|
70
|
+
say "- Working directory is now #{`pwd`}"
|
71
|
+
RVM.use_from_path! '.'
|
72
|
+
rvm_gemset = %x[rvm current]
|
73
|
+
say "- RVM gemset is now #{rvm_gemset}"
|
74
|
+
|
75
|
+
say "- Recreating Gemfile..."
|
76
|
+
|
77
|
+
remove_file "#{app_name}/Gemfile" # the one that 'rails new' created
|
78
|
+
create_file "#{app_name}/Gemfile", <<-END_GEMFILE.strip_heredoc_with_indent
|
79
|
+
# generated by inline_forms v#{VERSION}
|
80
|
+
|
81
|
+
source 'http://rubygems.org'
|
82
|
+
|
83
|
+
gem 'test-unit'
|
84
|
+
gem 'rails'
|
85
|
+
gem 'rake'
|
86
|
+
gem 'jquery-rails'
|
87
|
+
gem 'capistrano'
|
88
|
+
gem 'will_paginate', :git => 'git://github.com/acesuares/will_paginate.git'
|
89
|
+
gem 'tabs_on_rails' # , :git => 'git://github.com/acesuares/tabs_on_rails.git', :branch => 'add_remote'
|
90
|
+
gem 'ckeditor', :git => 'git://github.com/acesuares/ckeditor.git', :branch => 'master'
|
91
|
+
gem 'carrierwave'
|
92
|
+
gem 'remotipart', '~> 1.0'
|
93
|
+
gem 'paper_trail'
|
94
|
+
gem 'devise'
|
95
|
+
gem 'cancan'
|
96
|
+
gem 'inline_forms'
|
97
|
+
gem 'mini_magick'
|
98
|
+
gem 'jquery_datepicker'
|
99
|
+
gem 'yaml_db'
|
100
|
+
gem 'rails-i18n'
|
101
|
+
gem 'unicorn'
|
102
|
+
gem 'rvm'
|
103
|
+
gem 'rvm-capistrano'
|
104
|
+
|
105
|
+
# Include everything needed to run rake, tests, features, etc.
|
106
|
+
group :development do
|
107
|
+
gem 'sqlite3'
|
108
|
+
gem 'rspec-rails'
|
109
|
+
gem 'shoulda', '>= 0'
|
110
|
+
gem 'bundler'
|
111
|
+
gem 'jeweler'
|
112
|
+
# gem 'rcov', '>= 0'
|
113
|
+
end
|
114
|
+
|
115
|
+
# these are just for production
|
116
|
+
group :production do
|
117
|
+
gem 'mysql2'
|
118
|
+
gem 'therubyracer'
|
119
|
+
gem 'uglifier'
|
120
|
+
end
|
121
|
+
END_GEMFILE
|
122
|
+
|
123
|
+
say "- Running bundle..."
|
124
|
+
system "bundle install" unless dry_run?
|
118
125
|
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
126
|
+
say "- Database setup: creating config/database.yml with development database #{options_database}"
|
127
|
+
remove_file "#{app_name}/config/database.yml" # the one that 'rails new' created
|
128
|
+
if options_database == 'mysql'
|
129
|
+
create_file "#{app_name}/config/database.yml", <<-END_DATABASEYML.strip_heredoc_with_indent
|
130
|
+
development:
|
131
|
+
adapter: mysql2
|
132
|
+
database: #{app_name}_dev
|
133
|
+
username: #{app_name}
|
134
|
+
password: #{app_name}
|
135
|
+
|
136
|
+
END_DATABASEYML
|
137
|
+
else
|
138
|
+
create_file "#{app_name}/config/database.yml", <<-END_DATABASEYML.strip_heredoc_with_indent
|
139
|
+
development:
|
140
|
+
adapter: sqlite3
|
141
|
+
database: db/development.sqlite3
|
142
|
+
pool: 5
|
143
|
+
timeout: 5000
|
144
|
+
|
145
|
+
END_DATABASEYML
|
146
|
+
end
|
147
|
+
append_file "#{app_name}/config/database.yml", <<-END_DATABASEYML.strip_heredoc_with_indent
|
148
|
+
production:
|
149
|
+
adapter: mysql2
|
150
|
+
database: #{app_name}_p
|
151
|
+
username: #{app_name}
|
152
|
+
password: #{app_name}444
|
153
|
+
END_DATABASEYML
|
154
|
+
|
155
|
+
say "- Devise install..."
|
156
|
+
RVM.run "bundle exec rails g devise:install" unless dry_run?
|
157
|
+
|
158
|
+
say "- Devise User model install with added name field..."
|
159
|
+
RVM.run "bundle exec rails g devise User name:string" unless dry_run?
|
160
|
+
|
161
|
+
say "- Install ckeditor..."
|
162
|
+
RVM.run "bundle exec rails g ckeditor:install" unless dry_run?
|
163
|
+
|
164
|
+
say "- Create ckeditor config.js"
|
165
|
+
copy_file "lib/app/assets/javascripts/ckeditor/config.js", "#{app_name}/app/assets/javascripts/ckeditor/config.js"
|
166
|
+
|
167
|
+
say "- Add remotipart to application.js..."
|
168
|
+
create_file "#{app_name}/app/assets/javascripts/application.js", "//= require_tree .\n" if dry_run?
|
169
|
+
insert_into_file "#{app_name}/app/assets/javascripts/application.js", "//= require jquery.remotipart\n", :before => "//= require_tree .\n"
|
170
|
+
|
171
|
+
say "- Paper_trail install..."
|
172
|
+
RVM.run "bundle exec rails g paper_trail:install" unless dry_run?
|
173
|
+
|
174
|
+
say "- Migrating Devise and Versions"
|
175
|
+
RVM.run "bundle exec rake db:migrate" unless dry_run?
|
176
|
+
|
177
|
+
say "- Creating header in app/views/inline_forms/_header.html.erb..."
|
178
|
+
create_file "#{app_name}/app/views/inline_forms/_header.html.erb", <<-END_HEADER.strip_heredoc_with_indent
|
179
|
+
<div id='Header'>
|
180
|
+
<div id='title'>
|
181
|
+
#{app_name} v<%= inline_forms_version -%>
|
182
|
+
</div>
|
183
|
+
<% if current_user -%>
|
184
|
+
<div id='logout'>
|
185
|
+
<%= link_to \"Afmelden: \#{current_user.name}\", destroy_user_session_path, :method => :delete %>
|
186
|
+
</div>
|
187
|
+
<% end -%>
|
188
|
+
<div style='clear: both;'></div>
|
189
|
+
</div>
|
190
|
+
END_HEADER
|
191
|
+
|
192
|
+
say "- Recreating ApplicationHelper to set application_name and application_title..."
|
193
|
+
remove_file "#{app_name}/app/helpers/application_helper.rb" # the one that 'rails new' created
|
194
|
+
create_file "#{app_name}/app/helpers/application_helper.rb", <<-END_APPHELPER.strip_heredoc_with_indent
|
195
|
+
module ApplicationHelper
|
196
|
+
def application_name
|
197
|
+
#{app_name}
|
198
|
+
end
|
199
|
+
def application_title
|
200
|
+
#{app_name}
|
201
|
+
end
|
202
|
+
end
|
203
|
+
END_APPHELPER
|
204
|
+
|
205
|
+
say "- Recreating ApplicationController to add devise and cancan stuff..."
|
206
|
+
remove_file "#{app_name}/app/controllers/application_controller.rb" # the one that 'rails new' created
|
207
|
+
create_file "#{app_name}/app/controllers/application_controller.rb", <<-END_APPCONTROLLER.strip_heredoc_with_indent
|
208
|
+
class ApplicationController < ActionController::Base
|
209
|
+
protect_from_forgery
|
210
|
+
|
211
|
+
# before_filter :authenticate_user!
|
212
|
+
# check_authorization :unless => :devise_controller?
|
213
|
+
|
214
|
+
# rescue_from CanCan::AccessDenied do |exception|
|
215
|
+
# sign_out :user if user_signed_in?
|
216
|
+
# redirect_to new_user_session_path, :alert => exception.message
|
217
|
+
# end
|
218
|
+
end
|
219
|
+
END_APPCONTROLLER
|
220
|
+
|
221
|
+
# create environments/production.rb if it's a dry run
|
222
|
+
create_file "#{app_name}/config/environments/production.rb", " # config.assets.precompile += %w( search.js )\nend\n" if dry_run?
|
223
|
+
|
224
|
+
say "- Injecting precompile assets stuff in environments/production.rb..."
|
225
|
+
insert_into_file "#{app_name}/config/environments/production.rb",
|
226
|
+
" config.assets.precompile += %w(inline_forms_application.js inline_forms_application.css devise.css)\n",
|
227
|
+
:after => " # config.assets.precompile += %w( search.js )\n"
|
228
|
+
|
229
|
+
say "- Injecting devise mailer stuff in environments/production.rb..."
|
230
|
+
insert_into_file "#{app_name}/config/environments/production.rb", <<-DEVISE_MAILER_STUFF.strip_heredoc_with_indent(2), :before => "end\n"
|
231
|
+
|
232
|
+
# for devise
|
233
|
+
config.action_mailer.default_url_options = { :protocol => 'https', :host => 'YOURHOSTNAME' }
|
234
|
+
config.action_mailer.delivery_method = :smtp
|
235
|
+
config.action_mailer.smtp_settings = {
|
236
|
+
:address => 'YOURMAILSERVER',
|
237
|
+
:enable_starttls_auto => true,
|
238
|
+
:password => 'YOURPASSWORD',
|
239
|
+
:user_name => 'YOURUSERNAME'
|
240
|
+
}
|
241
|
+
|
242
|
+
DEVISE_MAILER_STUFF
|
243
|
+
|
244
|
+
say "- Setting config.assets.compile to true in environments/production.rb..."
|
245
|
+
insert_into_file "#{app_name}/config/environments/production.rb", " config.assets.compile = false\n", :before => "end\n" if dry_run?
|
246
|
+
insert_into_file "#{app_name}/config/environments/production.rb", <<-COMPILE_ASSETS.strip_heredoc_with_indent(2), :after => " config.assets.compile = false\n"
|
247
|
+
# Fallback to assets pipeline if a precompiled asset is missed, we need this for ckeditor
|
248
|
+
config.assets.compile = true
|
249
|
+
COMPILE_ASSETS
|
250
|
+
|
251
|
+
comment_lines "#{app_name}/config/environments/production.rb", /config\.assets\.compile = false/
|
252
|
+
|
253
|
+
say "- Capify..."
|
254
|
+
RVM.run 'capify .'
|
255
|
+
remove_file "#{app_name}/config/deploy.rb" # remove the file capify created!
|
256
|
+
copy_file "lib/generators/templates/deploy.rb", "#{app_name}/config/deploy.rb"
|
257
|
+
|
258
|
+
say "- Unicorn Config..."
|
259
|
+
copy_file "lib/generators/templates/unicorn.rb", "#{app_name}/config/unicorn.rb"
|
260
|
+
|
261
|
+
say "- Initializing git..."
|
262
|
+
RVM.run 'git init'
|
263
|
+
create_file "#{app_name}/.gitignore", "/tmp\n" if dry_run?
|
264
|
+
insert_into_file "#{app_name}/.gitignore", <<-GITIGNORE.strip_heredoc_with_indent, :after => "/tmp\n"
|
265
|
+
# netbeans
|
266
|
+
nbproject
|
267
|
+
# remotipart uploads
|
268
|
+
public/uploads
|
269
|
+
GITIGNORE
|
270
|
+
|
271
|
+
RVM.run 'git add .'
|
272
|
+
RVM.run 'git commit -a -m " * Initial"'
|
273
|
+
|
274
|
+
say "\nDone! Now make your tables with 'rails g inline_forms ...", :green
|
275
|
+
#say "- Don't forget: edit .rvmrc, config/{routes.rb, deploy.rb}, .git/config, delete public/index.html\n"
|
276
|
+
|
277
|
+
end
|
278
|
+
end
|
279
|
+
Creator.start
|
182
280
|
end
|
183
281
|
end
|
184
|
-
"
|
185
|
-
File.open( 'app/helpers/application_helper.rb', 'w') {|f| f.write(app_helper) }
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
puts "Overwriting application_controller...\n"
|
190
|
-
app_cont = "
|
191
|
-
class ApplicationController < ActionController::Base
|
192
|
-
protect_from_forgery
|
193
|
-
|
194
|
-
# before_filter :authenticate_user!
|
195
|
-
# check_authorization :unless => :devise_controller?
|
196
|
-
|
197
|
-
# rescue_from CanCan::AccessDenied do |exception|
|
198
|
-
# sign_out :user if user_signed_in?
|
199
|
-
# redirect_to new_user_session_path, :alert => exception.message
|
200
|
-
# end
|
201
|
-
end
|
202
|
-
"
|
203
|
-
File.open( 'app/controllers/application_controller.rb', 'w+') {|f| f.write(app_cont) }
|
204
|
-
|
205
|
-
puts "Injecting precompile assets stuff in production.rb...\n"
|
206
|
-
precomp = "
|
207
|
-
\n
|
208
|
-
\n
|
209
|
-
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
210
|
-
#{app_name}::Application.configure do
|
211
|
-
config.assets.precompile += %w( inline_forms_application.js inline_forms_application.css devise.css )
|
212
|
-
# Fallback to assets pipeline if a precompiled asset is missed, we need this for ckeditor
|
213
|
-
config.assets.compile = true
|
214
|
-
# for devise
|
215
|
-
config.action_mailer.default_url_options = { :protocol => 'https', :host => 'YOURHOSTNAME' }
|
216
|
-
|
217
|
-
config.action_mailer.delivery_method = :smtp
|
218
|
-
config.action_mailer.smtp_settings = {
|
219
|
-
:address => 'YOURMAILSERVER',
|
220
|
-
:enable_starttls_auto => true,
|
221
|
-
:password => 'YOURPASSWORD',
|
222
|
-
:user_name => 'YOURUSERNAME'
|
223
|
-
}
|
224
|
-
end
|
225
|
-
\n"
|
226
|
-
File.open( 'config/environments/production.rb', 'a') {|f| f.write(precomp) }
|
227
|
-
|
228
|
-
puts "Capify...\n"
|
229
|
-
system('capify .')
|
230
|
-
system("cp #{src}/lib/generators/templates/deploy.rb config/deploy.rb")
|
231
|
-
|
232
|
-
puts "Unicorn Config...\n"
|
233
|
-
system("cp #{src}/lib/generators/templates/unicorn.rb config/unicorn.rb")
|
234
|
-
|
235
|
-
puts "Initializing git...\n"
|
236
|
-
system('git init')
|
237
|
-
system('echo >> .gitignore')
|
238
|
-
system('echo "nbproject" >> .gitignore')
|
239
|
-
system('echo "public/uploads" >> .gitignore')
|
240
|
-
system('echo >> .gitignore')
|
241
|
-
system('git add .')
|
242
|
-
system('git commit -a -m " * Initial"')
|
243
|
-
|
244
|
-
puts "\n\nDone! Now make your tables with 'rails g inline_forms ...\n"
|
245
|
-
puts "\nDon't forget: edit .rvmrc, config/{routes.rb, deploy.rb}, .git/config, delete public/index.html\n\n"
|
246
|
-
|
247
|
-
end
|
248
|
-
|
data/lib/inline_forms/version.rb
CHANGED