tokamak 1.0.0.beta2 → 1.0.0.beta4
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/LICENSE +14 -0
- data/README.md +159 -0
- data/lib/tokamak/builder/base.rb +74 -0
- data/lib/tokamak/{json/builder.rb → builder/json.rb} +38 -29
- data/lib/tokamak/builder/values.rb +33 -0
- data/lib/tokamak/{atom/builder.rb → builder/xml.rb} +46 -41
- data/lib/tokamak/builder.rb +22 -0
- data/lib/tokamak/errors.rb +3 -0
- data/lib/tokamak/hook/rails.rb +78 -0
- data/lib/tokamak/hook/sinatra.rb +18 -0
- data/lib/tokamak/hook/tilt.rb +42 -0
- data/lib/tokamak/hook.rb +6 -0
- data/lib/tokamak/recipes.rb +26 -0
- data/lib/tokamak/version.rb +13 -0
- data/lib/tokamak.rb +14 -18
- data/script/console +7 -0
- data/test/rails2_skel/Rakefile +16 -0
- data/test/rails2_skel/app/controllers/application_controller.rb +1 -0
- data/test/rails2_skel/app/controllers/test_controller.rb +18 -0
- data/test/rails2_skel/app/views/test/_feed_member.tokamak +9 -0
- data/test/rails2_skel/app/views/test/feed.tokamak +24 -0
- data/test/rails2_skel/app/views/test/show.tokamak +31 -0
- data/test/rails2_skel/config/boot.rb +110 -0
- data/test/rails2_skel/config/environment.rb +20 -0
- data/test/rails2_skel/config/environments/development.rb +17 -0
- data/test/rails2_skel/config/environments/production.rb +28 -0
- data/test/rails2_skel/config/environments/test.rb +28 -0
- data/test/rails2_skel/config/initializers/cookie_verification_secret.rb +2 -0
- data/test/rails2_skel/config/initializers/mime_types.rb +3 -0
- data/test/rails2_skel/config/initializers/new_rails_defaults.rb +10 -0
- data/test/rails2_skel/config/initializers/session_store.rb +5 -0
- data/test/rails2_skel/config/routes.rb +43 -0
- data/test/rails2_skel/script/console +3 -0
- data/test/test_helper.rb +7 -0
- data/test/tokamak/builder/base_test.rb +28 -0
- data/test/tokamak/builder/json_test.rb +227 -0
- data/test/tokamak/builder/xml_test.rb +254 -0
- data/test/tokamak/helper_test.rb +106 -0
- data/test/tokamak/hook/rails_test.rb +74 -0
- data/test/tokamak/hook/sinatra_test.rb +85 -0
- data/test/tokamak/hook/tilt_test.rb +35 -0
- data/test/tokamak/recipes_test.rb +90 -0
- metadata +106 -113
- data/.document +0 -5
- data/.rspec +0 -1
- data/Gemfile +0 -27
- data/Gemfile.lock +0 -77
- data/LICENSE.txt +0 -20
- data/README.rdoc +0 -69
- data/Rakefile +0 -50
- data/VERSION +0 -1
- data/lib/tokamak/atom/base.rb +0 -87
- data/lib/tokamak/atom/helpers.rb +0 -13
- data/lib/tokamak/atom.rb +0 -8
- data/lib/tokamak/error.rb +0 -6
- data/lib/tokamak/json/base.rb +0 -83
- data/lib/tokamak/json/helpers.rb +0 -13
- data/lib/tokamak/json.rb +0 -10
- data/lib/tokamak/representation/atom/atom.rng +0 -597
- data/lib/tokamak/representation/atom/base.rb +0 -140
- data/lib/tokamak/representation/atom/category.rb +0 -39
- data/lib/tokamak/representation/atom/entry.rb +0 -56
- data/lib/tokamak/representation/atom/factory.rb +0 -48
- data/lib/tokamak/representation/atom/feed.rb +0 -108
- data/lib/tokamak/representation/atom/link.rb +0 -66
- data/lib/tokamak/representation/atom/person.rb +0 -46
- data/lib/tokamak/representation/atom/source.rb +0 -57
- data/lib/tokamak/representation/atom/tag_collection.rb +0 -36
- data/lib/tokamak/representation/atom/xml.rb +0 -94
- data/lib/tokamak/representation/atom.rb +0 -18
- data/lib/tokamak/representation/generic.rb +0 -20
- data/lib/tokamak/representation/json/base.rb +0 -25
- data/lib/tokamak/representation/json/keys_as_methods.rb +0 -72
- data/lib/tokamak/representation/json/link.rb +0 -27
- data/lib/tokamak/representation/json/link_collection.rb +0 -21
- data/lib/tokamak/representation/json.rb +0 -11
- data/lib/tokamak/representation/links.rb +0 -9
- data/lib/tokamak/representation.rb +0 -3
- data/lib/tokamak/values.rb +0 -29
- data/lib/tokamak/xml/base.rb +0 -60
- data/lib/tokamak/xml/builder.rb +0 -115
- data/lib/tokamak/xml/helpers.rb +0 -13
- data/lib/tokamak/xml/link.rb +0 -31
- data/lib/tokamak/xml/links.rb +0 -35
- data/lib/tokamak/xml.rb +0 -12
- data/spec/integration/atom/atom_spec.rb +0 -191
- data/spec/integration/full_atom.xml +0 -92
- data/spec/integration/full_json.js +0 -46
- data/spec/integration/json/json_spec.rb +0 -172
- data/spec/integration/xml/xml_spec.rb +0 -203
- data/spec/spec_helper.rb +0 -12
@@ -0,0 +1,85 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'rubygems'
|
3
|
+
require 'ruby-debug'
|
4
|
+
require "methodize"
|
5
|
+
require "sinatra"
|
6
|
+
require "rack/conneg"
|
7
|
+
|
8
|
+
# requiring the hook for sinatra
|
9
|
+
require "tokamak/hook/sinatra"
|
10
|
+
|
11
|
+
# simple sinatra app declaration
|
12
|
+
set :views, File.expand_path(File.dirname(__FILE__) + '/../../rails2_skel/app/views/test')
|
13
|
+
|
14
|
+
use(Rack::Conneg) do |conneg|
|
15
|
+
conneg.set :accept_all_extensions, false
|
16
|
+
conneg.set :fallback, :html
|
17
|
+
conneg.ignore('/public/')
|
18
|
+
conneg.provide([:json,:xml])
|
19
|
+
end
|
20
|
+
|
21
|
+
before do
|
22
|
+
if negotiated?
|
23
|
+
content_type negotiated_type
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
get "/" do
|
28
|
+
some_articles = [
|
29
|
+
{:id => 1, :title => "a great article", :updated => Time.now},
|
30
|
+
{:id => 2, :title => "another great article", :updated => Time.now}
|
31
|
+
]
|
32
|
+
tokamak :show, {}, {:@some_articles => some_articles}
|
33
|
+
end
|
34
|
+
|
35
|
+
require "rack/test"
|
36
|
+
ENV['RACK_ENV'] = 'test'
|
37
|
+
|
38
|
+
class Tokamak::Hook::SinatraTest < Test::Unit::TestCase
|
39
|
+
include Rack::Test::Methods
|
40
|
+
|
41
|
+
def app
|
42
|
+
Sinatra::Application
|
43
|
+
end
|
44
|
+
|
45
|
+
def test_tokamak_builder_hook_with_sinatra_rendering_json
|
46
|
+
get '/', {}, {"HTTP_ACCEPT" => "application/json"}
|
47
|
+
|
48
|
+
assert last_response.ok?
|
49
|
+
hash = JSON.parse(last_response.body).extend(Methodize)
|
50
|
+
|
51
|
+
assert_equal "John Doe" , hash.author.first.name
|
52
|
+
assert_equal "foobar@example.com" , hash.author.last.email
|
53
|
+
assert_equal "http://example.com/json", hash.id
|
54
|
+
|
55
|
+
assert_equal "http://a.link.com/next" , hash.link.first.href
|
56
|
+
assert_equal "next" , hash.link.first.rel
|
57
|
+
assert_equal "application/json" , hash.link.last.type
|
58
|
+
|
59
|
+
assert_equal "uri:1" , hash.articles.first.id
|
60
|
+
assert_equal "a great article" , hash.articles.first.title
|
61
|
+
assert_equal "http://example.com/image/1" , hash.articles.last.link.first.href
|
62
|
+
assert_equal "image" , hash.articles.last.link.first.rel
|
63
|
+
assert_equal "application/json" , hash.articles.last.link.last.type
|
64
|
+
end
|
65
|
+
|
66
|
+
def test_tokamak_builder_hook_with_sinatra_rendering_xml
|
67
|
+
get '/', {}, {"HTTP_ACCEPT" => "application/xml"}
|
68
|
+
|
69
|
+
xml = Nokogiri::XML::Document.parse(last_response.body)
|
70
|
+
|
71
|
+
assert_equal "John Doe" , xml.css("root > author").first.css("name").first.text
|
72
|
+
assert_equal "foobar@example.com" , xml.css("root > author").last.css("email").first.text
|
73
|
+
|
74
|
+
assert_equal "http://a.link.com/next" , xml.css("root > link").first["href"]
|
75
|
+
assert_equal "next" , xml.css("root > link").first["rel"]
|
76
|
+
assert_equal "application/xml" , xml.css("root > link").last["type"]
|
77
|
+
|
78
|
+
assert_equal "uri:1" , xml.css("root > articles").first.css("id").first.text
|
79
|
+
assert_equal "a great article" , xml.css("root > articles").first.css("title").first.text
|
80
|
+
assert_equal "http://example.com/image/1" , xml.css("root > articles").first.css("link").first["href"]
|
81
|
+
assert_equal "image" , xml.css("root > articles").first.css("link").first["rel"]
|
82
|
+
assert_equal "application/json" , xml.css("root > articles").first.css("link").last["type"]
|
83
|
+
end
|
84
|
+
|
85
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'rubygems'
|
3
|
+
require 'ruby-debug'
|
4
|
+
require "methodize"
|
5
|
+
require "tilt"
|
6
|
+
|
7
|
+
require "tokamak/hook/tilt"
|
8
|
+
|
9
|
+
class Tokamak::Hook::TiltTest < Test::Unit::TestCase
|
10
|
+
|
11
|
+
def test_tokamak_builder_integration_with_tilt
|
12
|
+
@some_articles = [
|
13
|
+
{:id => 1, :title => "a great article", :updated => Time.now},
|
14
|
+
{:id => 2, :title => "another great article", :updated => Time.now}
|
15
|
+
]
|
16
|
+
|
17
|
+
template = Tokamak::Hook::Tilt::TokamakTemplate.new(File.expand_path(File.dirname(__FILE__) + '/../../rails2_skel/app/views/test/show.tokamak'), :media_type => "application/json")
|
18
|
+
json = template.render(self, :@some_articles => @some_articles)
|
19
|
+
hash = JSON.parse(json).extend(Methodize)
|
20
|
+
|
21
|
+
assert_equal "John Doe" , hash.author.first.name
|
22
|
+
assert_equal "foobar@example.com" , hash.author.last.email
|
23
|
+
assert_equal "http://example.com/json", hash.id
|
24
|
+
|
25
|
+
assert_equal "http://a.link.com/next" , hash.link.first.href
|
26
|
+
assert_equal "next" , hash.link.first.rel
|
27
|
+
assert_equal "application/json" , hash.link.last.type
|
28
|
+
|
29
|
+
assert_equal "uri:1" , hash.articles.first.id
|
30
|
+
assert_equal "a great article" , hash.articles.first.title
|
31
|
+
assert_equal "http://example.com/image/1" , hash.articles.last.link.first.href
|
32
|
+
assert_equal "image" , hash.articles.last.link.first.rel
|
33
|
+
assert_equal "application/json" , hash.articles.last.link.last.type
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
|
2
|
+
|
3
|
+
class Tokamak::RecipesTest < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def test_add_recipe_to_tokamak
|
6
|
+
Tokamak::Recipes.add "foo" do
|
7
|
+
string = "recipes are represented as blocks"
|
8
|
+
end
|
9
|
+
Tokamak::Recipes.add :bar do
|
10
|
+
string = "recipes are represented as blocks"
|
11
|
+
end
|
12
|
+
|
13
|
+
assert_equal Proc, Tokamak::Recipes["foo"].class
|
14
|
+
assert_equal Proc, Tokamak::Recipes[:bar].class
|
15
|
+
assert_equal nil , Tokamak::Recipes["undeclared recipe"]
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_remove_recipe_from_tokamak
|
19
|
+
Tokamak::Recipes.add :bar do
|
20
|
+
string = "recipes are represented as blocks"
|
21
|
+
end
|
22
|
+
Tokamak::Recipes.remove(:bar)
|
23
|
+
|
24
|
+
assert_equal nil, Tokamak::Recipes[:bar]
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_list_recipe_names
|
28
|
+
Tokamak::Recipes.add "foo" do
|
29
|
+
string = "recipes are represented as blocks"
|
30
|
+
end
|
31
|
+
Tokamak::Recipes.add :bar do
|
32
|
+
string = "recipes are represented as blocks"
|
33
|
+
end
|
34
|
+
|
35
|
+
assert Tokamak::Recipes.list.include?(:bar)
|
36
|
+
assert Tokamak::Recipes.list.include?("foo")
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_builder_with_previously_declared_recipe
|
40
|
+
obj = [{ :foo => "bar" }]
|
41
|
+
|
42
|
+
Tokamak::Recipes.add :simple_feed do |collection|
|
43
|
+
collection.values do |values|
|
44
|
+
values.id "an_id"
|
45
|
+
end
|
46
|
+
|
47
|
+
collection.members do |member, some_foos|
|
48
|
+
member.values do |values|
|
49
|
+
values.id some_foos[:foo]
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
json = Tokamak::Builder::Json.build(obj, :recipe => :simple_feed)
|
55
|
+
hash = JSON.parse(json).extend(Methodize)
|
56
|
+
|
57
|
+
assert_equal "an_id", hash.id
|
58
|
+
assert_equal "bar" , hash.members.first.id
|
59
|
+
end
|
60
|
+
|
61
|
+
def test_raise_exception_with_a_undeclared_recipe
|
62
|
+
obj = [{ :foo => "bar" }]
|
63
|
+
|
64
|
+
assert_raise Tokamak::BuilderError do
|
65
|
+
json = Tokamak::Builder::Json.build(obj, :recipe => :invalid_recipe)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def test_builder_with_recipe_option_as_a_block
|
70
|
+
obj = [{ :foo => "bar" }]
|
71
|
+
|
72
|
+
json = Tokamak::Builder::Json.build(obj, :recipe => Proc.new { |collection|
|
73
|
+
collection.values do |values|
|
74
|
+
values.id "an_id"
|
75
|
+
end
|
76
|
+
|
77
|
+
collection.members do |member, some_foos|
|
78
|
+
member.values do |values|
|
79
|
+
values.id some_foos[:foo]
|
80
|
+
end
|
81
|
+
end
|
82
|
+
})
|
83
|
+
hash = JSON.parse(json).extend(Methodize)
|
84
|
+
|
85
|
+
assert_equal "an_id", hash.id
|
86
|
+
assert_equal "bar" , hash.members.first.id
|
87
|
+
end
|
88
|
+
|
89
|
+
end
|
90
|
+
|
metadata
CHANGED
@@ -6,50 +6,47 @@ version: !ruby/object:Gem::Version
|
|
6
6
|
- 1
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.0.
|
9
|
+
- beta4
|
10
|
+
version: 1.0.0.beta4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
|
-
-
|
13
|
+
- Luis Cipriani
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2011-01-06 00:00:00 -02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
|
-
name:
|
22
|
+
name: json_pure
|
23
|
+
prerelease: false
|
23
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
25
|
none: false
|
25
26
|
requirements:
|
26
27
|
- - ">="
|
27
28
|
- !ruby/object:Gem::Version
|
28
29
|
segments:
|
29
|
-
- 3
|
30
30
|
- 0
|
31
|
-
|
32
|
-
version: 3.0.0
|
31
|
+
version: "0"
|
33
32
|
type: :runtime
|
34
|
-
prerelease: false
|
35
33
|
version_requirements: *id001
|
36
34
|
- !ruby/object:Gem::Dependency
|
37
|
-
name:
|
35
|
+
name: nokogiri
|
36
|
+
prerelease: false
|
38
37
|
requirement: &id002 !ruby/object:Gem::Requirement
|
39
38
|
none: false
|
40
39
|
requirements:
|
41
40
|
- - ">="
|
42
41
|
- !ruby/object:Gem::Version
|
43
42
|
segments:
|
44
|
-
- 3
|
45
|
-
- 0
|
46
43
|
- 0
|
47
|
-
version:
|
44
|
+
version: "0"
|
48
45
|
type: :runtime
|
49
|
-
prerelease: false
|
50
46
|
version_requirements: *id002
|
51
47
|
- !ruby/object:Gem::Dependency
|
52
|
-
name:
|
48
|
+
name: ruby-debug
|
49
|
+
prerelease: false
|
53
50
|
requirement: &id003 !ruby/object:Gem::Requirement
|
54
51
|
none: false
|
55
52
|
requirements:
|
@@ -58,11 +55,11 @@ dependencies:
|
|
58
55
|
segments:
|
59
56
|
- 0
|
60
57
|
version: "0"
|
61
|
-
type: :
|
62
|
-
prerelease: false
|
58
|
+
type: :development
|
63
59
|
version_requirements: *id003
|
64
60
|
- !ruby/object:Gem::Dependency
|
65
|
-
name:
|
61
|
+
name: methodize
|
62
|
+
prerelease: false
|
66
63
|
requirement: &id004 !ruby/object:Gem::Requirement
|
67
64
|
none: false
|
68
65
|
requirements:
|
@@ -71,145 +68,145 @@ dependencies:
|
|
71
68
|
segments:
|
72
69
|
- 0
|
73
70
|
version: "0"
|
74
|
-
type: :
|
75
|
-
prerelease: false
|
71
|
+
type: :development
|
76
72
|
version_requirements: *id004
|
77
73
|
- !ruby/object:Gem::Dependency
|
78
|
-
name:
|
74
|
+
name: rack
|
75
|
+
prerelease: false
|
79
76
|
requirement: &id005 !ruby/object:Gem::Requirement
|
80
77
|
none: false
|
81
78
|
requirements:
|
82
79
|
- - ~>
|
83
80
|
- !ruby/object:Gem::Version
|
84
81
|
segments:
|
82
|
+
- 1
|
85
83
|
- 2
|
86
|
-
|
87
|
-
- 0
|
88
|
-
version: 2.3.0
|
84
|
+
version: "1.2"
|
89
85
|
type: :development
|
90
|
-
prerelease: false
|
91
86
|
version_requirements: *id005
|
92
87
|
- !ruby/object:Gem::Dependency
|
93
|
-
name:
|
88
|
+
name: rack-test
|
89
|
+
prerelease: false
|
94
90
|
requirement: &id006 !ruby/object:Gem::Requirement
|
95
91
|
none: false
|
96
92
|
requirements:
|
97
|
-
- -
|
93
|
+
- - ">="
|
98
94
|
- !ruby/object:Gem::Version
|
99
95
|
segments:
|
100
|
-
- 1
|
101
96
|
- 0
|
102
|
-
|
103
|
-
version: 1.0.0
|
97
|
+
version: "0"
|
104
98
|
type: :development
|
105
|
-
prerelease: false
|
106
99
|
version_requirements: *id006
|
107
100
|
- !ruby/object:Gem::Dependency
|
108
|
-
name:
|
101
|
+
name: rack-conneg
|
102
|
+
prerelease: false
|
109
103
|
requirement: &id007 !ruby/object:Gem::Requirement
|
110
104
|
none: false
|
111
105
|
requirements:
|
112
|
-
- -
|
106
|
+
- - ">="
|
113
107
|
- !ruby/object:Gem::Version
|
114
108
|
segments:
|
115
|
-
-
|
116
|
-
|
117
|
-
- 2
|
118
|
-
version: 1.5.2
|
109
|
+
- 0
|
110
|
+
version: "0"
|
119
111
|
type: :development
|
120
|
-
prerelease: false
|
121
112
|
version_requirements: *id007
|
122
113
|
- !ruby/object:Gem::Dependency
|
123
|
-
name:
|
114
|
+
name: tilt
|
115
|
+
prerelease: false
|
124
116
|
requirement: &id008 !ruby/object:Gem::Requirement
|
125
117
|
none: false
|
126
118
|
requirements:
|
127
|
-
- -
|
119
|
+
- - ~>
|
128
120
|
- !ruby/object:Gem::Version
|
129
121
|
segments:
|
130
|
-
-
|
131
|
-
|
122
|
+
- 1
|
123
|
+
- 2
|
124
|
+
version: "1.2"
|
132
125
|
type: :development
|
133
|
-
prerelease: false
|
134
126
|
version_requirements: *id008
|
135
127
|
- !ruby/object:Gem::Dependency
|
136
|
-
name:
|
128
|
+
name: sinatra
|
129
|
+
prerelease: false
|
137
130
|
requirement: &id009 !ruby/object:Gem::Requirement
|
138
131
|
none: false
|
139
132
|
requirements:
|
140
|
-
- -
|
133
|
+
- - ~>
|
141
134
|
- !ruby/object:Gem::Version
|
142
135
|
segments:
|
143
|
-
-
|
144
|
-
|
136
|
+
- 1
|
137
|
+
- 1
|
138
|
+
version: "1.1"
|
145
139
|
type: :development
|
146
|
-
prerelease: false
|
147
140
|
version_requirements: *id009
|
148
|
-
|
149
|
-
|
141
|
+
- !ruby/object:Gem::Dependency
|
142
|
+
name: rails
|
143
|
+
prerelease: false
|
144
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
146
|
+
requirements:
|
147
|
+
- - ~>
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
segments:
|
150
|
+
- 2
|
151
|
+
- 3
|
152
|
+
version: "2.3"
|
153
|
+
type: :development
|
154
|
+
version_requirements: *id010
|
155
|
+
description:
|
156
|
+
email: luis.cipriani@abril.com.br
|
150
157
|
executables: []
|
151
158
|
|
152
159
|
extensions: []
|
153
160
|
|
154
|
-
extra_rdoc_files:
|
155
|
-
|
156
|
-
- README.rdoc
|
161
|
+
extra_rdoc_files: []
|
162
|
+
|
157
163
|
files:
|
158
|
-
- .
|
159
|
-
- .
|
160
|
-
-
|
161
|
-
-
|
162
|
-
-
|
163
|
-
-
|
164
|
-
-
|
165
|
-
-
|
164
|
+
- lib/tokamak/builder/base.rb
|
165
|
+
- lib/tokamak/builder/json.rb
|
166
|
+
- lib/tokamak/builder/values.rb
|
167
|
+
- lib/tokamak/builder/xml.rb
|
168
|
+
- lib/tokamak/builder.rb
|
169
|
+
- lib/tokamak/errors.rb
|
170
|
+
- lib/tokamak/hook/rails.rb
|
171
|
+
- lib/tokamak/hook/sinatra.rb
|
172
|
+
- lib/tokamak/hook/tilt.rb
|
173
|
+
- lib/tokamak/hook.rb
|
174
|
+
- lib/tokamak/recipes.rb
|
175
|
+
- lib/tokamak/version.rb
|
166
176
|
- lib/tokamak.rb
|
167
|
-
-
|
168
|
-
-
|
169
|
-
-
|
170
|
-
-
|
171
|
-
-
|
172
|
-
-
|
173
|
-
-
|
174
|
-
-
|
175
|
-
-
|
176
|
-
-
|
177
|
-
-
|
178
|
-
-
|
179
|
-
-
|
180
|
-
-
|
181
|
-
-
|
182
|
-
-
|
183
|
-
-
|
184
|
-
-
|
185
|
-
-
|
186
|
-
-
|
187
|
-
-
|
188
|
-
-
|
189
|
-
-
|
190
|
-
-
|
191
|
-
-
|
192
|
-
-
|
193
|
-
-
|
194
|
-
-
|
195
|
-
-
|
196
|
-
- lib/tokamak/values.rb
|
197
|
-
- lib/tokamak/xml.rb
|
198
|
-
- lib/tokamak/xml/base.rb
|
199
|
-
- lib/tokamak/xml/builder.rb
|
200
|
-
- lib/tokamak/xml/helpers.rb
|
201
|
-
- lib/tokamak/xml/link.rb
|
202
|
-
- lib/tokamak/xml/links.rb
|
203
|
-
- spec/integration/atom/atom_spec.rb
|
204
|
-
- spec/integration/full_atom.xml
|
205
|
-
- spec/integration/full_json.js
|
206
|
-
- spec/integration/json/json_spec.rb
|
207
|
-
- spec/integration/xml/xml_spec.rb
|
208
|
-
- spec/spec_helper.rb
|
177
|
+
- README.md
|
178
|
+
- LICENSE
|
179
|
+
- test/rails2_skel/app/controllers/application_controller.rb
|
180
|
+
- test/rails2_skel/app/controllers/test_controller.rb
|
181
|
+
- test/rails2_skel/app/views/test/_feed_member.tokamak
|
182
|
+
- test/rails2_skel/app/views/test/feed.tokamak
|
183
|
+
- test/rails2_skel/app/views/test/show.tokamak
|
184
|
+
- test/rails2_skel/config/boot.rb
|
185
|
+
- test/rails2_skel/config/environment.rb
|
186
|
+
- test/rails2_skel/config/environments/development.rb
|
187
|
+
- test/rails2_skel/config/environments/production.rb
|
188
|
+
- test/rails2_skel/config/environments/test.rb
|
189
|
+
- test/rails2_skel/config/initializers/cookie_verification_secret.rb
|
190
|
+
- test/rails2_skel/config/initializers/mime_types.rb
|
191
|
+
- test/rails2_skel/config/initializers/new_rails_defaults.rb
|
192
|
+
- test/rails2_skel/config/initializers/session_store.rb
|
193
|
+
- test/rails2_skel/config/routes.rb
|
194
|
+
- test/rails2_skel/Rakefile
|
195
|
+
- test/rails2_skel/script/console
|
196
|
+
- test/test_helper.rb
|
197
|
+
- test/tokamak/builder/base_test.rb
|
198
|
+
- test/tokamak/builder/json_test.rb
|
199
|
+
- test/tokamak/builder/xml_test.rb
|
200
|
+
- test/tokamak/helper_test.rb
|
201
|
+
- test/tokamak/hook/rails_test.rb
|
202
|
+
- test/tokamak/hook/sinatra_test.rb
|
203
|
+
- test/tokamak/hook/tilt_test.rb
|
204
|
+
- test/tokamak/recipes_test.rb
|
205
|
+
- script/console
|
209
206
|
has_rdoc: true
|
210
|
-
homepage: http://github.com/
|
211
|
-
licenses:
|
212
|
-
|
207
|
+
homepage: http://github.com/abril/tokamak
|
208
|
+
licenses: []
|
209
|
+
|
213
210
|
post_install_message:
|
214
211
|
rdoc_options: []
|
215
212
|
|
@@ -220,7 +217,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
220
217
|
requirements:
|
221
218
|
- - ">="
|
222
219
|
- !ruby/object:Gem::Version
|
223
|
-
hash: -3434081769285654990
|
224
220
|
segments:
|
225
221
|
- 0
|
226
222
|
version: "0"
|
@@ -240,9 +236,6 @@ rubyforge_project:
|
|
240
236
|
rubygems_version: 1.3.7
|
241
237
|
signing_key:
|
242
238
|
specification_version: 3
|
243
|
-
summary: A template
|
244
|
-
test_files:
|
245
|
-
|
246
|
-
- spec/integration/json/json_spec.rb
|
247
|
-
- spec/integration/xml/xml_spec.rb
|
248
|
-
- spec/spec_helper.rb
|
239
|
+
summary: A template handler that generates several media types representations, from a simple DSL
|
240
|
+
test_files: []
|
241
|
+
|
data/.document
DELETED
data/.rspec
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
--color
|
data/Gemfile
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
source "http://rubygems.org"
|
2
|
-
# Add dependencies required to use your gem here.
|
3
|
-
# Example:
|
4
|
-
# gem "activesupport", ">= 2.3.5"
|
5
|
-
|
6
|
-
# Add dependencies to develop your gem here.
|
7
|
-
# Include everything needed to run rake, tests, features, etc.
|
8
|
-
group :development do
|
9
|
-
gem "rspec", "~> 2.3.0"
|
10
|
-
gem "bundler", "~> 1.0.0"
|
11
|
-
gem "jeweler", "~> 1.5.2"
|
12
|
-
gem "rcov", ">= 0"
|
13
|
-
if RUBY_VERSION < "1.9"
|
14
|
-
gem "ruby-debug"
|
15
|
-
else
|
16
|
-
gem "ruby-debug19", :require => "ruby-debug"
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
group :test do
|
21
|
-
gem "nokogiri"
|
22
|
-
end
|
23
|
-
|
24
|
-
gem "activesupport", ">= 3.0.0"
|
25
|
-
gem "actionpack", ">= 3.0.0"
|
26
|
-
gem "libxml-ruby"
|
27
|
-
gem "json_pure"
|
data/Gemfile.lock
DELETED
@@ -1,77 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: http://rubygems.org/
|
3
|
-
specs:
|
4
|
-
abstract (1.0.0)
|
5
|
-
actionpack (3.0.0)
|
6
|
-
activemodel (= 3.0.0)
|
7
|
-
activesupport (= 3.0.0)
|
8
|
-
builder (~> 2.1.2)
|
9
|
-
erubis (~> 2.6.6)
|
10
|
-
i18n (~> 0.4.1)
|
11
|
-
rack (~> 1.2.1)
|
12
|
-
rack-mount (~> 0.6.12)
|
13
|
-
rack-test (~> 0.5.4)
|
14
|
-
tzinfo (~> 0.3.23)
|
15
|
-
activemodel (3.0.0)
|
16
|
-
activesupport (= 3.0.0)
|
17
|
-
builder (~> 2.1.2)
|
18
|
-
i18n (~> 0.4.1)
|
19
|
-
activesupport (3.0.0)
|
20
|
-
archive-tar-minitar (0.5.2)
|
21
|
-
builder (2.1.2)
|
22
|
-
columnize (0.3.2)
|
23
|
-
diff-lcs (1.1.2)
|
24
|
-
erubis (2.6.6)
|
25
|
-
abstract (>= 1.0.0)
|
26
|
-
git (1.2.5)
|
27
|
-
i18n (0.4.1)
|
28
|
-
jeweler (1.5.2)
|
29
|
-
bundler (~> 1.0.0)
|
30
|
-
git (>= 1.2.5)
|
31
|
-
rake
|
32
|
-
json_pure (1.4.6)
|
33
|
-
libxml-ruby (1.1.4)
|
34
|
-
linecache19 (0.5.11)
|
35
|
-
ruby_core_source (>= 0.1.4)
|
36
|
-
nokogiri (1.4.3.1)
|
37
|
-
rack (1.2.1)
|
38
|
-
rack-mount (0.6.12)
|
39
|
-
rack (>= 1.0.0)
|
40
|
-
rack-test (0.5.4)
|
41
|
-
rack (>= 1.0)
|
42
|
-
rake (0.8.7)
|
43
|
-
rcov (0.9.9)
|
44
|
-
rspec (2.3.0)
|
45
|
-
rspec-core (~> 2.3.0)
|
46
|
-
rspec-expectations (~> 2.3.0)
|
47
|
-
rspec-mocks (~> 2.3.0)
|
48
|
-
rspec-core (2.3.1)
|
49
|
-
rspec-expectations (2.3.0)
|
50
|
-
diff-lcs (~> 1.1.2)
|
51
|
-
rspec-mocks (2.3.0)
|
52
|
-
ruby-debug-base19 (0.11.24)
|
53
|
-
columnize (>= 0.3.1)
|
54
|
-
linecache19 (>= 0.5.11)
|
55
|
-
ruby_core_source (>= 0.1.4)
|
56
|
-
ruby-debug19 (0.11.6)
|
57
|
-
columnize (>= 0.3.1)
|
58
|
-
linecache19 (>= 0.5.11)
|
59
|
-
ruby-debug-base19 (>= 0.11.19)
|
60
|
-
ruby_core_source (0.1.4)
|
61
|
-
archive-tar-minitar (>= 0.5.2)
|
62
|
-
tzinfo (0.3.23)
|
63
|
-
|
64
|
-
PLATFORMS
|
65
|
-
ruby
|
66
|
-
|
67
|
-
DEPENDENCIES
|
68
|
-
actionpack (>= 3.0.0)
|
69
|
-
activesupport (>= 3.0.0)
|
70
|
-
bundler (~> 1.0.0)
|
71
|
-
jeweler (~> 1.5.2)
|
72
|
-
json_pure
|
73
|
-
libxml-ruby
|
74
|
-
nokogiri
|
75
|
-
rcov
|
76
|
-
rspec (~> 2.3.0)
|
77
|
-
ruby-debug19
|
data/LICENSE.txt
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Copyright (c) 2010 Guilherme Silveira
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|