captify 0.2.0 → 0.2.1
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/VERSION +1 -1
- data/captify.gemspec +2 -2
- data/lib/captify/template.rb +21 -1
- metadata +3 -3
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.2.
|
|
1
|
+
0.2.1
|
data/captify.gemspec
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = "captify"
|
|
8
|
-
s.version = "0.2.
|
|
8
|
+
s.version = "0.2.1"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
11
|
s.authors = ["Huiming Teo"]
|
|
12
|
-
s.date = "2012-06-
|
|
12
|
+
s.date = "2012-06-12"
|
|
13
13
|
s.description = "Capistrano capify with canned templates."
|
|
14
14
|
s.email = "teohuiming@gmail.com"
|
|
15
15
|
s.executables = ["captify"]
|
data/lib/captify/template.rb
CHANGED
|
@@ -1,7 +1,27 @@
|
|
|
1
1
|
module Captify
|
|
2
2
|
class Template
|
|
3
|
+
|
|
4
|
+
def self.find_files_in_load_path(glob)
|
|
5
|
+
$LOAD_PATH.map { |load_path|
|
|
6
|
+
Dir["#{File.expand_path glob, load_path}#{Gem.suffix_pattern}"]
|
|
7
|
+
}.flatten.select { |file| File.file? file.untaint }
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def self.find_files_in_latest_gems(glob, prelease=false)
|
|
11
|
+
Gem::Specification.latest_specs(:prelease => prelease).map { |spec|
|
|
12
|
+
spec.matches_for_glob("#{glob}#{Gem.suffix_pattern}")
|
|
13
|
+
}.flatten
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def self.find_latest_files(glob, check_load_path=true)
|
|
17
|
+
files = []
|
|
18
|
+
files = find_files_in_load_path(glob) if check_load_path
|
|
19
|
+
files.concat find_files_in_latest_gems(glob)
|
|
20
|
+
return files
|
|
21
|
+
end
|
|
22
|
+
|
|
3
23
|
def self.load_all
|
|
4
|
-
|
|
24
|
+
find_latest_files('captify_template').each do |path|
|
|
5
25
|
load path if File.exist? path
|
|
6
26
|
end
|
|
7
27
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: captify
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.1
|
|
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-06-
|
|
12
|
+
date: 2012-06-12 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: capistrano
|
|
@@ -109,7 +109,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
109
109
|
version: '0'
|
|
110
110
|
segments:
|
|
111
111
|
- 0
|
|
112
|
-
hash:
|
|
112
|
+
hash: 3703749771761234941
|
|
113
113
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
114
|
none: false
|
|
115
115
|
requirements:
|