vlaah 0.9.0 → 0.9.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.
data/lib/vlaah/base.rb CHANGED
@@ -111,7 +111,7 @@ module VLAAH
111
111
  }
112
112
 
113
113
  response = connect_http.get(Path + path, headers)
114
- accepted = response["X-Accept-Protocol"]
114
+ accepted = response["X-Protocol"]
115
115
 
116
116
  if accepted =~ /(^|,)\s*#{Protocol}\s*;\s*expires\s*=\s*(.+?)(,|$)/
117
117
  warn "#{caller[0]}: warning:" +
data/lib/vlaah/comment.rb CHANGED
@@ -55,6 +55,14 @@ module VLAAH
55
55
  new(xml) if xml.attributes.include? 'type'
56
56
  end
57
57
 
58
+ # The topic what it says about. +Topic+ instance.
59
+ #
60
+ # comment.topic #=> <VLAAH::Topic name="Kanye West">
61
+ # comment.topic.name #=> "Kanye West"
62
+ def topic
63
+ Topic.new raw_data("topic").first
64
+ end
65
+
58
66
  # :plus or :minus.
59
67
  #
60
68
  # plus_comment.type #=> :plus
data/lib/vlaah/topic.rb CHANGED
@@ -3,6 +3,11 @@ require 'vlaah/unit'
3
3
  require 'rexml/xpath'
4
4
 
5
5
  module VLAAH
6
+ # :stopdoc:
7
+ class TopicError < Error; end
8
+ class EmptyTopicError < TopicError; end
9
+ # :startdoc:
10
+
6
11
  # = Topic: The atomic object of VLAAH.
7
12
  #
8
13
  # It represents topics of VLAAH.
@@ -99,6 +104,8 @@ module VLAAH
99
104
  end
100
105
 
101
106
  @name = @raw_data.attributes['name'].strip if defined? @raw_data
107
+
108
+ raise EmptyTopicError, "The name of topic cannot be empty" if @name.empty?
102
109
  end
103
110
 
104
111
  # The name of the topic. It is not normalized.
@@ -118,6 +125,8 @@ module VLAAH
118
125
  raw_data("@normalized-name").first.value
119
126
  end
120
127
 
128
+ alias_method :normal_name, :normalized_name
129
+
121
130
  # Returns +true+ if it and +operand+ are the same.
122
131
  # (Compare by +normalized_name+.)
123
132
  #
data/lib/vlaah/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
 
2
2
  module VLAAH
3
- Version = "0.9.0"
3
+ Version = "0.9.1"
4
4
  end
metadata CHANGED
@@ -1,33 +1,26 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.4
3
- specification_version: 1
4
2
  name: vlaah
5
3
  version: !ruby/object:Gem::Version
6
- version: 0.9.0
7
- date: 2008-10-19 00:00:00 +09:00
8
- summary: VLAAH API client library for Ruby.
9
- require_paths:
10
- - lib
11
- email:
12
- homepage: http://vlaah.rubyforge.org/
13
- rubyforge_project:
14
- description: It provides various model classes which wrap the raw protocol of VLAAH API. (http://api.vlaah.com/)
15
- autorequire: vlaah
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
4
+ version: 0.9.1
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
29
6
  authors: []
30
7
 
8
+ autorequire: vlaah
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-08-06 00:00:00 +09:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: It provides various model classes which wrap the raw protocol of VLAAH API. (http://api.vlaah.com/)
17
+ email:
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files: []
23
+
31
24
  files:
32
25
  - doc/template.rb
33
26
  - lib/vlaah
@@ -40,17 +33,31 @@ files:
40
33
  - lib/vlaah/unit.rb
41
34
  - lib/vlaah/locale.rb
42
35
  - lib/vlaah.rb
43
- test_files: []
44
-
36
+ has_rdoc: true
37
+ homepage: http://vlaah.rubyforge.org/
38
+ post_install_message:
45
39
  rdoc_options: []
46
40
 
47
- extra_rdoc_files: []
48
-
49
- executables: []
50
-
51
- extensions: []
52
-
41
+ require_paths:
42
+ - lib
43
+ required_ruby_version: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: "0"
48
+ version:
49
+ required_rubygems_version: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: "0"
54
+ version:
53
55
  requirements: []
54
56
 
55
- dependencies: []
57
+ rubyforge_project:
58
+ rubygems_version: 1.3.1
59
+ signing_key:
60
+ specification_version: 2
61
+ summary: VLAAH API client library for Ruby.
62
+ test_files: []
56
63