not-quite-submodules 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/not-quite-submodules.rb +3 -2
- data/not-quite-submodules.gemspec +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/lib/not-quite-submodules.rb
CHANGED
@@ -6,10 +6,11 @@ require 'digest/sha1'
|
|
6
6
|
class NotQuiteSubmodules
|
7
7
|
class << self
|
8
8
|
# Update configuration repository every day
|
9
|
-
|
9
|
+
DEFAULT_UPDATE_INTERVAL = 60 * 60 * 24
|
10
10
|
|
11
11
|
def initialize(repository, target_path, args = {})
|
12
12
|
args[:target_path] = target_path
|
13
|
+
@update_interval = args[:update_interval] || DEFAULT_UPDATE_INTERVAL
|
13
14
|
|
14
15
|
if args[:temp_path].nil?
|
15
16
|
tmp_name = (Digest::SHA1.hexdigest repository)
|
@@ -106,7 +107,7 @@ private
|
|
106
107
|
# touched (by the #update_repository method)
|
107
108
|
def repository_needs_update?(temp_path)
|
108
109
|
return true if !ENV["FORCE_UPDATE"].nil?
|
109
|
-
(Time.now - File.mtime(temp_path)) >
|
110
|
+
(Time.now - File.mtime(temp_path)) > @update_interval
|
110
111
|
end
|
111
112
|
|
112
113
|
# Pull the latest contents (including tags) for the repository
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: not-quite-submodules
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -172,7 +172,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
172
172
|
version: '0'
|
173
173
|
segments:
|
174
174
|
- 0
|
175
|
-
hash: -
|
175
|
+
hash: -2096812673318803401
|
176
176
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
177
177
|
none: false
|
178
178
|
requirements:
|