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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 582e59cb41974922ea200196ccdaa17f61791ca7
4
- data.tar.gz: 6daed3f5cecd632b93fa95b335126efb84bb75bb
3
+ metadata.gz: ac2a53f721bb1eb5785155d07e9a0f63afb07b43
4
+ data.tar.gz: d0deb6961935b84b30766580fb1f3e66dc1439ac
5
5
  SHA512:
6
- metadata.gz: 723355b78007243ccdd74e4362969cbc7ce5dc27ecd1a722e267bb99ab795c872be7bb56da3e77b01ac3627239118676be1f7438f72eeba12ab8cd5dd3d9ac2f
7
- data.tar.gz: 43df4f2518b7df9d1830b0fdc0aba4946c1871a107830e146378b5151e7b48486a8fff3cf16bd4b303cbec16212644e9f5593711de568e590fe746d3ee2573d6
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] = time.to_datetime.iso8601(3)
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] = time.to_datetime.iso8601(3)
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
- ret = DateTime.parse(cache[local_path.to_s])
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 "File Missing: #{file}"
62
+ say_error "No spec file to push: #{file}"
63
63
  end
64
64
  end
65
65
  end
@@ -1,4 +1,4 @@
1
1
  module MrMurano
2
- VERSION = '1.5.0'.freeze
2
+ VERSION = '1.5.2'.freeze
3
3
  end
4
4
 
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.0
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-26 00:00:00.000000000 Z
11
+ date: 2016-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander