pupu 0.1.pre → 0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. data/.gitignore +9 -0
  2. data/CHANGELOG +23 -4
  3. data/Gemfile +9 -0
  4. data/LICENSE +1 -1
  5. data/README.textile +3 -3
  6. data/TODO.txt +8 -3
  7. data/bin/pupu +19 -24
  8. data/examples/merb/.gitignore +17 -0
  9. data/examples/merb/Gemfile +27 -0
  10. data/examples/merb/README.textile +3 -5
  11. data/examples/merb/Rakefile +3 -3
  12. data/examples/merb/config/framework.rb +4 -4
  13. data/examples/merb/config/init.rb +7 -0
  14. data/examples/merb/public/pupu/autocompleter/.gitignore +5 -0
  15. data/examples/merb/public/pupu/autocompleter/README.textile +2 -2
  16. data/examples/merb/public/pupu/autocompleter/config.rb +1 -1
  17. data/examples/merb/public/pupu/blueprint/.gitignore +5 -0
  18. data/examples/merb/public/pupu/blueprint/config.rb +7 -7
  19. data/examples/merb/public/pupu/flash/.gitignore +5 -0
  20. data/examples/merb/public/pupu/flash/config.rb +1 -1
  21. data/examples/merb/public/pupu/lighter/.gitignore +10 -0
  22. data/examples/merb/public/pupu/lighter/config.rb +2 -2
  23. data/{spec/pupu/adapters/merb_spec.rb → examples/merb/public/pupu/lighter/images/.gitignore} +0 -0
  24. data/examples/merb/public/pupu/mootools/.gitignore +5 -0
  25. data/examples/merb/public/pupu/mootools/README.textile +1 -1
  26. data/examples/merb/public/pupu/mootools/config.rb +1 -1
  27. data/examples/rails/.gitignore +7 -0
  28. data/examples/rails/Gemfile +28 -0
  29. data/examples/rails/README.textile +5 -0
  30. data/examples/rails/Rakefile +10 -0
  31. data/examples/rails/app/controllers/application_controller.rb +10 -0
  32. data/examples/rails/app/controllers/home_controller.rb +8 -0
  33. data/examples/rails/app/helpers/application_helper.rb +3 -0
  34. data/{spec/pupu/adapters/rango_spec.rb → examples/rails/app/views/examples/arguments.html.erb} +0 -0
  35. data/examples/rails/app/views/examples/dependencies.html.erb +0 -0
  36. data/examples/rails/app/views/examples/simple.html.erb +4 -0
  37. data/examples/rails/app/views/index.html.erb +7 -0
  38. data/examples/rails/app/views/layout.html.erb +12 -0
  39. data/examples/rails/config/boot.rb +110 -0
  40. data/examples/rails/config/environment.rb +55 -0
  41. data/examples/rails/config/environments/development.rb +17 -0
  42. data/examples/rails/config/environments/production.rb +28 -0
  43. data/examples/rails/config/environments/test.rb +28 -0
  44. data/examples/rails/config/initializers/backtrace_silencers.rb +7 -0
  45. data/examples/rails/config/initializers/inflections.rb +10 -0
  46. data/examples/rails/config/initializers/mime_types.rb +5 -0
  47. data/examples/rails/config/initializers/new_rails_defaults.rb +21 -0
  48. data/examples/rails/config/initializers/session_store.rb +15 -0
  49. data/examples/rails/config/routes.rb +43 -0
  50. data/examples/rails/db/seeds.rb +7 -0
  51. data/examples/rails/public/404.html +30 -0
  52. data/examples/rails/public/422.html +30 -0
  53. data/examples/rails/public/500.html +30 -0
  54. data/examples/rails/public/favicon.ico +0 -0
  55. data/examples/rails/public/robots.txt +5 -0
  56. data/examples/rails/script/about +4 -0
  57. data/examples/rails/script/console +3 -0
  58. data/examples/rails/script/dbconsole +3 -0
  59. data/examples/rails/script/destroy +3 -0
  60. data/examples/rails/script/generate +3 -0
  61. data/examples/rails/script/performance/benchmarker +3 -0
  62. data/examples/rails/script/performance/profiler +3 -0
  63. data/examples/rails/script/plugin +3 -0
  64. data/examples/rails/script/runner +3 -0
  65. data/examples/rails/script/server +3 -0
  66. data/examples/rails/spec/application_spec.rb +37 -0
  67. data/examples/rails/spec/spec_helper.rb +0 -0
  68. data/examples/rango/.gitignore +4 -0
  69. data/examples/rango/Gemfile +56 -0
  70. data/examples/rango/README.textile +4 -6
  71. data/examples/rango/init.rb +7 -0
  72. data/examples/rango/media/pupu/autocompleter/.gitignore +5 -0
  73. data/examples/rango/media/pupu/autocompleter/README.textile +2 -2
  74. data/examples/rango/media/pupu/autocompleter/config.rb +1 -1
  75. data/examples/rango/media/pupu/blueprint/.gitignore +5 -0
  76. data/examples/rango/media/pupu/blueprint/config.rb +7 -7
  77. data/examples/rango/media/pupu/flash/.gitignore +5 -0
  78. data/examples/rango/media/pupu/flash/config.rb +1 -1
  79. data/examples/rango/media/pupu/lighter/.gitignore +10 -0
  80. data/examples/rango/media/pupu/lighter/config.rb +2 -2
  81. data/examples/rango/media/pupu/lighter/images/.gitignore +0 -0
  82. data/examples/rango/media/pupu/mootools/.gitignore +5 -0
  83. data/examples/rango/media/pupu/mootools/README.textile +1 -1
  84. data/examples/rango/media/pupu/mootools/config.rb +1 -1
  85. data/gems/cache/media-path-0.1.2.gem +0 -0
  86. data/gems/cache/nake-0.0.8.gem +0 -0
  87. data/gems/cache/rspec-1.3.0.gem +0 -0
  88. data/gems/cache/term-ansicolor-1.0.4.gem +0 -0
  89. data/lib/pupu.rb +2 -1
  90. data/lib/pupu/adapters/merb.rb +12 -0
  91. data/lib/pupu/adapters/rails.rb +12 -0
  92. data/lib/pupu/adapters/rango.rb +25 -3
  93. data/lib/pupu/cli.rb +13 -11
  94. data/lib/pupu/dsl.rb +34 -13
  95. data/lib/pupu/exceptions.rb +5 -0
  96. data/lib/pupu/github.rb +26 -14
  97. data/lib/pupu/helpers.rb +8 -2
  98. data/lib/pupu/metadata.rb +2 -0
  99. data/lib/pupu/parser.rb +19 -4
  100. data/lib/pupu/pupu.rb +53 -27
  101. data/lib/pupu/tasks/pupu.nake +52 -0
  102. data/lib/pupu/version.rb +1 -3
  103. data/pupu.gemspec +15 -7
  104. data/pupu.pre.gemspec +5 -33
  105. data/spec/data/public/pupu/autocompleter/.gitignore +5 -0
  106. data/spec/data/public/pupu/autocompleter/README.textile +2 -2
  107. data/spec/data/public/pupu/autocompleter/config.rb +3 -1
  108. data/spec/pupu/dsl_spec.rb +3 -0
  109. data/spec/pupu/exceptions_spec.rb +3 -0
  110. data/spec/pupu/github_spec.rb +4 -1
  111. data/spec/pupu/helpers_spec.rb +5 -2
  112. data/spec/pupu/metadata_spec.rb +3 -0
  113. data/spec/pupu/parser_spec.rb +4 -1
  114. data/spec/pupu/pupu_spec.rb +3 -0
  115. data/stubs/pupu/content/%name%.gemspec.rbt +47 -0
  116. data/stubs/pupu/content/%name%.pre.gemspec.rbt +8 -0
  117. data/stubs/pupu/content/.gitignore +12 -0
  118. data/stubs/pupu/content/config.rb.rbt +3 -1
  119. data/stubs/pupu/content/deps.rip +5 -0
  120. data/stubs/pupu/content/images/.gitignore +0 -0
  121. data/stubs/pupu/content/init.rb.rbt +17 -0
  122. data/stubs/pupu/content/lib/%name%.rb.rbt +4 -0
  123. data/stubs/pupu/content/lib/%name%/adapters/rails.rb +0 -0
  124. data/stubs/pupu/content/lib/%name%/adapters/rango.rb +0 -0
  125. data/stubs/pupu/content/spec/%name%/.gitignore +0 -0
  126. data/stubs/pupu/content/spec/%name%_spec.rb.rbt +10 -0
  127. data/stubs/pupu/content/spec/spec.opts +5 -0
  128. data/stubs/pupu/content/spec/spec_helper.rb.rbt +7 -0
  129. data/stubs/pupu/postprocess.rb +8 -0
  130. data/stubs/pupu/setup.rb +4 -0
  131. data/tasks.rb +37 -0
  132. metadata +284 -200
  133. data/Rakefile +0 -28
  134. data/script/spec +0 -14
  135. data/tasks/benchmark.rake +0 -11
  136. data/tasks/gem.rake +0 -23
  137. data/tasks/hooks.rake +0 -12
  138. data/tasks/release.rake +0 -68
  139. data/tasks/spec.rake +0 -27
  140. data/tasks/submodules.rake +0 -33
  141. 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,5 @@
