syoboi_calendar 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 868119fd5a5b282c5db313b144f77997d4671e15
4
- data.tar.gz: fcab1aa760c3bdbc41d69fce7020d85f7e300176
3
+ metadata.gz: 53da71b944bae16571ebf66bc151f3d554a1688b
4
+ data.tar.gz: ad48c2b0925bdc8715fbb32ad1249d100f9fdae4
5
5
  SHA512:
6
- metadata.gz: bc6f29de1b9c57666a79f4cbc841919809c376a8afca22dd922d95ccc2f28bfda0b03a18a01fcca2321404531ad1ae52d59b7ee057c552bf1c46e1a36fed0e9b
7
- data.tar.gz: 68755cfc0efbac89a202612f044c187aba095c1b8d2da8a46a3273438a298b46438e2f41f81be0abb556f3443859f3725cbe2a94d160f91d0fc7b9cdb1575495
6
+ metadata.gz: d61e719e947709f931796b838ea28969307d853ba16a28b4bd554576f9de08d44c34f812e3b8fd5d07bb565816017b1ae9b3d4adb3e6bfa45b5cafb85430201b
7
+ data.tar.gz: 2a04c00611955ef239903eb072574a58dc27eef4b6909c96394ff5228e2c2ce27f661caf298a7e95bf1a1dbd4b6ea03281b08d918145ce656ecb1f68b124588b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.2.1
2
+ * SyoboiCalendar::Client returns a Hashie::Mash as a response
3
+
1
4
  ## 0.2.0
2
5
  * Remake SyoboiCalendar::Client from scratch
3
6
  * Support GET /db.php API
data/README.md CHANGED
@@ -12,40 +12,15 @@ gem "syoboi_calendar"
12
12
  require "syoboi_calendar"
13
13
 
14
14
  client = SyoboiCalendar::Client
15
- client.channels #=> [...]
16
- client.programs #=> [...]
17
- client.titles #=> [...]
15
+ client.channels #=> a Hashie::Mash instance
16
+ client.programs #=> a Hashie::Mash instance
17
+ client.titles #=> a Hashie::Mash instance
18
18
  ```
19
19
 
20
20
  ## API
21
- Supported API request examples:
21
+ SyoboiCalender::Client provides `#channels`, `#titles`, `#programs` methods.
22
22
 
23
- ```
24
- GET http://cal.syoboi.jp/db.php?Command=ProgLookup&JOIN=SubTitles
25
- GET http://cal.syoboi.jp/db.php?Command=ProgLookup&JOIN=SubTitles&ChID=:channelID
26
- GET http://cal.syoboi.jp/db.php?Command=ProgLookup&JOIN=SubTitles&Count=:count
27
- GET http://cal.syoboi.jp/db.php?Command=ProgLookup&JOIN=SubTitles&PID=:id
28
- GET http://cal.syoboi.jp/db.php?Command=ProgLookup&JOIN=SubTitles&PID=:id
29
- GET http://cal.syoboi.jp/db.php?Command=ProgLookup&JOIN=SubTitles&Range=-:playedTo
30
- GET http://cal.syoboi.jp/db.php?Command=ProgLookup&JOIN=SubTitles&Range=:playedFrom-
31
- GET http://cal.syoboi.jp/db.php?Command=ProgLookup&JOIN=SubTitles&Range=:playedFrom-:playedTo
32
- GET http://cal.syoboi.jp/db.php?Command=ProgLookup&JOIN=SubTitles&StTime=-:startedTo
33
- GET http://cal.syoboi.jp/db.php?Command=TitleLookup
34
- GET http://cal.syoboi.jp/db.php?Command=TitleLookup&LastUpdate=-:updatedTo&TID=*
35
- GET http://cal.syoboi.jp/db.php?Command=TitleLookup&LastUpdate=:updatedFrom-&TID=*
36
- GET http://cal.syoboi.jp/db.php?Command=TitleLookup&LastUpdate=:updatedFrom-:updatedTo&TID=*
37
- GET http://cal.syoboi.jp/db.php?Command=TitleLookup&TID=:id
38
- GET http://cal.syoboi.jp/db.php?Command=ChLookup
39
- GET http://cal.syoboi.jp/db.php?Command=ChLookup&ChID=:id
40
- GET http://cal.syoboi.jp/db.php?Command=ChLookup&LastUpdate=:updatedFrom-:updatedTo
41
- GET http://cal.syoboi.jp/db.php?Command=ChLookup&LastUpdate=:updatedFrom-
42
- GET http://cal.syoboi.jp/db.php?Command=ChLookup&LastUpdate=-:updatedTo
43
- ```
44
-
45
- ## Interface
46
- SyoboiCalender::Client has `#channels`, `#titles`, `#programs` methods.
47
-
48
- ```
23
+ ```ruby
49
24
  SyoboiCalendar::Client
50
25
  #channels
51
26
  with options {}
@@ -21,12 +21,15 @@ module SyoboiCalendar
21
21
  private
22
22
 
23
23
  def get(query_class, options = {})
24
- connection.get(path, query_class.new(options).to_hash)
24
+ connection.get(path, query_class.new(options).to_hash).body
25
25
  end
26
26
 
27
27
  def connection
28
28
  @connection ||= Faraday.new(url: url) do |connection|
29
29
  connection.adapter :net_http
30
+ connection.response :mashify
31
+ connection.response :xml
32
+ connection.response :raise_error
30
33
  end
31
34
  end
32
35
 
@@ -1,3 +1,3 @@
1
1
  module SyoboiCalendar
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -3,6 +3,7 @@ require "active_support/core_ext/class/attribute"
3
3
  require "active_support/core_ext/object/try"
4
4
  require "active_support/core_ext/string/inflections"
5
5
  require "faraday"
6
+ require "faraday_middleware"
6
7
 
7
8
  require "syoboi_calendar/client"
8
9
  require "syoboi_calendar/queries/base"
@@ -18,6 +18,9 @@ Gem::Specification.new do |spec|
18
18
 
19
19
  spec.add_dependency "activesupport"
20
20
  spec.add_dependency "faraday"
21
+ spec.add_dependency "faraday_middleware"
22
+ spec.add_dependency "hashie"
23
+ spec.add_dependency "multi_xml"
21
24
  spec.add_development_dependency "pry"
22
25
  spec.add_development_dependency "rake"
23
26
  spec.add_development_dependency "rspec", "2.14.1"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syoboi_calendar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
@@ -38,6 +38,48 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: faraday_middleware
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: hashie
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: multi_xml
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
41
83
  - !ruby/object:Gem::Dependency
42
84
  name: pry
43
85
  requirement: !ruby/object:Gem::Requirement