dev 2.0.208 → 2.0.209
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.
- checksums.yaml +4 -4
- data/lib/apps/git.rb +10 -2
- data/lib/base/project.rb +25 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a49e0279ff0a40f386a7e2a5fe6b02711a08f7e9
|
4
|
+
data.tar.gz: fb81b9898965140ac8a0857c25a44510eef87648
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 325b8e3ddb39c4350a1c23426e508392e6056776d020274391922afad9fb4dc4ca5525ca4512762a296b7548f14f5fff4dce4be8dd0c47f52b6f028df6621c55
|
7
|
+
data.tar.gz: a6998d098c3187229e1e0b3db1336158085702ac8a25e690731fcd8866237086afbd9ef8490b51ff2abb9a75d8a06417ecf1896b66ca391169726be07b8fc8d0
|
data/lib/apps/git.rb
CHANGED
@@ -113,7 +113,15 @@ class Git
|
|
113
113
|
end
|
114
114
|
end
|
115
115
|
|
116
|
-
def self.latest_tag
|
117
|
-
|
116
|
+
def self.latest_tag directory=''
|
117
|
+
if directory.length==0
|
118
|
+
`git describe --abbrev=0 --tags`.strip
|
119
|
+
else
|
120
|
+
result=''
|
121
|
+
Dir.chdir(directory) do
|
122
|
+
result=`git describe --abbrev=0 --tags`.strip
|
123
|
+
end
|
124
|
+
result
|
125
|
+
end
|
118
126
|
end
|
119
127
|
end
|
data/lib/base/project.rb
CHANGED
@@ -52,9 +52,15 @@ class Project < Hash
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def wrk_dir
|
55
|
+
FileUtils.mkdir("#{Environment.dev_root}/wrk") if !File.exists? "#{Environment.dev_root}/wrk"
|
55
56
|
"#{Environment.dev_root}/wrk/#{self.fullname}"
|
56
57
|
end
|
57
58
|
|
59
|
+
def make_dir
|
60
|
+
FileUtils.mkdir("#{Environment.dev_root}/make") if !File.exists? "#{Environment.dev_root}/make"
|
61
|
+
"#{Environment.dev_root}/make/#{self.fullname}"
|
62
|
+
end
|
63
|
+
|
58
64
|
def pull
|
59
65
|
if(File.exists?(wrk_dir) && File.exists?("#{wrk_dir}/.git"))
|
60
66
|
Dir.chdir(wrk_dir) do
|
@@ -99,12 +105,30 @@ class Project < Hash
|
|
99
105
|
puts "#{'version'.fix(13)}: #{VERSION}" if defined? VERSION
|
100
106
|
end
|
101
107
|
|
108
|
+
def latest_tag
|
109
|
+
makedir=make_dir
|
110
|
+
FileUtils.mkdir_p(File.dirname(makedir)) if !File.exists?(File.dirname(makedir))
|
111
|
+
if(File.exists?(makedir))
|
112
|
+
Dir.chdir(makedir) do
|
113
|
+
Command.exit_code('git pull')
|
114
|
+
end
|
115
|
+
else
|
116
|
+
Command.exit_code('git clone #{self.url} #{makedir}')
|
117
|
+
end
|
118
|
+
if(File.exists?(makedir))
|
119
|
+
Dir.chdir(makedir) do
|
120
|
+
return Git.latest_tag
|
121
|
+
end
|
122
|
+
end
|
123
|
+
''
|
124
|
+
end
|
125
|
+
|
102
126
|
def make_dir tag
|
103
127
|
"#{Environment.dev_root}/make/#{self.fullname}-#{tag}"
|
104
128
|
end
|
105
129
|
|
106
130
|
def make tag=''
|
107
|
-
tag=
|
131
|
+
tag=latest_tag if tag.length==0
|
108
132
|
|
109
133
|
raise 'no tag specified' if tag.length==0
|
110
134
|
|