serve 0.9.10 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. data/{History.txt → CHANGELOG.rdoc} +9 -0
  2. data/{License.txt → LICENSE} +1 -1
  3. data/{Quickstart.textile → QUICKSTART.rdoc} +61 -80
  4. data/{README.txt → README.rdoc} +10 -13
  5. data/Rakefile +11 -13
  6. data/VERSION +1 -0
  7. data/bin/serve +6 -0
  8. data/lib/serve.rb +2 -8
  9. data/lib/serve/application.rb +13 -6
  10. data/lib/serve/file_resolver.rb +48 -0
  11. data/lib/serve/handlers/dynamic_handler.rb +31 -21
  12. data/lib/serve/handlers/file_type_handler.rb +23 -32
  13. data/lib/serve/handlers/markdown_handler.rb +1 -1
  14. data/lib/serve/handlers/redirect_handler.rb +6 -5
  15. data/lib/serve/handlers/sass_handler.rb +4 -3
  16. data/lib/serve/rack.rb +57 -0
  17. data/lib/serve/rails.rb +4 -0
  18. data/lib/serve/rails/configuration.rb +69 -0
  19. data/lib/serve/rails/mount.rb +38 -0
  20. data/lib/serve/rails/routing.rb +25 -0
  21. data/lib/serve/rails/serve_controller.rb +52 -0
  22. data/lib/serve/response_cache.rb +170 -0
  23. data/lib/serve/version.rb +4 -9
  24. data/lib/serve/webrick/extensions.rb +80 -15
  25. data/lib/serve/webrick/server.rb +17 -0
  26. data/lib/serve/webrick/servlet.rb +19 -0
  27. data/rails/init.rb +6 -0
  28. data/spec/{serve_application_spec.rb → application_spec.rb} +5 -4
  29. data/spec/response_cache_spec.rb +248 -0
  30. data/spec/serve_spec.rb +1 -0
  31. data/spec/spec_helper.rb +10 -9
  32. metadata +51 -69
  33. data.tar.gz.sig +0 -0
  34. data/Manifest.txt +0 -44
  35. data/config/hoe.rb +0 -70
  36. data/config/requirements.rb +0 -17
  37. data/log/debug.log +0 -0
  38. data/script/destroy +0 -14
  39. data/script/generate +0 -14
  40. data/script/txt2html +0 -74
  41. data/setup.rb +0 -1585
  42. data/tasks/deployment.rake +0 -27
  43. data/tasks/environment.rake +0 -7
  44. data/tasks/rspec.rake +0 -21
  45. data/tasks/undefine.rake +0 -5
  46. data/tasks/website.rake +0 -17
  47. data/test_project/_layout.haml +0 -12
  48. data/test_project/erb/_footer.html.erb +0 -2
  49. data/test_project/erb/_layout.html.erb +0 -28
  50. data/test_project/erb/index.html.erb +0 -10
  51. data/test_project/haml/_footer.haml +0 -2
  52. data/test_project/haml/_layout.haml +0 -20
  53. data/test_project/haml/index.haml +0 -9
  54. data/test_project/test.haml +0 -3
  55. data/test_project/test.html.erb +0 -3
  56. data/test_project/view_helpers.rb +0 -5
  57. metadata.gz.sig +0 -0
