capistrano_banner 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 68e22bb02144e977f49d7ae355b53a3511d0cbf8
4
- data.tar.gz: a5d368282895419acc92e8a81c63b73018e16c76
3
+ metadata.gz: 3ba6105981fe49e2ecee72ffbfd2e57ff7d63973
4
+ data.tar.gz: fe579acfeb6b0ddd0aec384b20ac8ae97793003e
5
5
  SHA512:
6
- metadata.gz: 9056944f37f628f0d766d1362be58572a82e07777baabe6ff4cef58b89d5836d83f0251b8b3f10a10428c3f0bf2b127da04197ee2c73c814b70bbc0f70556da2
7
- data.tar.gz: 322d117f4d36669319147611456d18dfe68c587228c627d255264138d89bc7671bf4b8c3191509cb34447393d469c9b832fb74a7b4caf5a189fba99e2d5b3b81
6
+ metadata.gz: 6da0a054d6ab6c2590cc5eb5fb142ddb13c26ea6529ecac1ff624fd6f0422f410c34ef05475997ab6524cb9de994116a3db2e22a1950efd2c0d5f128219549a2
7
+ data.tar.gz: 5c68e0539b3e5908a7786b94a312428fba7fbf3f643abb27941eaff13ef66261fbce7e8021415e4b42a4affe13ffc2121b3630b93c36173373a33b844ec08e30
@@ -3,7 +3,9 @@ require 'capistrano_banner/base'
3
3
  namespace :deploy do
4
4
  desc 'Show banner of service'
5
5
  task :banner do
6
- path = fetch(:banner_path, "./config/banner.txt")
6
+ path = fetch(:banner_path, lambda {
7
+ File.exist?("./config/banner.txt.erb") ? "./config/banner.txt.erb" : "./config/banner.txt"
8
+ })
7
9
  stage = fetch(:stage, :development)
8
10
  options = fetch(:banner_options, {})
9
11
 
@@ -10,7 +10,13 @@ module CapistranoBanner
10
10
  end
11
11
 
12
12
  def banner
13
- File.read(@path)
13
+ if @path.end_with? ".erb"
14
+ require 'erb'
15
+ template = File.read(@path)
16
+ ERB.new(template).result
17
+ else
18
+ File.read(@path)
19
+ end
14
20
  end
15
21
 
16
22
  def color_banner(color)
@@ -49,7 +55,10 @@ module CapistranoBanner
49
55
  end
50
56
  end
51
57
 
52
- def self.banner(banner_path = "./config/banner.txt", stage = fetch(:stage), options = {})
58
+ def self.banner(banner_path = nil, stage = fetch(:stage), options = {})
59
+ banner_path ||= (
60
+ File.exist?("./config/banner.txt.erb") ? "./config/banner.txt.erb" : "./config/banner.txt"
61
+ )
53
62
  Base.new(stage, banner_path).print_banner(options)
54
63
  end
55
64
  end
@@ -1,3 +1,3 @@
1
1
  module CapistranoBanner
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano_banner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - HORII Keima
@@ -9,48 +9,48 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-27 00:00:00.000000000 Z
12
+ date: 2014-04-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ">="
18
+ - - '>='
19
19
  - !ruby/object:Gem::Version
20
20
  version: 3.0.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ">="
25
+ - - '>='
26
26
  - !ruby/object:Gem::Version
27
27
  version: 3.0.0
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: term-ansicolor
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ">="
32
+ - - '>='
33
33
  - !ruby/object:Gem::Version
34
34
  version: '0'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ">="
39
+ - - '>='
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: highline
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ">="
46
+ - - '>='
47
47
  - !ruby/object:Gem::Version
48
48
  version: '0'
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - ">="
53
+ - - '>='
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  description: capistrano application banner
@@ -61,7 +61,7 @@ executables: []
61
61
  extensions: []
62
62
  extra_rdoc_files: []
63
63
  files:
64
- - ".gitignore"
64
+ - .gitignore
65
65
  - Gemfile
66
66
  - LICENSE.txt
67
67
  - README.md
@@ -81,17 +81,17 @@ require_paths:
81
81
  - lib
82
82
  required_ruby_version: !ruby/object:Gem::Requirement
83
83
  requirements:
84
- - - ">="
84
+ - - '>='
85
85
  - !ruby/object:Gem::Version
86
86
  version: '0'
87
87
  required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  requirements:
89
- - - ">="
89
+ - - '>='
90
90
  - !ruby/object:Gem::Version
91
91
  version: '0'
92
92
  requirements: []
93
93
  rubyforge_project:
94
- rubygems_version: 2.2.0
94
+ rubygems_version: 2.0.14
95
95
  signing_key:
96
96
  specification_version: 4
97
97
  summary: provides a task to display application banner