nicovideo 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,7 +1,11 @@
1
+ 2008-02-03 version 0.0.5
2
+
3
+ * added getter to Nicovideo::Base#agent(WWW::Mechanize object)
4
+ * fixed typo of agent's get method
5
+
1
6
  2008-02-02 version 0.0.4
2
7
 
3
8
  * added functions to get mylist and openlist
4
9
  * auto login (ref: http://d.hatena.ne.jp/zorio/20080122/1201018583)
5
10
  * added published_at method to VideoPage
6
11
  * did unit tests
7
-
@@ -4,9 +4,6 @@ module Nicovideo
4
4
  class LoginError < StandardError ; end
5
5
  class NotFound < StandardError ; end
6
6
  class Forbidden < StandardError ; end
7
- # class NotOpened < StandardError ; end
8
- # class OpenListNotFound < StandardError ; end
9
- # class MyListNotFound < StandardError ; end
10
7
 
11
8
  class Base
12
9
 
@@ -22,6 +19,8 @@ module Nicovideo
22
19
  self
23
20
  end
24
21
 
22
+ attr_reader :agent
23
+
25
24
  def agent_init auto_login=true
26
25
  @agent.instance_eval do
27
26
  alias raw_get get
@@ -43,7 +42,7 @@ module Nicovideo
43
42
  if auto_login
44
43
  @agent.instance_eval do
45
44
  @wait_time = 3
46
- def get(*args) try(:raw_post, *args) end
45
+ def get(*args) try(:raw_get, *args) end
47
46
  def post(*args) try(:raw_post, *args) end
48
47
 
49
48
  def try(name, *args)
@@ -105,7 +104,7 @@ module Nicovideo
105
104
  def openlist(video_id)
106
105
  OpenList.new(@agent, video_id)
107
106
  end
108
-
107
+
109
108
  private
110
109
  def get_videopage(video_id)
111
110
  if @vp.nil? || video_id != @vp.video_id
@@ -2,7 +2,7 @@ module Nicovideo #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 4
5
+ TINY = 5
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/test/runner.rb ADDED
@@ -0,0 +1,3 @@
1
+ require File.dirname(__FILE__) + '/test_helper.rb'
2
+
3
+ Test::Unit::AutoRunner.run(true, File.dirname(__FILE__))
@@ -21,7 +21,12 @@ class TestNicovideoVideoPage < Test::Unit::TestCase
21
21
  assert_instance_of(Nicovideo::VideoPage, vp)
22
22
  assert_instance_of(Array, vp.tags)
23
23
  assert_instance_of(String, vp.title)
24
+ assert_instance_of(Time, vp.published_at)
24
25
  assert_instance_of(Nicovideo::Comments, vp.comments)
26
+
27
+ puts vp.tags
28
+ puts vp.title
29
+ puts vp.published_at
25
30
  # assert_instance_of(String, vp.flv)
26
31
  # assert_instance_of(String, vp.video)
27
32
 
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: nicovideo
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.4
7
- date: 2008-02-02 00:00:00 +09:00
6
+ version: 0.0.5
7
+ date: 2008-02-03 00:00:00 +09:00
8
8
  summary: utils for nicovideo
9
9
  require_paths:
10
10
  - lib
@@ -44,6 +44,7 @@ files:
44
44
  - lib/nicovideo/mylist.rb
45
45
  - lib/nicovideo/openlist.rb
46
46
  - test/test_helper.rb
47
+ - test/runner.rb
47
48
  - test/test_nicovideo.rb
48
49
  - test/test_login.rb
49
50
  - test/test_videopage.rb
@@ -55,7 +56,6 @@ files:
55
56
  - sample/nv_openlist.rb
56
57
  test_files:
57
58
  - test/test_openlist.rb
58
- - test/test_runner.rb
59
59
  - test/test_nicovideo.rb
60
60
  - test/test_mylist.rb
61
61
  - test/test_videopage.rb
data/test/test_runner.rb DELETED
File without changes