nicoapi 0.0.4.1 → 0.0.6

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: 0a3520fed29c4892f054b138419338f972479d4f
4
- data.tar.gz: 1c26f1fadee7ac5460999736ffd5586719b60fe7
3
+ metadata.gz: a55070e52bd1ba3b43715c130aa183412f409bf8
4
+ data.tar.gz: a41bb5eeed230f137c98cbdee457213eb8c7cdf0
5
5
  SHA512:
6
- metadata.gz: 13bd1d8d5e188ffc4b2e8d7be80831618aa19b5a2a407f7ea0a6e3ab3caf6caaffddf0828122c09f46bf1004007b618b57dde28cc2c3b115dd55659b1fbbfbdc
7
- data.tar.gz: a6e40157df5e67bfd4eb73df6bfef5d76466828ee4ce8c78f48f35f77afdbf6d7d4866af776cd6b929987f60526e86dec74289fceff8dce6bc3c89dbb26e46c1
6
+ metadata.gz: bfed0747d94957ae7cd76eb1a2c48c1722299cd2a6e2e192d6476e4591fdf75d901f5b59045626317ddc506c59e22f2d007443640225ff4658003cbb982dbdbb
7
+ data.tar.gz: 26297ac2b634cd0f3b3ce504ec8bfe86ce099b473ca14de21a8754c2ef2864854f567651d2e66749831d46ead1ea18eeffdb345d1f2cbdc5cd7f1bab0af4f279
data/Gemfile CHANGED
@@ -1,5 +1,3 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem "activesupport", "~> 4.0.0"
4
-
5
3
  gemspec
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nicoapi (0.0.4.1)
4
+ nicoapi (0.0.6)
5
5
  activesupport (~> 4.0.0)
6
6
  i18n
7
7
  rest-client
@@ -48,7 +48,6 @@ PLATFORMS
48
48
  ruby
49
49
 
50
50
  DEPENDENCIES
51
- activesupport (~> 4.0.0)
52
51
  bundler (~> 1.3)
53
52
  nicoapi!
