soda_xml_team 1.3.0 → 1.3.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: 623f032e340989c1f062b6de1d9fa2408b1b0d0f
4
- data.tar.gz: 40a86ea991e8c70e90739655b496a15dd40aa4a3
3
+ metadata.gz: 8790c17cc037ad47ab785a64c4d393c2131a48e5
4
+ data.tar.gz: 61c0532a78e633d738530450ffd4917ee38534cb
5
5
  SHA512:
6
- metadata.gz: f9ad840368ce8179ae12c5a9a60c12f92a4399323a57b4c31df98ebd847c9423fa6c7d21e8f3441a33c46494469ab60a29e5e3177e1d84c3222d5e71ade2d189
7
- data.tar.gz: cdcf080fcf5946f18c7f22b3962b45cda11deaa25136d43ba462fd2be0bd9eec0e54cbb5aca327e7b6423b18b479fc98ad6f33f338e8f7cbbcda33d9316d81a6
6
+ metadata.gz: 94043f2f2ee6ae3f5925efa822adf11c61adbcca5649fd8492c99d45b85c13e6f43ed1e9df1a46c500df3f20fca273ee353a054b38bb0d54f4843acf50b17776
7
+ data.tar.gz: bd8fcbf0e862d1accf51ed8e90b4dcedbedab0f826c1920b5f9cd1d8728e432a4e2cbd17c2836e5f733731b74ed85b7220b95f8df949a702611f89188f2da50b
data/README.md CHANGED
@@ -14,11 +14,15 @@ gem 'soda_xml_team'
14
14
 
15
15
  And then execute:
16
16
 
17
- $ bundle
17
+ ```bash
18
+ $ bundle
19
+ ```
18
20
 
19
21
  Or install it yourself as:
20
22
 
21
- $ gem install soda_xml_team
23
+ ```bash
24
+ $ gem install soda_xml_team
25
+ ```
22
26
 
23
27
  ## Usage
24
28
 
@@ -34,8 +38,8 @@ listing = soda.content_finder({
34
38
  league_id: 'l.nhl.com',
35
39
  team_id: 'l.nhl.com-t.19',
36
40
  type: 'schedule-single-team',
37
- start_datetime: DateTime.parse('2010-01-01 00:00:00 CDT'),
38
- end_datetime: DateTime.parse('2011-01-01 00:00:00 CDT')
41
+ start_datetime: '2010-01-01 00:00:00 CDT',
42
+ end_datetime: '2011-01-01 00:00:00 CDT'
39
43
  })
40
44
 
41
45
  # An array of documents matching your query
@@ -104,7 +108,6 @@ standings = SodaXmlTeam::Standings.parse_standings(standings_document)
104
108
  puts standings.inspect
105
109
  ```
106
110
 
107
-
108
111
  ## Contributing
109
112
 
110
113
  1. Fork it ( https://github.com/seatshare/soda_xml_team/fork )
@@ -35,12 +35,18 @@ module SodaXmlTeam
35
35
  end
36
36
 
37
37
  # Start date/time
38
- if options[:start_datetime].is_a? DateTime
38
+ if options[:start_datetime].is_a? String
39
+ options[:start_datetime] = DateTime.parse(options[:start_datetime])
40
+ path << "earliest-date-time=#{options[:start_datetime].strftime('%Y%m%dT%H%M%S%z')}"
41
+ elsif options[:start_datetime].is_a? DateTime
39
42
  path << "earliest-date-time=#{options[:start_datetime].strftime('%Y%m%dT%H%M%S%z')}"
40
43
  end
41
44
 
42
45
  # End date/time
43
- if options[:end_datetime].is_a? DateTime
46
+ if options[:end_datetime].is_a? String
47
+ options[:end_datetime] = DateTime.parse(options[:end_datetime])
48
+ path << "latest-date-time=#{options[:end_datetime].strftime('%Y%m%dT%H%M%S%z')}"
49
+ elsif options[:end_datetime].is_a? DateTime
44
50
  path << "latest-date-time=#{options[:end_datetime].strftime('%Y%m%dT%H%M%S%z')}"
45
51
  end
46
52
 
@@ -1,3 +1,3 @@
1
1
  module SodaXmlTeam
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.1"
3
3
  end
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Stephen Yeargin"]
10
10
  spec.email = ["stephen@seatsha.re"]
11
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)}
12
+ spec.description = %q{A basic layer for interacting with XML Team's Sports On Demand API (SODA)}
13
13
  spec.homepage = "https://github.com/seatshare/soda_xml_team"
14
14
  spec.license = "MIT"
15
15
 
@@ -35,6 +35,35 @@ describe "SodaXmlTeam" do
35
35
  expect(output[0][:team]).to eq "l.nhl.com-t.19"
36
36
  end
37
37
 
38
+ let(:input) {
39
+ {
40
+ sandbox: true,
41
+ league_id: 'l.nhl.com',
42
+ team_id: 'l.nhl.com-t.19',
43
+ type: 'schedule-single-team',
44
+ start_datetime: '2010-01-01 00:00:00 CDT',
45
+ end_datetime: '2011-01-01 00:00:00 CDT'
46
+ }
47
+ }
48
+ let(:output) { subject.content_finder(input) }
49
+
50
+ it 'has seven items with string timestamp' do
51
+ expect(output.length).to eq 7
52
+ end
53
+
54
+ it 'has attributes that match with string timestamp' do
55
+ expect(output[1][:title]).to eq "2010 Nashville Predators Schedule"
56
+ expect(output[1][:link]).to eq "http://soda.xmlteam.com/api-trial/getDocuments?doc-ids=xt.10860136-nas-sked"
57
+ expect(output[1][:document_id]).to eq "xt.10860136-nas-sked"
58
+ expect(output[1][:date]).to eq DateTime.parse('February 12, 2010 22:49 PM CDT')
59
+ expect(output[1][:publisher]).to eq "sportsnetwork.com"
60
+ expect(output[1][:priority]).to eq "normal"
61
+ expect(output[1][:sport]).to eq "15031000"
62
+ expect(output[1][:league]).to eq "l.nhl.com"
63
+ expect(output[1][:conference]).to eq "c.western"
64
+ expect(output[1][:team]).to eq "l.nhl.com-t.19"
65
+ end
66
+
38
67
  end
39
68
 
40
69
  describe '.get_document' do
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.3.0
4
+ version: 1.3.1
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-10-09 00:00:00.000000000 Z
11
+ date: 2014-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -94,7 +94,7 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0.13'
97
- description: A basic layer for interacting XML Team's Sports On Demand API (SODA)
97
+ description: A basic layer for interacting with XML Team's Sports On Demand API (SODA)
98
98
  email:
99
99
  - stephen@seatsha.re
100
100
  executables: []