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
@@ -0,0 +1,17 @@
|
|
1
|
+
# Sets the default handler for FastCGI scripts
|
2
|
+
AddHandler fastcgi-script .fcgi
|
3
|
+
|
4
|
+
# If Apache2 is used together with mod_fcgid,
|
5
|
+
# uncomment the line below and comment in the line
|
6
|
+
# above to set the correct script handler
|
7
|
+
#AddHandler fcgid-script .fcgi
|
8
|
+
|
9
|
+
RewriteEngine On
|
10
|
+
|
11
|
+
RewriteRule ^$ index.html [QSA]
|
12
|
+
RewriteRule ^([^.]+)$ $1.html [QSA]
|
13
|
+
RewriteCond %{REQUEST_FILENAME} !-f
|
14
|
+
RewriteRule ^(.*)$ merb.fcgi [QSA,L]
|
15
|
+
|
16
|
+
|
17
|
+
ErrorDocument 500 "<h2>Application Error</h2>Merb could not be reached"
|
Binary file
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
// Common JavaScript code across your application goes here.
|
@@ -0,0 +1,22 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'merb-core'
|
5
|
+
|
6
|
+
# this is Merb.root, change this if you have some funky setup.
|
7
|
+
merb_root = File.expand_path(File.dirname(__FILE__) / '../')
|
8
|
+
|
9
|
+
# If the fcgi process runs as apache, make sure
|
10
|
+
# we have an inlinedir set for Rubyinline action-args to work
|
11
|
+
unless ENV["INLINEDIR"] || ENV["HOME"]
|
12
|
+
tmpdir = merb_root / "tmp"
|
13
|
+
unless File.directory?(tmpdir)
|
14
|
+
Dir.mkdir(tmpdir)
|
15
|
+
end
|
16
|
+
ENV["INLINEDIR"] = tmpdir
|
17
|
+
end
|
18
|
+
|
19
|
+
# start merb with the fcgi adapter, add options or change the log dir here
|
20
|
+
Merb.start(:adapter => 'fcgi',
|
21
|
+
:merb_root => merb_root,
|
22
|
+
:log_file => merb_root /'log'/'merb.log')
|
@@ -0,0 +1,119 @@
|
|
1
|
+
body {
|
2
|
+
font-family: Arial, Verdana, sans-serif;
|
3
|
+
font-size: 12px;
|
4
|
+
background-color: #fff;
|
5
|
+
}
|
6
|
+
* {
|
7
|
+
margin: 0px;
|
8
|
+
padding: 0px;
|
9
|
+
text-decoration: none;
|
10
|
+
}
|
11
|
+
html {
|
12
|
+
height: 100%;
|
13
|
+
margin-bottom: 1px;
|
14
|
+
}
|
15
|
+
#container {
|
16
|
+
width: 80%;
|
17
|
+
text-align: left;
|
18
|
+
background-color: #fff;
|
19
|
+
margin-right: auto;
|
20
|
+
margin-left: auto;
|
21
|
+
}
|
22
|
+
#header-container {
|
23
|
+
width: 100%;
|
24
|
+
padding-top: 15px;
|
25
|
+
}
|
26
|
+
#header-container h1, #header-container h2 {
|
27
|
+
margin-left: 6px;
|
28
|
+
margin-bottom: 6px;
|
29
|
+
}
|
30
|
+
.spacer {
|
31
|
+
width: 100%;
|
32
|
+
height: 15px;
|
33
|
+
}
|
34
|
+
hr {
|
35
|
+
border: 0px;
|
36
|
+
color: #ccc;
|
37
|
+
background-color: #cdcdcd;
|
38
|
+
height: 1px;
|
39
|
+
width: 100%;
|
40
|
+
text-align: left;
|
41
|
+
}
|
42
|
+
h1 {
|
43
|
+
font-size: 28px;
|
44
|
+
color: #c55;
|
45
|
+
background-color: #fff;
|
46
|
+
font-family: Arial, Verdana, sans-serif;
|
47
|
+
font-weight: 300;
|
48
|
+
}
|
49
|
+
h2 {
|
50
|
+
font-size: 15px;
|
51
|
+
color: #999;
|
52
|
+
font-family: Arial, Verdana, sans-serif;
|
53
|
+
font-weight: 300;
|
54
|
+
background-color: #fff;
|
55
|
+
}
|
56
|
+
h3 {
|
57
|
+
color: #4d9b12;
|
58
|
+
font-size: 15px;
|
59
|
+
text-align: left;
|
60
|
+
font-weight: 300;
|
61
|
+
padding: 5px;
|
62
|
+
margin-top: 5px;
|
63
|
+
}
|
64
|
+
|
65
|
+
#left-container {
|
66
|
+
float: left;
|
67
|
+
width: 250px;
|
68
|
+
background-color: #FFFFFF;
|
69
|
+
color: black;
|
70
|
+
}
|
71
|
+
|
72
|
+
#left-container h3 {
|
73
|
+
color: #c55;
|
74
|
+
}
|
75
|
+
|
76
|
+
#main-container {
|
77
|
+
margin: 5px 5px 5px 260px;
|
78
|
+
padding: 15px;
|
79
|
+
border-left: 1px solid silver;
|
80
|
+
min-height: 400px;
|
81
|
+
}
|
82
|
+
p {
|
83
|
+
color: #000;
|
84
|
+
background-color: #fff;
|
85
|
+
line-height: 20px;
|
86
|
+
padding: 5px;
|
87
|
+
}
|
88
|
+
a {
|
89
|
+
color: #4d9b12;
|
90
|
+
background-color: #fff;
|
91
|
+
text-decoration: none;
|
92
|
+
}
|
93
|
+
a:hover {
|
94
|
+
color: #4d9b12;
|
95
|
+
background-color: #fff;
|
96
|
+
text-decoration: underline;
|
97
|
+
}
|
98
|
+
#footer-container {
|
99
|
+
clear: both;
|
100
|
+
font-size: 12px;
|
101
|
+
font-family: Verdana, Arial, sans-serif;
|
102
|
+
}
|
103
|
+
.right {
|
104
|
+
float: right;
|
105
|
+
font-size: 100%;
|
106
|
+
margin-top: 5px;
|
107
|
+
color: #999;
|
108
|
+
background-color: #fff;
|
109
|
+
}
|
110
|
+
.left {
|
111
|
+
float: left;
|
112
|
+
font-size: 100%;
|
113
|
+
margin-top: 5px;
|
114
|
+
color: #999;
|
115
|
+
background-color: #fff;
|
116
|
+
}
|
117
|
+
#main-container ul {
|
118
|
+
margin-left: 3.0em;
|
119
|
+
}
|
File without changes
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require "rubygems"
|
4
|
+
|
5
|
+
# Add the local gems dir if found within the app root; any dependencies loaded
|
6
|
+
# hereafter will try to load from the local gems before loading system gems.
|
7
|
+
if (local_gem_dir = File.join(File.dirname(__FILE__), '..', 'gems')) && $BUNDLE.nil?
|
8
|
+
$BUNDLE = true; Gem.clear_paths; Gem.path.unshift(local_gem_dir)
|
9
|
+
end
|
10
|
+
|
11
|
+
require "merb-core"
|
12
|
+
require "spec" # Satisfies Autotest and anyone else not using the Rake tasks
|
13
|
+
|
14
|
+
# this loads all plugins required in your init file so don't add them
|
15
|
+
# here again, Merb will do it for you
|
16
|
+
Merb.start_environment(:testing => true, :adapter => 'runner', :environment => ENV['MERB_ENV'] || 'test')
|
17
|
+
|
18
|
+
Spec::Runner.configure do |config|
|
19
|
+
config.include(Merb::Test::ViewHelper)
|
20
|
+
config.include(Merb::Test::RouteHelper)
|
21
|
+
config.include(Merb::Test::ControllerHelper)
|
22
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
#!/usr/bin/env ruby
|
4
|
+
|
5
|
+
# This was added by Merb's bundler
|
6
|
+
|
7
|
+
require "rubygems"
|
8
|
+
require File.join(File.dirname(__FILE__), "common")
|
9
|
+
|
10
|
+
gems_dir = File.join(File.dirname(__FILE__), '..', 'gems')
|
11
|
+
|
12
|
+
if File.directory?(gems_dir)
|
13
|
+
$BUNDLE = true
|
14
|
+
Gem.clear_paths
|
15
|
+
Gem.path.replace([File.expand_path(gems_dir)])
|
16
|
+
ENV["PATH"] = "#{File.dirname(__FILE__)}:#{ENV["PATH"]}"
|
17
|
+
|
18
|
+
gem_file = File.join(gems_dir, "specifications", "<%= spec.name %>-*.gemspec")
|
19
|
+
|
20
|
+
if local_gem = Dir[gem_file].last
|
21
|
+
version = File.basename(local_gem)[/-([\.\d]+)\.gemspec$/, 1]
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
version ||= "<%= Gem::Requirement.default %>"
|
26
|
+
|
27
|
+
if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
|
28
|
+
version = $1
|
29
|
+
ARGV.shift
|
30
|
+
end
|
31
|
+
|
32
|
+
gem '<%= @spec.name %>', version
|
33
|
+
load '<%= bin_file_name %>'
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# This was added via Merb's bundler
|
4
|
+
|
5
|
+
require "rubygems"
|
6
|
+
require "rubygems/source_index"
|
7
|
+
|
8
|
+
module Gem
|
9
|
+
BUNDLED_SPECS = File.join(Dir.pwd, "gems", "specifications")
|
10
|
+
MAIN_INDEX = Gem::SourceIndex.from_gems_in(BUNDLED_SPECS)
|
11
|
+
FALLBACK_INDEX = Gem::SourceIndex.from_installed_gems
|
12
|
+
|
13
|
+
def self.source_index
|
14
|
+
MultiSourceIndex.new
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.searcher
|
18
|
+
MultiPathSearcher.new
|
19
|
+
end
|
20
|
+
|
21
|
+
class ArbitrarySearcher < GemPathSearcher
|
22
|
+
def initialize(source_index)
|
23
|
+
@source_index = source_index
|
24
|
+
super()
|
25
|
+
end
|
26
|
+
|
27
|
+
def init_gemspecs
|
28
|
+
@source_index.map { |_, spec| spec }.sort { |a,b|
|
29
|
+
(a.name <=> b.name).nonzero? || (b.version <=> a.version)
|
30
|
+
}
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
class MultiPathSearcher
|
35
|
+
def initialize
|
36
|
+
@main_searcher = ArbitrarySearcher.new(MAIN_INDEX)
|
37
|
+
@fallback_searcher = ArbitrarySearcher.new(FALLBACK_INDEX)
|
38
|
+
end
|
39
|
+
|
40
|
+
def find(path)
|
41
|
+
try = @main_searcher.find(path)
|
42
|
+
return try if try
|
43
|
+
@fallback_searcher.find(path)
|
44
|
+
end
|
45
|
+
|
46
|
+
def find_all(path)
|
47
|
+
try = @main_searcher.find_all(path)
|
48
|
+
return try unless try.empty?
|
49
|
+
@fallback_searcher.find_all(path)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
class MultiSourceIndex
|
54
|
+
# Used by merb.thor to confirm; not needed when MSI is in use
|
55
|
+
def load_gems_in(*args)
|
56
|
+
end
|
57
|
+
|
58
|
+
def search(*args)
|
59
|
+
try = MAIN_INDEX.search(*args)
|
60
|
+
return try unless try.empty?
|
61
|
+
FALLBACK_INDEX.search(*args)
|
62
|
+
end
|
63
|
+
|
64
|
+
def find_name(*args)
|
65
|
+
try = MAIN_INDEX.find_name(*args)
|
66
|
+
return try unless try.empty?
|
67
|
+
FALLBACK_INDEX.find_name(*args)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,127 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require "erb"
|
4
|
+
|
5
|
+
Gem.pre_install_hooks.push(proc do |installer|
|
6
|
+
unless File.file?(installer.bin_dir / "common.rb")
|
7
|
+
FileUtils.mkdir_p(installer.bin_dir)
|
8
|
+
FileUtils.cp(File.dirname(__FILE__) / "common.rb", installer.bin_dir / "common.rb")
|
9
|
+
end
|
10
|
+
|
11
|
+
include ColorfulMessages
|
12
|
+
name = installer.spec.name
|
13
|
+
if $GEMS && versions = ($GEMS.assoc(name) || [])[1]
|
14
|
+
dep = Gem::Dependency.new(name, versions)
|
15
|
+
unless dep.version_requirements.satisfied_by?(installer.spec.version)
|
16
|
+
error "Cannot install #{installer.spec.full_name} " \
|
17
|
+
"for #{$INSTALLING}; " \
|
18
|
+
"you required #{dep}"
|
19
|
+
::Thor::Tasks::Merb::Gem.rollback_trans
|
20
|
+
exit!
|
21
|
+
end
|
22
|
+
end
|
23
|
+
success "Installing #{installer.spec.full_name}"
|
24
|
+
end)
|
25
|
+
|
26
|
+
class ::Gem::Uninstaller
|
27
|
+
def self._with_silent_ui
|
28
|
+
|
29
|
+
ui = Gem::DefaultUserInteraction.ui
|
30
|
+
def ui.say(str)
|
31
|
+
puts "- #{str}"
|
32
|
+
end
|
33
|
+
|
34
|
+
yield
|
35
|
+
|
36
|
+
class << Gem::DefaultUserInteraction.ui
|
37
|
+
remove_method :say
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def self._uninstall(source_index, name, op, version)
|
42
|
+
unless source_index.find_name(name, "#{op} #{version}").empty?
|
43
|
+
uninstaller = Gem::Uninstaller.new(
|
44
|
+
name,
|
45
|
+
:version => "#{op} #{version}",
|
46
|
+
:install_dir => Dir.pwd / "gems",
|
47
|
+
:all => true,
|
48
|
+
:ignore => true
|
49
|
+
)
|
50
|
+
_with_silent_ui { uninstaller.uninstall }
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def self._uninstall_others(source_index, name, version)
|
55
|
+
_uninstall(source_index, name, "<", version)
|
56
|
+
_uninstall(source_index, name, ">", version)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
Gem.post_install_hooks.push(proc do |installer|
|
61
|
+
source_index = installer.instance_variable_get("@source_index")
|
62
|
+
::Gem::Uninstaller._uninstall_others(
|
63
|
+
source_index, installer.spec.name, installer.spec.version
|
64
|
+
)
|
65
|
+
end)
|
66
|
+
|
67
|
+
class ::Gem::DependencyInstaller
|
68
|
+
alias old_fg find_gems_with_sources
|
69
|
+
|
70
|
+
def find_gems_with_sources(dep)
|
71
|
+
if @source_index.any? { |_, installed_spec|
|
72
|
+
installed_spec.satisfies_requirement?(dep)
|
73
|
+
}
|
74
|
+
return []
|
75
|
+
end
|
76
|
+
|
77
|
+
old_fg(dep)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
class ::Gem::SpecFetcher
|
82
|
+
alias old_fetch fetch
|
83
|
+
def fetch(dependency, all = false, matching_platform = true)
|
84
|
+
idx = Gem::SourceIndex.from_installed_gems
|
85
|
+
|
86
|
+
reqs = dependency.version_requirements.requirements
|
87
|
+
|
88
|
+
if reqs.size == 1 && reqs[0][0] == "="
|
89
|
+
dep = idx.search(dependency).sort.last
|
90
|
+
end
|
91
|
+
|
92
|
+
if dep
|
93
|
+
file = dep.loaded_from.dup
|
94
|
+
file.gsub!(/specifications/, "cache")
|
95
|
+
file.gsub!(/gemspec$/, "gem")
|
96
|
+
spec = ::Gem::Format.from_file_by_path(file).spec
|
97
|
+
[[spec, file]]
|
98
|
+
else
|
99
|
+
old_fetch(dependency, all, matching_platform)
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
class ::Gem::Installer
|
105
|
+
def app_script_text(bin_file_name)
|
106
|
+
template = File.read(File.dirname(__FILE__) / "app_script.rb")
|
107
|
+
erb = ERB.new(template)
|
108
|
+
erb.result(binding)
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
class ::Gem::Specification
|
113
|
+
def recursive_dependencies(from, index = Gem.source_index)
|
114
|
+
specs = self.runtime_dependencies.map do |dep|
|
115
|
+
spec = index.search(dep).last
|
116
|
+
unless spec
|
117
|
+
from_name = from.is_a?(::Gem::Specification) ? from.full_name : from.to_s
|
118
|
+
wider_net = index.find_name(dep.name).last
|
119
|
+
ThorUI.error "Needed #{dep} for #{from_name}, but could not find it"
|
120
|
+
ThorUI.error "Found #{wider_net.full_name}" if wider_net
|
121
|
+
::Thor::Tasks::Merb::Gem.rollback_trans
|
122
|
+
end
|
123
|
+
spec
|
124
|
+
end
|
125
|
+
specs + specs.map {|s| s.recursive_dependencies(self, index)}.flatten.uniq
|
126
|
+
end
|
127
|
+
end
|
@@ -0,0 +1,152 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require "rubygems"
|
4
|
+
require "rubygems/source_index"
|
5
|
+
require "rubygems/dependency_installer"
|
6
|
+
require "rubygems/uninstaller"
|
7
|
+
require "fileutils"
|
8
|
+
require File.join(File.dirname(__FILE__), "utils")
|
9
|
+
require File.join(File.dirname(__FILE__), "gem_ext")
|
10
|
+
require File.join(File.dirname(__FILE__), "ops")
|
11
|
+
|
12
|
+
$INSTALLING = []
|
13
|
+
|
14
|
+
module Merb
|
15
|
+
|
16
|
+
class Gem < Thor
|
17
|
+
extend ColorfulMessages
|
18
|
+
|
19
|
+
def initialize
|
20
|
+
dirs = [Dir.pwd, File.dirname(__FILE__) / ".."]
|
21
|
+
root = dirs.find {|d| File.file?(d / "config" / "dependencies.rb")}
|
22
|
+
|
23
|
+
if root
|
24
|
+
@depsrb = root / "config" / "dependencies.rb"
|
25
|
+
else
|
26
|
+
self.class.error "dependencies.rb was not found"
|
27
|
+
exit!
|
28
|
+
end
|
29
|
+
|
30
|
+
FileUtils.mkdir_p(Dir.pwd / "gems")
|
31
|
+
|
32
|
+
@list = Collector.collect(File.read(@depsrb))
|
33
|
+
@idx = ::Gem::SourceIndex.new.load_gems_in("gems/specifications")
|
34
|
+
end
|
35
|
+
|
36
|
+
def list
|
37
|
+
require "pp"
|
38
|
+
pp @list
|
39
|
+
end
|
40
|
+
|
41
|
+
desc "redeploy", "Syncs up gems/cache with gems/gems. All gems in the cache " \
|
42
|
+
"that are not already installed will be installed from the " \
|
43
|
+
"cache. All installed gems that are not in the cache will " \
|
44
|
+
"be uninstalled."
|
45
|
+
def redeploy
|
46
|
+
gem_dir = Dir.pwd / "gems" / "gems"
|
47
|
+
cache_dir = Dir.pwd / "gems" / "cache"
|
48
|
+
|
49
|
+
gems = Dir[gem_dir / "*"].map! {|n| File.basename(n)}
|
50
|
+
cache = Dir[cache_dir / "*.gem"].map! {|n| File.basename(n, ".gem")}
|
51
|
+
new_gems = cache - gems
|
52
|
+
outdated = gems - cache
|
53
|
+
idx = ::Gem::SourceIndex.new
|
54
|
+
idx.load_gems_in(Dir.pwd / "gems" / "specifications")
|
55
|
+
|
56
|
+
new_gems.each do |g|
|
57
|
+
installer = ::Gem::Installer.new(cache_dir / "#{g}.gem",
|
58
|
+
:bin_dir => Dir.pwd / "bin",
|
59
|
+
:install_dir => Dir.pwd / "gems",
|
60
|
+
:ignore_dependencies => true,
|
61
|
+
:user_install => false,
|
62
|
+
:wrappers => true,
|
63
|
+
:source_index => idx)
|
64
|
+
|
65
|
+
installer.install
|
66
|
+
end
|
67
|
+
|
68
|
+
outdated.each do |g|
|
69
|
+
/(.*)\-(.*)/ =~ g
|
70
|
+
name, version = $1, $2
|
71
|
+
uninstaller = ::Gem::Uninstaller.new(name,
|
72
|
+
:version => version,
|
73
|
+
:bin_dir => Dir.pwd / "bin",
|
74
|
+
:install_dir => Dir.pwd / "gems",
|
75
|
+
:ignore => true,
|
76
|
+
:executables => true
|
77
|
+
)
|
78
|
+
uninstaller.uninstall
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
desc "confirm", "Confirm the current setup. merb:gem:install will " \
|
83
|
+
"automatically run this task before committing the " \
|
84
|
+
"changes it makes."
|
85
|
+
def confirm(gems = @list)
|
86
|
+
::Gem.path.replace([Dir.pwd / "gems"])
|
87
|
+
::Gem.source_index.load_gems_in(Dir.pwd / "gems" / "specifications")
|
88
|
+
|
89
|
+
self.class.info "Confirming configuration..."
|
90
|
+
|
91
|
+
::Gem.loaded_specs.clear
|
92
|
+
|
93
|
+
begin
|
94
|
+
gems.each do |name, versions|
|
95
|
+
versions ||= []
|
96
|
+
::Gem.activate name, *versions
|
97
|
+
end
|
98
|
+
rescue ::Gem::LoadError => e
|
99
|
+
self.class.error "Configuration could not be confirmed: #{e.message}"
|
100
|
+
self.class.rollback_trans
|
101
|
+
end
|
102
|
+
self.class.info "Confirmed"
|
103
|
+
end
|
104
|
+
|
105
|
+
desc 'install', 'Sync up your bundled gems with the list in config/dependencies.rb'
|
106
|
+
def install(*gems)
|
107
|
+
if gems.empty?
|
108
|
+
gems = @list
|
109
|
+
else
|
110
|
+
gems = gems.map {|desc| name, *versions = desc.split(" ") }
|
111
|
+
end
|
112
|
+
|
113
|
+
$GEMS = gems
|
114
|
+
|
115
|
+
self.class.begin_trans
|
116
|
+
|
117
|
+
gems.each do |name, versions|
|
118
|
+
dep = ::Gem::Dependency.new(name, versions || [])
|
119
|
+
unless @idx.search(dep).empty?
|
120
|
+
next
|
121
|
+
end
|
122
|
+
|
123
|
+
rescue_failures do
|
124
|
+
$INSTALLING = dep
|
125
|
+
_install(dep)
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
gem_dir = Dir.pwd / "gems" / "gems"
|
130
|
+
installed_gems = Dir[gem_dir / "*"].map! {|n| File.basename(n)}
|
131
|
+
|
132
|
+
list = full_list.map {|x| x.full_name}.compact
|
133
|
+
|
134
|
+
(installed_gems - list).each do |g|
|
135
|
+
/^(.*)\-(.*)$/ =~ g
|
136
|
+
name, version = $1, $2
|
137
|
+
uninstaller = ::Gem::Uninstaller.new(name,
|
138
|
+
:version => version,
|
139
|
+
:bin_dir => (Dir.pwd / "bin").to_s,
|
140
|
+
:install_dir => (Dir.pwd / "gems").to_s,
|
141
|
+
:ignore => true,
|
142
|
+
:executables => true
|
143
|
+
)
|
144
|
+
uninstaller.uninstall
|
145
|
+
end
|
146
|
+
|
147
|
+
confirm(gems)
|
148
|
+
|
149
|
+
self.class.commit_trans
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|