vlaah 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/vlaah/base.rb +1 -1
- data/lib/vlaah/comment.rb +8 -0
- data/lib/vlaah/topic.rb +9 -0
- data/lib/vlaah/version.rb +1 -1
- metadata +40 -33
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-
|
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
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.
|
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
|
-
|
44
|
-
|
36
|
+
has_rdoc: true
|
37
|
+
homepage: http://vlaah.rubyforge.org/
|
38
|
+
post_install_message:
|
45
39
|
rdoc_options: []
|
46
40
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
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
|
-
|
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
|
|