transcoder 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.0
1
+ 0.4.1
@@ -12,6 +12,10 @@ module Transcoder
12
12
  def self.for(mime)
13
13
  Parser.for(mime)
14
14
  end
15
+
16
+ def self.register(mime, klass)
17
+ klass.send(:identifier, mime)
18
+ end
15
19
  end
16
20
 
17
21
  $LOAD_PATH << File.dirname(__FILE__) + "/transcoder/parser"
@@ -6,6 +6,12 @@ describe "Transcoder" do
6
6
  Transcoder.for("application/json")
7
7
  end
8
8
 
9
+ it "should register a given kind to a parser" do
10
+ lambda { Transcoder.for("foo/bar") }.should raise_error(Registry::NotRegistered)
11
+ Transcoder.register("foo/bar", Transcoder::Json)
12
+ Transcoder.for("foo/bar").should == Transcoder::Json
13
+ end
14
+
9
15
  describe "mime-types" do
10
16
  it "should parse json" do
11
17
  Transcoder.for('application/json').should == Transcoder::Json
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{transcoder}
8
- s.version = "0.4.0"
8
+ s.version = "0.4.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ben Schwarz"]
12
- s.date = %q{2010-03-21}
12
+ s.date = %q{2010-10-08}
13
13
  s.description = %q{Transcode from json, xml or atom/rss feeds to Ruby.}
14
14
  s.email = %q{ben.schwarz@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -45,7 +45,7 @@ Gem::Specification.new do |s|
45
45
  s.homepage = %q{http://github.com/benschwarz/transcoder}
46
46
  s.rdoc_options = ["--charset=UTF-8"]
47
47
  s.require_paths = ["lib"]
48
- s.rubygems_version = %q{1.3.6}
48
+ s.rubygems_version = %q{1.3.7}
49
49
  s.summary = %q{Transcode from common web based formats into plain old Ruby.}
50
50
  s.test_files = [
51
51
  "spec/parser/feed_spec.rb",
@@ -60,7 +60,7 @@ Gem::Specification.new do |s|
60
60
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
61
61
  s.specification_version = 3
62
62
 
63
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
63
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
64
64
  s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
65
65
  s.add_development_dependency(%q<rest-client>, [">= 0"])
66
66
  s.add_runtime_dependency(%q<registry>, [">= 0.1.2"])
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transcoder
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 13
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 4
8
- - 0
9
- version: 0.4.0
9
+ - 1
10
+ version: 0.4.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Ben Schwarz
@@ -14,16 +15,18 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-03-21 00:00:00 +11:00
18
+ date: 2010-10-08 00:00:00 +11:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: rspec
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
24
26
  requirements:
25
27
  - - ">="
26
28
  - !ruby/object:Gem::Version
29
+ hash: 13
27
30
  segments:
28
31
  - 1
29
32
  - 2
@@ -35,9 +38,11 @@ dependencies:
35
38
  name: rest-client
36
39
  prerelease: false
37
40
  requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
38
42
  requirements:
39
43
  - - ">="
40
44
  - !ruby/object:Gem::Version
45
+ hash: 3
41
46
  segments:
42
47
  - 0
43
48
  version: "0"
@@ -47,9 +52,11 @@ dependencies:
47
52
  name: registry
48
53
  prerelease: false
49
54
  requirement: &id003 !ruby/object:Gem::Requirement
55
+ none: false
50
56
  requirements:
51
57
  - - ">="
52
58
  - !ruby/object:Gem::Version
59
+ hash: 31
53
60
  segments:
54
61
  - 0
55
62
  - 1
@@ -61,9 +68,11 @@ dependencies:
61
68
  name: json
62
69
  prerelease: false
63
70
  requirement: &id004 !ruby/object:Gem::Requirement
71
+ none: false
64
72
  requirements:
65
73
  - - ">="
66
74
  - !ruby/object:Gem::Version
75
+ hash: 3
67
76
  segments:
68
77
  - 0
69
78
  version: "0"
@@ -73,9 +82,11 @@ dependencies:
73
82
  name: crack
74
83
  prerelease: false
75
84
  requirement: &id005 !ruby/object:Gem::Requirement
85
+ none: false
76
86
  requirements:
77
87
  - - ">="
78
88
  - !ruby/object:Gem::Version
89
+ hash: 3
79
90
  segments:
80
91
  - 0
81
92
  version: "0"
@@ -85,9 +96,11 @@ dependencies:
85
96
  name: simple-rss
86
97
  prerelease: false
87
98
  requirement: &id006 !ruby/object:Gem::Requirement
99
+ none: false
88
100
  requirements:
89
101
  - - ">="
90
102
  - !ruby/object:Gem::Version
103
+ hash: 3
91
104
  segments:
92
105
  - 0
93
106
  version: "0"
@@ -97,9 +110,11 @@ dependencies:
97
110
  name: nokogiri
98
111
  prerelease: false
99
112
  requirement: &id007 !ruby/object:Gem::Requirement
113
+ none: false
100
114
  requirements:
101
115
  - - ">="
102
116
  - !ruby/object:Gem::Version
117
+ hash: 3
103
118
  segments:
104
119
  - 0
105
120
  version: "0"
@@ -149,23 +164,27 @@ rdoc_options:
149
164
  require_paths:
150
165
  - lib
151
166
  required_ruby_version: !ruby/object:Gem::Requirement
167
+ none: false
152
168
  requirements:
153
169
  - - ">="
154
170
  - !ruby/object:Gem::Version
171
+ hash: 3
155
172
  segments:
156
173
  - 0
157
174
  version: "0"
158
175
  required_rubygems_version: !ruby/object:Gem::Requirement
176
+ none: false
159
177
  requirements:
160
178
  - - ">="
161
179
  - !ruby/object:Gem::Version
180
+ hash: 3
162
181
  segments:
163
182
  - 0
164
183
  version: "0"
165
184
  requirements: []
166
185
 
167
186
  rubyforge_project:
168
- rubygems_version: 1.3.6
187
+ rubygems_version: 1.3.7
169
188
  signing_key:
170
189
  specification_version: 3
171
190
  summary: Transcode from common web based formats into plain old Ruby.