capistrano-upstart 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Capistrano::Upstart
1
+ # capistrano-upstart
2
2
 
3
3
  a capistrano recipe to manage upstart service.
4
4
 
@@ -18,4 +18,6 @@ Gem::Specification.new do |gem|
18
18
  gem.require_paths = ["lib"]
19
19
 
20
20
  gem.add_dependency("capistrano")
21
+ gem.add_dependency("capistrano-file-resources", "~> 0.0.1")
22
+ gem.add_dependency("capistrano-file-transfer-ext", "~> 0.0.3")
21
23
  end
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Upstart
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -1,5 +1,7 @@
1
1
  require "capistrano-upstart/version"
2
- require 'erb'
2
+ require "capistrano/configuration/actions/file_transfer_ext"
3
+ require "capistrano/configuration/resources/file_resources"
4
+ require "erb"
3
5
 
4
6
  module Capistrano
5
7
  module Upstart
@@ -27,9 +29,7 @@ module Capistrano
27
29
  _cset(:upstart_template_files) {
28
30
  [
29
31
  "#{upstart_service_name}.conf",
30
- "#{upstart_service_name}.conf.erb",
31
32
  "upstart.conf",
32
- "upstart.conf.erb",
33
33
  ]
34
34
  }
35
35
 
@@ -70,22 +70,11 @@ module Capistrano
70
70
  after 'deploy:setup', 'upstart:setup'
71
71
 
72
72
  task(:configure, :roles => :app, :except => { :no_release => true }) {
73
- tempfile = '/tmp/upstart.conf'
74
- begin
75
- template = upstart_template_files.map { |f| File.join(upstart_template_source_path, f) }.find { |t| File.file?(t) }
76
- unless template
77
- abort("could not find template for upstart configuration file for `#{upstart_service_name}'.")
78
- end
79
- case File.extname(template)
80
- when '.erb'
81
- put(ERB.new(File.read(template)).result(binding), tempfile)
82
- else
83
- put(File.read(template), tempfile)
84
- end
85
- run("diff -u #{upstart_service_file} #{tempfile} || #{sudo} mv -f #{tempfile} #{upstart_service_file}")
86
- ensure
87
- run("rm -f #{tempfile}")
88
- end
73
+ t = upstart_template_files.find { |f|
74
+ File.file?(File.join(upstart_template_source_path, "#{f}.erb")) or File.file?(File.join(upstart_template_source_path, f))
75
+ }
76
+ abort("could not find template for upstart configuration file for `#{upstart_service_name}'.") unless t
77
+ safe_put(template(t, :path => upstart_template_source_path), upstart_service_file, :place => :if_modified, :sudo => true)
89
78
  }
90
79
 
91
80
  desc("Start upstart service.")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-upstart
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
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-09-28 00:00:00.000000000 Z
12
+ date: 2013-02-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano
@@ -27,6 +27,38 @@ dependencies:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: capistrano-file-resources
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: 0.0.1
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 0.0.1
46
+ - !ruby/object:Gem::Dependency
47
+ name: capistrano-file-transfer-ext
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: 0.0.3
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 0.0.3
30
62
  description: a capistrano recipe to manage upstart serivce.
31
63
  email:
32
64
  - yamashita@geishatokyo.com