dev 2.0.208 → 2.0.209

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/apps/git.rb +10 -2
  3. data/lib/base/project.rb +25 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a5c4c21f70fc445431dc7528ec77d210055511e7
4
- data.tar.gz: 1b23bc8d465d94c0c208a5d226b203f7f31ee0d5
3
+ metadata.gz: a49e0279ff0a40f386a7e2a5fe6b02711a08f7e9
4
+ data.tar.gz: fb81b9898965140ac8a0857c25a44510eef87648
5
5
  SHA512:
6
- metadata.gz: 357b1699f758efce8f8d6f9d24ff506f64664bd06e739afb14ad7c664ceb8b590add4ca88dd9b9d16d418595d53aaf544c4634d608978f0f97f2ef346e458781
7
- data.tar.gz: 467dfe422672a6c41a7f797107391b6166a5b2f5fbe77fd7e01639704cf2ed0e542b7c09aa7018b1a6ac3139d913cbf3f1c972ed9f568c615bd514e4457fd36a
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
- `git describe --abbrev=0 --tags`.strip
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=Git.latest_tag if tag.length==0
131
+ tag=latest_tag if tag.length==0
108
132
 
109
133
  raise 'no tag specified' if tag.length==0
110
134
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dev
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.208
4
+ version: 2.0.209
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lou Parslow