gh 0.12.0 → 0.12.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5eaf32d727662e6f4bd966e4683577be73528fab
4
- data.tar.gz: 0c87937a7ad68fc8c1909fb0cfb3b2042f1d62fa
3
+ metadata.gz: 2517df4f03a6ef34d397b40196454b49d1e043c5
4
+ data.tar.gz: 53452297cb9f73175890aed21b7e06b28f5cf851
5
5
  SHA512:
6
- metadata.gz: 4da20e23e06eb4be1e5090588086aefa88c35a1626e6efffce6941b82256d40021696f02f26cc91c5ad9b9597e43555ff0423b61b7f4e573502406fa6d955093
7
- data.tar.gz: 2e789815ff440f2d3ab9edf477b1618da33f367f7b9ab70d7b675448a1d712e5b7c9b7f3ceb71ae000f919fe980073b269476dc4a7491cc280767263803c77f2
6
+ metadata.gz: 0adf5c9f3ebf7b7cf93e3c7acb071d0944f99dfccea15399a4849591660789be1b5f8294af825bd97551f755f1701bc98563ba1e7845c72724c5238445a05318
7
+ data.tar.gz: 23041635dd030d364874e57c3eba40e50737d471bd34d7042ba88b0eb559ee8906c1d38e76f89e00eebaae1d69e29fc539ea5e2c71233e39678b2fbf42edcde0
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
1
  *.gem
2
2
  .bundle
3
3
  pkg/*
4
+ Gemfile.lock
data/.travis.yml CHANGED
@@ -15,3 +15,5 @@ matrix:
15
15
  - rvm: jruby-18mode
16
16
  - rvm: jruby-19mode
17
17
  - rvm: jruby-head
18
+ - rvm: rbx-18mode
19
+ - rvm: rbx-19mode
data/lib/gh/remote.rb CHANGED
@@ -130,7 +130,9 @@ module GH
130
130
  end
131
131
 
132
132
  def full_url(key)
133
- uri = api_host + Addressable::URI.parse(key.sub(/^\//, ''))
133
+ uri = Addressable::URI.parse(key)
134
+ uri.path = File.join(api_host.path, uri.path) unless uri.absolute? or uri.path.start_with?(api_host.path)
135
+ uri = api_host + uri
134
136
  raise ArgumentError, "URI out of scope: #{key}" if uri.host != api_host.host
135
137
  uri
136
138
  end
data/lib/gh/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module GH
2
2
  # Public: Library version.
3
- VERSION = "0.12.0"
3
+ VERSION = "0.12.1"
4
4
  end
data/spec/remote_spec.rb CHANGED
@@ -37,4 +37,12 @@ describe GH::Remote do
37
37
  wrapper.should_receive(:request).with(:delete, "/foo").and_return GH::Response.new
38
38
  wrapper.delete '/foo'
39
39
  end
40
+
41
+ describe :path_for do
42
+ before { subject.setup("http://localhost/api/v3", {}) }
43
+ example { subject.path_for("foo") .should be == "/api/v3/foo" }
44
+ example { subject.path_for("/foo") .should be == "/api/v3/foo" }
45
+ example { subject.path_for("/api/v3/foo") .should be == "/api/v3/foo" }
46
+ example { subject.path_for("http://localhost/api/v3/foo") .should be == "/api/v3/foo" }
47
+ end
40
48
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-30 00:00:00.000000000 Z
11
+ date: 2013-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -132,7 +132,6 @@ files:
132
132
  - .gitignore
133
133
  - .travis.yml
134
134
  - Gemfile
135
- - Gemfile.lock
136
135
  - LICENSE
137
136
  - README.md
138
137
  - Rakefile
data/Gemfile.lock DELETED
@@ -1,46 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- gh (0.11.3)
5
- addressable
6
- backports
7
- faraday (~> 0.8)
8
- multi_json (~> 1.0)
9
- net-http-persistent (>= 2.7)
10
- net-http-pipeline
11
-
12
- GEM
13
- remote: http://rubygems.org/
14
- specs:
15
- addressable (2.3.4)
16
- backports (3.3.3)
17
- crack (0.3.2)
18
- diff-lcs (1.2.4)
19
- faraday (0.8.7)
20
- multipart-post (~> 1.1)
21
- multi_json (1.7.7)
22
- multipart-post (1.2.0)
23
- net-http-persistent (2.8)
24
- net-http-pipeline (1.0.1)
25
- rake (10.0.4)
26
- rspec (2.13.0)
27
- rspec-core (~> 2.13.0)
28
- rspec-expectations (~> 2.13.0)
29
- rspec-mocks (~> 2.13.0)
30
- rspec-core (2.13.1)
31
- rspec-expectations (2.13.0)
32
- diff-lcs (>= 1.1.3, < 2.0)
33
- rspec-mocks (2.13.1)
34
- webmock (1.11.0)
35
- addressable (>= 2.2.7)
36
- crack (>= 0.3.2)
37
-
38
- PLATFORMS
39
- ruby
40
-
41
- DEPENDENCIES
42
- gh!
43
- jruby-openssl
44
- rake
45
- rspec
46
- webmock