sinatra 0.1.7 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sinatra might be problematic. Click here for more details.

Files changed (95) hide show
  1. data/CHANGELOG +1 -8
  2. data/Manifest +42 -49
  3. data/README.rdoc +430 -0
  4. data/Rakefile +22 -28
  5. data/images/404.png +0 -0
  6. data/images/500.png +0 -0
  7. data/index.html +9 -0
  8. data/lib/sinatra.rb +1144 -46
  9. data/lib/sinatra/test/methods.rb +56 -0
  10. data/lib/sinatra/test/spec.rb +10 -0
  11. data/lib/sinatra/test/unit.rb +13 -0
  12. data/sinatra.gemspec +44 -40
  13. data/test/app_test.rb +150 -0
  14. data/test/application_test.rb +175 -0
  15. data/test/builder_test.rb +101 -0
  16. data/test/custom_error_test.rb +67 -0
  17. data/test/diddy_test.rb +41 -0
  18. data/test/erb_test.rb +116 -0
  19. data/test/event_context_test.rb +15 -0
  20. data/test/events_test.rb +50 -0
  21. data/test/haml_test.rb +181 -0
  22. data/test/helper.rb +3 -16
  23. data/test/mapped_error_test.rb +61 -0
  24. data/test/public/foo.xml +1 -0
  25. data/test/rest_test.rb +16 -0
  26. data/test/sass_test.rb +57 -0
  27. data/test/sessions_test.rb +40 -0
  28. data/test/streaming_test.rb +112 -0
  29. data/test/sym_params_test.rb +19 -0
  30. data/test/template_test.rb +30 -0
  31. data/test/use_in_file_templates_test.rb +48 -0
  32. data/test/views/foo.builder +1 -0
  33. data/test/views/foo.erb +1 -0
  34. data/test/views/foo.haml +1 -0
  35. data/test/views/foo.sass +2 -0
  36. data/test/views/foo_layout.erb +2 -0
  37. data/test/views/foo_layout.haml +2 -0
  38. data/test/views/layout_test/foo.builder +1 -0
  39. data/test/views/layout_test/foo.erb +1 -0
  40. data/test/views/layout_test/foo.haml +1 -0
  41. data/test/views/layout_test/foo.sass +2 -0
  42. data/test/views/layout_test/layout.builder +3 -0
  43. data/test/views/layout_test/layout.erb +1 -0
  44. data/test/views/layout_test/layout.haml +1 -0
  45. data/test/views/layout_test/layout.sass +2 -0
  46. data/test/views/no_layout/no_layout.builder +1 -0
  47. data/test/views/no_layout/no_layout.haml +1 -0
  48. metadata +122 -98
  49. data/LICENSE +0 -22
  50. data/README +0 -100
  51. data/RakeFile +0 -35
  52. data/examples/hello/hello.rb +0 -28
  53. data/examples/hello/views/hello.erb +0 -1
  54. data/examples/todo/todo.rb +0 -38
  55. data/files/default_index.erb +0 -42
  56. data/files/error.erb +0 -9
  57. data/files/logo.png +0 -0
  58. data/files/not_found.erb +0 -52
  59. data/lib/sinatra/context.rb +0 -88
  60. data/lib/sinatra/context/renderer.rb +0 -75
  61. data/lib/sinatra/core_ext/array.rb +0 -5
  62. data/lib/sinatra/core_ext/class.rb +0 -49
  63. data/lib/sinatra/core_ext/hash.rb +0 -7
  64. data/lib/sinatra/core_ext/kernel.rb +0 -16
  65. data/lib/sinatra/core_ext/metaid.rb +0 -18
  66. data/lib/sinatra/core_ext/module.rb +0 -11
  67. data/lib/sinatra/core_ext/symbol.rb +0 -5
  68. data/lib/sinatra/dispatcher.rb +0 -27
  69. data/lib/sinatra/dsl.rb +0 -176
  70. data/lib/sinatra/environment.rb +0 -15
  71. data/lib/sinatra/event.rb +0 -238
  72. data/lib/sinatra/irb.rb +0 -56
  73. data/lib/sinatra/loader.rb +0 -31
  74. data/lib/sinatra/logger.rb +0 -22
  75. data/lib/sinatra/options.rb +0 -49
  76. data/lib/sinatra/rack_ext/request.rb +0 -15
  77. data/lib/sinatra/route.rb +0 -65
  78. data/lib/sinatra/server.rb +0 -57
  79. data/lib/sinatra/sessions.rb +0 -21
  80. data/lib/sinatra/test_methods.rb +0 -55
  81. data/site/index.htm +0 -104
  82. data/site/index.html +0 -104
  83. data/site/logo.png +0 -0
  84. data/test/sinatra/dispatcher_test.rb +0 -91
  85. data/test/sinatra/event_test.rb +0 -46
  86. data/test/sinatra/renderer_test.rb +0 -47
  87. data/test/sinatra/request_test.rb +0 -21
  88. data/test/sinatra/route_test.rb +0 -21
  89. data/test/sinatra/static_files/foo.txt +0 -1
  90. data/test/sinatra/static_files_test.rb +0 -48
  91. data/test/sinatra/url_test.rb +0 -18
  92. data/vendor/erb/init.rb +0 -3
  93. data/vendor/erb/lib/erb.rb +0 -41
  94. data/vendor/haml/init.rb +0 -3
  95. data/vendor/haml/lib/haml.rb +0 -41
