pupu 0.1.pre → 0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +9 -0
- data/CHANGELOG +23 -4
- data/Gemfile +9 -0
- data/LICENSE +1 -1
- data/README.textile +3 -3
- data/TODO.txt +8 -3
- data/bin/pupu +19 -24
- data/examples/merb/.gitignore +17 -0
- data/examples/merb/Gemfile +27 -0
- data/examples/merb/README.textile +3 -5
- data/examples/merb/Rakefile +3 -3
- data/examples/merb/config/framework.rb +4 -4
- data/examples/merb/config/init.rb +7 -0
- data/examples/merb/public/pupu/autocompleter/.gitignore +5 -0
- data/examples/merb/public/pupu/autocompleter/README.textile +2 -2
- data/examples/merb/public/pupu/autocompleter/config.rb +1 -1
- data/examples/merb/public/pupu/blueprint/.gitignore +5 -0
- data/examples/merb/public/pupu/blueprint/config.rb +7 -7
- data/examples/merb/public/pupu/flash/.gitignore +5 -0
- data/examples/merb/public/pupu/flash/config.rb +1 -1
- data/examples/merb/public/pupu/lighter/.gitignore +10 -0
- data/examples/merb/public/pupu/lighter/config.rb +2 -2
- data/{spec/pupu/adapters/merb_spec.rb → examples/merb/public/pupu/lighter/images/.gitignore} +0 -0
- data/examples/merb/public/pupu/mootools/.gitignore +5 -0
- data/examples/merb/public/pupu/mootools/README.textile +1 -1
- data/examples/merb/public/pupu/mootools/config.rb +1 -1
- data/examples/rails/.gitignore +7 -0
- data/examples/rails/Gemfile +28 -0
- data/examples/rails/README.textile +5 -0
- data/examples/rails/Rakefile +10 -0
- data/examples/rails/app/controllers/application_controller.rb +10 -0
- data/examples/rails/app/controllers/home_controller.rb +8 -0
- data/examples/rails/app/helpers/application_helper.rb +3 -0
- data/{spec/pupu/adapters/rango_spec.rb → examples/rails/app/views/examples/arguments.html.erb} +0 -0
- data/examples/rails/app/views/examples/dependencies.html.erb +0 -0
- data/examples/rails/app/views/examples/simple.html.erb +4 -0
- data/examples/rails/app/views/index.html.erb +7 -0
- data/examples/rails/app/views/layout.html.erb +12 -0
- data/examples/rails/config/boot.rb +110 -0
- data/examples/rails/config/environment.rb +55 -0
- data/examples/rails/config/environments/development.rb +17 -0
- data/examples/rails/config/environments/production.rb +28 -0
- data/examples/rails/config/environments/test.rb +28 -0
- data/examples/rails/config/initializers/backtrace_silencers.rb +7 -0
- data/examples/rails/config/initializers/inflections.rb +10 -0
- data/examples/rails/config/initializers/mime_types.rb +5 -0
- data/examples/rails/config/initializers/new_rails_defaults.rb +21 -0
- data/examples/rails/config/initializers/session_store.rb +15 -0
- data/examples/rails/config/routes.rb +43 -0
- data/examples/rails/db/seeds.rb +7 -0
- data/examples/rails/public/404.html +30 -0
- data/examples/rails/public/422.html +30 -0
- data/examples/rails/public/500.html +30 -0
- data/examples/rails/public/favicon.ico +0 -0
- data/examples/rails/public/robots.txt +5 -0
- data/examples/rails/script/about +4 -0
- data/examples/rails/script/console +3 -0
- data/examples/rails/script/dbconsole +3 -0
- data/examples/rails/script/destroy +3 -0
- data/examples/rails/script/generate +3 -0
- data/examples/rails/script/performance/benchmarker +3 -0
- data/examples/rails/script/performance/profiler +3 -0
- data/examples/rails/script/plugin +3 -0
- data/examples/rails/script/runner +3 -0
- data/examples/rails/script/server +3 -0
- data/examples/rails/spec/application_spec.rb +37 -0
- data/examples/rails/spec/spec_helper.rb +0 -0
- data/examples/rango/.gitignore +4 -0
- data/examples/rango/Gemfile +56 -0
- data/examples/rango/README.textile +4 -6
- data/examples/rango/init.rb +7 -0
- data/examples/rango/media/pupu/autocompleter/.gitignore +5 -0
- data/examples/rango/media/pupu/autocompleter/README.textile +2 -2
- data/examples/rango/media/pupu/autocompleter/config.rb +1 -1
- data/examples/rango/media/pupu/blueprint/.gitignore +5 -0
- data/examples/rango/media/pupu/blueprint/config.rb +7 -7
- data/examples/rango/media/pupu/flash/.gitignore +5 -0
- data/examples/rango/media/pupu/flash/config.rb +1 -1
- data/examples/rango/media/pupu/lighter/.gitignore +10 -0
- data/examples/rango/media/pupu/lighter/config.rb +2 -2
- data/examples/rango/media/pupu/lighter/images/.gitignore +0 -0
- data/examples/rango/media/pupu/mootools/.gitignore +5 -0
- data/examples/rango/media/pupu/mootools/README.textile +1 -1
- data/examples/rango/media/pupu/mootools/config.rb +1 -1
- data/gems/cache/media-path-0.1.2.gem +0 -0
- data/gems/cache/nake-0.0.8.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/lib/pupu.rb +2 -1
- data/lib/pupu/adapters/merb.rb +12 -0
- data/lib/pupu/adapters/rails.rb +12 -0
- data/lib/pupu/adapters/rango.rb +25 -3
- data/lib/pupu/cli.rb +13 -11
- data/lib/pupu/dsl.rb +34 -13
- data/lib/pupu/exceptions.rb +5 -0
- data/lib/pupu/github.rb +26 -14
- data/lib/pupu/helpers.rb +8 -2
- data/lib/pupu/metadata.rb +2 -0
- data/lib/pupu/parser.rb +19 -4
- data/lib/pupu/pupu.rb +53 -27
- data/lib/pupu/tasks/pupu.nake +52 -0
- data/lib/pupu/version.rb +1 -3
- data/pupu.gemspec +15 -7
- data/pupu.pre.gemspec +5 -33
- data/spec/data/public/pupu/autocompleter/.gitignore +5 -0
- data/spec/data/public/pupu/autocompleter/README.textile +2 -2
- data/spec/data/public/pupu/autocompleter/config.rb +3 -1
- data/spec/pupu/dsl_spec.rb +3 -0
- data/spec/pupu/exceptions_spec.rb +3 -0
- data/spec/pupu/github_spec.rb +4 -1
- data/spec/pupu/helpers_spec.rb +5 -2
- data/spec/pupu/metadata_spec.rb +3 -0
- data/spec/pupu/parser_spec.rb +4 -1
- data/spec/pupu/pupu_spec.rb +3 -0
- data/stubs/pupu/content/%name%.gemspec.rbt +47 -0
- data/stubs/pupu/content/%name%.pre.gemspec.rbt +8 -0
- data/stubs/pupu/content/.gitignore +12 -0
- data/stubs/pupu/content/config.rb.rbt +3 -1
- data/stubs/pupu/content/deps.rip +5 -0
- data/stubs/pupu/content/images/.gitignore +0 -0
- data/stubs/pupu/content/init.rb.rbt +17 -0
- data/stubs/pupu/content/lib/%name%.rb.rbt +4 -0
- data/stubs/pupu/content/lib/%name%/adapters/rails.rb +0 -0
- data/stubs/pupu/content/lib/%name%/adapters/rango.rb +0 -0
- data/stubs/pupu/content/spec/%name%/.gitignore +0 -0
- data/stubs/pupu/content/spec/%name%_spec.rb.rbt +10 -0
- data/stubs/pupu/content/spec/spec.opts +5 -0
- data/stubs/pupu/content/spec/spec_helper.rb.rbt +7 -0
- data/stubs/pupu/postprocess.rb +8 -0
- data/stubs/pupu/setup.rb +4 -0
- data/tasks.rb +37 -0
- metadata +284 -200
- data/Rakefile +0 -28
- data/script/spec +0 -14
- data/tasks/benchmark.rake +0 -11
- data/tasks/gem.rake +0 -23
- data/tasks/hooks.rake +0 -12
- data/tasks/release.rake +0 -68
- data/tasks/spec.rake +0 -27
- data/tasks/submodules.rake +0 -33
- data/tasks/yardoc.rake +0 -9
@@ -0,0 +1,30 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
|
6
|
+
<head>
|
7
|
+
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
8
|
+
<title>The change you wanted was rejected (422)</title>
|
9
|
+
<style type="text/css">
|
10
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
11
|
+
div.dialog {
|
12
|
+
width: 25em;
|
13
|
+
padding: 0 4em;
|
14
|
+
margin: 4em auto 0 auto;
|
15
|
+
border: 1px solid #ccc;
|
16
|
+
border-right-color: #999;
|
17
|
+
border-bottom-color: #999;
|
18
|
+
}
|
19
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
20
|
+
</style>
|
21
|
+
</head>
|
22
|
+
|
23
|
+
<body>
|
24
|
+
<!-- This file lives in public/422.html -->
|
25
|
+
<div class="dialog">
|
26
|
+
<h1>The change you wanted was rejected.</h1>
|
27
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
28
|
+
</div>
|
29
|
+
</body>
|
30
|
+
</html>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
|
6
|
+
<head>
|
7
|
+
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
8
|
+
<title>We're sorry, but something went wrong (500)</title>
|
9
|
+
<style type="text/css">
|
10
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
11
|
+
div.dialog {
|
12
|
+
width: 25em;
|
13
|
+
padding: 0 4em;
|
14
|
+
margin: 4em auto 0 auto;
|
15
|
+
border: 1px solid #ccc;
|
16
|
+
border-right-color: #999;
|
17
|
+
border-bottom-color: #999;
|
18
|
+
}
|
19
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
20
|
+
</style>
|
21
|
+
</head>
|
22
|
+
|
23
|
+
<body>
|
24
|
+
<!-- This file lives in public/500.html -->
|
25
|
+
<div class="dialog">
|
26
|
+
<h1>We're sorry, but something went wrong.</h1>
|
27
|
+
<p>We've been notified about this issue and we'll take a look at it shortly.</p>
|
28
|
+
</div>
|
29
|
+
</body>
|
30
|
+
</html>
|
File without changes
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require_relative "spec_helper"
|
2
|
+
|
3
|
+
describe "Simle example" do
|
4
|
+
before(:each) do
|
5
|
+
@response = request("/examples/simple")
|
6
|
+
end
|
7
|
+
|
8
|
+
it "should be successful" do
|
9
|
+
@response.should be_successful
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should be successful" do
|
13
|
+
@response.should be_successful
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should link to"
|
17
|
+
end
|
18
|
+
|
19
|
+
describe "Examples with arguments" do
|
20
|
+
before(:each) do
|
21
|
+
@response = request("/examples/arguments")
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should be successful" do
|
25
|
+
@response.should be_successful
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
describe "Examples with dependencies" do
|
30
|
+
before(:each) do
|
31
|
+
@response = request("/examples/dependencies")
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should be successful" do
|
35
|
+
@response.should be_successful
|
36
|
+
end
|
37
|
+
end
|
File without changes
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# === Usage === #
|
4
|
+
# Run gem bundle for installation. You have to have bundler gem installed.
|
5
|
+
|
6
|
+
# http://github.com/wycats/bundler
|
7
|
+
# http://litanyagainstfear.com/blog/2009/10/14/gem-bundler-is-the-future
|
8
|
+
# http://yehudakatz.com/2009/11/03/using-the-new-gem-bundler-today
|
9
|
+
# http://www.engineyard.com/blog/2009/using-the-rubygems-bundler-for-your-app
|
10
|
+
|
11
|
+
# === Shared Gems === #
|
12
|
+
# Specify a dependency on rango. When the bundler downloads gems,
|
13
|
+
# it will download rango as well as all of rango' dependencies
|
14
|
+
|
15
|
+
# rango stack
|
16
|
+
gem "rango"#, git: "git://github.com/botanicus/rango.git"
|
17
|
+
gem "rack"#, git: "git://github.com/rack/rack.git"
|
18
|
+
gem "tilt"#, git: "git://github.com/rtomayko/tilt.git"
|
19
|
+
|
20
|
+
# router
|
21
|
+
gem "usher"#, git: "git://github.com/joshbuddy/usher.git"
|
22
|
+
|
23
|
+
# template engine
|
24
|
+
gem "haml"#, git: "git://github.com/nex3/haml.git"
|
25
|
+
|
26
|
+
# NOTE: do not use require_as: nil because if you do so, bundler will require the library anyway
|
27
|
+
# Check last section of http://wiki.github.com/merb/merb/howto-using-the-bundler for more informations
|
28
|
+
only(:bundle) do
|
29
|
+
gem "thin"#, git: "git://github.com/macournoyer/thin.git" # there seems to be some problems with latest thin
|
30
|
+
#gem "unicorn"#, git: "git://repo.or.cz/unicorn.git"
|
31
|
+
gem "racksh"#, git: "git://github.com/sickill/racksh.git"
|
32
|
+
gem "shotgun"#, git: "git://github.com/rtomayko/shotgun.git"
|
33
|
+
end
|
34
|
+
|
35
|
+
gem "simple-logger"#, git: "git://github.com/botanicus/simple-logger.git"
|
36
|
+
gem "media-path"#, git: "git://github.com/botanicus/media-path.git"
|
37
|
+
|
38
|
+
# === Environment-Specific Setup === #
|
39
|
+
only(:test) do
|
40
|
+
gem "rspec"#, git: "git://github.com/dchelimsky/rspec.git"
|
41
|
+
gem "rack-test", require_as: "rack/test"#, git: "git://github.com/brynary/rack-test.git"
|
42
|
+
end
|
43
|
+
|
44
|
+
# === Bundler Setup === #
|
45
|
+
# Specify where the bundled gems should be stashed. This directory will
|
46
|
+
# be a gem repository where all gems are downloaded to and installed to.
|
47
|
+
#
|
48
|
+
# This is an optional setting.
|
49
|
+
# The default is: vendor/gems
|
50
|
+
bundle_path "gems"
|
51
|
+
|
52
|
+
# Specify where gem executables should be copied to.
|
53
|
+
#
|
54
|
+
# This is an optional setting.
|
55
|
+
# The default is: bin
|
56
|
+
bin_path "bin"
|
@@ -1,7 +1,5 @@
|
|
1
|
-
h1.
|
1
|
+
h1. Merb Example
|
2
2
|
|
3
|
-
*
|
4
|
-
* Run with @./
|
5
|
-
|
6
|
-
* Dependencies for testing: @rspec@, @webrat@, @rack-test@
|
7
|
-
* Specs: @spec spec/pupu_spec.rb --colour@
|
3
|
+
* @gem bundle@ (you have to have bundler 0.7.2 installed)
|
4
|
+
* Run with @./bin/merb -a webrick@ (will start at @http://localhost:4000@)
|
5
|
+
* Specs: @./bin/spec spec/application_spec.rb --colour@
|
data/examples/rango/init.rb
CHANGED
@@ -4,6 +4,13 @@
|
|
4
4
|
# === Usage === #
|
5
5
|
# init.rb
|
6
6
|
|
7
|
+
# bundler
|
8
|
+
begin
|
9
|
+
require_relative "gems/environment.rb"
|
10
|
+
rescue LoadError => exception
|
11
|
+
abort "LoadError during loading gems/environment: #{exception.message}\nRun gem bundle to fix it."
|
12
|
+
end
|
13
|
+
|
7
14
|
# setup $:
|
8
15
|
pupu_libdir = File.expand_path("../../lib")
|
9
16
|
raise Errno::ENOENT, "#{pupu_libdir} doesn't exist" unless File.directory?(pupu_libdir)
|
@@ -19,8 +19,8 @@ h2. Layout
|
|
19
19
|
plugin :autocompleter
|
20
20
|
|
21
21
|
# for local requests through Autocompleter.Request class
|
22
|
-
plugin :autocompleter, :
|
22
|
+
plugin :autocompleter, type: "local"
|
23
23
|
|
24
24
|
# for ajax requests through Autocompleter.Request class
|
25
|
-
plugin :autocompleter, :
|
25
|
+
plugin :autocompleter, type: "request"
|
26
26
|
</pre>
|
@@ -1,18 +1,18 @@
|
|
1
|
-
# css_include_tag "blueprint/screen", "blueprint/plugins/fancy-type/screen", :
|
2
|
-
# css_include_tag "blueprint/print", :
|
1
|
+
# css_include_tag "blueprint/screen", "blueprint/plugins/fancy-type/screen", media: "screen, projection"
|
2
|
+
# css_include_tag "blueprint/print", media: "print"
|
3
3
|
# / [if IE]
|
4
|
-
# = css_include_tag "blueprint/ie", :
|
4
|
+
# = css_include_tag "blueprint/ie", media: "screen, projection"
|
5
5
|
|
6
6
|
# TODO
|
7
|
-
# :
|
8
|
-
stylesheet "screen", :
|
9
|
-
stylesheet "print", :
|
7
|
+
# if: "ie"
|
8
|
+
stylesheet "screen", media: "screen, projection"
|
9
|
+
stylesheet "print", media: "print"
|
10
10
|
stylesheet "ie"
|
11
11
|
|
12
12
|
# parameters of plugin
|
13
13
|
# it will be blank in most cases
|
14
14
|
parameter :plugins do |plugins|
|
15
15
|
plugins.each do |plugin|
|
16
|
-
stylesheet "plugins/#{plugin}/screen", :
|
16
|
+
stylesheet "plugins/#{plugin}/screen", media: "screen, projection"
|
17
17
|
end
|
18
18
|
end
|
@@ -10,11 +10,11 @@ themes = Dir["#{root}/stylesheets/Flame.*.css"].map { |theme| File.basename(th
|
|
10
10
|
syntaxes = Dir["#{root}/javascripts/Fuel.*.js"].map { |theme| File.basename(theme).split(".")[1] }
|
11
11
|
|
12
12
|
# pupu :lighter, theme: "mocha"
|
13
|
-
parameter :theme, :
|
13
|
+
parameter :theme, optional: themes do |theme|
|
14
14
|
stylesheet "Flame.#{theme}"
|
15
15
|
end
|
16
16
|
|
17
17
|
# pupu :lighter, syntax: "ruby"
|
18
|
-
parameter :syntax, :
|
18
|
+
parameter :syntax, optional: syntaxes do |syntax|
|
19
19
|
javascript "Fuel.#{syntax}"
|
20
20
|
end
|
File without changes
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/lib/pupu.rb
CHANGED
data/lib/pupu/adapters/merb.rb
CHANGED
@@ -1,6 +1,18 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
require "pupu"
|
2
4
|
require "pupu/helpers"
|
3
5
|
|
6
|
+
Pupu.framework = :merb
|
7
|
+
|
8
|
+
def Pupu.environment
|
9
|
+
Merb.environment
|
10
|
+
end
|
11
|
+
|
12
|
+
def Pupu.logger
|
13
|
+
Merb.logger
|
14
|
+
end
|
15
|
+
|
4
16
|
Merb::BootLoader.before_app_loads do
|
5
17
|
Pupu.root = Merb.root
|
6
18
|
Pupu.media_root = File.join(Merb.root, "public")
|
data/lib/pupu/adapters/rails.rb
CHANGED
@@ -1,6 +1,18 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
require "pupu"
|
2
4
|
require "pupu/helpers"
|
3
5
|
|
6
|
+
Pupu.framework = :rails
|
7
|
+
|
8
|
+
def Pupu.environment
|
9
|
+
Rails.environment
|
10
|
+
end
|
11
|
+
|
12
|
+
def Pupu.logger
|
13
|
+
Rails.logger
|
14
|
+
end
|
15
|
+
|
4
16
|
Pupu.root = Rails.root
|
5
17
|
Pupu.media_root = File.join(Rails.root, "public")
|
6
18
|
ActionView::Base.send(:include, Pupu::Helpers)
|
data/lib/pupu/adapters/rango.rb
CHANGED
@@ -1,10 +1,32 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
require "pupu"
|
2
4
|
require "pupu/helpers"
|
3
5
|
|
6
|
+
Pupu.framework = :rango
|
7
|
+
|
8
|
+
def Pupu.environment
|
9
|
+
Rango.environment
|
10
|
+
end
|
11
|
+
|
12
|
+
def Pupu.logger
|
13
|
+
Rango.logger
|
14
|
+
end
|
15
|
+
|
4
16
|
Rango.after_boot(:register_pupu) do
|
5
|
-
Pupu.root =
|
6
|
-
Pupu.media_prefix = Project.settings.media_prefix
|
7
|
-
Pupu.media_root = Project.settings.media_root
|
17
|
+
Pupu.root = Rango.root
|
18
|
+
#Pupu.media_prefix = Project.settings.media_prefix
|
19
|
+
#Pupu.media_root = Project.settings.media_root
|
8
20
|
Rango::Helpers.send(:include, Pupu::Helpers)
|
9
21
|
Rango.logger.info("Pupu plugin registered")
|
10
22
|
end
|
23
|
+
|
24
|
+
module Pupu
|
25
|
+
module Helpers
|
26
|
+
def pupu_page
|
27
|
+
# page = get_context_value(:page) # TOHLE KUNDA NEFUNGUJE V TEMPLEJTACH :(
|
28
|
+
# set_context_value(:page, page || Page.new)
|
29
|
+
context[:pupu_page] ||= Page.new
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|