gitrb 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,15 +1,12 @@
1
- Gem.activate 'rspec'
2
1
  require 'rake'
3
- require "rake/rdoctask"
2
+ require 'rake/rdoctask'
4
3
 
5
4
  begin
6
5
  require 'spec/rake/spectask'
7
6
  rescue LoadError
8
- puts <<-EOS
9
- To use rspec for testing you must install the rspec gem:
10
- gem install rspec
11
- EOS
12
- exit(0)
7
+ puts %{To use rspec for testing you must install the rspec gem:
8
+ gem install rspec}
9
+ exit 0
13
10
  end
14
11
 
15
12
  desc "Run all specs"
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.1'
3
+ s.version = '0.1.2'
4
4
  s.summary = 'Pure ruby git implementation'
5
5
  s.author = 'Daniel Mendler'
6
6
  s.email = 'mail@daniel-mendler.de'
data/lib/gitrb.rb CHANGED
@@ -17,3 +17,13 @@ require 'gitrb/pack'
17
17
  require 'gitrb/commit'
18
18
  require 'gitrb/trie'
19
19
  require 'gitrb/repository'
20
+
21
+ # str[0] returns a 1-char string in Ruby 1.9 but a
22
+ # Fixnum in 1.8. Monkeypatch a fix if we're on 1.8.
23
+ if !1.respond_to?(:ord)
24
+ class Fixnum
25
+ def ord
26
+ self
27
+ end
28
+ end
29
+ end
@@ -9,7 +9,11 @@ module Gitrb
9
9
 
10
10
  def method_missing(name, *args, &block)
11
11
  if @object
12
- instance_eval %{def self.#{name}(*args, &block); @object.send("#{name}", *args, &block); end}
12
+ unless name == :to_ary || name == :to_str
13
+ # Ruby 1.9 uses the presence of the to_ary and to_str methods to determine if an object is coercable.
14
+ # If we create these methods, Ruby will incorrectly think that the object can be converted to an array.
15
+ instance_eval %{def self.#{name}(*args, &block); @object.send("#{name}", *args, &block); end}
16
+ end
13
17
  @object.send(name, *args, &block)
14
18
  elsif name == :type && (mode = @properties['mode'] || @properties[:mode])
15
19
  (mode & 040000 == 040000) ? :tree : :blob
data/lib/gitrb/user.rb CHANGED
@@ -7,7 +7,7 @@ module Gitrb
7
7
 
8
8
  def dump
9
9
  off = date.gmt_offset / 60
10
- '%s <%s> %d %s%02d%02d' % [name, email, date.to_i, off < 0 ? '-' : '+', off / 60, off % 60]
10
+ '%s <%s> %d %s%02d%02d' % [name, email, date.to_i, off < 0 ? '' : '+', off / 60, off % 60]
11
11
  end
12
12
 
13
13
  def self.parse(user)
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ hash: 31
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 2
10
+ version: 0.1.2
5
11
  platform: ruby
6
12
  authors:
7
13
  - Daniel Mendler
@@ -9,11 +15,13 @@ autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2010-06-06 00:00:00 +02:00
18
+ date: 2010-06-07 00:00:00 +02:00
13
19
  default_executable:
14
20
  dependencies: []
15
21
 
16
- description: Pure ruby git implementation similar to grit.
22
+ description: |
23
+ Pure ruby git implementation similar to grit.
24
+
17
25
  email: mail@daniel-mendler.de
18
26
  executables: []
19
27
 
@@ -47,29 +55,37 @@ files:
47
55
  - test/tree_spec.rb
48
56
  has_rdoc: true
49
57
  homepage: https://github.com/minad/gitrb
58
+ licenses: []
59
+
50
60
  post_install_message:
51
61
  rdoc_options: []
52
62
 
53
63
  require_paths:
54
64
  - lib
55
65
  required_ruby_version: !ruby/object:Gem::Requirement
66
+ none: false
56
67
  requirements:
57
68
  - - ">="
58
69
  - !ruby/object:Gem::Version
70
+ hash: 3
71
+ segments:
72
+ - 0
59
73
  version: "0"
60
- version:
61
74
  required_rubygems_version: !ruby/object:Gem::Requirement
75
+ none: false
62
76
  requirements:
63
77
  - - ">="
64
78
  - !ruby/object:Gem::Version
79
+ hash: 3
80
+ segments:
81
+ - 0
65
82
  version: "0"
66
- version:
67
83
  requirements: []
68
84
 
69
85
  rubyforge_project: gitrb
70
- rubygems_version: 1.3.1
86
+ rubygems_version: 1.3.7
71
87
  signing_key:
72
- specification_version: 2
88
+ specification_version: 3
73
89
  summary: Pure ruby git implementation
74
90
  test_files: []
75
91