rango 0.2 → 0.2.1.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +9 -0
- data/.gitmodules +3 -0
- data/CHANGELOG +5 -0
- data/CONTRIBUTORS +1 -0
- data/Gemfile +20 -0
- data/LICENSE +1 -1
- data/README.textile +5 -4
- data/benchmarks/ab.rb +6 -0
- data/benchmarks/bm/boot.rb +20 -0
- data/{spec/rango/version_spec.rb → benchmarks/bm/callbacks.rb} +0 -0
- data/benchmarks/bm/request.rb +4 -0
- data/benchmarks/bm/routers.rb +22 -0
- data/benchmarks/bm/stack.rb +19 -0
- data/{spec/stubs/acqs/dir/lib.rb → benchmarks/bm/templates.rb} +0 -0
- data/benchmarks/helper.rb +7 -0
- data/benchmarks/stubs/merb-app/.gitignore +21 -0
- data/benchmarks/stubs/merb-app/Rakefile +35 -0
- data/benchmarks/stubs/merb-app/app/controllers/application.rb +4 -0
- data/benchmarks/stubs/merb-app/app/controllers/exceptions.rb +15 -0
- data/benchmarks/stubs/merb-app/app/helpers/global_helpers.rb +7 -0
- data/benchmarks/stubs/merb-app/app/models/user.rb +19 -0
- data/benchmarks/stubs/merb-app/app/views/exceptions/not_acceptable.html.erb +63 -0
- data/benchmarks/stubs/merb-app/app/views/exceptions/not_found.html.erb +47 -0
- data/benchmarks/stubs/merb-app/app/views/layout/application.html.erb +12 -0
- data/benchmarks/stubs/merb-app/autotest/discover.rb +4 -0
- data/benchmarks/stubs/merb-app/autotest/merb.rb +154 -0
- data/benchmarks/stubs/merb-app/autotest/merb_rspec.rb +167 -0
- data/benchmarks/stubs/merb-app/config/database.yml +33 -0
- data/benchmarks/stubs/merb-app/config/dependencies.rb +36 -0
- data/benchmarks/stubs/merb-app/config/environments/development.rb +17 -0
- data/benchmarks/stubs/merb-app/config/environments/production.rb +12 -0
- data/benchmarks/stubs/merb-app/config/environments/rake.rb +13 -0
- data/benchmarks/stubs/merb-app/config/environments/staging.rb +12 -0
- data/benchmarks/stubs/merb-app/config/environments/test.rb +14 -0
- data/benchmarks/stubs/merb-app/config/init.rb +26 -0
- data/benchmarks/stubs/merb-app/config/rack.rb +13 -0
- data/benchmarks/stubs/merb-app/config/router.rb +46 -0
- data/benchmarks/stubs/merb-app/doc/rdoc/generators/merb_generator.rb +1364 -0
- data/benchmarks/stubs/merb-app/doc/rdoc/generators/template/merb/api_grease.js +640 -0
- data/benchmarks/stubs/merb-app/doc/rdoc/generators/template/merb/index.html.erb +37 -0
- data/benchmarks/stubs/merb-app/doc/rdoc/generators/template/merb/merb.css +252 -0
- data/benchmarks/stubs/merb-app/doc/rdoc/generators/template/merb/merb.rb +353 -0
- data/benchmarks/stubs/merb-app/doc/rdoc/generators/template/merb/merb_doc_styles.css +492 -0
- data/benchmarks/stubs/merb-app/doc/rdoc/generators/template/merb/prototype.js +2515 -0
- data/benchmarks/stubs/merb-app/merb/merb-auth/setup.rb +46 -0
- data/benchmarks/stubs/merb-app/merb/merb-auth/strategies.rb +13 -0
- data/benchmarks/stubs/merb-app/merb/session/session.rb +11 -0
- data/benchmarks/stubs/merb-app/public/.htaccess +17 -0
- data/benchmarks/stubs/merb-app/public/favicon.ico +0 -0
- data/benchmarks/stubs/merb-app/public/images/merb.jpg +0 -0
- data/benchmarks/stubs/merb-app/public/javascripts/application.js +1 -0
- data/benchmarks/stubs/merb-app/public/javascripts/jquery.js +19 -0
- data/benchmarks/stubs/merb-app/public/merb.fcgi +22 -0
- data/benchmarks/stubs/merb-app/public/robots.txt +5 -0
- data/benchmarks/stubs/merb-app/public/stylesheets/master.css +119 -0
- data/{spec/stubs/acqs/dir/lib_spec.rb → benchmarks/stubs/merb-app/spec/spec.opts} +0 -0
- data/benchmarks/stubs/merb-app/spec/spec_helper.rb +27 -0
- data/benchmarks/stubs/merb-app/tasks/doc.thor +151 -0
- data/benchmarks/stubs/merb-app/tasks/merb.thor/app_script.rb +33 -0
- data/benchmarks/stubs/merb-app/tasks/merb.thor/common.rb +70 -0
- data/benchmarks/stubs/merb-app/tasks/merb.thor/gem_ext.rb +127 -0
- data/benchmarks/stubs/merb-app/tasks/merb.thor/main.thor +152 -0
- data/benchmarks/stubs/merb-app/tasks/merb.thor/ops.rb +95 -0
- data/benchmarks/stubs/merb-app/tasks/merb.thor/utils.rb +42 -0
- data/benchmarks/stubs/merb-core/.gitignore +21 -0
- data/benchmarks/stubs/merb-core/Rakefile +35 -0
- data/benchmarks/stubs/merb-core/app/controllers/application.rb +4 -0
- data/benchmarks/stubs/merb-core/app/controllers/exceptions.rb +15 -0
- data/benchmarks/stubs/merb-core/app/helpers/global_helpers.rb +7 -0
- data/benchmarks/stubs/merb-core/app/views/exceptions/not_acceptable.html.erb +63 -0
- data/benchmarks/stubs/merb-core/app/views/exceptions/not_found.html.erb +47 -0
- data/benchmarks/stubs/merb-core/app/views/layout/application.html.erb +12 -0
- data/benchmarks/stubs/merb-core/autotest/discover.rb +1 -0
- data/benchmarks/stubs/merb-core/autotest/merb.rb +151 -0
- data/benchmarks/stubs/merb-core/autotest/merb_rspec.rb +167 -0
- data/benchmarks/stubs/merb-core/config/environments/development.rb +17 -0
- data/benchmarks/stubs/merb-core/config/environments/production.rb +12 -0
- data/benchmarks/stubs/merb-core/config/environments/rake.rb +13 -0
- data/benchmarks/stubs/merb-core/config/environments/staging.rb +12 -0
- data/benchmarks/stubs/merb-core/config/environments/test.rb +14 -0
- data/benchmarks/stubs/merb-core/config/init.rb +27 -0
- data/benchmarks/stubs/merb-core/config/rack.rb +13 -0
- data/benchmarks/stubs/merb-core/config/router.rb +43 -0
- data/benchmarks/stubs/merb-core/doc/rdoc/generators/merb_generator.rb +1364 -0
- data/benchmarks/stubs/merb-core/doc/rdoc/generators/template/merb/api_grease.js +640 -0
- data/benchmarks/stubs/merb-core/doc/rdoc/generators/template/merb/index.html.erb +37 -0
- data/benchmarks/stubs/merb-core/doc/rdoc/generators/template/merb/merb.css +252 -0
- data/benchmarks/stubs/merb-core/doc/rdoc/generators/template/merb/merb.rb +353 -0
- data/benchmarks/stubs/merb-core/doc/rdoc/generators/template/merb/merb_doc_styles.css +492 -0
- data/benchmarks/stubs/merb-core/doc/rdoc/generators/template/merb/prototype.js +2515 -0
- data/benchmarks/stubs/merb-core/public/.htaccess +17 -0
- data/benchmarks/stubs/merb-core/public/favicon.ico +0 -0
- data/benchmarks/stubs/merb-core/public/images/merb.jpg +0 -0
- data/benchmarks/stubs/merb-core/public/javascripts/application.js +1 -0
- data/benchmarks/stubs/merb-core/public/merb.fcgi +22 -0
- data/benchmarks/stubs/merb-core/public/robots.txt +5 -0
- data/benchmarks/stubs/merb-core/public/stylesheets/master.css +119 -0
- data/{spec/stubs/acqs/lib.rb → benchmarks/stubs/merb-core/spec/spec.opts} +0 -0
- data/benchmarks/stubs/merb-core/spec/spec_helper.rb +22 -0
- data/benchmarks/stubs/merb-core/tasks/merb.thor/app_script.rb +33 -0
- data/benchmarks/stubs/merb-core/tasks/merb.thor/common.rb +70 -0
- data/benchmarks/stubs/merb-core/tasks/merb.thor/gem_ext.rb +127 -0
- data/benchmarks/stubs/merb-core/tasks/merb.thor/main.thor +152 -0
- data/benchmarks/stubs/merb-core/tasks/merb.thor/ops.rb +95 -0
- data/benchmarks/stubs/merb-core/tasks/merb.thor/utils.rb +42 -0
- data/benchmarks/stubs/merb-flat/.gitignore +21 -0
- data/benchmarks/stubs/merb-flat/README.txt +10 -0
- data/benchmarks/stubs/merb-flat/Rakefile +35 -0
- data/benchmarks/stubs/merb-flat/application.rb +17 -0
- data/benchmarks/stubs/merb-flat/config/framework.rb +9 -0
- data/benchmarks/stubs/merb-flat/config/init.rb +42 -0
- data/benchmarks/stubs/merb-flat/spec/spec_helper.rb +26 -0
- data/benchmarks/stubs/merb-flat/tasks/merb.thor/app_script.rb +33 -0
- data/benchmarks/stubs/merb-flat/tasks/merb.thor/common.rb +70 -0
- data/benchmarks/stubs/merb-flat/tasks/merb.thor/gem_ext.rb +127 -0
- data/benchmarks/stubs/merb-flat/tasks/merb.thor/main.thor +152 -0
- data/benchmarks/stubs/merb-flat/tasks/merb.thor/ops.rb +95 -0
- data/benchmarks/stubs/merb-flat/tasks/merb.thor/utils.rb +42 -0
- data/benchmarks/stubs/merb-flat/views/foo.html.erb +3 -0
- data/benchmarks/stubs/merb-very-flat/.gitignore +21 -0
- data/benchmarks/stubs/merb-very-flat/Rakefile +35 -0
- data/benchmarks/stubs/merb-very-flat/merb-very-flat.rb +61 -0
- data/benchmarks/stubs/merb-very-flat/spec/spec_helper.rb +26 -0
- data/benchmarks/stubs/merb-very-flat/tasks/merb.thor/app_script.rb +33 -0
- data/benchmarks/stubs/merb-very-flat/tasks/merb.thor/common.rb +70 -0
- data/benchmarks/stubs/merb-very-flat/tasks/merb.thor/gem_ext.rb +127 -0
- data/benchmarks/stubs/merb-very-flat/tasks/merb.thor/main.thor +152 -0
- data/benchmarks/stubs/merb-very-flat/tasks/merb.thor/ops.rb +95 -0
- data/benchmarks/stubs/merb-very-flat/tasks/merb.thor/utils.rb +42 -0
- data/benchmarks/stubs/rails/README +243 -0
- data/benchmarks/stubs/rails/Rakefile +10 -0
- data/benchmarks/stubs/rails/app/controllers/application_controller.rb +12 -0
- data/benchmarks/stubs/rails/app/helpers/application_helper.rb +5 -0
- data/benchmarks/stubs/rails/config/boot.rb +112 -0
- data/benchmarks/stubs/rails/config/database.yml +22 -0
- data/benchmarks/stubs/rails/config/environment.rb +43 -0
- data/benchmarks/stubs/rails/config/environments/development.rb +19 -0
- data/benchmarks/stubs/rails/config/environments/production.rb +30 -0
- data/benchmarks/stubs/rails/config/environments/test.rb +30 -0
- data/benchmarks/stubs/rails/config/initializers/backtrace_silencers.rb +9 -0
- data/benchmarks/stubs/rails/config/initializers/inflections.rb +12 -0
- data/benchmarks/stubs/rails/config/initializers/mime_types.rb +7 -0
- data/benchmarks/stubs/rails/config/initializers/new_rails_defaults.rb +21 -0
- data/benchmarks/stubs/rails/config/initializers/session_store.rb +17 -0
- data/benchmarks/stubs/rails/config/locales/en.yml +5 -0
- data/benchmarks/stubs/rails/config/routes.rb +45 -0
- data/benchmarks/stubs/rails/doc/README_FOR_APP +2 -0
- data/{spec/stubs/acqs/tasks.thor → benchmarks/stubs/rails/log/development.log} +0 -0
- data/{stubs/stack/content/TODO.txt → benchmarks/stubs/rails/log/production.log} +0 -0
- data/benchmarks/stubs/rails/log/server.log +0 -0
- data/benchmarks/stubs/rails/log/test.log +0 -0
- data/benchmarks/stubs/rails/public/404.html +30 -0
- data/benchmarks/stubs/rails/public/422.html +30 -0
- data/benchmarks/stubs/rails/public/500.html +30 -0
- data/benchmarks/stubs/rails/public/favicon.ico +0 -0
- data/benchmarks/stubs/rails/public/images/rails.png +0 -0
- data/benchmarks/stubs/rails/public/index.html +275 -0
- data/benchmarks/stubs/rails/public/javascripts/application.js +2 -0
- data/benchmarks/stubs/rails/public/javascripts/controls.js +963 -0
- data/benchmarks/stubs/rails/public/javascripts/dragdrop.js +973 -0
- data/benchmarks/stubs/rails/public/javascripts/effects.js +1128 -0
- data/benchmarks/stubs/rails/public/javascripts/prototype.js +4320 -0
- data/benchmarks/stubs/rails/public/robots.txt +5 -0
- data/benchmarks/stubs/rails/script/about +4 -0
- data/benchmarks/stubs/rails/script/console +3 -0
- data/benchmarks/stubs/rails/script/dbconsole +3 -0
- data/benchmarks/stubs/rails/script/destroy +3 -0
- data/benchmarks/stubs/rails/script/generate +3 -0
- data/benchmarks/stubs/rails/script/performance/benchmarker +3 -0
- data/benchmarks/stubs/rails/script/performance/profiler +3 -0
- data/benchmarks/stubs/rails/script/plugin +3 -0
- data/benchmarks/stubs/rails/script/runner +3 -0
- data/benchmarks/stubs/rails/script/server +3 -0
- data/benchmarks/stubs/rails/test/performance/browsing_test.rb +11 -0
- data/benchmarks/stubs/rails/test/test_helper.rb +40 -0
- data/benchmarks/stubs/ramaze.rb +0 -0
- data/benchmarks/stubs/sinatra.rb +11 -0
- data/bin/rango +2 -2
- data/deps.rip +7 -0
- data/deps.rip.rbe +7 -0
- data/gems/cache/abstract-1.0.0.gem +0 -0
- data/gems/cache/code-cleaner-0.1.gem +0 -0
- data/gems/cache/code-cleaner-0.2.gem +0 -0
- data/gems/cache/code-cleaner-0.3.gem +0 -0
- data/gems/cache/code-cleaner-0.4.gem +0 -0
- data/gems/cache/code-cleaner-0.5.gem +0 -0
- data/gems/cache/code-cleaner-0.6.gem +0 -0
- data/gems/cache/code-cleaner-0.7.gem +0 -0
- data/gems/cache/code-cleaner-0.8.1.gem +0 -0
- data/gems/cache/code-cleaner-0.8.gem +0 -0
- data/gems/cache/erubis-2.6.5.gem +0 -0
- data/gems/cache/extlib-0.9.14.gem +0 -0
- data/gems/cache/haml-2.2.16.gem +0 -0
- data/gems/cache/haml-2.2.17.gem +0 -0
- data/gems/cache/nake-0.0.2.gem +0 -0
- data/gems/cache/nake-0.0.3.gem +0 -0
- data/gems/cache/nake-0.0.5.gem +0 -0
- data/gems/cache/nake-0.0.6.gem +0 -0
- data/gems/cache/nake-0.0.8.gem +0 -0
- data/gems/cache/rack-1.0.1.gem +0 -0
- data/gems/cache/rack-1.1.0.gem +0 -0
- data/gems/cache/rspec-1.2.9.gem +0 -0
- data/gems/cache/rspec-1.3.0.gem +0 -0
- data/gems/cache/term-ansicolor-1.0.4.gem +0 -0
- data/gems/cache/tilt-0.4.gem +0 -0
- data/gems/cache/tilt-0.5.gem +0 -0
- data/lib/rango.rb +28 -28
- data/lib/rango/cli.rb +34 -0
- data/lib/rango/contrib/pagination/adapters/datamapper.rb +21 -17
- data/lib/rango/controller.rb +36 -4
- data/lib/rango/environments.rb +1 -15
- data/lib/rango/exceptions.rb +144 -86
- data/lib/rango/helpers.rb +10 -2
- data/lib/rango/mailer.rb +48 -0
- data/lib/rango/mixins/action_args.rb +5 -7
- data/lib/rango/mixins/filters.rb +18 -14
- data/lib/rango/mixins/message.rb +30 -24
- data/lib/rango/mixins/rendering.rb +54 -0
- data/lib/rango/orm/tasks/datamapper.nake +81 -0
- data/lib/rango/orm/tasks/sequel.nake +43 -0
- data/lib/rango/router/adapters/usher.rb +2 -1
- data/lib/rango/stacks/controller.rb +12 -0
- data/lib/rango/tasks/spec.nake +9 -0
- data/lib/rango/templates/exts/haml.rb +1 -1
- data/lib/rango/templates/exts/tilt.rb +10 -0
- data/lib/rango/templates/helpers.rb +29 -25
- data/lib/rango/templates/template.rb +7 -6
- data/rango.gemspec +52 -0
- data/rango.pre.gemspec +8 -0
- data/spec/rango/environments_spec.rb +1 -1
- data/spec/rango/exceptions_spec.rb +8 -7
- data/spec/rango/mixins/render_spec.rb +1 -1
- data/spec/rango/templates/template_spec.rb +1 -1
- data/stubs/stack/content/%name%.gemspec.rbt +52 -0
- data/stubs/stack/content/%name%.pre.gemspec.rbt +8 -0
- data/stubs/stack/content/CHANGELOG +0 -0
- data/stubs/stack/content/Gemfile.rbt +22 -11
- data/stubs/stack/content/README.textile.rbt +7 -0
- data/stubs/stack/content/config.ru.rbt +33 -62
- data/stubs/stack/content/deps.rip +0 -0
- data/stubs/stack/content/init.rb.rbt +14 -39
- data/stubs/stack/content/lib/%name%.rb.rbt +8 -0
- data/stubs/stack/content/lib/%name%/config.rb.rbt +0 -0
- data/stubs/stack/content/{environments.rb.rbt → lib/%name%/environments/development.rb.rbt} +5 -0
- data/stubs/stack/content/lib/%name%/environments/production.rb.rbt +0 -0
- data/stubs/stack/content/lib/%name%/environments/stagging.rb.rbt +0 -0
- data/stubs/stack/content/lib/%name%/initializers/middlewares.rb.rbt +5 -0
- data/stubs/stack/content/lib/%name%/initializers/urls.rb.rbt +24 -0
- data/stubs/stack/content/{models.rb.rbt → lib/%name%/models.rb.rbt} +7 -0
- data/stubs/stack/content/{views.rb.rbt → lib/%name%/views.rb.rbt} +2 -8
- data/stubs/stack/content/rackup.rb.rbt +41 -0
- data/stubs/stack/content/tasks.rb.rbt +52 -0
- data/stubs/stack/setup.rb +7 -1
- data/support/hooks/pre-commit +12 -0
- data/tasks.rb +49 -0
- metadata +250 -54
- data/Rakefile +0 -33
- data/lib/rango/rack/middlewares/email_obfuscator.rb +0 -25
- data/lib/rango/version.rb +0 -7
- data/stubs/stack/content/.rvmrc.rbt +0 -2
- data/stubs/stack/content/Rakefile.rbt +0 -12
data/rango.pre.gemspec
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
#!/usr/bin/env gem build
|
2
|
+
# encoding: utf-8
|
3
|
+
|
4
|
+
# You might think this is a terrible mess and guess what, you're
|
5
|
+
# right mate! However say thanks to authors of RubyGems, not me.
|
6
|
+
eval(File.read("rango.gemspec")).tap do |specification|
|
7
|
+
specification.version = "#{specification.version}.pre"
|
8
|
+
end
|
@@ -23,7 +23,7 @@ describe "Rango environments" do
|
|
23
23
|
end
|
24
24
|
|
25
25
|
describe ".production?" do
|
26
|
-
%w{production
|
26
|
+
%w{production stagging}.each do |environment|
|
27
27
|
it "should be true if Rango.environment is '#{environment}'" do
|
28
28
|
Rango.environment = environment
|
29
29
|
Rango.should be_production
|
@@ -1,19 +1,20 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
require_relative "../spec_helper"
|
4
|
+
require "rango/exceptions"
|
4
5
|
|
5
|
-
describe Rango::
|
6
|
+
describe Rango::Exceptions do
|
6
7
|
before(:each) do
|
7
|
-
@error = Rango::NotFound.new("Post with given ID doesn't exist")
|
8
|
+
@error = Rango::Exceptions::NotFound.new("Post with given ID doesn't exist")
|
8
9
|
end
|
9
10
|
|
10
11
|
describe "constants" do
|
11
12
|
it "should has CONTENT_TYPE" do
|
12
|
-
Rango::HttpError.constants.should include(:CONTENT_TYPE)
|
13
|
+
Rango::Exceptions::HttpError.constants.should include(:CONTENT_TYPE)
|
13
14
|
end
|
14
|
-
|
15
|
+
|
15
16
|
it "should xxxxxxxxx" do
|
16
|
-
@class = Class.new(Rango::HttpError)
|
17
|
+
@class = Class.new(Rango::Exceptions::HttpError)
|
17
18
|
-> { @class::STATUS }.should raise_error(NameError, /has to have defined constant STATUS/)
|
18
19
|
end
|
19
20
|
end
|
@@ -51,8 +52,8 @@ describe Rango::HttpError do
|
|
51
52
|
@error.to_snakecase.should eql("not_found")
|
52
53
|
end
|
53
54
|
end
|
54
|
-
|
55
|
-
describe "#
|
55
|
+
|
56
|
+
describe "#to_response" do
|
56
57
|
before(:each) do
|
57
58
|
@status, @headers, @body = @error.to_response
|
58
59
|
end
|
@@ -42,7 +42,7 @@ describe Rango::RenderMixin do
|
|
42
42
|
end
|
43
43
|
|
44
44
|
it "should raise TemplateNotFound if template wasn't found" do
|
45
|
-
-> { render "idonotexist.html" }.should raise_error(Rango::
|
45
|
+
-> { render "idonotexist.html" }.should raise_error(Rango::Exceptions::TemplateNotFound)
|
46
46
|
end
|
47
47
|
end
|
48
48
|
end
|
@@ -30,7 +30,7 @@ describe Rango::Template do
|
|
30
30
|
describe "#render" do
|
31
31
|
it "should raise TemplateNotFound if template can't be found" do
|
32
32
|
template = Rango::Template.new("idonotexist.html")
|
33
|
-
-> { template.render }.should raise_error(Rango::
|
33
|
+
-> { template.render }.should raise_error(Rango::Exceptions::TemplateNotFound)
|
34
34
|
end
|
35
35
|
|
36
36
|
it "should render" do
|
@@ -0,0 +1,52 @@
|
|
1
|
+
#!/usr/bin/env gem build
|
2
|
+
# encoding: utf-8
|
3
|
+
|
4
|
+
require "base64"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "<%= @name %>"
|
8
|
+
spec.version = "0.0.1"
|
9
|
+
spec.authors = ["<%= @full_name %>"]
|
10
|
+
spec.homepage = "http://github.com/<%= @gh_user %>/<%= @name %>"
|
11
|
+
spec.summary = ""
|
12
|
+
spec.description = "" # TODO: long description
|
13
|
+
spec.cert_chain = nil
|
14
|
+
spec.email = "TODO"
|
15
|
+
spec.has_rdoc = true
|
16
|
+
|
17
|
+
# files
|
18
|
+
spec.files = `git ls-files`.split("\n")
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
# Ruby version
|
22
|
+
# NOTE: if you are using JRuby, you have to run jruby --1.9 -S gem install <%= @name %>
|
23
|
+
spec.required_ruby_version = ::Gem::Requirement.new("~> 1.9")
|
24
|
+
|
25
|
+
# dependencies
|
26
|
+
spec.add_dependency "rango", ">= 0.3"
|
27
|
+
spec.add_dependency "pancake"
|
28
|
+
spec.add_dependency "usher"
|
29
|
+
spec.add_dependency "tilt"
|
30
|
+
spec.add_dependency "haml"
|
31
|
+
|
32
|
+
# RubyGems has runtime dependencies (add_dependency) and
|
33
|
+
# development dependencies (add_development_dependency)
|
34
|
+
# Rango isn't a monolithic framework, so you might want
|
35
|
+
# to use just one specific part of it, so it has no sense
|
36
|
+
# to specify dependencies for the whole gem. If you want
|
37
|
+
# to install everything what you need for start with Rango,
|
38
|
+
# just run gem install rango --development
|
39
|
+
|
40
|
+
spec.add_development_dependency "bundler"
|
41
|
+
|
42
|
+
begin
|
43
|
+
require "changelog"
|
44
|
+
rescue LoadError
|
45
|
+
warn "You have to have changelog gem installed for post install message"
|
46
|
+
else
|
47
|
+
spec.post_install_message = CHANGELOG.new.version_changes
|
48
|
+
end
|
49
|
+
|
50
|
+
# RubyForge
|
51
|
+
spec.rubyforge_project = "<%= @name %>"
|
52
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
#!/usr/bin/env gem build
|
2
|
+
# encoding: utf-8
|
3
|
+
|
4
|
+
# You might think this is a terrible mess and guess what, you're
|
5
|
+
# right mate! However say thanks to authors of RubyGems, not me.
|
6
|
+
eval(File.read("<%= @name %>.gemspec")).tap do |specification|
|
7
|
+
specification.version = "#{specification.version}.pre"
|
8
|
+
end
|
File without changes
|
@@ -16,12 +16,19 @@
|
|
16
16
|
gem "rango"#, git: "git://github.com/botanicus/rango.git"
|
17
17
|
gem "rack"#, git: "git://github.com/rack/rack.git"
|
18
18
|
gem "tilt"#, git: "git://github.com/rtomayko/tilt.git"
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
19
|
+
|
20
|
+
gem "nake"#, git: "git://github.com/botanicus/nake.git"
|
21
|
+
<% if @code_cleaner %>
|
22
|
+
gem "code-cleaner"#, git: "git://github.com/botanicus/code-cleaner.git"
|
23
|
+
<% end %>
|
24
|
+
<% if @git_deployer %>
|
25
|
+
gem "git-deployer"#, git: "git://github.com/botanicus/git-deployer.git"
|
23
26
|
<% end %>
|
24
27
|
|
28
|
+
gem "helpers"#, git: "git://github.com/botanicus/helpers.git"
|
29
|
+
# rack middlewares
|
30
|
+
gem "multigiri"#, git: "git://github.com/botanicus/multigiri.git"
|
31
|
+
|
25
32
|
# router
|
26
33
|
<% case @router %>
|
27
34
|
<% when "usher" %>
|
@@ -50,10 +57,18 @@ gem "dm-aggregates"#, git: "git://github.com/datamapper/dm-more.git" # for count
|
|
50
57
|
<% when "sequel" %>
|
51
58
|
gem "sequel"#, git: "git://github.com/jeremyevans/sequel.git"
|
52
59
|
|
60
|
+
<% when "mongomapper" %>
|
61
|
+
gem "mongo_mapper"#, git: "git://github.com/jnunemaker/mongomapper.git"
|
62
|
+
|
53
63
|
<% end %>
|
54
|
-
|
55
|
-
#
|
56
|
-
|
64
|
+
# NOTE: do not use require_as: nil because if you do so, bundler will require the library anyway
|
65
|
+
# Check last section of http://wiki.github.com/merb/merb/howto-using-the-bundler for more informations
|
66
|
+
only(:bundle) do
|
67
|
+
gem "thin"#, git: "git://github.com/macournoyer/thin.git" # there seems to be some problems with latest thin
|
68
|
+
#gem "unicorn"#, git: "git://repo.or.cz/unicorn.git"
|
69
|
+
gem "racksh"#, git: "git://github.com/sickill/racksh.git"
|
70
|
+
gem "shotgun"#, git: "git://github.com/rtomayko/shotgun.git"
|
71
|
+
end
|
57
72
|
<% if @warden %>
|
58
73
|
gem "warden"
|
59
74
|
<% end %>
|
@@ -62,10 +77,6 @@ gem "simple-logger"#, git: "git://github.com/botanicus/simple-logger.git"
|
|
62
77
|
gem "media-path"#, git: "git://github.com/botanicus/media-path.git" # for asset helpers
|
63
78
|
|
64
79
|
# === Environment-Specific Setup === #
|
65
|
-
only(:development) do
|
66
|
-
gem "shotgun", require_as: nil#, git: "git://github.com/rtomayko/shotgun.git"
|
67
|
-
end
|
68
|
-
|
69
80
|
except(:stage, :production) do
|
70
81
|
<% case @orm %>
|
71
82
|
<% when "datamapper" %>
|
@@ -1,65 +1,36 @@
|
|
1
|
-
<%= shebang "./
|
1
|
+
<%= shebang "./bin/shotgun", %w[-p 4000 -s thin] %>
|
2
2
|
# encoding: utf-8
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
#
|
7
|
-
|
8
|
-
#
|
9
|
-
#
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
#
|
14
|
-
#
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
4
|
+
# Shebang:
|
5
|
+
# - bin/shotgun
|
6
|
+
# - bin/rackup
|
7
|
+
|
8
|
+
# Try to keep this file as small as possible.
|
9
|
+
# You should put here rack-specific stuff which means mainly
|
10
|
+
# middleware initialization (Rack::Builder#use) and setting
|
11
|
+
# rack endpoint (Rack::Builder#run). Middleware setup should be placed into rackup.rb
|
12
|
+
|
13
|
+
# In fact
|
14
|
+
# - It's a stupid idea to evaluate the whole file in context of a Rack::Builder instance
|
15
|
+
# - You can't use __END__ in config.ru because of the eval
|
16
|
+
# - File vs. Rack::File
|
17
|
+
|
18
|
+
unless __FILE__.eql?("(eval)")
|
19
|
+
require "init.rb"
|
20
|
+
require "rackup.rb"
|
21
|
+
else
|
22
|
+
puts "~ Running config.ru #{self.inspect}"
|
23
|
+
use Rango::Middlewares::Basic
|
24
|
+
|
25
|
+
# <% if @warden %>
|
26
|
+
# use Warden::Manager do |manager|
|
27
|
+
# manager.default_strategies :password
|
28
|
+
# # Rango::Controller has class method call which will call Rango::Controller.reroute(action),
|
29
|
+
# # for example Login.route_to(:login) which will set login action of Login controller as default
|
30
|
+
# # Internally it just rewrites env["rango.controller"] and env["rango.action"] to "Login", resp. "login"
|
31
|
+
# manager.failure_app = Login
|
32
|
+
# end
|
33
|
+
#
|
34
|
+
# <% end %>
|
35
|
+
run lambda { |env| [200, Hash.new, ["hey"]] }
|
23
36
|
end
|
24
|
-
|
25
|
-
# See also wiki.github.com/hassox/warden/callbacks
|
26
|
-
Warden::Manager.serialize_into_session { |user| user.id }
|
27
|
-
Warden::Manager.serialize_from_session { |key| User.get(id) }
|
28
|
-
|
29
|
-
# Go to login
|
30
|
-
Warden::Manager.before_failure do |env, opts|
|
31
|
-
Login.route_to env, "login"
|
32
|
-
end
|
33
|
-
|
34
|
-
Warden::Strategies.add(:password) do
|
35
|
-
def authenticate!
|
36
|
-
User.new # TODO
|
37
|
-
end
|
38
|
-
end
|
39
|
-
<% end %>
|
40
|
-
|
41
|
-
# http://wiki.github.com/botanicus/rango/routers
|
42
|
-
Rango::Router.use(:<%= @router.to_sym %>)
|
43
|
-
|
44
|
-
<% case @router %>
|
45
|
-
<% when "usher" %>
|
46
|
-
# http://github.com/joshbuddy/usher
|
47
|
-
Rango::Router.app = Usher::Interface.for(:rack) do
|
48
|
-
get("/").to(<%= @name.camel_case %>::ShowCase.dispatcher(:index)).name(:showcase)
|
49
|
-
end
|
50
|
-
<% when "rack-mount" %>
|
51
|
-
# http://github.com/josh/rack-mount
|
52
|
-
Rango::Router.app = Rack::Mount::RouteSet.new do |set|
|
53
|
-
# add_route takes a rack application and conditions to match with
|
54
|
-
# conditions may be strings or regexps
|
55
|
-
# See Rack::Mount::RouteSet#add_route for more options.
|
56
|
-
set.add_route <%= @name.camel_case %>::ShowCase.dispatcher(:index), method: "get", path: "/"
|
57
|
-
end
|
58
|
-
<% when "rack-router" %>
|
59
|
-
# TODO: routes
|
60
|
-
<% when "urlmap" %>
|
61
|
-
# TODO: routes
|
62
|
-
<% end %>
|
63
|
-
|
64
|
-
use Rango::Middlewares::Basic
|
65
|
-
run Rango::Router.app
|
File without changes
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<% if
|
1
|
+
<% if RUBY_PLATFORM.eql?("java") %>
|
2
2
|
<%= shebang rubypath, ["--1.9", "--disable-gems"] %>
|
3
3
|
<% else %>
|
4
4
|
<%= shebang rubypath, ["--disable-gems"] %>
|
@@ -20,44 +20,19 @@ rescue LoadError => exception
|
|
20
20
|
abort "LoadError during loading gems/environment: #{exception.message}\nRun gem bundle to fix it."
|
21
21
|
end
|
22
22
|
|
23
|
-
require "rango
|
23
|
+
require "rango"
|
24
24
|
|
25
|
-
#
|
26
|
-
|
25
|
+
# we need to load dependencies before boot, so bootloaders will be called
|
26
|
+
Rango.logger.info("Loading dependencies for #{Rango.environment}")
|
27
|
+
Bundler.require_env(Rango.environment)
|
28
|
+
Rango.boot
|
27
29
|
|
28
|
-
|
29
|
-
ENV["RACK_ENV"] = (RACK_ENV ||= environment)
|
30
|
-
unless %w[test development stage production].include?(environment)
|
31
|
-
abort "Unknown environment: #{environment}"
|
32
|
-
end
|
30
|
+
$LOAD_PATH.unshift(File.expand_path("../lib", __FILE__))
|
33
31
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
require_relative "environments"
|
42
|
-
|
43
|
-
# register applications
|
44
|
-
require_relative "views.rb"
|
45
|
-
require_relative "models.rb"
|
46
|
-
|
47
|
-
# if you will run this script with -i argument, interactive session will begin
|
48
|
-
Rango.interactive if ARGV.delete("-i")
|
49
|
-
|
50
|
-
# so it can work as a runner
|
51
|
-
# ./init.rb: start webserver
|
52
|
-
if ARGV.length > 0 && $0.eql?(__FILE__)
|
53
|
-
# config.ru
|
54
|
-
if ARGV.last.split(".").last.eql?("ru")
|
55
|
-
if Rango.development?
|
56
|
-
load File.join(File.dirname(__FILE__), "bin", "shotgun")
|
57
|
-
else
|
58
|
-
load File.join(File.dirname(__FILE__), "bin", "rackup")
|
59
|
-
end
|
60
|
-
else
|
61
|
-
load ARGV.shift
|
62
|
-
end
|
63
|
-
end
|
32
|
+
require "<%= name %>"
|
33
|
+
|
34
|
+
# Available arguments:
|
35
|
+
# ./init.rb -i
|
36
|
+
# ./init.rb -i file
|
37
|
+
# ./init.rb file
|
38
|
+
Rango.parse(ARGV)
|
File without changes
|
@@ -1,5 +1,8 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
+
# http://wiki.github.com/botanicus/rango/environments-support
|
4
|
+
require "rango/environments"
|
5
|
+
|
3
6
|
# database connection
|
4
7
|
<% case @orm %>
|
5
8
|
<% when "sequel" %>
|
@@ -17,6 +20,8 @@ when "development", "production", "staging"
|
|
17
20
|
when "test", "spec", "cucumber"
|
18
21
|
DataMapper.setup(:default, "sqlite3::memory:")
|
19
22
|
end
|
23
|
+
<% when "mongomapper" %>
|
24
|
+
MongoMapper.database = "#{Rango.environment}"
|
20
25
|
<% end %>
|
21
26
|
|
22
27
|
if Rango.development?
|
File without changes
|
File without changes
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# http://wiki.github.com/botanicus/rango/routers
|
4
|
+
Rango::Router.use(:<%= @router.to_sym %>)
|
5
|
+
|
6
|
+
<% case @router %>
|
7
|
+
<% when "usher" %>
|
8
|
+
# http://github.com/joshbuddy/usher
|
9
|
+
Rango::Router.app = Usher::Interface.for(:rack) do
|
10
|
+
get("/").to(<%= @name.camel_case %>::ShowCase.dispatcher(:index)).name(:showcase)
|
11
|
+
end
|
12
|
+
<% when "rack-mount" %>
|
13
|
+
# http://github.com/josh/rack-mount
|
14
|
+
Rango::Router.app = Rack::Mount::RouteSet.new do |set|
|
15
|
+
# add_route takes a rack application and conditions to match with
|
16
|
+
# conditions may be strings or regexps
|
17
|
+
# See Rack::Mount::RouteSet#add_route for more options.
|
18
|
+
set.add_route <%= @name.camel_case %>::ShowCase.dispatcher(:index), method: "get", path: "/"
|
19
|
+
end
|
20
|
+
<% when "rack-router" %>
|
21
|
+
# TODO: routes
|
22
|
+
<% when "urlmap" %>
|
23
|
+
# TODO: routes
|
24
|
+
<% end %>
|
@@ -15,6 +15,13 @@ module <%= @name.camel_case %>
|
|
15
15
|
# TODO: implement <%= model %> model
|
16
16
|
end
|
17
17
|
|
18
|
+
<% when "mongomapper" %>
|
19
|
+
class <%= model.camel_case %>
|
20
|
+
include MongoMapper::Document
|
21
|
+
key :title, String
|
22
|
+
key :slug, String, index: true
|
23
|
+
end
|
24
|
+
|
18
25
|
<% end %>
|
19
26
|
<% end %>
|
20
27
|
end
|