MrMurano 1.5.0 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/MrMurano/Solution-Services.rb +17 -3
- data/lib/MrMurano/commands/productSpec.rb +2 -2
- data/lib/MrMurano/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac2a53f721bb1eb5785155d07e9a0f63afb07b43
|
4
|
+
data.tar.gz: d0deb6961935b84b30766580fb1f3e66dc1439ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3694669cfcc0b7a9588cff924ac3aa9516e5a30194a9884cdb3911617542d813a3015f3b7cc4a72cf08eaf71f6dcd886d63cd8fa029297316627fb2f49aa5d1c
|
7
|
+
data.tar.gz: 0a510f4d9d497057a7b3371be4f792720f4d84eb9ee815be2dfcbcd580329835f4f0461c7bf746785482285514ce31045a414e523575ac66d173b84646a14c75
|
@@ -3,6 +3,7 @@ require 'net/http'
|
|
3
3
|
require 'json'
|
4
4
|
require 'yaml'
|
5
5
|
require 'date'
|
6
|
+
require 'digest/sha1'
|
6
7
|
require 'MrMurano/Solution'
|
7
8
|
|
8
9
|
module MrMurano
|
@@ -94,18 +95,22 @@ module MrMurano
|
|
94
95
|
|
95
96
|
def cacheUpdateTimeFor(local_path, time=nil)
|
96
97
|
time = Time.now.getutc if time.nil?
|
98
|
+
entry = {
|
99
|
+
:sha1=>Digest::SHA1.file(local_path.to_s).hexdigest,
|
100
|
+
:updated_at=>time.to_datetime.iso8601(3)
|
101
|
+
}
|
97
102
|
cacheFile = $cfg.file_at("cache.#{self.class.to_s}.yaml")
|
98
103
|
if cacheFile.file? then
|
99
104
|
cacheFile.open('r+') do |io|
|
100
105
|
cache = YAML.load(io)
|
101
106
|
io.rewind
|
102
|
-
cache[local_path.to_s] =
|
107
|
+
cache[local_path.to_s] = entry
|
103
108
|
io << cache.to_yaml
|
104
109
|
end
|
105
110
|
else
|
106
111
|
cacheFile.open('w') do |io|
|
107
112
|
cache = {}
|
108
|
-
cache[local_path.to_s] =
|
113
|
+
cache[local_path.to_s] = entry
|
109
114
|
io << cache.to_yaml
|
110
115
|
end
|
111
116
|
end
|
@@ -113,13 +118,22 @@ module MrMurano
|
|
113
118
|
end
|
114
119
|
|
115
120
|
def cachedUpdateTimeFor(local_path)
|
121
|
+
cksm = Digest::SHA1.file(local_path.to_s).hexdigest
|
116
122
|
cacheFile = $cfg.file_at("cache.#{self.class.to_s}.yaml")
|
117
123
|
return nil unless cacheFile.file?
|
118
124
|
ret = nil
|
119
125
|
cacheFile.open('r') do |io|
|
120
126
|
cache = YAML.load(io)
|
121
127
|
if cache.has_key?(local_path.to_s) then
|
122
|
-
|
128
|
+
entry = cache[local_path.to_s]
|
129
|
+
debug("For #{local_path}:")
|
130
|
+
debug(" cached: #{entry.to_s}")
|
131
|
+
debug(" cm: #{cksm}")
|
132
|
+
if entry.kind_of?(Hash) then
|
133
|
+
if entry[:sha1] == cksm and entry.has_key?(:updated_at) then
|
134
|
+
ret = DateTime.parse(entry[:updated_at])
|
135
|
+
end
|
136
|
+
end
|
123
137
|
end
|
124
138
|
end
|
125
139
|
ret
|
@@ -55,11 +55,11 @@ command 'product spec' do |c|
|
|
55
55
|
file = $cfg["p-#{prid}.spec"] unless prid.nil? or $cfg["p-#{prid}.spec"].nil?
|
56
56
|
file = options.file unless options.file.nil?
|
57
57
|
|
58
|
-
if FileTest.exist?(file) then
|
58
|
+
if not file.nil? and FileTest.exist?(file) then
|
59
59
|
prd = MrMurano::Product.new
|
60
60
|
pp prd.update(file)
|
61
61
|
else
|
62
|
-
say_error "
|
62
|
+
say_error "No spec file to push: #{file}"
|
63
63
|
end
|
64
64
|
end
|
65
65
|
end
|
data/lib/MrMurano/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: MrMurano
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Conrad Tadpol Tilstra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|