Last active
January 4, 2016 19:09
Revisions
-
jodosha revised this gist
Jan 28, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ Gem::Specification.new do |s| s.email = 'me@lucaguidi.com' s.summary = 'Building Sinatra with Lotus' s.description = 'A step by step guide about how use Lotus to build Sinatra' s.homepage = 'http://bit.ly/1e4e58T' s.license = 'MIT' s.files = ['lotus-sinatra.rb'] -
jodosha revised this gist
Jan 28, 2014 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,8 +4,8 @@ Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.author = 'Luca Guidi' s.email = 'me@lucaguidi.com' s.summary = 'Building Sinatra with Lotus' s.description = 'A step by step guide about how use Lotus to build Sinatra' s.homepage = '' s.license = 'MIT' -
jodosha revised this gist
Jan 28, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,5 +12,5 @@ Gem::Specification.new do |s| s.files = ['lotus-sinatra.rb'] s.require_path = '.' s.add_dependency 'lotus-router', '~> 0.1.0' end -
jodosha created this gist
Jan 28, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ Gem::Specification.new do |s| s.name = 'lotus-sinatra' s.version = '0.1.0' s.platform = Gem::Platform::RUBY s.author = 'Luca Guidi' s.email = 'me@lucaguidi.com' s.summary = 'Cloning Sinatra with Lotus' s.description = 'A step by step guide about how use Lotus to clone Sinatra' s.homepage = '' s.license = 'MIT' s.files = ['lotus-sinatra.rb'] s.require_path = '.' spec.add_dependency 'lotus-router', '~> 0.1.0' end This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ require 'rubygems' require 'lotus/router' class Endpoint < Lotus::Routing::Endpoint def call(env) [200, {}, [super(params(env))]] end private def params(env) env.fetch('router.params') end end resolver = Lotus::Routing::EndpointResolver.new(endpoint: Endpoint) Application = Rack::Builder.new do run Lotus::Router.new(resolver: resolver) end.to_app def method_missing(m, *args, &blk) if Application.respond_to?(m) Application.send m, *args, &blk else super end end