54
53
  pry
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- [![Build Status](https://secure.travis-ci.org/hdemon/NicoAPI.png)](http://travis-ci.org/hdemon/NicoAPI)
1
+ [![Build Status](https://secure.travis-ci.org/hdemon/nicoapi-core.png)](http://travis-ci.org/hdemon/nicoapi-core)
2
2
 
3
- # NicoAPI::Core
3
+ # Nicoapi::Core
4
4
 
5
5
  TODO: Write a gem description
6
6
 
@@ -8,7 +8,7 @@ TODO: Write a gem description
8
8
 
9
9
  Add this line to your application's Gemfile:
10
10
 
11
- gem 'NicoAPI'
11
+ gem 'nicoapi-core'
12
12
 
13
13
  And then execute:
14
14
 
@@ -16,7 +16,7 @@ And then execute:
16
16
 
17
17
  Or install it yourself as:
18
18
 
19
- $ gem install NicoAPI
19
+ $ gem install nicoapi-core
20
20
 
21
21
  ## Usage
22
22
 
data/lib/nicoapi/base.rb CHANGED
@@ -1,4 +1,4 @@
1
- require 'NicoAPI/http_client'
1
+ require 'nicoapi/http_client'
2
2
 
3
3
 
4
4
  module NicoAPI
@@ -25,9 +25,10 @@ module NicoAPI
25
25
  end
26
26
 
27
27
  def get
28
- http_client = NicoAPI::HttpClient.instance
28
+ http_client = NicoAPI::HttpClient.new
29
29
  http_client.set_params uri.to_s
30
30
  http_client.get
31
31
  end
32
32
  end
33
33
  end
34
+
@@ -1,11 +1,11 @@
1
- require 'NicoAPI/base'
1
+ require 'nicoapi/base'
2
2
 
3
3
 
4
4
  module NicoAPI
5
5
  class GetThumbInfo
6
6
  include NicoAPI::Base
7
7
 
8
- def set(video_id)
8
+ def initialize(video_id)
9
9
  @dynamic_segment = video_id
10
10
  @params_array = []
11
11
  end
@@ -1,12 +1,11 @@
1
1
  require 'rest_client'
2
- require 'singleton'
3
2
 
4
3
 
5
4
  module NicoAPI
6
5
  class HttpClient
7
- include Singleton
8
-
9
- def set_params(uri) @uri = uri end
6
+ def set_params(uri)
7
+ @uri = uri
8
+ end
10
9
 
11
10
  def get
12
11
  RestClient.get @uri.to_s
@@ -1,12 +1,12 @@
1
1
  require 'active_support/core_ext'
2
- require 'NicoAPI/base'
2
+ require 'nicoapi/base'
3
3
 
4
4
 
5
5
  module NicoAPI
6
6
  class TagSearch
7
7
  include NicoAPI::Base
8
8
 
9
- def set(tag: tag, sort: sort, order: order, page: page)
9
+ def initialize(tag: tag, sort: sort, order: order, page: page)
10
10
  @dynamic_segment = tag
11
11
  @params_array = params_array(sort, order, page)
12
12
  end
@@ -1,3 +1,3 @@
1
1
  module NicoAPI
2
- VERSION = "0.0.4.1"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -1,13 +1,14 @@
1
- require 'NicoAPI/base'
1
+ require 'nicoapi/base'
2
2
 
3
3
 
4
4
  module NicoAPI
5
5
  class VideoArray
6
6
  include NicoAPI::Base
7
7
 
8
- def set(video_id_array)
8
+ def initialize(video_id_array)
9
+ @video_id_array = video_id_array
9
10
  @dynamic_segment = ''
10
- @params_array = params_array video_id_array
11
+ @params_array = params_array @video_id_array
11
12
  end
12
13
 
13
14
  private
data/lib/nicoapi.rb CHANGED
@@ -1,26 +1,23 @@
1
- require "NicoAPI/version"
1
+ require 'nicoapi/version'
2
2
 
3
- require "NicoAPI/getthumbinfo"
4
- require "NicoAPI/tag_search"
5
- require "NicoAPI/video_array"
3
+ require 'nicoapi/getthumbinfo'
4
+ require 'nicoapi/tag_search'
5
+ require 'nicoapi/video_array'
6
6
 
7
7
 
8
8
  module NicoAPI
9
9
  def getthumbinfo(video_id)
10
- instance = NicoAPI::GetThumbInfo.new
11
- instance.set video_id
10
+ instance = NicoAPI::GetThumbInfo.new video_id
12
11
  instance.get
13
12
  end
14
13
 
15
14
  def video_array(video_id_array)
16
- instance = NicoAPI::VideoArray.new
17
- instance.set video_id_array
15
+ instance = NicoAPI::VideoArray.new video_id_array
18
16
  instance.get
19
17
  end
20
18
 
21
19
  def tag_search(tag: tag, sort: sort, order: order, page: page)
22
- instance = NicoAPI::TagSearch.new
23
- instance.set tag: tag, sort: sort, order: order, page: page
20
+ instance = NicoAPI::TagSearch.new tag: tag, sort: sort, order: order, page: page
24
21
  instance.get
25
22
  end
26
23
 
data/nicoapi.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'NicoAPI/version'
4
+ require 'nicoapi/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "nicoapi"
@@ -1,10 +1,9 @@
1
- require 'NicoAPI/getthumbinfo'
1
+ require 'nicoapi/getthumbinfo'
2
2
 
3
3
 
4
4
  describe "getthumbinfo" do
5
5
  before do
6
- @instance = NicoAPI::GetThumbInfo.new
7
- @instance.set 'sm9'
6
+ @instance = NicoAPI::GetThumbInfo.new 'sm9'
8
7
  end
9
8
 
10
9
  describe "uri" do
@@ -1,10 +1,12 @@
1
- require 'NicoAPI/tag_search'
1
+ require 'nicoapi/tag_search'
2
2
 
3
3
 
4
4
  describe "tag_search" do
5
5
  before do
6
- @instance = NicoAPI::TagSearch.new
7
- @instance.set tag: 'ゆっくり実況プレイ', sort: :published_at, order: :asc, page: 1
6
+ @instance = NicoAPI::TagSearch.new tag: 'ゆっくり実況プレイ',
7
+ sort: :published_at,
8
+ order: :asc,
9
+ page: 1
8
10
  end
9
11
 
10
12
  describe "uri" do
@@ -1,10 +1,9 @@
1
- require 'NicoAPI/video_array'
1
+ require 'nicoapi/video_array'
2
2
 
3
3
 
4
4
  describe "VideoArray" do
5
5
  before do
6
- @instance = NicoAPI::VideoArray.new
7
- @instance.set ['sm9', 'sm14']
6
+ @instance = NicoAPI::VideoArray.new ['sm9', 'sm14']
8
7
  end
9
8
 
10
9
  describe "uri" do
@@ -13,4 +12,4 @@ describe "VideoArray" do
13
12
  expect(subject).to match /http:\/\/i\.nicovideo\.jp\/v3\/video\.array\?v=((sm\d|nm\d),{0,}){1,}/
14
13
  }
15
14
  end
16
- end
15
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nicoapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4.1
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masami Yonehara
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-08 00:00:00.000000000 Z
11
+ date: 2013-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -142,13 +142,11 @@ files:
142
142
  - lib/nicoapi/getthumbinfo.rb
143
143
  - lib/nicoapi/hash_mapper.rb
144
144
  - lib/nicoapi/http_client.rb
145
- - lib/nicoapi/mylist.rb
146
145
  - lib/nicoapi/tag_search.rb
147
146
  - lib/nicoapi/version.rb
148
147
  - lib/nicoapi/video_array.rb
149
148
  - nicoapi.gemspec
150
149
  - spec/getthumbinfo_spec.rb
151
- - spec/mylist_spec.rb
152
150
  - spec/spec_helper.rb
153
151
  - spec/tag_search_spec.rb
154
152
  - spec/video_array_spec.rb
@@ -178,7 +176,6 @@ specification_version: 4
178
176
  summary: niconico low level api library
179
177
  test_files:
180
178
  - spec/getthumbinfo_spec.rb
181
- - spec/mylist_spec.rb
182
179
  - spec/spec_helper.rb
183
180
  - spec/tag_search_spec.rb
184
181
  - spec/video_array_spec.rb
@@ -1,31 +0,0 @@
1
- require 'active_support/core_ext'
2
- require 'NicoAPI/base'
3
-
4
-
5
- module NicoAPI
6
- class Mylist
7
- include NicoAPI::Base
8
-
9
- def set(mylist_id: mylist_id)
10
- @dynamic_segment = mylist_id
11
- @params_array = params_array
12
- end
13
-
14
- private
15
- def host
16
- 'www.nicovideo.jp'
17
- end
18
-
19
- def static_segment
20
- 'mylist'
21
- end
22
-
23
- def params_array
24
- [format]
25
- end
26
-
27
- def format
28
- "rss=2.0"
29
- end
30
- end
31
- end
data/spec/mylist_spec.rb DELETED
@@ -1,18 +0,0 @@
1
- require 'NicoAPI/mylist'
2
-
3
-
4
- describe "mylist" do
5
- before do
6
- @instance = NicoAPI::Mylist.new
7
- @instance.set mylist_id: "12345678"
8
- end
9
-
10
- describe "uri" do
11
- subject { @instance.uri }
12
-
13
- specify { expect(subject).to match /http:\/\/www\.nicovideo\.jp\/mylist/ }
14
-
15
- specify { expect(subject).to match /12345678/ }
16
- specify { expect(subject).to match /rss\=2\.0/ }
17
- end
18
- end