rss-dcterms 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rss/dcterms.rb +1 -1
- data/lib/rss/dcterms/1.0.rb +5 -5
- data/lib/rss/dcterms/2.0.rb +3 -3
- data/lib/rss/dcterms/atom.rb +4 -4
- data/lib/rss/dcterms/property.rb +6 -6
- data/lib/rss/dcterms/version.rb +2 -2
- data/lib/rss/maker/dcterms.rb +21 -21
- data/rss-dcterms.gemspec +3 -3
- metadata +15 -15
data/lib/rss/dcterms.rb
CHANGED
data/lib/rss/dcterms/1.0.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
require 'rss/1.0'
|
2
2
|
|
3
3
|
module RSS
|
4
|
-
RDF.install_ns(
|
4
|
+
RDF.install_ns(DCTerms::PREFIX, DCTerms::URI)
|
5
5
|
|
6
6
|
class RDF
|
7
|
-
class Channel; include
|
8
|
-
class Image; include
|
9
|
-
class Item; include
|
10
|
-
class Textinput; include
|
7
|
+
class Channel; include DCTerms::PropertyModel; end
|
8
|
+
class Image; include DCTerms::PropertyModel; end
|
9
|
+
class Item; include DCTerms::PropertyModel; end
|
10
|
+
class Textinput; include DCTerms::PropertyModel; end
|
11
11
|
end
|
12
12
|
end
|
data/lib/rss/dcterms/2.0.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
require 'rss/2.0'
|
2
2
|
|
3
3
|
module RSS
|
4
|
-
Rss.install_ns(
|
4
|
+
Rss.install_ns(DCTerms::PREFIX, DCTerms::URI)
|
5
5
|
|
6
6
|
class Rss
|
7
7
|
class Channel
|
8
|
-
include
|
9
|
-
class Item; include
|
8
|
+
include DCTerms::PropertyModel
|
9
|
+
class Item; include DCTerms::PropertyModel; end
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
data/lib/rss/dcterms/atom.rb
CHANGED
@@ -2,15 +2,15 @@ require 'rss/atom'
|
|
2
2
|
|
3
3
|
module RSS
|
4
4
|
module Atom
|
5
|
-
Feed.install_ns(
|
5
|
+
Feed.install_ns(DCTerms::PREFIX, DCTerms::URI)
|
6
6
|
|
7
7
|
class Feed
|
8
|
-
include
|
9
|
-
class Entry; include
|
8
|
+
include DCTerms::PropertyModel
|
9
|
+
class Entry; include DCTerms::PropertyModel; end
|
10
10
|
end
|
11
11
|
|
12
12
|
class Entry
|
13
|
-
include
|
13
|
+
include DCTerms::PropertyModel
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
data/lib/rss/dcterms/property.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module RSS
|
2
|
-
module
|
2
|
+
module DCTerms
|
3
3
|
module BasePropertyModel
|
4
4
|
def append_features(klass)
|
5
5
|
super
|
@@ -9,7 +9,7 @@ module RSS
|
|
9
9
|
plural = plural_name || "#{name}s"
|
10
10
|
full_name = "#{PREFIX}_#{name}"
|
11
11
|
full_plural_name = "#{PREFIX}_#{plural}"
|
12
|
-
klass_name = "
|
12
|
+
klass_name = "DCTerms#{Utils.to_class_name(name)}"
|
13
13
|
klass.install_must_call_validator(PREFIX, URI)
|
14
14
|
klass.install_have_children_element(name, URI, "*",
|
15
15
|
full_name, full_plural_name)
|
@@ -137,7 +137,7 @@ module RSS
|
|
137
137
|
|
138
138
|
ELEMENTS.each do |name, plural_name|
|
139
139
|
module_eval(<<-EOC, *get_file_and_line_from_caller(0))
|
140
|
-
class
|
140
|
+
class DCTerms#{Utils.to_class_name(name)} < Element
|
141
141
|
include RSS10
|
142
142
|
|
143
143
|
content_setup
|
@@ -184,7 +184,7 @@ module RSS
|
|
184
184
|
DATE_ELEMENTS.each do |name, type|
|
185
185
|
tag_name = "#{PREFIX}:#{name}"
|
186
186
|
module_eval(<<-EOC, *get_file_and_line_from_caller(0))
|
187
|
-
class
|
187
|
+
class DCTerms#{Utils.to_class_name(name)} < Element
|
188
188
|
remove_method(:content=)
|
189
189
|
remove_method(:value=)
|
190
190
|
|
@@ -196,11 +196,11 @@ module RSS
|
|
196
196
|
end
|
197
197
|
end
|
198
198
|
|
199
|
-
|
199
|
+
DCTerms::PropertyModel::ELEMENTS.each do |name|
|
200
200
|
class_name = Utils.to_class_name(name)
|
201
201
|
BaseListener.install_class_name(URI, name, class_name)
|
202
202
|
end
|
203
203
|
|
204
|
-
|
204
|
+
DCTerms::PropertyModel::ELEMENTS.collect! {|name| "#{PREFIX}_#{name}"}
|
205
205
|
end
|
206
206
|
end
|
data/lib/rss/dcterms/version.rb
CHANGED
data/lib/rss/maker/dcterms.rb
CHANGED
@@ -3,17 +3,17 @@ require 'rss/maker'
|
|
3
3
|
|
4
4
|
module RSS
|
5
5
|
module Maker
|
6
|
-
module
|
6
|
+
module DCTerms
|
7
7
|
module PropertyModel
|
8
8
|
class << self
|
9
9
|
def append_features(klass)
|
10
10
|
super
|
11
11
|
|
12
|
-
::RSS::
|
12
|
+
::RSS::DCTerms::PropertyModel::ELEMENT_NAME_INFOS.each do |name, plural_name|
|
13
13
|
plural_name ||= "#{name}s"
|
14
|
-
full_name = "#{RSS::
|
15
|
-
full_plural_name = "#{RSS::
|
16
|
-
plural_klass_name = "
|
14
|
+
full_name = "#{RSS::DCTerms::PREFIX}_#{name}"
|
15
|
+
full_plural_name = "#{RSS::DCTerms::PREFIX}_#{plural_name}"
|
16
|
+
plural_klass_name = "DCTerms#{Utils.to_class_name(plural_name)}"
|
17
17
|
klass.def_classed_elements full_name, 'value', plural_klass_name,
|
18
18
|
full_plural_name, name
|
19
19
|
klass.module_eval(<<-EOC)
|
@@ -31,11 +31,11 @@ module RSS
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def install_dcterms_core(klass)
|
34
|
-
::RSS::
|
34
|
+
::RSS::DCTerms::PropertyModel::ELEMENT_NAME_INFOS.each do |name, plural_name|
|
35
35
|
plural_name ||= "#{name}s"
|
36
36
|
klass_name = Utils.to_class_name(name)
|
37
|
-
full_klass_name = "
|
38
|
-
plural_klass_name = "
|
37
|
+
full_klass_name = "DCTerms#{klass_name}"
|
38
|
+
plural_klass_name = "DCTerms#{Utils.to_class_name(plural_name)}"
|
39
39
|
klass.module_eval(<<-EOC, __FILE__, __LINE__ + 1)
|
40
40
|
class #{plural_klass_name} < #{plural_klass_name}Base
|
41
41
|
class #{full_klass_name} < #{full_klass_name}Base
|
@@ -47,13 +47,13 @@ EOC
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
-
::RSS::
|
50
|
+
::RSS::DCTerms::PropertyModel::ELEMENT_NAME_INFOS.each do |name, plural_name|
|
51
51
|
plural_name ||= "#{name}s"
|
52
|
-
full_name = "#{RSS::
|
53
|
-
full_plural_name = "#{RSS::
|
52
|
+
full_name = "#{RSS::DCTerms::PREFIX}_#{name}"
|
53
|
+
full_plural_name = "#{RSS::DCTerms::PREFIX}_#{plural_name}"
|
54
54
|
klass_name = Utils.to_class_name(name)
|
55
|
-
full_klass_name = "
|
56
|
-
plural_klass_name = "
|
55
|
+
full_klass_name = "DCTerms#{klass_name}"
|
56
|
+
plural_klass_name = "DCTerms#{Utils.to_class_name(plural_name)}"
|
57
57
|
module_eval(<<-EOC, __FILE__, __LINE__ + 1)
|
58
58
|
class #{plural_klass_name}Base < Base
|
59
59
|
def_array_element #{name.dump}, #{full_plural_name.dump},
|
@@ -84,35 +84,35 @@ EOC
|
|
84
84
|
end
|
85
85
|
|
86
86
|
class ChannelBase
|
87
|
-
include
|
87
|
+
include DCTerms::PropertyModel
|
88
88
|
end
|
89
89
|
|
90
|
-
class ImageBase; include
|
90
|
+
class ImageBase; include DCTerms::PropertyModel; end
|
91
91
|
class ItemsBase
|
92
92
|
class ItemBase
|
93
|
-
include
|
93
|
+
include DCTerms::PropertyModel
|
94
94
|
end
|
95
95
|
end
|
96
|
-
class TextinputBase; include
|
96
|
+
class TextinputBase; include DCTerms::PropertyModel; end
|
97
97
|
|
98
98
|
makers.each do |maker|
|
99
99
|
maker.module_eval(<<-EOC, __FILE__, __LINE__ + 1)
|
100
100
|
class Channel
|
101
|
-
|
101
|
+
DCTerms::PropertyModel.install_dcterms_core self
|
102
102
|
end
|
103
103
|
|
104
104
|
class Image
|
105
|
-
|
105
|
+
DCTerms::PropertyModel.install_dcterms_core self
|
106
106
|
end
|
107
107
|
|
108
108
|
class Items
|
109
109
|
class Item
|
110
|
-
|
110
|
+
DCTerms::PropertyModel.install_dcterms_core self
|
111
111
|
end
|
112
112
|
end
|
113
113
|
|
114
114
|
class Textinput
|
115
|
-
|
115
|
+
DCTerms::PropertyModel.install_dcterms_core self
|
116
116
|
end
|
117
117
|
EOC
|
118
118
|
end
|
data/rss-dcterms.gemspec
CHANGED
@@ -4,8 +4,8 @@ require File.expand_path('../lib/rss/dcterms/version', __FILE__)
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.authors = ["KITAITI Makoto"]
|
6
6
|
gem.email = ["KitaitiMakoto@gmail.com"]
|
7
|
-
gem.description = %q{
|
8
|
-
gem.summary = %q{
|
7
|
+
gem.description = %q{Enables standard bundled RSS library parse and make feeds including DCMI(Dublin Core Metadata Initiative) Metadata Terms}
|
8
|
+
gem.summary = %q{DCTerms support for standard bundled RSS library}
|
9
9
|
gem.homepage = "http://rss-ext.rubyforge.org/"
|
10
10
|
|
11
11
|
gem.files = `git ls-files`.split($\)
|
@@ -13,7 +13,7 @@ Gem::Specification.new do |gem|
|
|
13
13
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
14
|
gem.name = "rss-dcterms"
|
15
15
|
gem.require_paths = ["lib"]
|
16
|
-
gem.version = RSS::
|
16
|
+
gem.version = RSS::DCTerms::VERSION
|
17
17
|
|
18
18
|
gem.add_development_dependency 'test-unit'
|
19
19
|
gem.add_development_dependency 'pry'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rss-dcterms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-10-11 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: test-unit
|
16
|
-
requirement: &
|
16
|
+
requirement: &17852620 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *17852620
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: pry
|
27
|
-
requirement: &
|
27
|
+
requirement: &17851900 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *17851900
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: pry-doc
|
38
|
-
requirement: &
|
38
|
+
requirement: &17851080 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *17851080
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: yard
|
49
|
-
requirement: &
|
49
|
+
requirement: &17849880 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *17849880
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: redcarpet
|
60
|
-
requirement: &
|
60
|
+
requirement: &17849220 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,8 +65,8 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
69
|
-
description:
|
68
|
+
version_requirements: *17849220
|
69
|
+
description: Enables standard bundled RSS library parse and make feeds including DCMI(Dublin
|
70
70
|
Core Metadata Initiative) Metadata Terms
|
71
71
|
email:
|
72
72
|
- KitaitiMakoto@gmail.com
|
@@ -103,7 +103,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
103
103
|
version: '0'
|
104
104
|
segments:
|
105
105
|
- 0
|
106
|
-
hash:
|
106
|
+
hash: 29086319745245033
|
107
107
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
108
|
none: false
|
109
109
|
requirements:
|
@@ -112,12 +112,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
112
|
version: '0'
|
113
113
|
segments:
|
114
114
|
- 0
|
115
|
-
hash:
|
115
|
+
hash: 29086319745245033
|
116
116
|
requirements: []
|
117
117
|
rubyforge_project:
|
118
118
|
rubygems_version: 1.8.8
|
119
119
|
signing_key:
|
120
120
|
specification_version: 3
|
121
|
-
summary:
|
121
|
+
summary: DCTerms support for standard bundled RSS library
|
122
122
|
test_files: []
|
123
123
|
has_rdoc:
|