gh 0.9.1 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -3,6 +3,7 @@ rvm:
3
3
  - 1.8.7
4
4
  - 1.9.2
5
5
  - 1.9.3
6
+ - 2.0.0
6
7
  - jruby-18mode
7
8
  - jruby-19mode
8
9
  - rbx-18mode
data/gh.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.add_development_dependency 'webmock'
21
21
 
22
22
  s.add_runtime_dependency 'faraday', '~> 0.8'
23
- s.add_runtime_dependency 'backports', '~> 2.3'
23
+ s.add_runtime_dependency 'backports'
24
24
  s.add_runtime_dependency 'multi_json', '~> 1.0'
25
25
  s.add_runtime_dependency 'addressable'
26
26
  s.add_runtime_dependency 'net-http-persistent', '>= 2.7'
data/lib/gh/error.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'gh'
2
2
 
3
3
  module GH
4
- class Error < Exception
4
+ class Error < StandardError
5
5
  attr_reader :info
6
6
 
7
7
  def initialize(error = nil, payload = nil, info = {})
data/lib/gh/remote.rb CHANGED
@@ -26,13 +26,15 @@ module GH
26
26
  api_host = api_host.api_host if api_host.respond_to? :api_host
27
27
  @api_host = Addressable::URI.parse(api_host)
28
28
  @headers = options[:headers].try(:dup) || {
29
- #"Origin" => options[:origin] || "http://example.org",
29
+ "User-Agent" => options[:user_agent] || "GH/#{GH::VERSION}",
30
30
  "Accept" => "application/vnd.github.v3.full+json," \
31
31
  "application/vnd.github.beta.full+json;q=0.5," \
32
32
  "application/json;q=0.1",
33
- "Accept-Charset" => "utf-8"
33
+ "Accept-Charset" => "utf-8",
34
34
  }
35
35
 
36
+ @headers['Origin'] = options[:origin] if options[:origin]
37
+
36
38
  @prefix = ""
37
39
  @prefix << "#{token}@" if token
38
40
  @prefix << "#{username}:#{password}@" if username and password
data/lib/gh/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module GH
2
2
  # Public: Library version.
3
- VERSION = "0.9.1"
3
+ VERSION = "0.9.2"
4
4
  end
data/spec/error_spec.rb CHANGED
@@ -22,7 +22,7 @@ describe GH::Error do
22
22
  end
23
23
 
24
24
  it "exposes the original exception" do
25
- exception.error.should be_a(RuntimeError)
25
+ exception.error.should be_a(StandardError)
26
26
  end
27
27
 
28
28
  it 'keeps the payload around' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-14 00:00:00.000000000 Z
12
+ date: 2013-04-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -64,17 +64,17 @@ dependencies:
64
64
  requirement: !ruby/object:Gem::Requirement
65
65
  none: false
66
66
  requirements:
67
- - - ~>
67
+ - - ! '>='
68
68
  - !ruby/object:Gem::Version
69
- version: '2.3'
69
+ version: '0'
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
- - - ~>
75
+ - - ! '>='
76
76
  - !ruby/object:Gem::Version
77
- version: '2.3'
77
+ version: '0'
78
78
  - !ruby/object:Gem::Dependency
79
79
  name: multi_json
80
80
  requirement: !ruby/object:Gem::Requirement