transcoder 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +1 -1
- data/VERSION +1 -1
- data/lib/transcoder.rb +5 -9
- data/lib/transcoder/parser/feed/handler.rb +5 -0
- data/lib/transcoder/parser/{feed.rb → feed/identifier.rb} +3 -3
- data/lib/transcoder/parser/json/handler.rb +5 -0
- data/lib/transcoder/parser/{json.rb → json/identifier.rb} +3 -3
- data/lib/transcoder/parser/xml/handler.rb +5 -0
- data/lib/transcoder/parser/{xml.rb → xml/identifier.rb} +3 -3
- data/lib/transcoder/parser/{yaml.rb → yaml/identifier.rb} +1 -0
- data/transcoder.gemspec +8 -6
- metadata +9 -7
- data/lib/core_ext/autoload.rb +0 -27
data/LICENSE
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/lib/transcoder.rb
CHANGED
@@ -12,13 +12,9 @@ module Transcoder
|
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
-
|
16
|
-
# rather than from the current $LOAD_PATH only
|
17
|
-
require 'core_ext/autoload'
|
15
|
+
$LOAD_PATH << File.dirname(__FILE__) + "/transcoder/parser"
|
18
16
|
|
19
|
-
|
20
|
-
|
21
|
-
require '
|
22
|
-
require '
|
23
|
-
require 'transcoder/parser/feed'
|
24
|
-
require 'transcoder/parser/yaml'
|
17
|
+
require 'json/identifier'
|
18
|
+
require 'xml/identifier'
|
19
|
+
require 'feed/identifier'
|
20
|
+
require 'yaml/identifier'
|
@@ -1,12 +1,12 @@
|
|
1
|
-
autoload :SimpleRSS, "simple-rss"
|
2
|
-
|
3
1
|
module Transcoder
|
4
2
|
class Feed < Parser
|
5
3
|
identifier "application/atom+xml",
|
6
4
|
"application/rss+xml"
|
5
|
+
|
6
|
+
autoload :Handler, "feed/handler"
|
7
7
|
|
8
8
|
def self.parse(raw)
|
9
|
-
|
9
|
+
Feed::Handler.parse(raw)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
autoload :JSON, "json"
|
2
|
-
|
3
1
|
module Transcoder
|
4
2
|
class Json < Parser
|
5
3
|
identifier "application/json",
|
@@ -8,8 +6,10 @@ module Transcoder
|
|
8
6
|
"text/x-javascript",
|
9
7
|
"text/x-json"
|
10
8
|
|
9
|
+
autoload :Handler, "json/handler"
|
10
|
+
|
11
11
|
def self.parse(raw)
|
12
|
-
|
12
|
+
Json::Handler.parse(raw)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
data/transcoder.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{transcoder}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.3.0"
|
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"]
|
@@ -24,12 +24,14 @@ Gem::Specification.new do |s|
|
|
24
24
|
"README.md",
|
25
25
|
"Rakefile",
|
26
26
|
"VERSION",
|
27
|
-
"lib/core_ext/autoload.rb",
|
28
27
|
"lib/transcoder.rb",
|
29
|
-
"lib/transcoder/parser/feed.rb",
|
30
|
-
"lib/transcoder/parser/
|
31
|
-
"lib/transcoder/parser/
|
32
|
-
"lib/transcoder/parser/
|
28
|
+
"lib/transcoder/parser/feed/handler.rb",
|
29
|
+
"lib/transcoder/parser/feed/identifier.rb",
|
30
|
+
"lib/transcoder/parser/json/handler.rb",
|
31
|
+
"lib/transcoder/parser/json/identifier.rb",
|
32
|
+
"lib/transcoder/parser/xml/handler.rb",
|
33
|
+
"lib/transcoder/parser/xml/identifier.rb",
|
34
|
+
"lib/transcoder/parser/yaml/identifier.rb",
|
33
35
|
"spec/parser/feed_spec.rb",
|
34
36
|
"spec/parser/json_spec.rb",
|
35
37
|
"spec/parser/xml_spec.rb",
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
7
|
+
- 3
|
8
8
|
- 0
|
9
|
-
version: 0.
|
9
|
+
version: 0.3.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Ben Schwarz
|
@@ -110,12 +110,14 @@ files:
|
|
110
110
|
- README.md
|
111
111
|
- Rakefile
|
112
112
|
- VERSION
|
113
|
-
- lib/core_ext/autoload.rb
|
114
113
|
- lib/transcoder.rb
|
115
|
-
- lib/transcoder/parser/feed.rb
|
116
|
-
- lib/transcoder/parser/
|
117
|
-
- lib/transcoder/parser/
|
118
|
-
- lib/transcoder/parser/
|
114
|
+
- lib/transcoder/parser/feed/handler.rb
|
115
|
+
- lib/transcoder/parser/feed/identifier.rb
|
116
|
+
- lib/transcoder/parser/json/handler.rb
|
117
|
+
- lib/transcoder/parser/json/identifier.rb
|
118
|
+
- lib/transcoder/parser/xml/handler.rb
|
119
|
+
- lib/transcoder/parser/xml/identifier.rb
|
120
|
+
- lib/transcoder/parser/yaml/identifier.rb
|
119
121
|
- spec/parser/feed_spec.rb
|
120
122
|
- spec/parser/json_spec.rb
|
121
123
|
- spec/parser/xml_spec.rb
|
data/lib/core_ext/autoload.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
class Object
|
2
|
-
class << self
|
3
|
-
alias_method :_const_missing, :const_missing
|
4
|
-
private :_const_missing
|
5
|
-
|
6
|
-
def const_missing(constant)
|
7
|
-
if Kernel._autoloads.key? constant
|
8
|
-
require Kernel._autoloads[constant]
|
9
|
-
const_get(constant)
|
10
|
-
else
|
11
|
-
_const_missing(constant)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
module Kernel
|
18
|
-
module_function :autoload
|
19
|
-
|
20
|
-
def _autoloads
|
21
|
-
@@_autoloads
|
22
|
-
end
|
23
|
-
|
24
|
-
def autoload(const, path)
|
25
|
-
(@@_autoloads||={})[const] = path
|
26
|
-
end
|
27
|
-
end
|