1
+ # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2
+ #
3
+ # To ban all spiders from the entire site uncomment the next two lines:
4
+ # User-Agent: *
5
+ # Disallow: /
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../config/boot', __FILE__)
3
+ $LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
4
+ require 'commands/about'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../config/boot', __FILE__)
3
+ require 'commands/console'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../config/boot', __FILE__)
3
+ require 'commands/dbconsole'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../config/boot', __FILE__)
3
+ require 'commands/destroy'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../config/boot', __FILE__)
3
+ require 'commands/generate'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../../config/boot', __FILE__)
3
+ require 'commands/performance/benchmarker'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../../config/boot', __FILE__)
3
+ require 'commands/performance/profiler'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../config/boot', __FILE__)
3
+ require 'commands/plugin'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../config/boot', __FILE__)
3
+ require 'commands/runner'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../config/boot', __FILE__)
3
+ require 'commands/server'
@@ -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,4 @@
1
+ # You usually don't want to ignore gems/cache, but examples are
2
+ # part of the pupu gem and we want to keep it as small as possible
3
+ gems/*
4
+ bin/*
@@ -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. Rango Example
1
+ h1. Merb Example
2
2
 
3
- * Dependencies for running: @rango@, @usher@, @haml@
4
- * Run with @./config.ru@ (will start at @http://localhost:4000@)
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@
@@ -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)
@@ -0,0 +1,5 @@
1
+ .DS_Store
2
+ *~
3
+ .*.swp
4
+ .#*
5
+ .svn/*
@@ -19,8 +19,8 @@ h2. Layout
19
19
  plugin :autocompleter
20
20
 
21
21
  # for local requests through Autocompleter.Request class
22
- plugin :autocompleter, :type => "local"
22
+ plugin :autocompleter, type: "local"
23
23
 
24
24
  # for ajax requests through Autocompleter.Request class
25
- plugin :autocompleter, :type => "request"
25
+ plugin :autocompleter, type: "request"
26
26
  </pre>
@@ -7,6 +7,6 @@ javascripts "observer", "autocompleter"
7
7
  # stylesheet
8
8
  stylesheet "autocompleter"
9
9
 
10
- parameter :type, :optional => ["local", "request"] do |type|
10
+ parameter :type, optional: ["local", "request"] do |type|
11
11
  javascript "autocompleter.#{type}"
12
12
  end
@@ -0,0 +1,5 @@
1
+ .DS_Store
2
+ *~
3
+ .*.swp
4
+ .#*
5
+ .svn/*
@@ -1,18 +1,18 @@
1
- # css_include_tag "blueprint/screen", "blueprint/plugins/fancy-type/screen", :media => "screen, projection"
2
- # css_include_tag "blueprint/print", :media => "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", :media => "screen, projection"
4
+ # = css_include_tag "blueprint/ie", media: "screen, projection"
5
5
 
6
6
  # TODO
7
- # :if => "ie"
8
- stylesheet "screen", :media => "screen, projection"
9
- stylesheet "print", :media => "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", :media => "screen, projection"
16
+ stylesheet "plugins/#{plugin}/screen", media: "screen, projection"
17
17
  end
18
18
  end
@@ -0,0 +1,5 @@
1
+ .DS_Store
2
+ *~
3
+ .*.swp
4
+ .#*
5
+ .svn/*
@@ -6,6 +6,6 @@ javascript "flash"
6
6
 
7
7
  # parameters of plugin
8
8
  # it will be blank in most cases
9
- #parameter :request, :optional => ["local", "ajax"] do |type|
9
+ #parameter :request, optional: ["local", "ajax"] do |type|
10
10
  # javascript "lib/autocompleter.#{type}"
11
11
  #end
@@ -0,0 +1,10 @@
1
+ *~
2
+ .*.swp
3
+ .#*
4
+ .svn/*
5
+ .DS_Store
6
+ .yardoc
7
+ .cache
8
+ pkg/
9
+ nbproject/
10
+ metadata.yml
@@ -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, :optional => themes do |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, :optional => syntaxes do |syntax|
18
+ parameter :syntax, optional: syntaxes do |syntax|
19
19
  javascript "Fuel.#{syntax}"
20
20
  end
@@ -0,0 +1,5 @@
1
+ .DS_Store
2
+ *~
3
+ .*.swp
4
+ .#*
5
+ .svn/*
@@ -15,5 +15,5 @@ h2. Layout
15
15
  plugin :mootools
16
16
 
17
17
  # for mootools-more
18
- plugin :mootools, :more => true
18
+ plugin :mootools, more: true
19
19
  </pre>
@@ -2,7 +2,7 @@
2
2
  javascript "mootools-1.2-core"
3
3
 
4
4
  # parameters of plugin
5
- # pupu :mootools, :more => true
5
+ # pupu :mootools, more: true
6
6
  parameter :more do |boolean|
7
7
  javascript "mootools-1.2-more" if boolean
8
8
  end
Binary file
@@ -1,7 +1,8 @@
1
+ # encoding: utf-8
2
+
1
3
  require "media-path"
2
4
  require "pupu/exceptions"
3
5
  require "pupu/pupu"
4
6
 
5
7
  module Pupu
6
- VERSION ||= "0.0.2"
7
8
  end
@@ -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")
@@ -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)
@@ -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 = Project.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