capifony 2.0.9 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/CHANGELOG +4 -0
  2. data/bin/capifony +22 -15
  3. metadata +4 -4
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ == 2.1.0 / June 24, 2011
2
+
3
+ * fully support different app path
4
+
1
5
  == 2.0.9 / June 15, 2011
2
6
 
3
7
  * migrations fixed in Symfony2
@@ -3,7 +3,8 @@
3
3
  require 'optparse'
4
4
  require 'fileutils'
5
5
 
6
- symfony_version_option = nil
6
+ symfony_version = nil
7
+ symfony_app_path = 'app'
7
8
 
8
9
  OptionParser.new do |opts|
9
10
  opts.banner = "Usage: #{File.basename($0)} [path]"
@@ -14,7 +15,11 @@ OptionParser.new do |opts|
14
15
  end
15
16
 
16
17
  opts.on("-s", "--symfony VERSION", "Capify specific symfony verion (1|2)") do |version|
17
- symfony_version_option = version.to_i
18
+ symfony_version = version.to_i
19
+ end
20
+
21
+ opts.on("-p", "--app NAME", "Specify app name (folder) to capify") do |path|
22
+ symfony_app_path = path
18
23
  end
19
24
 
20
25
  begin
@@ -42,8 +47,7 @@ def unindent(string)
42
47
  end
43
48
 
44
49
  base = ARGV.shift
45
- symfony_version = (File.directory? File.join(base, 'config')) ? 1 : 2
46
- symfony_version = symfony_version_option == nil ? symfony_version : symfony_version_option
50
+ symfony_version = symfony_version || ((File.directory? File.join(base, 'config')) ? 1 : 2)
47
51
 
48
52
  if symfony_version == 2
49
53
  files = {
@@ -51,22 +55,25 @@ if symfony_version == 2
51
55
  load 'deploy' if respond_to?(:namespace) # cap2 differentiator
52
56
  Dir['vendor/bundles/*/*/recipes/*.rb'].each { |bundle| load(bundle) }
53
57
  load Gem.required_location('capifony', 'symfony2.rb')
54
- load 'app/config/deploy'
58
+ load '#{symfony_app_path}/config/deploy'
55
59
  FILE
56
60
 
57
- "app/config/deploy.rb" => 'set :application, "set your application name here"
58
- set :domain, "#{application}.com"
59
- set :deploy_to, "/var/www/#{domain}"
61
+ "#{symfony_app_path}/config/deploy.rb" => unindent(<<-FILE)
62
+ set :application, "set your application name here"
63
+ set :domain, "\#{application}.com"
64
+ set :deploy_to, "/var/www/\#{domain}"
65
+ set :app_path, "#{symfony_app_path}"
60
66
 
61
- set :repository, "#{domain}:/var/repos/#{application}.git"
62
- set :scm, :git
63
- # Or: `accurev`, `bzr`, `cvs`, `darcs`, `subversion`, `mercurial`, `perforce`, `subversion` or `none`
67
+ set :repository, "\#{domain}:/var/repos/\#{application}.git"
68
+ set :scm, :git
69
+ # Or: `accurev`, `bzr`, `cvs`, `darcs`, `subversion`, `mercurial`, `perforce`, `subversion` or `none`
64
70
 
65
- role :web, domain # Your HTTP server, Apache/etc
66
- role :app, domain # This may be the same as your `Web` server
67
- role :db, domain, :primary => true # This is where Rails migrations will run
71
+ role :web, domain # Your HTTP server, Apache/etc
72
+ role :app, domain # This may be the same as your `Web` server
73
+ role :db, domain, :primary => true # This is where Rails migrations will run
68
74
 
69
- set :keep_releases, 3'
75
+ set :keep_releases, 3
76
+ FILE
70
77
  }
71
78
  else
72
79
  files = {
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capifony
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
+ - 1
8
9
  - 0
9
- - 9
10
- version: 2.0.9
10
+ version: 2.1.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Konstantin Kudryashov
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-06-15 00:00:00 +03:00
18
+ date: 2011-06-24 00:00:00 +03:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency