em_rugged 0.1.3 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,34 @@
1
+ # encoding: utf-8
2
+ # --
3
+ # The MIT License (MIT)
4
+ #
5
+ # Copyright (C) 2012 Gitorious AS
6
+ #
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be included in all
15
+ # copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ # SOFTWARE.
24
+ #++
25
+
26
+ module EMRugged
27
+ module Delegator
28
+ def delegate(method)
29
+ define_method(method) do |*args|
30
+ subject.send(method, *args)
31
+ end
32
+ end
33
+ end
34
+ end
@@ -24,20 +24,23 @@
24
24
  #++
25
25
  require "rugged"
26
26
  require "em_rugged/deferrable"
27
+ require "em_rugged/delegator"
27
28
 
28
29
  module EMRugged
29
30
  class Repository
30
31
  extend EMRugged::Deferrable
32
+ extend EMRugged::Delegator
31
33
 
32
34
  def initialize(root)
33
35
  @repo = Rugged::Repository.new(root)
34
36
  end
35
37
 
36
- def subject
37
- @repo
38
- end
38
+ def subject; @repo end
39
39
 
40
+ delegate :bare?
41
+ delegate :path
40
42
  defer :rev_parse
41
43
  defer :refs
44
+ defer :lookup
42
45
  end
43
46
  end
@@ -24,5 +24,5 @@
24
24
  #++
25
25
 
26
26
  module EMRugged
27
- VERSION = "0.1.3"
27
+ VERSION = "0.1.5"
28
28
  end
@@ -70,4 +70,11 @@ describe EMRugged::Repository do
70
70
  wait!
71
71
  end
72
72
  end
73
+
74
+ describe "#bare?" do
75
+ it "delegates to subject" do
76
+ repo = EMRugged::Repository.new(".")
77
+ assert !repo.bare?
78
+ end
79
+ end
73
80
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: em_rugged
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 3
10
- version: 0.1.3
9
+ - 5
10
+ version: 0.1.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Christian Johansen
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-10-03 00:00:00 +02:00
18
+ date: 2012-10-06 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -41,7 +41,7 @@ dependencies:
41
41
  requirements:
42
42
  - - "="
43
43
  - !ruby/object:Gem::Version
44
- hash: -2424074336
44
+ hash: 2841310113
45
45
  segments:
46
46
  - 0
47
47
  - 17
@@ -108,6 +108,7 @@ extra_rdoc_files: []
108
108
  files:
109
109
  - lib/em_rugged.rb
110
110
  - lib/em_rugged/deferrable.rb
111
+ - lib/em_rugged/delegator.rb
111
112
  - lib/em_rugged/repository.rb
112
113
  - lib/em_rugged/version.rb
113
114
  - test/em_rugged/repository_test.rb