@@ -0,0 +1,2 @@
1
+ #sass
2
+ :background_color #FFF
@@ -0,0 +1,3 @@
1
+ xml.layout do
2
+ xml << yield
3
+ end
@@ -0,0 +1 @@
1
+ x <%= yield %> x
@@ -0,0 +1 @@
1
+ == x #{yield} x
@@ -0,0 +1,2 @@
1
+ b0rked!
2
+ = yield
@@ -0,0 +1 @@
1
+ xml.foo "No Layout!"
@@ -0,0 +1 @@
1
+ %h1 No Layout!
metadata CHANGED
@@ -1,110 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.4
3
- specification_version: 1
4
2
  name: sinatra
5
3
  version: !ruby/object:Gem::Version
6
- version: 0.1.7
7
- date: 2007-10-23 00:00:00 -07:00
8
- summary: Sinatra is a classy web-framework dressed in a DSL
9
- require_paths:
10
- - lib
11
- email: blake.mizerany@gmail.com
12
- homepage: http://sinatra.rubyforge.org/
13
- rubyforge_project: sinatra
14
- description: Sinatra is a classy web-framework dressed in a DSL
15
- autorequire:
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
4
+ version: 0.2.0
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
29
6
  authors:
30
7
  - Blake Mizerany
31
- files:
32
- - CHANGELOG
33
- - examples/hello/hello.rb
34
- - examples/hello/views/hello.erb
35
- - examples/todo/todo.rb
36
- - files/default_index.erb
37
- - files/error.erb
38
- - files/logo.png
39
- - files/not_found.erb
40
- - lib/sinatra/context/renderer.rb
41
- - lib/sinatra/context.rb
42
- - lib/sinatra/core_ext/array.rb
43
- - lib/sinatra/core_ext/class.rb
44
- - lib/sinatra/core_ext/hash.rb
45
- - lib/sinatra/core_ext/kernel.rb
46
- - lib/sinatra/core_ext/metaid.rb
47
- - lib/sinatra/core_ext/module.rb
48
- - lib/sinatra/core_ext/symbol.rb
49
- - lib/sinatra/dispatcher.rb
50
- - lib/sinatra/dsl.rb
51
- - lib/sinatra/environment.rb
52
- - lib/sinatra/event.rb
53
- - lib/sinatra/irb.rb
54
- - lib/sinatra/loader.rb
55
- - lib/sinatra/logger.rb
56
- - lib/sinatra/options.rb
57
- - lib/sinatra/rack_ext/request.rb
58
- - lib/sinatra/route.rb
59
- - lib/sinatra/server.rb
60
- - lib/sinatra/sessions.rb
61
- - lib/sinatra/test_methods.rb
62
- - lib/sinatra.rb
63
- - LICENSE
64
- - Manifest
65
- - RakeFile
66
- - README
67
- - site/index.htm
68
- - site/index.html
69
- - site/logo.png
70
- - test/helper.rb
71
- - test/sinatra/dispatcher_test.rb
72
- - test/sinatra/event_test.rb
73
- - test/sinatra/renderer_test.rb
74
- - test/sinatra/request_test.rb
75
- - test/sinatra/route_test.rb
76
- - test/sinatra/static_files/foo.txt
77
- - test/sinatra/static_files_test.rb
78
- - test/sinatra/url_test.rb
79
- - vendor/erb/init.rb
80
- - vendor/erb/lib/erb.rb
81
- - vendor/haml/init.rb
82
- - vendor/haml/lib/haml.rb
83
- - Rakefile
84
- - sinatra.gemspec
85
- test_files:
86
- - test/sinatra/dispatcher_test.rb
87
- - test/sinatra/event_test.rb
88
- - test/sinatra/renderer_test.rb
89
- - test/sinatra/request_test.rb
90
- - test/sinatra/route_test.rb
91
- - test/sinatra/static_files_test.rb
92
- - test/sinatra/url_test.rb
93
- rdoc_options: []
94
-
95
- extra_rdoc_files: []
96
-
97
- executables: []
98
-
99
- extensions: []
100
-
101
- requirements: []
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
102
11
 
