funkenplate 0.0.2 → 0.0.3

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/funkenplate CHANGED
@@ -3,7 +3,7 @@
3
3
  require 'rubygems'
4
4
 
5
5
  puts
6
- puts "FUNKENPLATE"
6
+ puts "Version: #{Gem.source_index.find_name('funkenplate').last.version.version}"
7
7
  puts
8
8
  puts "Online Usage:"
9
9
  puts "rails myapp --template http://github.com/funkensturm/funkenplate/raw/master/funkenplate.rb"
data/funkenplate.rb CHANGED
@@ -125,7 +125,7 @@ print_table [
125
125
  ['Application Server domain:', @secrets[:deploy][:app_server][:domain]],
126
126
  ['Application Server SSH user:', @secrets[:deploy][:app_server][:user]],
127
127
  ['Application Server SSH port:', @secrets[:deploy][:app_server][:port]],
128
- ['Github account:', @secrets[:deploy][:app_server][:user]],
128
+ ['Github account:', @secrets[:deploy][:github][:account]],
129
129
  ['Location of your SSH key:', @secrets[:deploy][:app_server][:keys]],
130
130
  ], :ident => 16
131
131
 
@@ -170,11 +170,13 @@ initializer 'extensions.rb',
170
170
  Dir.glob(File.join(Rails.root, 'lib', 'rails_extensions', '*.rb')) { |file| require file }\n
171
171
  Dir.glob(File.join(Rails.root, 'lib', 'gem_extensions', '*.rb')) { |file| require file }\n"
172
172
 
173
+ say_status :TASK, 'Creating initializer for the private directory...', :magenta
174
+ initializer 'directory.rb', read_template(File.join(templates_path, 'config', 'initializers', 'directories.rb'))
173
175
 
174
176
  say_status :TASK, 'Creating sample database.yml...', :magenta
175
177
  file 'config/database.yml.sample', "
176
178
  # HINT: If you are on the server, you might want to delete
177
- # the :development and :test database definition in this file.
179
+ # the \"development\" and \"test\" database definition in this file.
178
180
  # This way you won't accidentally work on a development database.
179
181
  #
180
182
  \n\n#{File.new('config/database.yml').read}"
@@ -183,10 +185,8 @@ say_status :TASK, 'Creating TextMate project file...', :magenta
183
185
  file "#{app_name}.tmproj", apply_template(File.join(templates_path, 'tmproj'))
184
186
 
185
187
  say_status :TASK, 'Adding backtrace silencers...', :magenta
186
- append_file 'config/initializers/backtrace_silencers.rb' do
187
- "bc.add_silencer { |line| line =~ /^\s*passenger/ }\n
188
- bc.clean(exception.backtrace)"
189
- end
188
+ append_file 'config/initializers/backtrace_silencers.rb',
189
+ "Rails.backtrace_cleaner.add_silencer { |line| line =~ /^\s*passenger/ }"
190
190
 
191
191
  # –––––––
192
192
  # GIT
@@ -207,8 +207,8 @@ git :add => '.'
207
207
  git :commit => "-a -m 'Initial commit.'"
208
208
 
209
209
  say_status :GIT, 'Adding repository remotes for the fs server ...', :magenta
210
- run "git remote add fs #{apply_template(File.join(templates_path, 'deploy', 'repositories', 'fs_remote_fs'))}"
211
- run "git remote add fs.git #{apply_template(File.join(templates_path, 'deploy', 'repositories', 'fs_remote_git'))}"
210
+ run "git remote add fs #{apply_template(File.join(templates_path, 'config', 'deploy', 'repositories', 'fs_remote_fs'))}"
211
+ run "git remote add fs.git #{apply_template(File.join(templates_path, 'config', 'deploy', 'repositories', 'fs_remote_git'))}"
212
212
 
213
213
  # ––––––––––
214
214
  # CAPISTRANO
@@ -223,20 +223,20 @@ say_status :CAPISTRANO, 'Backup original deploy.rb...', :magenta
223
223
  run 'cp config/deploy.rb config/deploy.rb.sample'
224
224
 
225
225
  deploy_header = [
226
- apply_template(File.join(templates_path, 'deploy', 'header.rb')),
227
- apply_template(File.join(templates_path, 'deploy', 'options.rb'))
226
+ apply_template(File.join(templates_path, 'config', 'deploy', 'header.rb')),
227
+ apply_template(File.join(templates_path, 'config', 'deploy', 'options.rb'))
228
228
  ].join("\n")
