dev 2.0.193 → 2.0.194
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/base/project.rb +48 -1
- data/lib/tasks/test.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0563d7b60183ac907de34d6e819f28c117acc61e
|
4
|
+
data.tar.gz: b2f16cd208c4b51489f2fff9198675883ef7fda9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a167e8793cfe59baef1da3ac1a26e656aca831deabe9e67f11beea733500f203f8ce21d93f8691bb1199ee7d20bebd11c7019ca31f729d0c1b5c5db2c07083dd
|
7
|
+
data.tar.gz: e67af08a04ae5a0e408f1dc59569c16952823833b311af6f6c14b8646df9a221a082adb48ad17c0d20a5172ffafe200a60595036e34fe3a57fc08607891b1093
|
data/lib/base/project.rb
CHANGED
@@ -17,7 +17,11 @@ class Project < Hash
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.get_fullname
|
20
|
-
Rake.application.original_dir.gsub(Environment.dev_root,'').gsub('/trunk','')
|
20
|
+
Rake.application.original_dir.gsub(Environment.dev_root,'').gsub('/trunk','') .gsub('/wrk','')
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.get_fullname_from_url url
|
24
|
+
return url.gsub('http://','').gsub('http://','').gsub('.com/','/').gsub('.git','')
|
21
25
|
end
|
22
26
|
|
23
27
|
def initialize value=''
|
@@ -26,6 +30,7 @@ class Project < Hash
|
|
26
30
|
self[:fullname]=Project.get_fullname
|
27
31
|
if value.is_a?(String)
|
28
32
|
self[:url] = value if value.is_a?(String) && value.length > 0
|
33
|
+
self[:fullname] = Project.get_fullname_from_url self[:url]
|
29
34
|
elsif(value.is_a?(Hash))
|
30
35
|
value.each{|k,v|self[k]=v}
|
31
36
|
else
|
@@ -33,6 +38,9 @@ class Project < Hash
|
|
33
38
|
end
|
34
39
|
end
|
35
40
|
|
41
|
+
def url
|
42
|
+
self[:url]
|
43
|
+
end
|
36
44
|
def fullname
|
37
45
|
self[:fullname]
|
38
46
|
end
|
@@ -94,5 +102,44 @@ class Project < Hash
|
|
94
102
|
puts "#{'url'.fix(13)}: #{self[:url]}"
|
95
103
|
puts "#{'version'.fix(13)}: #{VERSION}" if defined? VERSION
|
96
104
|
end
|
105
|
+
|
106
|
+
def make_dir tag
|
107
|
+
"#{Environment.dev_root}/make/#{self.fullname}-#{tag}"
|
108
|
+
end
|
109
|
+
|
110
|
+
def make tag
|
111
|
+
rake_default=nil
|
112
|
+
logfile="#{Environment.dev_root}/log/#{self.fullname}/#{tag}/#{Environment.user}@#{Environment.machine}.json"
|
113
|
+
#logfile="#{Environment.dev_root}/log/#{Environment.machine}/#{Environment.user}/#{self.fullname}/#{tag}.json"
|
114
|
+
if(File.exists?(logfile))
|
115
|
+
# load hash from json
|
116
|
+
return Command.new(JSON.parse(IO.read(logfile)))
|
117
|
+
else
|
118
|
+
FileUtils.mkdir("#{Environment.dev_root}/make") if !File.exists? "#{Environment.dev_root}/make"
|
119
|
+
makedir="#{Environment.dev_root}/make/#{self.fullname}-#{tag}"
|
120
|
+
FileUtils.mkdir_p(File.dirname(makedir)) if !File.exists? File.dirname(makedir)
|
121
|
+
if(self[:url].include?('.git'))
|
122
|
+
clone=Command.new({:input=>"git clone #{self[:url]} #{makedir}",:quiet=>true})
|
123
|
+
clone.execute
|
124
|
+
Dir.chdir(makedir) do
|
125
|
+
checkout=Command.new({:input=>"git checkout #{tag}",:quiet=>true})
|
126
|
+
checkout.execute
|
127
|
+
FileUtils.rm_r '.git'
|
128
|
+
rake_default=Command.new('rake default')
|
129
|
+
rake_default[:quiet]=true
|
130
|
+
rake_default.execute
|
131
|
+
FileUtils.mkdir_p(File.dirname(logfile)) if !File.exists?(File.dirname(logfile))
|
132
|
+
File.open(logfile,'w'){|f|f.write(rake_default.to_json)}
|
133
|
+
rake_default
|
134
|
+
end
|
135
|
+
end
|
136
|
+
FileUtils.rm_r makedir
|
137
|
+
rake_default
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
def clobber
|
142
|
+
|
143
|
+
end
|
97
144
|
end
|
98
145
|
|
data/lib/tasks/test.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dev
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.194
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lou Parslow
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
106
|
version: '0'
|
107
107
|
requirements: []
|
108
108
|
rubyforge_project:
|
109
|
-
rubygems_version: 2.
|
109
|
+
rubygems_version: 2.4.5
|
110
110
|
signing_key:
|
111
111
|
specification_version: 4
|
112
112
|
summary: dev
|