not-quite-submodules 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.0
1
+ 0.4.1
@@ -18,6 +18,8 @@ class NotQuiteSubmodules
18
18
  args[:temp_path] = "#{Dir.tmpdir}/#{tmp_name[0..8]}"
19
19
  end
20
20
 
21
+ check_temporary_repository(args[:temp_path])
22
+
21
23
  if !File.directory? args[:temp_path]
22
24
  clone_repository(repository, args[:temp_path])
23
25
  elsif repository_needs_update?(args[:temp_path])
@@ -128,6 +130,20 @@ private
128
130
  execute_command("touch #{temp_path}")
129
131
  end
130
132
 
133
+ # Since we're using a system temp directory by default, parts of the repository
134
+ # may be deleted as part of OS cleanup (at least this seems to be the case with
135
+ # OSX, since the repository became randomly invalid after standby/reboot). Therefore,
136
+ # we need to check if the repository is still valid, and delete it if it is not.
137
+ def check_temporary_repository(temp_path)
138
+ in_dir_do(temp_path) do
139
+ `git status`
140
+ if $? != 0
141
+ tell "Repository at temporary path seems to be invalid. Deleting it."
142
+ FileUtils.rm_r temp_path
143
+ end
144
+ end
145
+ end
146
+
131
147
  def tell(text)
132
148
  if @wrote_banner.nil?
133
149
  puts "[NotQuiteSubmodules]"
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "not-quite-submodules"
8
- s.version = "0.4.0"
8
+ s.version = "0.4.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Lucas Jenss"]
12
- s.date = "2013-04-18"
12
+ s.date = "2013-04-26"
13
13
  s.description = "This gem can be used to automatically clone an update a git repository, relying on tags to see if a newer version of the repository is available."
14
14
  s.email = "lucas@x3ro.de"
15
15
  s.extra_rdoc_files = [
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.0
4
+ version: 0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-18 00:00:00.000000000 Z
12
+ date: 2013-04-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: versionomy
@@ -172,7 +172,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
172
172
  version: '0'
173
173
  segments:
174
174
  - 0
175
- hash: -4321208896240466877
175
+ hash: 1070972143398926735
176
176
  required_rubygems_version: !ruby/object:Gem::Requirement
177
177
  none: false
178
178
  requirements: