pupu 0.0.1 → 0.0.2.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (241) hide show
  1. data/CHANGELOG +12 -1
  2. data/README.textile +38 -104
  3. data/Rakefile +17 -54
  4. data/TODO.txt +11 -6
  5. data/examples/merb/README.textile +7 -0
  6. data/examples/merb/Rakefile +30 -0
  7. data/examples/merb/application.rb +13 -0
  8. data/examples/merb/config/framework.rb +7 -0
  9. data/examples/merb/config/init.rb +48 -0
  10. data/examples/{blog/media/pupu/autocompleter → merb/public}/javascripts/initializers/autocompleter.js +0 -0
  11. data/examples/{blog/media/pupu/flash → merb/public}/javascripts/initializers/flash.js +0 -0
  12. data/examples/{blog/media/pupu/lighter → merb/public/javascripts}/initializers/lighter.js +0 -0
  13. data/examples/{blog/media → merb/public}/pupu/autocompleter/CHANGELOG +0 -0
  14. data/examples/{blog/media → merb/public}/pupu/autocompleter/LICENSE +0 -0
  15. data/examples/{blog/media → merb/public}/pupu/autocompleter/README.textile +0 -0
  16. data/examples/{blog/media → merb/public}/pupu/autocompleter/Rakefile +0 -0
  17. data/examples/{blog/media → merb/public}/pupu/autocompleter/TODO +0 -0
  18. data/examples/{blog/media → merb/public}/pupu/autocompleter/config.rb +0 -0
  19. data/examples/{blog/media → merb/public}/pupu/autocompleter/images/spinner.gif +0 -0
  20. data/examples/{blog/media → merb/public}/pupu/autocompleter/javascripts/autocompleter.js +0 -0
  21. data/examples/{blog/media → merb/public}/pupu/autocompleter/javascripts/autocompleter.local.js +0 -0
  22. data/examples/{blog/media → merb/public}/pupu/autocompleter/javascripts/autocompleter.request.js +0 -0
  23. data/examples/{blog/media → merb/public}/pupu/autocompleter/javascripts/observer.js +0 -0
  24. data/examples/{blog/media → merb/public}/pupu/autocompleter/metadata.yml +0 -0
  25. data/examples/{blog/media → merb/public}/pupu/autocompleter/stylesheets/autocompleter.css +0 -0
  26. data/examples/{blog/media → merb/public}/pupu/blueprint/CHANGELOG +0 -0
  27. data/examples/{blog/media → merb/public}/pupu/blueprint/LICENSE +0 -0
  28. data/examples/{blog/media → merb/public}/pupu/blueprint/README.textile +0 -0
  29. data/examples/{blog/media → merb/public}/pupu/blueprint/Rakefile +0 -0
  30. data/examples/{blog/media → merb/public}/pupu/blueprint/TODO +0 -0
  31. data/examples/{blog/media → merb/public}/pupu/blueprint/config.rb +0 -0
  32. data/examples/{blog/media → merb/public}/pupu/blueprint/metadata.yml +0 -0
  33. data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/ie.css +0 -0
  34. data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/buttons/icons/cross.png +0 -0
  35. data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/buttons/icons/key.png +0 -0
  36. data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/buttons/icons/tick.png +0 -0
  37. data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/buttons/readme.txt +0 -0
  38. data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/buttons/screen.css +0 -0
  39. data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/fancy-type/readme.txt +0 -0
  40. data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/fancy-type/screen.css +0 -0
  41. data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/link-icons/icons/doc.png +0 -0
  42. data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/link-icons/icons/email.png +0 -0
  43. data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/link-icons/icons/external.png +0 -0
  44. data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/link-icons/icons/feed.png +0 -0
  45. data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/link-icons/icons/im.png +0 -0
  46. data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/link-icons/icons/pdf.png +0 -0
  47. data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/link-icons/icons/visited.png +0 -0
  48. data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/link-icons/icons/xls.png +0 -0
  49. data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/link-icons/readme.txt +0 -0
  50. data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/link-icons/screen.css +0 -0
  51. data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/rtl/readme.txt +0 -0
  52. data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/plugins/rtl/screen.css +0 -0
  53. data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/print.css +0 -0
  54. data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/screen.css +0 -0
  55. data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/src/forms.css +0 -0
  56. data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/src/grid.css +0 -0
  57. data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/src/grid.png +0 -0
  58. data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/src/ie.css +0 -0
  59. data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/src/print.css +0 -0
  60. data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/src/reset.css +0 -0
  61. data/examples/{blog/media → merb/public}/pupu/blueprint/stylesheets/src/typography.css +0 -0
  62. data/examples/{blog/media → merb/public}/pupu/flash/CHANGELOG +0 -0
  63. data/examples/{blog/media → merb/public}/pupu/flash/LICENSE +0 -0
  64. data/examples/{blog/media → merb/public}/pupu/flash/README.textile +0 -0
  65. data/examples/{blog/media → merb/public}/pupu/flash/Rakefile +0 -0
  66. data/examples/{blog/media → merb/public}/pupu/flash/TODO +0 -0
  67. data/examples/{blog/media → merb/public}/pupu/flash/config.rb +0 -0
  68. data/examples/{blog/media → merb/public}/pupu/flash/javascripts/flash.js +0 -0
  69. data/examples/{blog/media → merb/public}/pupu/flash/metadata.yml +0 -0
  70. data/examples/{blog/media → merb/public}/pupu/lighter/CHANGELOG +0 -0
  71. data/examples/{blog/media → merb/public}/pupu/lighter/LICENSE +0 -0
  72. data/examples/{blog/media → merb/public}/pupu/lighter/README.textile +0 -0
  73. data/examples/{blog/media → merb/public}/pupu/lighter/TODO.txt +0 -0
  74. data/examples/{blog/media → merb/public}/pupu/lighter/config.rb +0 -0
  75. data/examples/{blog/media → merb/public}/pupu/lighter/javascripts/Fuel.css.js +0 -0
  76. data/examples/{blog/media → merb/public}/pupu/lighter/javascripts/Fuel.html.js +0 -0
  77. data/examples/{blog/media → merb/public}/pupu/lighter/javascripts/Fuel.js.js +0 -0
  78. data/examples/{blog/media → merb/public}/pupu/lighter/javascripts/Fuel.md.js +0 -0
  79. data/examples/{blog/media → merb/public}/pupu/lighter/javascripts/Fuel.php.js +0 -0
  80. data/examples/{blog/media → merb/public}/pupu/lighter/javascripts/Fuel.ruby.js +0 -0
  81. data/examples/{blog/media → merb/public}/pupu/lighter/javascripts/Fuel.shell.js +0 -0
  82. data/examples/{blog/media → merb/public}/pupu/lighter/javascripts/Fuel.sql.js +0 -0
  83. data/examples/{blog/media → merb/public}/pupu/lighter/javascripts/Fuel.template.js +0 -0
  84. data/examples/{blog/media → merb/public}/pupu/lighter/javascripts/ZeroClipboard.js +0 -0
  85. data/examples/{blog/media → merb/public}/pupu/lighter/javascripts/lighter.js +0 -0
  86. data/examples/{blog/media → merb/public}/pupu/lighter/media/ZeroClipboard.swf +0 -0
  87. data/examples/{blog/media → merb/public}/pupu/lighter/metadata.yml +0 -0
  88. data/examples/{blog/media → merb/public}/pupu/lighter/stylesheets/Flame.git.css +0 -0
  89. data/examples/{blog/media → merb/public}/pupu/lighter/stylesheets/Flame.mocha.css +0 -0
  90. data/examples/{blog/media → merb/public}/pupu/lighter/stylesheets/Flame.panic.css +0 -0
  91. data/examples/{blog/media → merb/public}/pupu/lighter/stylesheets/Flame.standard.css +0 -0
  92. data/examples/{blog/media → merb/public}/pupu/lighter/stylesheets/Flame.template.css +0 -0
  93. data/examples/{blog/media → merb/public}/pupu/lighter/stylesheets/Flame.tutti.css +0 -0
  94. data/examples/{blog/media → merb/public}/pupu/lighter/stylesheets/Flame.twilight.css +0 -0
  95. data/examples/{blog/media → merb/public}/pupu/mootools/CHANGELOG +0 -0
  96. data/examples/{blog/media → merb/public}/pupu/mootools/LICENSE +0 -0
  97. data/examples/{blog/media → merb/public}/pupu/mootools/README.textile +0 -0
  98. data/examples/{blog/media → merb/public}/pupu/mootools/Rakefile +0 -0
  99. data/examples/{blog/media → merb/public}/pupu/mootools/TODO +0 -0
  100. data/examples/{blog/media → merb/public}/pupu/mootools/config.rb +0 -0
  101. data/examples/{blog/media → merb/public}/pupu/mootools/javascripts/mootools-1.2-core.js +0 -0
  102. data/examples/{blog/media → merb/public}/pupu/mootools/javascripts/mootools-1.2-more.js +0 -0
  103. data/examples/{blog/media → merb/public}/pupu/mootools/metadata.yml +0 -0
  104. data/examples/{blog/media/pupu/flash → merb/public}/stylesheets/initializers/flash.css +0 -0
  105. data/examples/merb/spec/application_spec.rb +37 -0
  106. data/examples/merb/spec/spec_helper.rb +16 -0
  107. data/examples/merb/views/examples/arguments.html.erb +0 -0
  108. data/examples/merb/views/examples/dependencies.html.erb +0 -0
  109. data/examples/merb/views/examples/simple.html.erb +4 -0
  110. data/examples/merb/views/index.html.erb +7 -0
  111. data/examples/merb/views/layout.html.erb +12 -0
  112. data/examples/rango/README.textile +7 -0
  113. data/examples/{blog → rango}/Rakefile +0 -0
  114. data/examples/{blog → rango}/config.ru +2 -3
  115. data/examples/{blog → rango}/init.rb +6 -5
  116. data/examples/{blog → rango}/media/javascripts/initializers/lighter.js +0 -0
  117. data/examples/rango/media/pupu/autocompleter/CHANGELOG +1 -0
  118. data/examples/rango/media/pupu/autocompleter/LICENSE +20 -0
  119. data/examples/rango/media/pupu/autocompleter/README.textile +26 -0
  120. data/examples/rango/media/pupu/autocompleter/Rakefile +29 -0
  121. data/examples/rango/media/pupu/autocompleter/TODO +1 -0
  122. data/examples/rango/media/pupu/autocompleter/config.rb +12 -0
  123. data/examples/rango/media/pupu/autocompleter/images/spinner.gif +0 -0
  124. data/examples/rango/media/pupu/autocompleter/javascripts/autocompleter.js +442 -0
  125. data/examples/rango/media/pupu/autocompleter/javascripts/autocompleter.local.js +31 -0
  126. data/examples/rango/media/pupu/autocompleter/javascripts/autocompleter.request.js +109 -0
  127. data/examples/rango/media/pupu/autocompleter/javascripts/initializers/autocompleter.js +26 -0
  128. data/examples/rango/media/pupu/autocompleter/javascripts/observer.js +69 -0
  129. data/examples/rango/media/pupu/autocompleter/metadata.yml +5 -0
  130. data/examples/rango/media/pupu/autocompleter/stylesheets/autocompleter.css +68 -0
  131. data/examples/rango/media/pupu/blueprint/CHANGELOG +1 -0
  132. data/examples/rango/media/pupu/blueprint/LICENSE +20 -0
  133. data/examples/rango/media/pupu/blueprint/README.textile +22 -0
  134. data/examples/rango/media/pupu/blueprint/Rakefile +29 -0
  135. data/examples/rango/media/pupu/blueprint/TODO +3 -0
  136. data/examples/rango/media/pupu/blueprint/config.rb +18 -0
  137. data/examples/rango/media/pupu/blueprint/metadata.yml +5 -0
  138. data/examples/rango/media/pupu/blueprint/stylesheets/ie.css +26 -0
  139. data/examples/rango/media/pupu/blueprint/stylesheets/plugins/buttons/icons/cross.png +0 -0
  140. data/examples/rango/media/pupu/blueprint/stylesheets/plugins/buttons/icons/key.png +0 -0
  141. data/examples/rango/media/pupu/blueprint/stylesheets/plugins/buttons/icons/tick.png +0 -0
  142. data/examples/rango/media/pupu/blueprint/stylesheets/plugins/buttons/readme.txt +32 -0
  143. data/examples/rango/media/pupu/blueprint/stylesheets/plugins/buttons/screen.css +97 -0
  144. data/examples/rango/media/pupu/blueprint/stylesheets/plugins/fancy-type/readme.txt +14 -0
  145. data/examples/rango/media/pupu/blueprint/stylesheets/plugins/fancy-type/screen.css +71 -0
  146. data/examples/rango/media/pupu/blueprint/stylesheets/plugins/link-icons/icons/doc.png +0 -0
  147. data/examples/rango/media/pupu/blueprint/stylesheets/plugins/link-icons/icons/email.png +0 -0
  148. data/examples/rango/media/pupu/blueprint/stylesheets/plugins/link-icons/icons/external.png +0 -0
  149. data/examples/rango/media/pupu/blueprint/stylesheets/plugins/link-icons/icons/feed.png +0 -0
  150. data/examples/rango/media/pupu/blueprint/stylesheets/plugins/link-icons/icons/im.png +0 -0
  151. data/examples/rango/media/pupu/blueprint/stylesheets/plugins/link-icons/icons/pdf.png +0 -0
  152. data/examples/rango/media/pupu/blueprint/stylesheets/plugins/link-icons/icons/visited.png +0 -0
  153. data/examples/rango/media/pupu/blueprint/stylesheets/plugins/link-icons/icons/xls.png +0 -0
  154. data/examples/rango/media/pupu/blueprint/stylesheets/plugins/link-icons/readme.txt +18 -0
  155. data/examples/rango/media/pupu/blueprint/stylesheets/plugins/link-icons/screen.css +40 -0
  156. data/examples/rango/media/pupu/blueprint/stylesheets/plugins/rtl/readme.txt +10 -0
  157. data/examples/rango/media/pupu/blueprint/stylesheets/plugins/rtl/screen.css +109 -0
  158. data/examples/rango/media/pupu/blueprint/stylesheets/print.css +30 -0
  159. data/examples/rango/media/pupu/blueprint/stylesheets/screen.css +251 -0
  160. data/examples/rango/media/pupu/blueprint/stylesheets/src/forms.css +49 -0
  161. data/examples/rango/media/pupu/blueprint/stylesheets/src/grid.css +212 -0
  162. data/examples/rango/media/pupu/blueprint/stylesheets/src/grid.png +0 -0
  163. data/examples/rango/media/pupu/blueprint/stylesheets/src/ie.css +59 -0
  164. data/examples/rango/media/pupu/blueprint/stylesheets/src/print.css +85 -0
  165. data/examples/rango/media/pupu/blueprint/stylesheets/src/reset.css +38 -0
  166. data/examples/rango/media/pupu/blueprint/stylesheets/src/typography.css +105 -0
  167. data/examples/rango/media/pupu/flash/CHANGELOG +1 -0
  168. data/examples/rango/media/pupu/flash/LICENSE +20 -0
  169. data/examples/rango/media/pupu/flash/README.textile +22 -0
  170. data/examples/rango/media/pupu/flash/Rakefile +37 -0
  171. data/examples/rango/media/pupu/flash/TODO +1 -0
  172. data/examples/rango/media/pupu/flash/config.rb +11 -0
  173. data/examples/rango/media/pupu/flash/javascripts/flash.js +63 -0
  174. data/examples/rango/media/pupu/flash/javascripts/initializers/flash.js +12 -0
  175. data/examples/rango/media/pupu/flash/metadata.yml +5 -0
  176. data/examples/rango/media/pupu/flash/stylesheets/initializers/flash.css +21 -0
  177. data/examples/rango/media/pupu/lighter/CHANGELOG +2 -0
  178. data/examples/rango/media/pupu/lighter/LICENSE +20 -0
  179. data/examples/rango/media/pupu/lighter/README.textile +19 -0
  180. data/examples/rango/media/pupu/lighter/TODO.txt +4 -0
  181. data/examples/rango/media/pupu/lighter/config.rb +20 -0
  182. data/examples/rango/media/pupu/lighter/initializers/lighter.js +11 -0
  183. data/examples/rango/media/pupu/lighter/javascripts/Fuel.css.js +1 -0
  184. data/examples/rango/media/pupu/lighter/javascripts/Fuel.html.js +1 -0
  185. data/examples/rango/media/pupu/lighter/javascripts/Fuel.js.js +1 -0
  186. data/examples/rango/media/pupu/lighter/javascripts/Fuel.md.js +1 -0
  187. data/examples/rango/media/pupu/lighter/javascripts/Fuel.php.js +1 -0
  188. data/examples/rango/media/pupu/lighter/javascripts/Fuel.ruby.js +1 -0
  189. data/examples/rango/media/pupu/lighter/javascripts/Fuel.shell.js +1 -0
  190. data/examples/rango/media/pupu/lighter/javascripts/Fuel.sql.js +1 -0
  191. data/examples/rango/media/pupu/lighter/javascripts/Fuel.template.js +45 -0
  192. data/examples/rango/media/pupu/lighter/javascripts/ZeroClipboard.js +1 -0
  193. data/examples/rango/media/pupu/lighter/javascripts/lighter.js +1 -0
  194. data/examples/rango/media/pupu/lighter/media/ZeroClipboard.swf +0 -0
  195. data/examples/rango/media/pupu/lighter/metadata.yml +5 -0
  196. data/examples/rango/media/pupu/lighter/stylesheets/Flame.git.css +1 -0
  197. data/examples/rango/media/pupu/lighter/stylesheets/Flame.mocha.css +1 -0
  198. data/examples/rango/media/pupu/lighter/stylesheets/Flame.panic.css +1 -0
  199. data/examples/rango/media/pupu/lighter/stylesheets/Flame.standard.css +1 -0
  200. data/examples/rango/media/pupu/lighter/stylesheets/Flame.template.css +101 -0
  201. data/examples/rango/media/pupu/lighter/stylesheets/Flame.tutti.css +1 -0
  202. data/examples/rango/media/pupu/lighter/stylesheets/Flame.twilight.css +1 -0
  203. data/examples/rango/media/pupu/mootools/CHANGELOG +2 -0
  204. data/examples/rango/media/pupu/mootools/LICENSE +20 -0
  205. data/examples/rango/media/pupu/mootools/README.textile +19 -0
  206. data/examples/rango/media/pupu/mootools/Rakefile +29 -0
  207. data/examples/rango/media/pupu/mootools/TODO +1 -0
  208. data/examples/rango/media/pupu/mootools/config.rb +8 -0
  209. data/examples/rango/media/pupu/mootools/javascripts/mootools-1.2-core.js +350 -0
  210. data/examples/rango/media/pupu/mootools/javascripts/mootools-1.2-more.js +154 -0
  211. data/examples/rango/media/pupu/mootools/metadata.yml +5 -0
  212. data/examples/rango/spec/pupu_spec.rb +37 -0
  213. data/examples/rango/spec/spec_helper.rb +15 -0
  214. data/examples/{blog → rango}/templates/base.html.haml +2 -3
  215. data/examples/rango/templates/examples/arguments.html.haml +7 -0
  216. data/examples/{blog → rango}/templates/examples/base.html.haml +3 -3
  217. data/examples/{blog → rango}/templates/examples/dependencies.html.haml +1 -1
  218. data/examples/{blog → rango}/templates/examples/simple.html.haml +1 -1
  219. data/examples/{blog → rango}/templates/index.html.haml +0 -0
  220. data/lib/pupu.rb +1 -1
  221. data/lib/pupu/adapters/merb.rb +4 -10
  222. data/lib/pupu/adapters/rails.rb +6 -0
  223. data/lib/pupu/adapters/rango.rb +0 -1
  224. data/lib/pupu/cli.rb +7 -3
  225. data/lib/pupu/github.rb +1 -1
  226. data/pupu.pre.gemspec +44 -0
  227. data/script/spec +2 -0
  228. data/tasks/benchmark.rake +11 -0
  229. data/tasks/gem.rake +23 -0
  230. data/tasks/hooks.rake +12 -0
  231. data/tasks/release.rake +68 -0
  232. data/tasks/spec.rake +27 -0
  233. data/tasks/submodules.rake +33 -0
  234. data/tasks/yardoc.rake +9 -0
  235. metadata +227 -115
  236. data/examples/blog/Thorfile +0 -9
  237. data/examples/blog/bin/pupu +0 -4
  238. data/examples/blog/config/pupu.rb +0 -4
  239. data/examples/blog/templates/examples/arguments.html.haml +0 -7
  240. data/url.rb +0 -20
  241. data/url_spec.rb +0 -35
@@ -1,9 +0,0 @@
1
- # encoding: utf-8
2
-
3
- # Init hooks
4
- # Rango::Tasks.hook do
5
- # Dir["models/*.rb"].each(&method(:require))
6
- # end
7
-
8
- require_relative "init"
9
- load "pupu/tasks/pupu.thor"
@@ -1,4 +0,0 @@
1
- #!init.rb
2
-
3
- puts "We loaded init.rb, so our environment is loaded and now we can run the original bin/pupu from the pupu gem"
4
- load File.join("../../bin/pupu")
@@ -1,4 +0,0 @@
1
- require "pupu"
2
-
3
- Pupu.root = File.join(File.dirname(__FILE__), "..")
4
- Pupu.media_root = File.join(MediaPath.root, "media")
@@ -1,7 +0,0 @@
1
- - extends "examples/base.html"
2
-
3
- - block(:title, "Example With Arguments")
4
- - block(:pupu) do
5
- != pupu :mootools, more: true
6
- != pupu :blueprint, plugins: ["fancy-type"]
7
- != pupu :autocompleter, type: "request"
data/url.rb DELETED
@@ -1,20 +0,0 @@
1
- require "pupu/pupu"
2
- require "pupu/exceptions"
3
-
4
- module Pupu
5
- class URL
6
- attr_reader :path
7
- # URL.new(root/pupu/autocompleter/javascripts/autocompleter.js)
8
- # URL.new(Merb.root/root/pupu/autocompleter/javascripts/autocompleter.js)
9
- def initialize(path)
10
- path = File.expand_path(path).sub(%r[^#{Regexp::quote(::Pupu.root)}/], '')
11
- raise AssetNotFound.new(path) unless File.exist?(path)
12
- @path = path.sub(%r{^(.*/)?(root/.+$)}, '\2')
13
- end
14
-
15
- def url
16
- url = @path.sub(%r[^#{Regexp::quote(::Pupu.media_root)}], Regexp::quote(::Pupu.media_prefix))
17
- "/#{url}"
18
- end
19
- end
20
- end
data/url_spec.rb DELETED
@@ -1,35 +0,0 @@
1
- require_relative "../spec_helper"
2
- require "pupu/url"
3
-
4
- describe Pupu::URL do
5
- before(:each) do
6
- @fullpath = "spec/data/public/pupu/autocompleter/javascripts/autocompleter.js"
7
- @relative = "data/public/pupu/autocompleter/javascripts/autocompleter.js"
8
- Pupu.root = File.dirname(__FILE__) + "/data/public/root/pupu"
9
- @url = Pupu::URL.new(@fullpath)
10
- end
11
-
12
- describe "#initialize" do
13
- it "should raise AssetNotFound if given path do not exist" do
14
- lambda { Pupu::URL.new("i/do/not/exists") }.should raise_error(Pupu::AssetNotFound)
15
- end
16
- end
17
-
18
- describe "#path" do
19
- it "should be same as the path relative from current directory" do
20
- @url.path.should eql(@relative)
21
- end
22
-
23
- it "should cut the path to path relative from current directory" do
24
- path = "#{Dir.pwd}/spec/data/public/pupu/autocompleter/javascripts/autocompleter.js"
25
- url = Pupu::URL.new(path)
26
- url.path.should eql(@relative) # yep, it still should be the same as @relative
27
- end
28
- end
29
-
30
- describe "#inspect" do
31
- it "should show @fullpath and url" do
32
- @url.inspect.should eql(%Q{#<URL: @path="#{@relative}" url="/pupu/autocompleter/javascripts/autocompleter.js">})
33
- end
34
- end
35
- end