jellyfish 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/CHANGES.md +4 -0
- data/Gemfile +0 -3
- data/README.md +4 -2
- data/Rakefile +1 -1
- data/jellyfish.gemspec +8 -45
- data/jellyfish.png +0 -0
- data/lib/jellyfish/version.rb +1 -1
- metadata +22 -46
- data/sinatra/builder_test.rb +0 -95
- data/sinatra/coffee_test.rb +0 -92
- data/sinatra/contest.rb +0 -98
- data/sinatra/creole_test.rb +0 -65
- data/sinatra/delegator_test.rb +0 -162
- data/sinatra/encoding_test.rb +0 -20
- data/sinatra/erb_test.rb +0 -104
- data/sinatra/extensions_test.rb +0 -100
- data/sinatra/filter_test.rb +0 -428
- data/sinatra/haml_test.rb +0 -101
- data/sinatra/helper.rb +0 -123
- data/sinatra/helpers_test.rb +0 -1783
- data/sinatra/integration/app.rb +0 -62
- data/sinatra/integration_helper.rb +0 -214
- data/sinatra/integration_test.rb +0 -85
- data/sinatra/less_test.rb +0 -67
- data/sinatra/liquid_test.rb +0 -59
- data/sinatra/mapped_error_test.rb +0 -259
- data/sinatra/markaby_test.rb +0 -80
- data/sinatra/markdown_test.rb +0 -81
- data/sinatra/middleware_test.rb +0 -68
- data/sinatra/nokogiri_test.rb +0 -69
- data/sinatra/rack_test.rb +0 -45
- data/sinatra/radius_test.rb +0 -59
- data/sinatra/rdoc_test.rb +0 -66
- data/sinatra/readme_test.rb +0 -136
- data/sinatra/request_test.rb +0 -45
- data/sinatra/response_test.rb +0 -61
- data/sinatra/result_test.rb +0 -98
- data/sinatra/route_added_hook_test.rb +0 -59
- data/sinatra/routing_test.rb +0 -1104
- data/sinatra/sass_test.rb +0 -116
- data/sinatra/scss_test.rb +0 -89
- data/sinatra/server_test.rb +0 -48
- data/sinatra/settings_test.rb +0 -538
- data/sinatra/sinatra_test.rb +0 -17
- data/sinatra/slim_test.rb +0 -88
- data/sinatra/static_test.rb +0 -178
- data/sinatra/streaming_test.rb +0 -140
- data/sinatra/templates_test.rb +0 -298
- data/sinatra/textile_test.rb +0 -65
data/.gitignore
CHANGED
data/CHANGES.md
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
by Lin Jen-Shin ([godfat](http://godfat.org))
|
4
4
|
|
5
|
+
![logo](https://github.com/godfat/jellyfish/raw/master/jellyfish.png)
|
6
|
+
|
5
7
|
## LINKS:
|
6
8
|
|
7
9
|
* [github](https://github.com/godfat/jellyfish)
|
@@ -10,8 +12,8 @@ by Lin Jen-Shin ([godfat](http://godfat.org))
|
|
10
12
|
|
11
13
|
## DESCRIPTION:
|
12
14
|
|
13
|
-
Pico web framework for building API-centric web applications
|
14
|
-
Rack applications or Rack middlewares. Under 200 lines of code.
|
15
|
+
Pico web framework for building API-centric web applications.
|
16
|
+
For Rack applications or Rack middlewares. Under 200 lines of code.
|
15
17
|
|
16
18
|
## DESIGN:
|
17
19
|
|
data/Rakefile
CHANGED
data/jellyfish.gemspec
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "jellyfish"
|
5
|
-
s.version = "0.5.
|
5
|
+
s.version = "0.5.1"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Lin Jen-Shin (godfat)"]
|
9
|
-
s.date = "2012-10-
|
10
|
-
s.description = "Pico web framework for building API-centric web applications
|
9
|
+
s.date = "2012-10-19"
|
10
|
+
s.description = "Pico web framework for building API-centric web applications.\nFor Rack applications or Rack middlewares. Under 200 lines of code."
|
11
11
|
s.email = ["godfat (XD) godfat.org"]
|
12
12
|
s.files = [
|
13
13
|
".gitignore",
|
@@ -23,6 +23,7 @@ Gem::Specification.new do |s|
|
|
23
23
|
"example/rainbows.rb",
|
24
24
|
"example/server.sh",
|
25
25
|
"jellyfish.gemspec",
|
26
|
+
"jellyfish.png",
|
26
27
|
"lib/jellyfish.rb",
|
27
28
|
"lib/jellyfish/public/302.html",
|
28
29
|
"lib/jellyfish/public/404.html",
|
@@ -30,54 +31,13 @@ Gem::Specification.new do |s|
|
|
30
31
|
"lib/jellyfish/sinatra.rb",
|
31
32
|
"lib/jellyfish/test.rb",
|
32
33
|
"lib/jellyfish/version.rb",
|
33
|
-
"sinatra/builder_test.rb",
|
34
|
-
"sinatra/coffee_test.rb",
|
35
|
-
"sinatra/contest.rb",
|
36
|
-
"sinatra/creole_test.rb",
|
37
|
-
"sinatra/delegator_test.rb",
|
38
|
-
"sinatra/encoding_test.rb",
|
39
|
-
"sinatra/erb_test.rb",
|
40
|
-
"sinatra/extensions_test.rb",
|
41
|
-
"sinatra/filter_test.rb",
|
42
|
-
"sinatra/haml_test.rb",
|
43
|
-
"sinatra/helper.rb",
|
44
|
-
"sinatra/helpers_test.rb",
|
45
|
-
"sinatra/integration/app.rb",
|
46
|
-
"sinatra/integration_helper.rb",
|
47
|
-
"sinatra/integration_test.rb",
|
48
|
-
"sinatra/less_test.rb",
|
49
|
-
"sinatra/liquid_test.rb",
|
50
|
-
"sinatra/mapped_error_test.rb",
|
51
|
-
"sinatra/markaby_test.rb",
|
52
|
-
"sinatra/markdown_test.rb",
|
53
|
-
"sinatra/middleware_test.rb",
|
54
|
-
"sinatra/nokogiri_test.rb",
|
55
|
-
"sinatra/rack_test.rb",
|
56
|
-
"sinatra/radius_test.rb",
|
57
|
-
"sinatra/rdoc_test.rb",
|
58
|
-
"sinatra/readme_test.rb",
|
59
|
-
"sinatra/request_test.rb",
|
60
|
-
"sinatra/response_test.rb",
|
61
|
-
"sinatra/result_test.rb",
|
62
|
-
"sinatra/route_added_hook_test.rb",
|
63
|
-
"sinatra/routing_test.rb",
|
64
|
-
"sinatra/sass_test.rb",
|
65
|
-
"sinatra/scss_test.rb",
|
66
|
-
"sinatra/server_test.rb",
|
67
|
-
"sinatra/settings_test.rb",
|
68
|
-
"sinatra/sinatra_test.rb",
|
69
|
-
"sinatra/slim_test.rb",
|
70
|
-
"sinatra/static_test.rb",
|
71
|
-
"sinatra/streaming_test.rb",
|
72
|
-
"sinatra/templates_test.rb",
|
73
|
-
"sinatra/textile_test.rb",
|
74
34
|
"task/.gitignore",
|
75
35
|
"task/gemgem.rb",
|
76
36
|
"test/sinatra/test_base.rb"]
|
77
37
|
s.homepage = "https://github.com/godfat/jellyfish"
|
78
38
|
s.require_paths = ["lib"]
|
79
39
|
s.rubygems_version = "1.8.24"
|
80
|
-
s.summary = "Pico web framework for building API-centric web applications
|
40
|
+
s.summary = "Pico web framework for building API-centric web applications."
|
81
41
|
s.test_files = ["test/sinatra/test_base.rb"]
|
82
42
|
|
83
43
|
if s.respond_to? :specification_version then
|
@@ -85,10 +45,13 @@ Gem::Specification.new do |s|
|
|
85
45
|
|
86
46
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
87
47
|
s.add_development_dependency(%q<rack>, [">= 0"])
|
48
|
+
s.add_development_dependency(%q<bacon>, [">= 0"])
|
88
49
|
else
|
89
50
|
s.add_dependency(%q<rack>, [">= 0"])
|
51
|
+
s.add_dependency(%q<bacon>, [">= 0"])
|
90
52
|
end
|
91
53
|
else
|
92
54
|
s.add_dependency(%q<rack>, [">= 0"])
|
55
|
+
s.add_dependency(%q<bacon>, [">= 0"])
|
93
56
|
end
|
94
57
|
end
|
data/jellyfish.png
ADDED
Binary file
|
data/lib/jellyfish/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jellyfish
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-10-
|
12
|
+
date: 2012-10-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
@@ -27,9 +27,25 @@ dependencies:
|
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '0'
|
30
|
-
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: bacon
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
description: ! 'Pico web framework for building API-centric web applications.
|
31
47
|
|
32
|
-
Rack applications or Rack middlewares. Under 200 lines of code.'
|
48
|
+
For Rack applications or Rack middlewares. Under 200 lines of code.'
|
33
49
|
email:
|
34
50
|
- godfat (XD) godfat.org
|
35
51
|
executables: []
|
@@ -49,6 +65,7 @@ files:
|
|
49
65
|
- example/rainbows.rb
|
50
66
|
- example/server.sh
|
51
67
|
- jellyfish.gemspec
|
68
|
+
- jellyfish.png
|
52
69
|
- lib/jellyfish.rb
|
53
70
|
- lib/jellyfish/public/302.html
|
54
71
|
- lib/jellyfish/public/404.html
|
@@ -56,47 +73,6 @@ files:
|
|
56
73
|
- lib/jellyfish/sinatra.rb
|
57
74
|
- lib/jellyfish/test.rb
|
58
75
|
- lib/jellyfish/version.rb
|
59
|
-
- sinatra/builder_test.rb
|
60
|
-
- sinatra/coffee_test.rb
|
61
|
-
- sinatra/contest.rb
|
62
|
-
- sinatra/creole_test.rb
|
63
|
-
- sinatra/delegator_test.rb
|
64
|
-
- sinatra/encoding_test.rb
|
65
|
-
- sinatra/erb_test.rb
|
66
|
-
- sinatra/extensions_test.rb
|
67
|
-
- sinatra/filter_test.rb
|
68
|
-
- sinatra/haml_test.rb
|
69
|
-
- sinatra/helper.rb
|
70
|
-
- sinatra/helpers_test.rb
|
71
|
-
- sinatra/integration/app.rb
|
72
|
-
- sinatra/integration_helper.rb
|
73
|
-
- sinatra/integration_test.rb
|
74
|
-
- sinatra/less_test.rb
|
75
|
-
- sinatra/liquid_test.rb
|
76
|
-
- sinatra/mapped_error_test.rb
|
77
|
-
- sinatra/markaby_test.rb
|
78
|
-
- sinatra/markdown_test.rb
|
79
|
-
- sinatra/middleware_test.rb
|
80
|
-
- sinatra/nokogiri_test.rb
|
81
|
-
- sinatra/rack_test.rb
|
82
|
-
- sinatra/radius_test.rb
|
83
|
-
- sinatra/rdoc_test.rb
|
84
|
-
- sinatra/readme_test.rb
|
85
|
-
- sinatra/request_test.rb
|
86
|
-
- sinatra/response_test.rb
|
87
|
-
- sinatra/result_test.rb
|
88
|
-
- sinatra/route_added_hook_test.rb
|
89
|
-
- sinatra/routing_test.rb
|
90
|
-
- sinatra/sass_test.rb
|
91
|
-
- sinatra/scss_test.rb
|
92
|
-
- sinatra/server_test.rb
|
93
|
-
- sinatra/settings_test.rb
|
94
|
-
- sinatra/sinatra_test.rb
|
95
|
-
- sinatra/slim_test.rb
|
96
|
-
- sinatra/static_test.rb
|
97
|
-
- sinatra/streaming_test.rb
|
98
|
-
- sinatra/templates_test.rb
|
99
|
-
- sinatra/textile_test.rb
|
100
76
|
- task/.gitignore
|
101
77
|
- task/gemgem.rb
|
102
78
|
- test/sinatra/test_base.rb
|
@@ -123,7 +99,7 @@ rubyforge_project:
|
|
123
99
|
rubygems_version: 1.8.24
|
124
100
|
signing_key:
|
125
101
|
specification_version: 3
|
126
|
-
summary: Pico web framework for building API-centric web applications
|
102
|
+
summary: Pico web framework for building API-centric web applications.
|
127
103
|
test_files:
|
128
104
|
- test/sinatra/test_base.rb
|
129
105
|
has_rdoc:
|
data/sinatra/builder_test.rb
DELETED
@@ -1,95 +0,0 @@
|
|
1
|
-
require File.expand_path('../helper', __FILE__)
|
2
|
-
|
3
|
-
begin
|
4
|
-
require 'builder'
|
5
|
-
|
6
|
-
class BuilderTest < Test::Unit::TestCase
|
7
|
-
def builder_app(options = {}, &block)
|
8
|
-
mock_app {
|
9
|
-
set :views, File.dirname(__FILE__) + '/views'
|
10
|
-
set options
|
11
|
-
get '/', &block
|
12
|
-
}
|
13
|
-
get '/'
|
14
|
-
end
|
15
|
-
|
16
|
-
it 'renders inline Builder strings' do
|
17
|
-
builder_app { builder 'xml.instruct!' }
|
18
|
-
assert ok?
|
19
|
-
assert_equal %{<?xml version="1.0" encoding="UTF-8"?>\n}, body
|
20
|
-
end
|
21
|
-
|
22
|
-
it 'defaults content type to xml' do
|
23
|
-
builder_app { builder 'xml.instruct!' }
|
24
|
-
assert ok?
|
25
|
-
assert_equal "application/xml;charset=utf-8", response['Content-Type']
|
26
|
-
end
|
27
|
-
|
28
|
-
it 'defaults allows setting content type per route' do
|
29
|
-
builder_app do
|
30
|
-
content_type :html
|
31
|
-
builder 'xml.instruct!'
|
32
|
-
end
|
33
|
-
assert ok?
|
34
|
-
assert_equal "text/html;charset=utf-8", response['Content-Type']
|
35
|
-
end
|
36
|
-
|
37
|
-
it 'defaults allows setting content type globally' do
|
38
|
-
builder_app(:builder => { :content_type => 'html' }) do
|
39
|
-
builder 'xml.instruct!'
|
40
|
-
end
|
41
|
-
assert ok?
|
42
|
-
assert_equal "text/html;charset=utf-8", response['Content-Type']
|
43
|
-
end
|
44
|
-
|
45
|
-
it 'renders inline blocks' do
|
46
|
-
builder_app {
|
47
|
-
@name = "Frank & Mary"
|
48
|
-
builder do |xml|
|
49
|
-
xml.couple @name
|
50
|
-
end
|
51
|
-
}
|
52
|
-
assert ok?
|
53
|
-
assert_equal "<couple>Frank & Mary</couple>\n", body
|
54
|
-
end
|
55
|
-
|
56
|
-
it 'renders .builder files in views path' do
|
57
|
-
builder_app {
|
58
|
-
@name = "Blue"
|
59
|
-
builder :hello
|
60
|
-
}
|
61
|
-
assert ok?
|
62
|
-
assert_equal %(<exclaim>You're my boy, Blue!</exclaim>\n), body
|
63
|
-
end
|
64
|
-
|
65
|
-
it "renders with inline layouts" do
|
66
|
-
mock_app {
|
67
|
-
layout do
|
68
|
-
%(xml.layout { xml << yield })
|
69
|
-
end
|
70
|
-
get('/') { builder %(xml.em 'Hello World') }
|
71
|
-
}
|
72
|
-
get '/'
|
73
|
-
assert ok?
|
74
|
-
assert_equal "<layout>\n<em>Hello World</em>\n</layout>\n", body
|
75
|
-
end
|
76
|
-
|
77
|
-
it "renders with file layouts" do
|
78
|
-
builder_app {
|
79
|
-
builder %(xml.em 'Hello World'), :layout => :layout2
|
80
|
-
}
|
81
|
-
assert ok?
|
82
|
-
assert_equal "<layout>\n<em>Hello World</em>\n</layout>\n", body
|
83
|
-
end
|
84
|
-
|
85
|
-
it "raises error if template not found" do
|
86
|
-
mock_app {
|
87
|
-
get('/') { builder :no_such_template }
|
88
|
-
}
|
89
|
-
assert_raise(Errno::ENOENT) { get('/') }
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
rescue LoadError
|
94
|
-
warn "#{$!.to_s}: skipping builder tests"
|
95
|
-
end
|
data/sinatra/coffee_test.rb
DELETED
@@ -1,92 +0,0 @@
|
|
1
|
-
require File.expand_path('../helper', __FILE__)
|
2
|
-
|
3
|
-
begin
|
4
|
-
require 'coffee-script'
|
5
|
-
require 'execjs'
|
6
|
-
|
7
|
-
begin
|
8
|
-
ExecJS.compile '1'
|
9
|
-
rescue Exception
|
10
|
-
raise LoadError, 'unable to execute JavaScript'
|
11
|
-
end
|
12
|
-
|
13
|
-
class CoffeeTest < Test::Unit::TestCase
|
14
|
-
def coffee_app(options = {}, &block)
|
15
|
-
mock_app {
|
16
|
-
set :views, File.dirname(__FILE__) + '/views'
|
17
|
-
set(options)
|
18
|
-
get '/', &block
|
19
|
-
}
|
20
|
-
get '/'
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'renders inline Coffee strings' do
|
24
|
-
coffee_app { coffee "alert 'Aye!'\n" }
|
25
|
-
assert ok?
|
26
|
-
assert body.include?("alert('Aye!');")
|
27
|
-
end
|
28
|
-
|
29
|
-
it 'defaults content type to javascript' do
|
30
|
-
coffee_app { coffee "alert 'Aye!'\n" }
|
31
|
-
assert ok?
|
32
|
-
assert_equal "application/javascript;charset=utf-8", response['Content-Type']
|
33
|
-
end
|
34
|
-
|
35
|
-
it 'defaults allows setting content type per route' do
|
36
|
-
coffee_app do
|
37
|
-
content_type :html
|
38
|
-
coffee "alert 'Aye!'\n"
|
39
|
-
end
|
40
|
-
assert ok?
|
41
|
-
assert_equal "text/html;charset=utf-8", response['Content-Type']
|
42
|
-
end
|
43
|
-
|
44
|
-
it 'defaults allows setting content type globally' do
|
45
|
-
coffee_app(:coffee => { :content_type => 'html' }) do
|
46
|
-
coffee "alert 'Aye!'\n"
|
47
|
-
end
|
48
|
-
assert ok?
|
49
|
-
assert_equal "text/html;charset=utf-8", response['Content-Type']
|
50
|
-
end
|
51
|
-
|
52
|
-
it 'renders .coffee files in views path' do
|
53
|
-
coffee_app { coffee :hello }
|
54
|
-
assert ok?
|
55
|
-
assert_include body, "alert(\"Aye!\");"
|
56
|
-
end
|
57
|
-
|
58
|
-
it 'ignores the layout option' do
|
59
|
-
coffee_app { coffee :hello, :layout => :layout2 }
|
60
|
-
assert ok?
|
61
|
-
assert_include body, "alert(\"Aye!\");"
|
62
|
-
end
|
63
|
-
|
64
|
-
it "raises error if template not found" do
|
65
|
-
mock_app {
|
66
|
-
get('/') { coffee :no_such_template }
|
67
|
-
}
|
68
|
-
assert_raise(Errno::ENOENT) { get('/') }
|
69
|
-
end
|
70
|
-
|
71
|
-
it "passes coffee options to the coffee engine" do
|
72
|
-
coffee_app { coffee "alert 'Aye!'\n", :no_wrap => true }
|
73
|
-
assert ok?
|
74
|
-
assert_body "alert('Aye!');"
|
75
|
-
end
|
76
|
-
|
77
|
-
it "passes default coffee options to the coffee engine" do
|
78
|
-
mock_app do
|
79
|
-
set :coffee, :no_wrap => true # default coffee style is :nested
|
80
|
-
get '/' do
|
81
|
-
coffee "alert 'Aye!'\n"
|
82
|
-
end
|
83
|
-
end
|
84
|
-
get '/'
|
85
|
-
assert ok?
|
86
|
-
assert_body "alert('Aye!');"
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
rescue LoadError
|
91
|
-
warn "#{$!.to_s}: skipping coffee tests"
|
92
|
-
end
|