gitrb 0.1.2 → 0.1.3

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.
data/gitrb.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'gitrb'
3
- s.version = '0.1.2'
3
+ s.version = '0.1.3'
4
4
  s.summary = 'Pure ruby git implementation'
5
5
  s.author = 'Daniel Mendler'
6
6
  s.email = 'mail@daniel-mendler.de'
@@ -19,7 +19,6 @@ module Gitrb
19
19
  REVISION_PATTERN = /^[\w\-\.]+([\^~](\d+)?)*$/
20
20
  DEFAULT_ENCODING = 'utf-8'
21
21
  MIN_GIT_VERSION = '1.6.0'
22
- LOCK = 'Gitrb.Repository.lock'
23
22
 
24
23
  if RUBY_VERSION > '1.9'
25
24
  def set_encoding(s); s.force_encoding(@encoding); end
@@ -33,6 +32,7 @@ module Gitrb
33
32
  @branch = options[:branch] || 'master'
34
33
  @logger = options[:logger] || Logger.new(nil)
35
34
  @encoding = options[:encoding] || DEFAULT_ENCODING
35
+ @lock = {}
36
36
 
37
37
  @path = options[:path]
38
38
  @path.chomp!('/')
@@ -68,7 +68,7 @@ module Gitrb
68
68
 
69
69
  # Is there any transaction going on?
70
70
  def in_transaction?
71
- Thread.current[LOCK]
71
+ @lock[Thread.current.object_id]
72
72
  end
73
73
 
74
74
  # Diff
@@ -329,7 +329,7 @@ module Gitrb
329
329
  def start_transaction
330
330
  file = File.open("#{head_path}.lock", 'w')
331
331
  file.flock(File::LOCK_EX)
332
- Thread.current[LOCK] = file
332
+ @lock[Thread.current.object_id] = file
333
333
  refresh
334
334
  end
335
335
 
@@ -346,8 +346,8 @@ module Gitrb
346
346
  #
347
347
  # Release the lock file.
348
348
  def finish_transaction
349
- Thread.current[LOCK].close rescue nil
350
- Thread.current[LOCK] = nil
349
+ @lock[Thread.current.object_id].close rescue nil
350
+ @lock.delete(Thread.current.object_id)
351
351
  File.unlink("#{head_path}.lock") rescue nil
352
352
  end
353
353
 
data/lib/gitrb/tree.rb CHANGED
@@ -87,7 +87,7 @@ module Gitrb
87
87
  end
88
88
  end
89
89
 
90
- # Delete a entry on specified path.
90
+ # Delete an entry on specified path.
91
91
  def delete(path)
92
92
  path = normalize_path(path)
93
93
  if path.empty?
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitrb
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
5
4
  prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 1
9
- - 2
10
- version: 0.1.2
8
+ - 3
9
+ version: 0.1.3
11
10
  platform: ruby
12
11
  authors:
13
12
  - Daniel Mendler
@@ -15,7 +14,7 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2010-06-07 00:00:00 +02:00
17
+ date: 2010-08-11 00:00:00 +02:00
19
18
  default_executable:
20
19
  dependencies: []
21
20
 
@@ -63,27 +62,23 @@ rdoc_options: []
63
62
  require_paths:
64
63
  - lib
65
64
  required_ruby_version: !ruby/object:Gem::Requirement
66
- none: false
67
65
  requirements:
68
66
  - - ">="
69
67
  - !ruby/object:Gem::Version
70
- hash: 3
71
68
  segments:
72
69
  - 0
73
70
  version: "0"
74
71
  required_rubygems_version: !ruby/object:Gem::Requirement
75
- none: false
76
72
  requirements:
77
73
  - - ">="
78
74
  - !ruby/object:Gem::Version
79
- hash: 3
80
75
  segments:
81
76
  - 0
82
77
  version: "0"
83
78
  requirements: []
84
79
 
85
80
  rubyforge_project: gitrb
86
- rubygems_version: 1.3.7
81
+ rubygems_version: 1.3.6
87
82
  signing_key:
88
83
  specification_version: 3
89
84
  summary: Pure ruby git implementation