soda_xml_team 1.0.2 → 1.0.3

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: b8265500ff78d9809b6f8c58b0be1bf15de1eb69
4
- data.tar.gz: 249f406ecc331128d7699913f8e1d26423be263c
3
+ metadata.gz: 833ef78983c11a295c78c5661559dd9bd3d26f69
4
+ data.tar.gz: e084cca08b942e47c0b10ab6ec734d54feba5a14
5
5
  SHA512:
6
- metadata.gz: 8430fe4090772492d3d253109dd5caa4e657752da05390835ea8c9aa6e339902adfca91471369f0d8638a21bdc72ce3fdbb7d30907130d05776fc6dc7f2b5560
7
- data.tar.gz: 1b849aaf3bbec488b81a9b4477466a535d9072c4eb871b7e6f31834cd7e4df2b85b0b074dded1244199efcbd431863ca373c31764ec60a6c4ba614c9eaa97433
6
+ metadata.gz: 0f8258f379a8d3c0359d8ff25d7a51c2ef6e3a79eaac0037126a29d3b4d9676939ac28b55308b8ff44407e70286f00ad6546f7659e3450768b0c41d0d21c5393
7
+ data.tar.gz: 78b06a72cb8cc9ccf45ce5d1f7bb34cd7d2e544e4c623f6f1f677eab8837fecf5a44dfea4311434154fdf17ebddd6e3d6b47aa226cb5ac98fe502d615517ecc1
data/.travis.yml CHANGED
@@ -3,4 +3,5 @@ rvm:
3
3
  - 1.9.3
4
4
  - 2.1.0
5
5
  env:
6
- - SODA_USERNAME=testuser SODA_PASSWORD=testpassword
6
+ - SODA_USERNAME=testuser SODA_PASSWORD=testpassword
7
+ script: rake spec
data/Gemfile CHANGED
@@ -1,3 +1,4 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gemspec
3
+ # Specify your gem's dependencies in soda_xml_team.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 SeatShare
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -4,9 +4,23 @@
4
4
 