12
+ date: 2008-04-11 00:00:00 -07:00
13
+ default_executable:
103
14
  dependencies:
104
15
  - !ruby/object:Gem::Dependency
105
16
  name: mongrel
106
17
  version_requirement:
107
- version_requirements: !ruby/object:Gem::Version::Requirement
18
+ version_requirements: !ruby/object:Gem::Requirement
108
19
  requirements:
109
20
  - - ">="
110
21
  - !ruby/object:Gem::Version
@@ -113,9 +24,122 @@ dependencies:
113
24
  - !ruby/object:Gem::Dependency
114
25
  name: rack
115
26
  version_requirement:
116
- version_requirements: !ruby/object:Gem::Version::Requirement
27
+ version_requirements: !ruby/object:Gem::Requirement
117
28
  requirements:
118
29
  - - ">="
119
30
  - !ruby/object:Gem::Version
120
- version: 0.2.0
31
+ version: "0"
32
+ - - "="
33
+ - !ruby/object:Gem::Version
34
+ version: 0.3.0
121
35
  version:
36
+ description: Classy web-development dressed in a DSL
37
+ email: ""
38
+ executables: []
39
+
40
+ extensions: []
41
+
42
+ extra_rdoc_files:
43
+ - CHANGELOG
44
+ - lib/sinatra/test/methods.rb
45
+ - lib/sinatra/test/spec.rb
46
+ - lib/sinatra/test/unit.rb
47
+ - lib/sinatra.rb
48
+ - README.rdoc
49
+ files:
50
+ - CHANGELOG
51
+ - images/404.png
52
+ - images/500.png
53
+ - index.html
54
+ - lib/sinatra/test/methods.rb
55
+ - lib/sinatra/test/spec.rb
56
+ - lib/sinatra/test/unit.rb
57
+ - lib/sinatra.rb
58
+ - README.rdoc
59
+ - test/app_test.rb
60
+ - test/application_test.rb
61
+ - test/builder_test.rb
62
+ - test/custom_error_test.rb
63
+ - test/diddy_test.rb
64
+ - test/erb_test.rb
65
+ - test/event_context_test.rb
66
+ - test/events_test.rb
67
+ - test/haml_test.rb
68
+ - test/helper.rb
69
+ - test/mapped_error_test.rb
70
+ - test/public/foo.xml
71
+ - test/rest_test.rb
72
+ - test/sass_test.rb
73
+ - test/sessions_test.rb
74
+ - test/streaming_test.rb
75
+ - test/sym_params_test.rb
76
+ - test/template_test.rb
77
+ - test/use_in_file_templates_test.rb
78
+ - test/views/foo.builder
79
+ - test/views/foo.erb
80
+ - test/views/foo.haml
81
+ - test/views/foo.sass
82
+ - test/views/foo_layout.erb
83
+ - test/views/foo_layout.haml
84
+ - test/views/layout_test/foo.builder
85
+ - test/views/layout_test/foo.erb
86
+ - test/views/layout_test/foo.haml
87
+ - test/views/layout_test/foo.sass
88
+ - test/views/layout_test/layout.builder
89
+ - test/views/layout_test/layout.erb
90
+ - test/views/layout_test/layout.haml
91
+ - test/views/layout_test/layout.sass
92
+ - test/views/no_layout/no_layout.builder
93
+ - test/views/no_layout/no_layout.haml
94
+ - Manifest
95
+ - sinatra.gemspec
96
+ - Rakefile
97
+ has_rdoc: true
98
+ homepage: http://www.sinatrarb.com
99
+ post_install_message: "*** Be sure to checkout the site for helpful tips! sinatrarb.com ***"
100
+ rdoc_options:
101
+ - --line-numbers
102
+ - --inline-source
103
+ - --title
104
+ - Sinatra
105
+ - --main
106
+ - README.rdoc
107
+ require_paths:
108
+ - lib
109
+ required_ruby_version: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ version: "0"
114
+ version:
115
+ required_rubygems_version: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: "0"
120
+ version:
121
+ requirements: []
122
+
123
+ rubyforge_project: sinatra
124
+ rubygems_version: 1.0.1
125
+ signing_key:
126
+ specification_version: 2
127
+ summary: Classy web-development dressed in a DSL
128
+ test_files:
129
+ - test/app_test.rb
130
+ - test/application_test.rb
131
+ - test/builder_test.rb
132
+ - test/custom_error_test.rb
133
+ - test/diddy_test.rb
134
+ - test/erb_test.rb
135
+ - test/event_context_test.rb
136
+ - test/events_test.rb
137
+ - test/haml_test.rb
138
+ - test/mapped_error_test.rb
139
+ - test/rest_test.rb
140
+ - test/sass_test.rb
141
+ - test/sessions_test.rb
142
+ - test/streaming_test.rb
143
+ - test/sym_params_test.rb
144
+ - test/template_test.rb
145
+ - test/use_in_file_templates_test.rb
data/LICENSE DELETED
@@ -1,22 +0,0 @@
1
- Copyright (c) 2007 Blake Mizerany
2
-
3
- Permission is hereby granted, free of charge, to any person
4
- obtaining a copy of this software and associated documentation
5
- files (the "Software"), to deal in the Software without
6
- restriction, including without limitation the rights to use,
7
- copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- copies of the Software, and to permit persons to whom the
9
- Software is furnished to do so, subject to the following
10
- conditions:
11
-
12
- The above copyright notice and this permission notice shall be
13
- included in all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
- OTHER DEALINGS IN THE SOFTWARE.
data/README DELETED
@@ -1,100 +0,0 @@
1
- Sinatra (C) 2007 By Blake Mizerany
2
-
3
- = Classy web-development dressed in a DSL
4
-
5
- == Install!
6
-
7
- sudo gem install sinatra -y
8
-
9
- == Use!
10
-
11
- I'm going to move quick. I'll let you drool at your own pace.
12
-
13
- * Create a file called lyrics.rb (or any name you like)
14
-
15
- * Add
16
- require 'rubygems'
17
- require 'sinatra'
18
-
19
- * Run (yes, with just ruby)
20
- % ruby lyrics.rb
21
- == Sinata has taken the stage on port 4567!
22
-
23
- * Take a moment and view the default page http://localhost:4567. Go ahead and bask in it's glory.
24
-
25
- * Notice:
26
- * It didn't create any page to show you that default page (just a cool thing to see, that's all)
27
- * There was nothing generated other than a log file
28
- * Sinatra is a really cool name for a web-framework that's a DSL
29
-
30
- * Modify lyrics.rb by adding:
31
- get '/' do
32
- 'Hello World'
33
- end
34
-
35
- * Refresh (no need to restart Sinatra):
36
- http://localhost:4567
37
-
38
- * Modify again (then refresh):
39
- get '/' do
40
- <<-HTML
41
- <form action='/' method="POST">
42
- <input type="text" name="name" />
43
- <input type="submit" value="Say my name!" />
44
- </form>
45
- HTML
46
- end
47
-
48
- post '/' do
49
- "Hello #{params[:name] || 'World'}!"
50
- end
51
-
52
- * Now you try:
53
- Use the Sinatra::Erb::EventContext or Sinatra::Haml::EventContext to do the same. Do them inline and as template files.
54
-
55
- * Learn more cool stuff:
56
- see Sinatra::Dsl
57
-
58
- * Create your own plugins!
59
- 1. Create a 'vendor' directory in your app directory
60
- 2. Lay it out like:
61
-
62
- myapp.rb : root
63
- |- vendor
64
- | - plugin_name
65
- | - init.rb # load and hook here
66
- | - lib
67
- |- modules/classes here
68
-
69
- 3. Use it in your app!
70
-
71
- see $SINATRA_GEM_ROOT/vendor/erb or $SINATRA_GEM_ROOT/vendor/erb for examples.
72
-
73
- * Tell!
74
- We would love to here what you're doing with Sinatra and any cool patches/features you would like. (blake { dot } mizerany [ at ] gmail)
75
-
76
- * Talk!
77
- IRC (irc.freenode.com #sinatra)
78
- Mailing List (sinatrarb@googlegroups.com)
79
-
80
- * Contribute
81
-
82
- We're using git as our scm.. cuz.. it rocks. You can get the latest source from http://repo.or.cz/w/sinatra.git
83
-
84
- NOTE: You can also get tar'd snapshots of each commit there too. So technically you don't need git to get the latest code.
85
-
86
- It's probably going to happen.. you'll find a bug. Please help by:
87
-
88
- * Sending a message to sintrarb@googlegroups.com with BUG: at the start of the subject (I'm working on a better tracking system)
89
- * Please send patches or pull requests to (blake { dot } mizerany [ at ] gmail) don't forget the dot com. ;)
90
-
91
- == Thanks!
92
-
93
- - Ezra Zygmuntowicz (http://brainspl.at) for answering all those random questions over IM and all the poached code
94
- - Ditto to Chris Wanstrath (errtheblog.com) and helping me keep things simple, and some cool tricks
95
- - Ari Lerner over at CitrusByte for ideas, code, and enthusiasm
96
- - Christian Neukirchen for Rack (http://rack.rubyforge.org/)
97
- - Koshi (http://www.songbirdnest.com/jkoshi/blog) here at POTI, Inc. for the Sinatra mark
98
- - Pete Golibersuch for the hat logo
99
- - John Philip Green (http://www.linkedin.com/in/johngreen) for motivation and evangelism
100
- - The team here at songbirdnest.com for cool ideas
data/RakeFile DELETED
@@ -1,35 +0,0 @@
1
- require 'rake/testtask'
2
- require 'ftools'
3
-
4
- Version = '0.1.0'
5
-
6
- begin
7
- require 'rubygems'
8
- gem 'echoe'
9
- ENV['RUBY_FLAGS'] = ""
10
- require 'echoe'
11
-
12
- Echoe.new('sinatra') do |p|
13
- p.rubyforge_name = 'sinatra'
14
- p.dependencies = ['mongrel >=1.0.1', 'rack >=0.2.0']
15
- p.summary = "Sinatra is a classy web-framework dressed in a DSL"
16
- p.description = "Sinatra is a classy web-framework dressed in a DSL"
17
- p.url = "http://sinatra.rubyforge.org/"
18
- p.author = 'Blake Mizerany'
19
- p.email = "blake.mizerany@gmail.com"
20
- p.test_pattern = 'test/**/*_test.rb'
21
- p.include_rakefile = true
22
- p.rdoc_pattern = ['README', 'LICENSE'] + Dir.glob('lib/**/*.rb') + Dir.glob('vendor/**/*.rb')
23
- p.docs_host = "bmizerany@rubyforge.org:/var/www/gforge-projects/"
24
- end
25
-
26
- rescue LoadError
27
- end
28
-
29
- desc 'Clear all the log files from here down'
30
- task :remove_logs do
31
- Dir.glob(Dir.pwd + '/**/*.log') do |logfile|
32
- FileUtils.rm(logfile)
33
- puts 'Removed: %s' % logfile
34
- end
35
- end
@@ -1,28 +0,0 @@
1
- $LOAD_PATH.unshift File.dirname(__FILE__) + '/../../lib'
2
- require 'sinatra'
3
-
4
- config_for(:production) do
5
-
6
- get 404 do
7
- "Not sure what you're looking for .. try something else."
8
- end
9
- end
10
-
11
- sessions :off
12
-
13
- get '/' do
14
- "Hello World!"
15
- end
16
-
17
- get '/erb.xml' do
18
- header 'Content-Type' => 'application/xml'
19
- '<this_is_xml/>'
20
- end
21
-
22
- get '/erb' do
23
- erb :hello
24
- end
25
-
26
- get '/erb2' do
27
- erb 'Hello <%= params[:name].capitalize || "World" %> 2!'
28
- end