@@ -1,27 +0,0 @@
1
- desc 'Release the website and new gem version'
2
- task :deploy => [:check_version, :website, :release] do
3
- puts "Remember to create SVN tag:"
4
- puts "svn copy svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/trunk " +
5
- "svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/tags/REL-#{VERS} "
6
- puts "Suggested comment:"
7
- puts "Tagging release #{CHANGES}"
8
- end
9
-
10
- desc 'Runs tasks website_generate and install_gem as a local deployment of the gem'
11
- task :local_deploy => [:website_generate, :install_gem]
12
-
13
- task :check_version do
14
- unless ENV['VERSION']
15
- puts 'Must pass a VERSION=x.y.z release version'
16
- exit
17
- end
18
- unless ENV['VERSION'] == VERS
19
- puts "Please update your version.rb to match the release version, currently #{VERS}"
20
- exit
21
- end
22
- end
23
-
24
- desc 'Install the package as a gem, without generating documentation(ri/rdoc)'
25
- task :install_gem_no_doc => [:clean, :package] do
26
- sh "#{'sudo ' unless Hoe::WINDOZE }gem install pkg/*.gem --no-rdoc --no-ri"
27
- end
@@ -1,7 +0,0 @@
1
- task :ruby_env do
2
- RUBY_APP = if RUBY_PLATFORM =~ /java/
3
- "jruby"
4
- else
5
- "ruby"
6
- end unless defined? RUBY_APP
7
- end
@@ -1,21 +0,0 @@
1
- begin
2
- require 'spec'
3
- rescue LoadError
4
- require 'rubygems'
5
- require 'spec'
6
- end
7
- begin
8
- require 'spec/rake/spectask'
9
- rescue LoadError
10
- puts <<-EOS
11
- To use rspec for testing you must install rspec gem:
12
- gem install rspec
13
- EOS
14
- exit(0)
15
- end
16
-
17
- desc "Run the specs under spec/models"
18
- Spec::Rake::SpecTask.new do |t|
19
- t.spec_opts = ['--options', "spec/spec.opts"]
20
- t.spec_files = FileList['spec/*_spec.rb']
21
- end
@@ -1,5 +0,0 @@
1
- def undefine_task(*names)
2
- app = Rake.application
3
- tasks = app.instance_variable_get('@tasks')
4
- names.flatten.each { |name| tasks.delete(name) }
5
- end
@@ -1,17 +0,0 @@
1
- desc 'Generate website files'
2
- task :website_generate => :ruby_env do
3
- (Dir['website/**/*.txt'] - Dir['website/version*.txt']).each do |txt|
4
- sh %{ #{RUBY_APP} script/txt2html #{txt} > #{txt.gsub(/txt$/,'html')} }
5
- end
6
- end
7
-
8
- desc 'Upload website files to rubyforge'
9
- task :website_upload do
10
- host = "#{rubyforge_username}@rubyforge.org"
11
- remote_dir = "/var/www/gforge-projects/#{RUBYFORGE_PROJECT}/"
12
- local_dir = 'website'
13
- sh %{rsync -aCv #{local_dir}/ #{host}:#{remote_dir}}
14
- end
15
-
16
- desc 'Generate and upload website files'
17
- task :website => [:website_generate, :website_upload, :publish_docs]
@@ -1,12 +0,0 @@
1
- !!! Strict
2
- %html
3
- %head
4
- %title= @title
5
- %link{:rel=>"stylesheet", :type=>"text/css", :href=>"/main.sass"}/
6
- %style{:type=>"text/css"}
7
- :sass
8
- body
9
- color: red
10
- %body
11
- %h1= @title
12
- = yield
@@ -1,2 +0,0 @@
1
- <hr style="clear: both" />
2
- <p>Copyright &copy; John W. Long. All rights reserved.</p>
@@ -1,28 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
- <html>
3
- <head>
4
- <title><%= @title %></title>
5
- <style type="text/css">
6
- #content {
7
- float: left;
8
- width: 70%;
9
- }
10
- #sidebar {
11
- float: right;
12
- width: 28%;
13
- }
14
- </style>
15
- </head>
16
- <body>
17
- <div id="content">
18
- <h1><%= @title %></h1>
19
- <%= yield %>
20
- </div>
21
- <% if content_for?(:sidebar) %>
22
- <div id="sidebar">
23
- <%= yield :sidebar %>
24
- </div>
25
- <% end %>
26
- <%= render :partial => "footer" %>
27
- </body>
28
- </html>
@@ -1,10 +0,0 @@
1
- <% @title = "ERB Template" %>
2
-
3
- <p>Hello World!</p>
4
-
5
- <%= custom_method %>
6
-
7
- <% content_for :sidebar do %>
8
- <h3>Sidebar</h3>
9
- <p>Just a test</p>
10
- <% end %>
@@ -1,2 +0,0 @@
1
- %hr{:style=>"clear: both"}/
2
- %p Copyright &copy; John W. Long. All rights reserved.
@@ -1,20 +0,0 @@
1
- !!! Strict
2
- %html
3
- %head
4
- %title= @title
5
- %style{:type=>"text/css"}
6
- :sass
7
- #content
8
- float: left
9
- width: 70%
10
- #sidebar
11
- float: right
12
- width: 28%
13
- %body
14
- #content
15
- %h1= @title
16
- = yield
17
- - if content_for?(:sidebar)
18
- #sidebar
19
- = yield :sidebar
20
- = render :partial => "footer"
@@ -1,9 +0,0 @@
1
- - @title = "HAML Template"
2
-
3
- %p Hello World!
4
-
5
- = custom_method
6
-
7
- - content_for :sidebar do
8
- %h3 Sidebar
9
- %p Just a test
@@ -1,3 +0,0 @@
1
- = render :template => "test.html.erb"
2
- = custom_method
3
- - @title = "Haml Template"
@@ -1,3 +0,0 @@
1
- <% @title = "ERB Template" %>
2
-
3
- <p>Hello World!</p>
@@ -1,5 +0,0 @@
1
- module ViewHelpers
2
- def custom_method
3
- "Request object: #{request.headers['user-agent']}"
4
- end
5
- end
metadata.gz.sig DELETED
Binary file