5
5
  This [gem]() serves as an interface to the [SODA (Sports On Demand API) from XML Team](http://www.xmlteam.com/soda/). It uses [HTTParty](http://johnnunemaker.com/httparty/) and [Nokogiri](http://nokogiri.org/) to retrieve and parse the data.
6
6
 
7
- ## Installing
7
+ ## Installation
8
8
 
9
- Run `gem install soda_xml_team` to make it available system wide or add `gem 'soda_xml_team'` to your `Gemfile`.
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'soda_xml_team'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install soda_xml_team
22
+
23
+ ## Usage
10
24
 
11
25
  ## Get a list of documents
12
26
 
@@ -60,4 +74,12 @@ schedule = SodaXmlTeam::Schedule.parse_schedule(schedule_document)
60
74
 
61
75
  # This is now available as an array of values
62
76
  puts schedule.inspect
63
- ```
77
+ ```
78
+
79
+ ## Contributing
80
+
81
+ 1. Fork it ( https://github.com/seatshare/soda_xml_team/fork )
82
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
83
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
84
+ 4. Push to the branch (`git push origin my-new-feature`)
85
+ 5. Create a new Pull Request
data/Rakefile CHANGED
@@ -1,9 +1,3 @@
1
1
  require "bundler/gem_tasks"
2
- require "rake/testtask"
3
2
 
4
- Rake::TestTask.new do |t|
5
- t.libs << 'test'
6
- end
7
-
8
- desc "Run tests"
9
- task :default => :test
3
+ Dir.glob('tasks/**/*.rake').each(&method(:import))
data/lib/ca-bundle.crt CHANGED
@@ -1,4 +1,34 @@
1
1
  -----BEGIN CERTIFICATE-----
2
+ MIIFLTCCBBWgAwIBAgIDDDIRMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT
3
+ MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew
4
+ HhcNMTMwNTIyMDAyNzUyWhcNMTUwNTI0MTcxNDIzWjCBvDEpMCcGA1UEBRMgYVhQ
5
+ M0l4LVQ2RDlOQnVXQU5FU1JsNG1iZWFHcHp5cTExEzARBgNVBAsTCkdUMDQxNDUy
6
+ MDgxMTAvBgNVBAsTKFNlZSB3d3cucmFwaWRzc2wuY29tL3Jlc291cmNlcy9jcHMg
7
+ KGMpMTMxLzAtBgNVBAsTJkRvbWFpbiBDb250cm9sIFZhbGlkYXRlZCAtIFJhcGlk
8
+ U1NMKFIpMRYwFAYDVQQDDA0qLnhtbHRlYW0uY29tMIIBIjANBgkqhkiG9w0BAQEF
9
+ AAOCAQ8AMIIBCgKCAQEAigWS0L49v4B9u4hQx1DabBqR7FlPM45JDfBWABA/EALg
10
+ y25WyKOIOEG7fFRviMOzhhYwR+EYxQysnsPgOCC42dJotEKYAgwUndCd7oBFWsFV
11
+ ibftZWs2e1jvVbsLwbD3VjHWdIcyxrDuiVW3CxeAOqW3ZUULKLYqQJ6b+MljNv3l
12
+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RConLxXS3+KhdvJAtdQioeomTtR4ecMxLg9eVM7Q
28
+ NFp2b6SvMHEln4vWCG31Qg7XMEw3uNS2qvgNcFxtUocOBk6VSSf0Yo5AJ3qNOXhf
29
+ guy3xsqbAAsmm++8W6T9mygWT7PI/3NfWCg7O2Cw425k
30
+ -----END CERTIFICATE-----
31
+ -----BEGIN CERTIFICATE-----
2
32
  MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJV
3
33
  UzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2Vy
4
34
  dGlmaWNhdGUgQXV0aG9yaXR5MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1
data/lib/soda_xml_team.rb CHANGED
@@ -1,9 +1,9 @@
1
- require 'soda_xml_team/version'
2
- require 'soda_xml_team/client'
3
- require 'soda_xml_team/base'
4
- require 'soda_xml_team/address'
5
- require 'soda_xml_team/schedule'
1
+ require "soda_xml_team/version"
2
+ require "soda_xml_team/client"
3
+ require "soda_xml_team/base"
4
+ require "soda_xml_team/address"
5
+ require "soda_xml_team/schedule"
6
6
 
7
7
  module SodaXmlTeam
8
-
9
- end
8
+
9
+ end
@@ -1,3 +1,3 @@
1
1
  module SodaXmlTeam
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
@@ -1,29 +1,28 @@
1
- # -*- encoding: utf-8 -*-
1
+ # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'soda_xml_team/version'
5
5
 
6
- Gem::Specification.new do |s|
7
- s.name = 'soda_xml_team'
8
- s.version = SodaXmlTeam::VERSION
9
- s.date = '2014-07-13'
10
- s.summary = "XML Team Sports On Demand API"
11
- s.description = "A basic layer for interacting XML Team's Sports On Demand API (SODA)"
12
- s.authors = ["Stephen Yeargin"]
13
- s.email = 'stephen@yearg.in'
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "soda_xml_team"
8
+ spec.version = SodaXmlTeam::VERSION
9
+ spec.authors = ["Stephen Yeargin"]
10
+ spec.email = ["stephen@seatsha.re"]
11
+ spec.summary = %q{XML Team Sports On Demand API}
12
+ spec.description = %q{A basic layer for interacting XML Team's Sports On Demand API (SODA)}
13
+ spec.homepage = "https://github.com/seatshare/soda_xml_team"
14
+ spec.license = "MIT"
14
15
 
15
- s.files = `git ls-files`.split($/)
16
- s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
- s.test_files = s.files.grep(%r{^(test|spec|features)/})
18
- s.require_paths = ["lib"]
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
19
20
 
20
- s.homepage = 'https://github.com/seatshare/soda_xml_team'
21
- s.license = 'MIT'
21
+ spec.add_development_dependency "bundler", "~> 1.6"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+ spec.add_development_dependency "rspec"
24
+ spec.add_development_dependency "webmock"
22
25
 
23
- s.add_development_dependency "bundler", "~> 1.3"
24
- s.add_development_dependency "rake", "~> 0"
25
- s.add_development_dependency "webmock", "~> 1.18"
26
-
27
- s.add_dependency "nokogiri", "~> 1.6", ">= 1.6.2"
28
- s.add_dependency "httparty", "~> 0.13", ">= 0.13"
29
- end
26
+ spec.add_dependency "nokogiri", ">= 1.6.3"
27
+ spec.add_dependency "httparty", ">= 0.13"
28
+ end
@@ -0,0 +1,72 @@
1
+ require 'spec_helper'
2
+
3
+ describe SodaXmlTeam do
4
+
5
+ subject { SodaXmlTeam::Client.new(ENV['SODA_USERNAME'], ENV['SODA_PASSWORD']) }
6
+
7
+ describe '.get_listing' do
8
+
9
+ let(:input) {
10
+ {
11
+ sandbox: true,
12
+ league_id: 'l.nhl.com',
13
+ team_id: 'l.nhl.com-t.19',
14
+ type: 'schedule-single-team',
15
+ start_datetime: DateTime.parse('2010-01-01 00:00:00 CDT'),
16
+ end_datetime: DateTime.parse('2011-01-01 00:00:00 CDT')
17
+ }
18
+ }
19
+ let(:output) { subject.get_listing(input) }
20
+
21
+ it 'has seven items' do
22
+ expect(output.css('item').length).to eq 7
23
+ end
24
+
25
+ it 'has a title that matches' do
26
+ expect(output.css('item title').first.content).to eq "2010 Nashville Predators Schedule"
27
+ end
28
+
29
+ end
30
+
31
+ describe '.get_document' do
32
+
33
+ let(:input) {
34
+ {
35
+ sandbox: true,
36
+ document_id: 'xt.10875359-nas-sked'
37
+ }
38
+ }
39
+ let(:output) { subject.get_document(input) }
40
+
41
+ it 'has one schedule node' do
42
+ expect(output.css('schedule').length).to eq 1
43
+ end
44
+
45
+ it 'has 82 games in a season' do
46
+ expect(output.css('schedule sports-event').length).to eq 82
47
+ end
48
+
49
+ end
50
+
51
+ end
52
+
53
+ describe SodaXmlTeam do
54
+
55
+ subject { SodaXmlTeam::Schedule }
56
+
57
+ describe '.parse_schedule' do
58
+
59
+ let(:input) {
60
+ SodaXmlTeam::Client.new(ENV['SODA_USERNAME'], ENV['SODA_PASSWORD']).get_document({
61
+ sandbox: true,
62
+ document_id: 'xt.10875359-nas-sked'
63
+ })
64
+ }
65
+ let(:output) { subject.parse_schedule(input) }
66
+
67
+ it 'has 82 games in a season' do
68
+ expect(output.length).to eq 82
69
+ end
70
+
71
+ end
72
+ end
@@ -0,0 +1,18 @@
1
+ require 'soda_xml_team'
2
+ require 'webmock/rspec'
3
+
4
+ RSpec.configure do |config|
5
+ config.before(:each) do
6
+
7
+ if ENV['SODA_USERNAME'].nil? || ENV['SODA_PASSWORD'].nil?
8
+ raise "Must provide a SOAP_USERNAME and SOAP_PASSWORD environment variable to run tests."
9
+ end
10
+
11
+ stub_request(:get, "https://#{ENV['SODA_USERNAME']}:#{ENV['SODA_PASSWORD']}@soda.xmlteam.com/api-trial/getListings?earliest-date-time=20100101T000000-0500&fixture-keys=schedule-single-team&latest-date-time=20110101T000000-0500&league-keys=l.nhl.com&max-result-count=10&revision-control=latest-only&stylesheet=sportsml2rss-1.0-s&team-keys=l.nhl.com-t.19").
12
+ to_return(:status => 200, :body => File.new("spec/fixtures/get_listing.xml").read, :headers => {})
13
+
14
+ stub_request(:get, "https://#{ENV['SODA_USERNAME']}:#{ENV['SODA_PASSWORD']}@soda.xmlteam.com/api-trial/getDocuments?doc-ids=xt.10875359-nas-sked").
15
+ to_return(:status => 200, :body => File.new("spec/fixtures/get_document.xml").read, :headers => {})
16
+
17
+ end
18
+ end
data/tasks/rspec.rake ADDED
@@ -0,0 +1,3 @@
1
+ require 'rspec/core/rake_task'
2
+
3
+ RSpec::Core::RakeTask.new(:spec)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soda_xml_team
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Yeargin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-13 00:00:00.000000000 Z
11
+ date: 2014-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,69 +16,74 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.3'
19
+ version: '1.6'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.3'
26
+ version: '1.6'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
39
53
  - !ruby/object:Gem::Version
40
54
  version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: webmock
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - "~>"
59
+ - - ">="
46
60
  - !ruby/object:Gem::Version
47
- version: '1.18'
61
+ version: '0'
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - "~>"
66
+ - - ">="
53
67
  - !ruby/object:Gem::Version
54
- version: '1.18'
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: nokogiri
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '1.6'
62
73
  - - ">="
63
74
  - !ruby/object:Gem::Version
64
- version: 1.6.2
75
+ version: 1.6.3
65
76
  type: :runtime
66
77
  prerelease: false
67
78
  version_requirements: !ruby/object:Gem::Requirement
68
79
  requirements:
69
- - - "~>"
70
- - !ruby/object:Gem::Version
71
- version: '1.6'
72
80
  - - ">="
73
81
  - !ruby/object:Gem::Version
74
- version: 1.6.2
82
+ version: 1.6.3
75
83
  - !ruby/object:Gem::Dependency
76
84
  name: httparty
77
85
  requirement: !ruby/object:Gem::Requirement
78
86
  requirements:
79
- - - "~>"
80
- - !ruby/object:Gem::Version
81
- version: '0.13'
82
87
  - - ">="
83
88
  - !ruby/object:Gem::Version
84
89
  version: '0.13'
@@ -86,14 +91,12 @@ dependencies:
86
91
  prerelease: false
87
92
  version_requirements: !ruby/object:Gem::Requirement
88
93
  requirements:
89
- - - "~>"
90
- - !ruby/object:Gem::Version
91
- version: '0.13'
92
94
  - - ">="
93
95
  - !ruby/object:Gem::Version
94
96
  version: '0.13'
95
97
  description: A basic layer for interacting XML Team's Sports On Demand API (SODA)
96
- email: stephen@yearg.in
98
+ email:
99
+ - stephen@seatsha.re
97
100
  executables: []
98
101
  extensions: []
99
102
  extra_rdoc_files: []
@@ -101,6 +104,7 @@ files:
101
104
  - ".gitignore"
102
105
  - ".travis.yml"
103
106
  - Gemfile
107
+ - LICENSE.txt
104
108
  - README.md
105
109
  - Rakefile
106
110
  - lib/ca-bundle.crt
@@ -111,11 +115,11 @@ files:
111
115
  - lib/soda_xml_team/schedule.rb
112
116
  - lib/soda_xml_team/version.rb
113
117
  - soda_xml_team.gemspec
114
- - test/fixtures/test_get_document.xml
115
- - test/fixtures/test_get_listing.xml
116
- - test/fixtures/test_parse_schedule.xml
117
- - test/test_helper.rb
118
- - test/test_soda_xml_team.rb
118
+ - spec/fixtures/get_document.xml
119
+ - spec/fixtures/get_listing.xml
120
+ - spec/soda_xml_team_spec.rb
121
+ - spec/spec_helper.rb
122
+ - tasks/rspec.rake
119
123
  homepage: https://github.com/seatshare/soda_xml_team
120
124
  licenses:
121
125
  - MIT
@@ -136,13 +140,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
140
  version: '0'
137
141
  requirements: []
138
142
  rubyforge_project:
139
- rubygems_version: 2.3.0
143
+ rubygems_version: 2.2.2
140
144
  signing_key:
141
145
  specification_version: 4
142
146
  summary: XML Team Sports On Demand API
143
147
  test_files:
144
- - test/fixtures/test_get_document.xml
145
- - test/fixtures/test_get_listing.xml
146
- - test/fixtures/test_parse_schedule.xml
147
- - test/test_helper.rb
148
- - test/test_soda_xml_team.rb
148
+ - spec/fixtures/get_document.xml
149
+ - spec/fixtures/get_listing.xml
150
+ - spec/soda_xml_team_spec.rb
151
+ - spec/spec_helper.rb