halo-reach-api 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -8,8 +8,8 @@ group :development do
8
8
  gem "rcov", ">= 0"
9
9
  end
10
10
 
11
- gem 'httparty'
12
- gem 'json'
11
+ gem 'httparty', "~> 0.6.1"
12
+ gem 'json', "~> 1.4.6"
13
13
 
14
14
  group :test do
15
15
  gem 'fakeweb'
@@ -1,11 +1,11 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- crack (0.1.6)
4
+ crack (0.1.8)
5
5
  fakeweb (1.2.8)
6
6
  git (1.2.5)
7
- httparty (0.5.2)
8
- crack (= 0.1.6)
7
+ httparty (0.6.1)
8
+ crack (= 0.1.8)
9
9
  jeweler (1.5.1)
10
10
  bundler (~> 1.0.0)
11
11
  git (>= 1.2.5)
@@ -22,8 +22,8 @@ PLATFORMS
22
22
  DEPENDENCIES
23
23
  bundler (~> 1.0.0)
24
24
  fakeweb
25
- httparty
25
+ httparty (~> 0.6.1)
26
26
  jeweler (~> 1.5.1)
27
- json
27
+ json (~> 1.4.6)
28
28
  mocha
29
29
  rcov
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010 David Czarnecki
1
+ Copyright (c) 2010-2011 David Czarnecki
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -47,6 +47,12 @@ Q: Dates are funky and not parsed as dates. For example:
47
47
  A: Yes they are funky. Yes. They. Are. You can now parse them out with the Halo::Reach::Util class.
48
48
 
49
49
  >> parsed_time, parsed_timezone = Halo::Reach::Util::parse_timestamp(api_timestamp)
50
+
51
+ == Changelog
52
+
53
+ === 1.0.2
54
+
55
+ * Added set_timeout method to set timeout for HTTP requests
50
56
 
51
57
  == Contributing to halo-reach-api
52
58
 
@@ -60,5 +66,5 @@ A: Yes they are funky. Yes. They. Are. You can now parse them out with the Halo:
60
66
 
61
67
  == Copyright
62
68
 
63
- Copyright (c) 2010 David Czarnecki. See LICENSE.txt for further details.
69
+ Copyright (c) 2010-2011 David Czarnecki. See LICENSE.txt for further details.
64
70
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.1
1
+ 1.0.2
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{halo-reach-api}
8
- s.version = "1.0.1"
8
+ s.version = "1.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["David Czarnecki"]
12
- s.date = %q{2010-11-23}
12
+ s.date = %q{2011-02-16}
13
13
  s.description = %q{Ruby gem for interacting with the Halo:Reach API}
14
14
  s.email = %q{dczarnecki@agoragames.com}
15
15
  s.extra_rdoc_files = [
@@ -62,21 +62,21 @@ Gem::Specification.new do |s|
62
62
  s.specification_version = 3
63
63
 
64
64
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
65
- s.add_runtime_dependency(%q<httparty>, [">= 0"])
66
- s.add_runtime_dependency(%q<json>, [">= 0"])
65
+ s.add_runtime_dependency(%q<httparty>, ["~> 0.6.1"])
66
+ s.add_runtime_dependency(%q<json>, ["~> 1.4.6"])
67
67
  s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
68
68
  s.add_development_dependency(%q<jeweler>, ["~> 1.5.1"])
69
69
  s.add_development_dependency(%q<rcov>, [">= 0"])
70
70
  else
71
- s.add_dependency(%q<httparty>, [">= 0"])
72
- s.add_dependency(%q<json>, [">= 0"])
71
+ s.add_dependency(%q<httparty>, ["~> 0.6.1"])
72
+ s.add_dependency(%q<json>, ["~> 1.4.6"])
73
73
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
74
74
  s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
75
75
  s.add_dependency(%q<rcov>, [">= 0"])
76
76
  end
77
77
  else
78
- s.add_dependency(%q<httparty>, [">= 0"])
79
- s.add_dependency(%q<json>, [">= 0"])
78
+ s.add_dependency(%q<httparty>, ["~> 0.6.1"])
79
+ s.add_dependency(%q<json>, ["~> 1.4.6"])
80
80
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
81
81
  s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
82
82
  s.add_dependency(%q<rcov>, [">= 0"])
@@ -7,7 +7,7 @@ module Halo
7
7
  class API
8
8
  include HTTParty
9
9
 
10
- VERSION = '1.0.1'.freeze
10
+ VERSION = '1.0.2'.freeze
11
11
  API_URL = 'http://www.bungie.net/api/reach/reachapijson.svc/'
12
12
 
13
13
  DEFAULT_HEADERS = {
@@ -35,6 +35,10 @@ module Halo
35
35
  headers(http_headers)
36
36
  end
37
37
 
38
+ def set_timeout(timeout)
39
+ default_timeout(timeout)
40
+ end
41
+
38
42
  def get_game_metadata
39
43
  game_metadata_uri = "game/metadata/#{@token}"
40
44
  self.class.get(@api_url + game_metadata_uri)
@@ -12,7 +12,7 @@ class TestHaloReachApi < Test::Unit::TestCase
12
12
  end
13
13
 
14
14
  def test_api_version
15
- assert_equal '1.0.1', Halo::Reach::API::VERSION
15
+ assert_equal '1.0.2', Halo::Reach::API::VERSION
16
16
  end
17
17
 
18
18
  def test_can_set_token
@@ -205,4 +205,11 @@ class TestHaloReachApi < Test::Unit::TestCase
205
205
 
206
206
  assert_equal 25, halo_reach_api_response['Files'].size
207
207
  end
208
+
209
+ def test_can_set_timeout
210
+ halo_reach_api = Halo::Reach::API.new('XXX')
211
+ halo_reach_api.expects(:default_timeout).at_least_once
212
+
213
+ halo_reach_api.set_timeout(5)
214
+ end
208
215
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: halo-reach-api
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 1
10
- version: 1.0.1
9
+ - 2
10
+ version: 1.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - David Czarnecki
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-23 00:00:00 -05:00
18
+ date: 2011-02-16 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -25,12 +25,14 @@ dependencies:
25
25
  version_requirements: &id001 !ruby/object:Gem::Requirement
26
26
  none: false
27
27
  requirements:
28
- - - ">="
28
+ - - ~>
29
29
  - !ruby/object:Gem::Version
30
- hash: 3
30
+ hash: 5
31
31
  segments:
32
32
  - 0
33
- version: "0"
33
+ - 6
34
+ - 1
35
+ version: 0.6.1
34
36
  requirement: *id001
35
37
  - !ruby/object:Gem::Dependency
36
38
  type: :runtime
@@ -39,12 +41,14 @@ dependencies:
39
41
  version_requirements: &id002 !ruby/object:Gem::Requirement
40
42
  none: false
41
43
  requirements:
42
- - - ">="
44
+ - - ~>
43
45
  - !ruby/object:Gem::Version
44
- hash: 3
46
+ hash: 11
45
47
  segments:
46
- - 0
47
- version: "0"
48
+ - 1
49
+ - 4
50
+ - 6
51
+ version: 1.4.6
48
52
  requirement: *id002
49
53
  - !ruby/object:Gem::Dependency
50
54
  type: :development