asgit 0.1.2 → 0.2.0
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.
- checksums.yaml +4 -4
- data/lib/asgit/services/github.rb +4 -0
- data/lib/asgit/services/service.rb +7 -22
- data/lib/asgit/url.rb +4 -0
- data/lib/asgit/version.rb +1 -1
- data/spec/lib/asgit/url_spec.rb +9 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b9a8c2c5bf1f7d9e58c9ef5485061726c028c85
|
4
|
+
data.tar.gz: e27c4c6ed799f60ad422462309218ce844857e8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af63a58c7b5da43a899951f9d4e82b277736866b2ef708dcd444c9f427e1064e29b034e3f8250a643a980b099b7d13c639dcb1d916c3a090ee1736e765fcdaa7
|
7
|
+
data.tar.gz: 1cdfdec55f29086a8a45854b01fd3b15f2f94e6a99a222ce10205f2cda94b40cf193147e0fe82241e8661385d7667126f9ba3c592642a2433111561378817686
|
@@ -8,28 +8,13 @@ module Asgit
|
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
def commit_uri
|
20
|
-
raise MissingUrlStructure, "#{self.class} does not implement #{__method__}"
|
21
|
-
end
|
22
|
-
|
23
|
-
def branch_uri
|
24
|
-
raise MissingUrlStructure, "#{self.class} does not implement #{__method__}"
|
25
|
-
end
|
26
|
-
|
27
|
-
def file_uri
|
28
|
-
raise MissingUrlStructure, "#{self.class} does not implement #{__method__}"
|
29
|
-
end
|
30
|
-
|
31
|
-
def file_at_commit_uri
|
32
|
-
raise MissingUrlStructure, "#{self.class} does not implement #{__method__}"
|
11
|
+
[ :base_url, :base_structure,
|
12
|
+
:commit_uri, :branch_uri, :file_uri,
|
13
|
+
:file_at_commit_uri, :compare_uri
|
14
|
+
].each do |m|
|
15
|
+
define_method m do
|
16
|
+
raise MissingUrlStructure, "#{self.class} does not implement #{__method__}"
|
17
|
+
end
|
33
18
|
end
|
34
19
|
|
35
20
|
class MissingUrlStructure < StandardError
|
data/lib/asgit/url.rb
CHANGED
@@ -39,6 +39,10 @@ module Asgit
|
|
39
39
|
File.join( project, service.file_at_commit_uri % { file_path: file_path, commit: commit, line: line } )
|
40
40
|
end
|
41
41
|
|
42
|
+
def compare ref_a, ref_b
|
43
|
+
File.join( project, service.compare_uri % { ref_a: ref_a, ref_b: ref_b })
|
44
|
+
end
|
45
|
+
|
42
46
|
private
|
43
47
|
|
44
48
|
def format_lines input
|
data/lib/asgit/version.rb
CHANGED
data/spec/lib/asgit/url_spec.rb
CHANGED
@@ -101,4 +101,13 @@ describe Asgit::Url do
|
|
101
101
|
end
|
102
102
|
end
|
103
103
|
|
104
|
+
describe "#compare" do
|
105
|
+
it "returns url for comparison with two commits" do
|
106
|
+
expect( subject.compare 'commit_sha_a', 'commit_sha_b' ).to eq 'https://github.com/stevenosloan/asgit/compare/commit_sha_a...commit_sha_b'
|
107
|
+
end
|
108
|
+
it "returns url for comparison with two branches" do
|
109
|
+
expect( subject.compare 'branch_a', 'branch_b' ).to eq 'https://github.com/stevenosloan/asgit/compare/branch_a...branch_b'
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
104
113
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asgit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Sloan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: here_or_there
|
@@ -68,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
68
68
|
version: '0'
|
69
69
|
requirements: []
|
70
70
|
rubyforge_project:
|
71
|
-
rubygems_version: 2.2
|
71
|
+
rubygems_version: 2.4.2
|
72
72
|
signing_key:
|
73
73
|
specification_version: 4
|
74
74
|
summary: A simple query interface for git
|