229
229
 
230
230
  deploy_footer = [
231
- apply_template(File.join(templates_path, 'deploy', 'tasks.rb')),
232
- apply_template(File.join(templates_path, 'deploy', 'helper.rb'))
231
+ apply_template(File.join(templates_path, 'config', 'deploy', 'tasks.rb')),
232
+ apply_template(File.join(templates_path, 'config', 'deploy', 'helper.rb'))
233
233
  ].join("\n")
234
234
 
235
235
  say_status :CAPISTRANO, 'Generating deploy.fs.rb for repositories on fs server...', :magenta
236
- file 'config/deploy.fs.rb', deploy_header + "\n" + apply_template(File.join(templates_path, 'deploy', 'repositories', 'fs.rb')) + "\n" + deploy_footer
236
+ file 'config/deploy.fs.rb', deploy_header + "\n" + apply_template(File.join(templates_path, 'config', 'deploy', 'repositories', 'fs.rb')) + "\n" + deploy_footer
237
237
 
238
238
  say_status :CAPISTRANO, 'Generating deploy.github.rb for repositories on github.com...', :magenta
239
- file 'config/deploy.github.rb', deploy_header + "\n" + apply_template(File.join(templates_path, 'deploy', 'repositories', 'github.rb')) + "\n" + deploy_footer
239
+ file 'config/deploy.github.rb', deploy_header + "\n" + apply_template(File.join(templates_path, 'config', 'deploy', 'repositories', 'github.rb')) + "\n" + deploy_footer
240
240
 
241
241
  say_status :GIT, 'Commiting capistrano changes...', :magenta
242
242
  git :add => '.'
File without changes
File without changes
File without changes
@@ -76,7 +76,7 @@ namespace :funkenplate do
76
76
  unless test_remote? :writable, deploy_to
77
77
  puts "\n------------ DIRECTOY NOT WRITABLE -------------"
78
78
  puts "Please run this command as root on the server:"
79
- puts "chown #{user}:#{user} #{deploy_to} --recursively"
79
+ puts "chown #{user}:#{user} #{deploy_to} --recursive"
80
80
  puts "------------------------------------------------\n\n"
81
81
  exit
82
82
  end
@@ -0,0 +1,9 @@
1
+ PRIVATE_PATH = File.join(Rails.root, 'private')
2
+
3
+ # More examples:
4
+ # PRIVATE_UPLOAD_PATH = File.join(Rails.root, 'private', 'uploads')
5
+ # PUBLIC_UPLOAD_PATH = File.join(Rails.root, 'public', 'images', 'uploads')
6
+
7
+ [PRIVATE_PATH].each do |path|
8
+ Dir.mkdir(path) unless File.directory?(path)
9
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 2
9
- version: 0.0.2
8
+ - 3
9
+ version: 0.0.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Captain Future
@@ -31,15 +31,16 @@ files:
31
31
  - funkenplate.rb
32
32
  - MIT-LICENSE
33
33
  - README.textile
34
- - templates/deploy/header.rb
35
- - templates/deploy/helper.rb
36
- - templates/deploy/options.rb
37
- - templates/deploy/repositories/fs.rb
38
- - templates/deploy/repositories/fs_remote_fs
39
- - templates/deploy/repositories/fs_remote_git
40
- - templates/deploy/repositories/github.rb
41
- - templates/deploy/repositories/github_remote
42
- - templates/deploy/tasks.rb
34
+ - templates/config/deploy/header.rb
35
+ - templates/config/deploy/helper.rb
36
+ - templates/config/deploy/options.rb
37
+ - templates/config/deploy/repositories/fs.rb
38
+ - templates/config/deploy/repositories/fs_remote_fs
39
+ - templates/config/deploy/repositories/fs_remote_git
40
+ - templates/config/deploy/repositories/github.rb
41
+ - templates/config/deploy/repositories/github_remote
42
+ - templates/config/deploy/tasks.rb
43
+ - templates/config/initializers/directories.rb
43
44
  - templates/gitignore
44
45
  - templates/lib/core_extensions/array.rb
45
46
  - templates/lib/core_extensions/object.rb