dev_tasks 0.0.100 → 0.0.101
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/pull.rb +2 -1
- data/lib/spec.json +1 -1
- data/lib/timer.rb +7 -0
- 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: 90663322bd72454b78e0895747b4b1e1c3aa3bac
|
4
|
+
data.tar.gz: df60f6ad54d03eec27763bb72a8daedd742179f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 451647ec4c7f078ae16b55a1bb8aaa55a12f5f0fe0652716ece00464543a82fb78e253be1f6955ff728d9f7943d83dd19658b6a8e31555782c441d33029397fe
|
7
|
+
data.tar.gz: 8f608f191176f57807e9bf99d5c21c715bb20fdfa6d5c71ddf6c1fa491dee11b76ffbf0384f6db8de5c61b07978d9d16e773b29b0004dc22ad5913072435b077
|
data/lib/pull.rb
CHANGED
@@ -9,7 +9,8 @@ class Pull < Array
|
|
9
9
|
|
10
10
|
def update
|
11
11
|
if(Environment.scm=='git')
|
12
|
-
if(Timer.
|
12
|
+
if(Timer.elapsed_exceeds?("last_pull",60*60*2))
|
13
|
+
#if(Timer.get_elapsed("last_pull").nil? || Timer.get_elapsed("last_pull") > 60*60*2)
|
13
14
|
self.add "<%`git pull 2>&1`%>"
|
14
15
|
self.add "<%Timer.set_timestamp('last_pull')%>"
|
15
16
|
end
|
data/lib/spec.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"name":"dev_tasks","version":"0.0.
|
1
|
+
{"name":"dev_tasks","version":"0.0.101"}
|
data/lib/timer.rb
CHANGED
@@ -13,6 +13,13 @@ class Timer
|
|
13
13
|
elapsed_str="[" + "%.0f" %(elapsed) + "s]"
|
14
14
|
end
|
15
15
|
|
16
|
+
def self.elapsed_exceeds?(name,duration_seconds)
|
17
|
+
if(Timer.get_elapsed(name).nil? || Timer.get_elapsed(name) > duration_seconds)
|
18
|
+
return true
|
19
|
+
end
|
20
|
+
return false
|
21
|
+
end
|
22
|
+
|
16
23
|
def self.get_elapsed(name)
|
17
24
|
timestamp=get_timestamp(name)
|
18
25
|
return Time.now-timestamp if(!timestamp.nil?)
|