classiccms 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (369) hide show
  1. data/lib/classiccms/application.rb +2 -3
  2. data/lib/classiccms/cli.rb +6 -0
  3. data/lib/classiccms/scaffold/Gemfile +4 -0
  4. data/lib/classiccms/{mongoid.yml → scaffold/config/mongoid.yml} +3 -4
  5. data/lib/classiccms/scaffold/spec/models/article_spec.rb +8 -0
  6. data/lib/classiccms/scaffold/spec/spec_helper.rb +24 -0
  7. data/lib/classiccms/version.rb +1 -1
  8. data/spec/cli_spec.rb +8 -0
  9. data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/build/v8/libv8.a +0 -0
  10. data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/build/v8/libv8preparser.a +0 -0
  11. data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/v8/include/v8-debug.h +395 -0
  12. data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/v8/include/v8-preparser.h +117 -0
  13. data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/v8/include/v8-profiler.h +505 -0
  14. data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/v8/include/v8-testing.h +104 -0
  15. data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/v8/include/v8.h +4124 -0
  16. data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/v8/include/v8stdint.h +53 -0
  17. data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/version.rb +6 -0
  18. data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8.rb +15 -0
  19. data/vendor/bundle/gems/sass-3.1.19/.yardopts +11 -0
  20. data/vendor/bundle/gems/sass-3.1.19/CONTRIBUTING +3 -0
  21. data/vendor/bundle/gems/sass-3.1.19/MIT-LICENSE +20 -0
  22. data/vendor/bundle/gems/sass-3.1.19/README.md +200 -0
  23. data/vendor/bundle/gems/sass-3.1.19/REVISION +1 -0
  24. data/vendor/bundle/gems/sass-3.1.19/Rakefile +339 -0
  25. data/vendor/bundle/gems/sass-3.1.19/VERSION +1 -0
  26. data/vendor/bundle/gems/sass-3.1.19/VERSION_NAME +1 -0
  27. data/vendor/bundle/gems/sass-3.1.19/bin/sass +8 -0
  28. data/vendor/bundle/gems/sass-3.1.19/bin/sass-convert +7 -0
  29. data/vendor/bundle/gems/sass-3.1.19/bin/scss +8 -0
  30. data/vendor/bundle/gems/sass-3.1.19/extra/update_watch.rb +13 -0
  31. data/vendor/bundle/gems/sass-3.1.19/init.rb +18 -0
  32. data/vendor/bundle/gems/sass-3.1.19/lib/sass/cache_stores/base.rb +86 -0
  33. data/vendor/bundle/gems/sass-3.1.19/lib/sass/cache_stores/chain.rb +33 -0
  34. data/vendor/bundle/gems/sass-3.1.19/lib/sass/cache_stores/filesystem.rb +61 -0
  35. data/vendor/bundle/gems/sass-3.1.19/lib/sass/cache_stores/memory.rb +47 -0
  36. data/vendor/bundle/gems/sass-3.1.19/lib/sass/cache_stores/null.rb +25 -0
  37. data/vendor/bundle/gems/sass-3.1.19/lib/sass/cache_stores.rb +15 -0
  38. data/vendor/bundle/gems/sass-3.1.19/lib/sass/callbacks.rb +66 -0
  39. data/vendor/bundle/gems/sass-3.1.19/lib/sass/css.rb +390 -0
  40. data/vendor/bundle/gems/sass-3.1.19/lib/sass/engine.rb +880 -0
  41. data/vendor/bundle/gems/sass-3.1.19/lib/sass/environment.rb +180 -0
  42. data/vendor/bundle/gems/sass-3.1.19/lib/sass/error.rb +201 -0
  43. data/vendor/bundle/gems/sass-3.1.19/lib/sass/exec.rb +682 -0
  44. data/vendor/bundle/gems/sass-3.1.19/lib/sass/importers/base.rb +139 -0
  45. data/vendor/bundle/gems/sass-3.1.19/lib/sass/importers/filesystem.rb +149 -0
  46. data/vendor/bundle/gems/sass-3.1.19/lib/sass/importers.rb +22 -0
  47. data/vendor/bundle/gems/sass-3.1.19/lib/sass/less.rb +382 -0
  48. data/vendor/bundle/gems/sass-3.1.19/lib/sass/logger/base.rb +32 -0
  49. data/vendor/bundle/gems/sass-3.1.19/lib/sass/logger/log_level.rb +49 -0
  50. data/vendor/bundle/gems/sass-3.1.19/lib/sass/logger.rb +15 -0
  51. data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin/compiler.rb +384 -0
  52. data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin/configuration.rb +123 -0
  53. data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin/generic.rb +15 -0
  54. data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin/merb.rb +48 -0
  55. data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin/rack.rb +60 -0
  56. data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin/rails.rb +47 -0
  57. data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin/staleness_checker.rb +183 -0
  58. data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin.rb +132 -0
  59. data/vendor/bundle/gems/sass-3.1.19/lib/sass/railtie.rb +9 -0
  60. data/vendor/bundle/gems/sass-3.1.19/lib/sass/repl.rb +57 -0
  61. data/vendor/bundle/gems/sass-3.1.19/lib/sass/root.rb +7 -0
  62. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/bool.rb +18 -0
  63. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/color.rb +475 -0
  64. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/css_lexer.rb +29 -0
  65. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/css_parser.rb +31 -0
  66. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/funcall.rb +175 -0
  67. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/functions.rb +1381 -0
  68. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/interpolation.rb +79 -0
  69. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/lexer.rb +337 -0
  70. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/list.rb +84 -0
  71. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/literal.rb +230 -0
  72. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/node.rb +99 -0
  73. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/number.rb +452 -0
  74. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/operation.rb +107 -0
  75. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/parser.rb +474 -0
  76. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/string.rb +51 -0
  77. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/string_interpolation.rb +103 -0
  78. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/unary_operation.rb +64 -0
  79. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/variable.rb +58 -0
  80. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script.rb +39 -0
  81. data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss/css_parser.rb +46 -0
  82. data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss/parser.rb +1055 -0
  83. data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss/rx.rb +137 -0
  84. data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss/sass_parser.rb +11 -0
  85. data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss/script_lexer.rb +15 -0
  86. data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss/script_parser.rb +25 -0
  87. data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss/static_parser.rb +40 -0
  88. data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss.rb +17 -0
  89. data/vendor/bundle/gems/sass-3.1.19/lib/sass/selector/abstract_sequence.rb +71 -0
  90. data/vendor/bundle/gems/sass-3.1.19/lib/sass/selector/comma_sequence.rb +86 -0
  91. data/vendor/bundle/gems/sass-3.1.19/lib/sass/selector/sequence.rb +296 -0
  92. data/vendor/bundle/gems/sass-3.1.19/lib/sass/selector/simple.rb +119 -0
  93. data/vendor/bundle/gems/sass-3.1.19/lib/sass/selector/simple_sequence.rb +154 -0
  94. data/vendor/bundle/gems/sass-3.1.19/lib/sass/selector.rb +373 -0
  95. data/vendor/bundle/gems/sass-3.1.19/lib/sass/shared.rb +76 -0
  96. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/charset_node.rb +22 -0
  97. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/comment_node.rb +90 -0
  98. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/debug_node.rb +18 -0
  99. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/directive_node.rb +28 -0
  100. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/each_node.rb +24 -0
  101. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/extend_node.rb +29 -0
  102. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/for_node.rb +36 -0
  103. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/function_node.rb +27 -0
  104. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/if_node.rb +52 -0
  105. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/import_node.rb +68 -0
  106. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/media_node.rb +32 -0
  107. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/mixin_def_node.rb +27 -0
  108. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/mixin_node.rb +32 -0
  109. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/node.rb +188 -0
  110. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/prop_node.rb +148 -0
  111. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/return_node.rb +18 -0
  112. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/root_node.rb +28 -0
  113. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/rule_node.rb +127 -0
  114. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/variable_node.rb +30 -0
  115. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/base.rb +75 -0
  116. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/check_nesting.rb +127 -0
  117. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/convert.rb +262 -0
  118. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/cssize.rb +206 -0
  119. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/deep_copy.rb +87 -0
  120. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/extend.rb +42 -0
  121. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/perform.rb +357 -0
  122. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/set_options.rb +97 -0
  123. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/to_css.rb +219 -0
  124. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/warn_node.rb +18 -0
  125. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/while_node.rb +18 -0
  126. data/vendor/bundle/gems/sass-3.1.19/lib/sass/util/multibyte_string_scanner.rb +134 -0
  127. data/vendor/bundle/gems/sass-3.1.19/lib/sass/util/subset_map.rb +101 -0
  128. data/vendor/bundle/gems/sass-3.1.19/lib/sass/util.rb +800 -0
  129. data/vendor/bundle/gems/sass-3.1.19/lib/sass/version.rb +112 -0
  130. data/vendor/bundle/gems/sass-3.1.19/lib/sass.rb +73 -0
  131. data/vendor/bundle/gems/sass-3.1.19/rails/init.rb +1 -0
  132. data/vendor/bundle/gems/sass-3.1.19/test/Gemfile +4 -0
  133. data/vendor/bundle/gems/sass-3.1.19/test/sass/cache_test.rb +89 -0
  134. data/vendor/bundle/gems/sass-3.1.19/test/sass/callbacks_test.rb +61 -0
  135. data/vendor/bundle/gems/sass-3.1.19/test/sass/conversion_test.rb +1245 -0
  136. data/vendor/bundle/gems/sass-3.1.19/test/sass/css2sass_test.rb +397 -0
  137. data/vendor/bundle/gems/sass-3.1.19/test/sass/data/hsl-rgb.txt +319 -0
  138. data/vendor/bundle/gems/sass-3.1.19/test/sass/engine_test.rb +2730 -0
  139. data/vendor/bundle/gems/sass-3.1.19/test/sass/extend_test.rb +1663 -0
  140. data/vendor/bundle/gems/sass-3.1.19/test/sass/fixtures/test_staleness_check_across_importers.css +1 -0
  141. data/vendor/bundle/gems/sass-3.1.19/test/sass/fixtures/test_staleness_check_across_importers.scss +1 -0
  142. data/vendor/bundle/gems/sass-3.1.19/test/sass/functions_test.rb +1047 -0
  143. data/vendor/bundle/gems/sass-3.1.19/test/sass/importer_test.rb +192 -0
  144. data/vendor/bundle/gems/sass-3.1.19/test/sass/less_conversion_test.rb +653 -0
  145. data/vendor/bundle/gems/sass-3.1.19/test/sass/logger_test.rb +58 -0
  146. data/vendor/bundle/gems/sass-3.1.19/test/sass/mock_importer.rb +49 -0
  147. data/vendor/bundle/gems/sass-3.1.19/test/sass/more_results/more1.css +9 -0
  148. data/vendor/bundle/gems/sass-3.1.19/test/sass/more_results/more1_with_line_comments.css +26 -0
  149. data/vendor/bundle/gems/sass-3.1.19/test/sass/more_results/more_import.css +29 -0
  150. data/vendor/bundle/gems/sass-3.1.19/test/sass/more_templates/_more_partial.sass +2 -0
  151. data/vendor/bundle/gems/sass-3.1.19/test/sass/more_templates/more1.sass +23 -0
  152. data/vendor/bundle/gems/sass-3.1.19/test/sass/more_templates/more_import.sass +11 -0
  153. data/vendor/bundle/gems/sass-3.1.19/test/sass/plugin_test.rb +496 -0
  154. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/alt.css +4 -0
  155. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/basic.css +9 -0
  156. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/compact.css +5 -0
  157. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/complex.css +86 -0
  158. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/compressed.css +1 -0
  159. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/expanded.css +19 -0
  160. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/if.css +3 -0
  161. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/import.css +31 -0
  162. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/import_charset.css +5 -0
  163. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/import_charset_1_8.css +5 -0
  164. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/import_charset_ibm866.css +5 -0
  165. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/line_numbers.css +49 -0
  166. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/mixins.css +95 -0
  167. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/multiline.css +24 -0
  168. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/nested.css +22 -0
  169. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/options.css +1 -0
  170. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/parent_ref.css +13 -0
  171. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/script.css +16 -0
  172. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/scss_import.css +31 -0
  173. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/scss_importee.css +2 -0
  174. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/subdir/nested_subdir/nested_subdir.css +1 -0
  175. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/subdir/subdir.css +3 -0
  176. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/units.css +11 -0
  177. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/warn.css +0 -0
  178. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/warn_imported.css +0 -0
  179. data/vendor/bundle/gems/sass-3.1.19/test/sass/script_conversion_test.rb +285 -0
  180. data/vendor/bundle/gems/sass-3.1.19/test/sass/script_test.rb +519 -0
  181. data/vendor/bundle/gems/sass-3.1.19/test/sass/scss/css_test.rb +975 -0
  182. data/vendor/bundle/gems/sass-3.1.19/test/sass/scss/rx_test.rb +156 -0
  183. data/vendor/bundle/gems/sass-3.1.19/test/sass/scss/scss_test.rb +1308 -0
  184. data/vendor/bundle/gems/sass-3.1.19/test/sass/scss/test_helper.rb +37 -0
  185. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/_double_import_loop2.sass +1 -0
  186. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/_imported_charset_ibm866.sass +4 -0
  187. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/_imported_charset_utf8.sass +4 -0
  188. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/_partial.sass +2 -0
  189. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/alt.sass +16 -0
  190. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/basic.sass +23 -0
  191. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/bork1.sass +2 -0
  192. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/bork2.sass +2 -0
  193. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/bork3.sass +2 -0
  194. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/bork4.sass +2 -0
  195. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/bork5.sass +3 -0
  196. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/compact.sass +17 -0
  197. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/complex.sass +305 -0
  198. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/compressed.sass +15 -0
  199. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/double_import_loop1.sass +1 -0
  200. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/expanded.sass +17 -0
  201. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/if.sass +11 -0
  202. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/import.sass +12 -0
  203. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/import_charset.sass +9 -0
  204. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/import_charset_1_8.sass +6 -0
  205. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/import_charset_ibm866.sass +11 -0
  206. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/importee.less +2 -0
  207. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/importee.sass +19 -0
  208. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/line_numbers.sass +13 -0
  209. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/mixin_bork.sass +5 -0
  210. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/mixins.sass +76 -0
  211. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/multiline.sass +20 -0
  212. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested.sass +25 -0
  213. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested_bork1.sass +2 -0
  214. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested_bork2.sass +2 -0
  215. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested_bork3.sass +2 -0
  216. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested_bork4.sass +2 -0
  217. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested_bork5.sass +2 -0
  218. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested_import.sass +2 -0
  219. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested_mixin_bork.sass +6 -0
  220. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/options.sass +2 -0
  221. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/parent_ref.sass +25 -0
  222. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/script.sass +101 -0
  223. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/scss_import.scss +11 -0
  224. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/scss_importee.scss +1 -0
  225. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/single_import_loop.sass +1 -0
  226. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +2 -0
  227. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +3 -0
  228. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/subdir/subdir.sass +6 -0
  229. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/units.sass +11 -0
  230. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/warn.sass +3 -0
  231. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/warn_imported.sass +4 -0
  232. data/vendor/bundle/gems/sass-3.1.19/test/sass/test_helper.rb +8 -0
  233. data/vendor/bundle/gems/sass-3.1.19/test/sass/util/multibyte_string_scanner_test.rb +147 -0
  234. data/vendor/bundle/gems/sass-3.1.19/test/sass/util/subset_map_test.rb +91 -0
  235. data/vendor/bundle/gems/sass-3.1.19/test/sass/util_test.rb +282 -0
  236. data/vendor/bundle/gems/sass-3.1.19/test/test_helper.rb +70 -0
  237. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/CHANGELOG.md +90 -0
  238. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/Gemfile +35 -0
  239. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/Guardfile +8 -0
  240. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/LICENSE +20 -0
  241. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/README.md +312 -0
  242. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/Rakefile +47 -0
  243. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/Vagrantfile +96 -0
  244. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/adapter.rb +167 -0
  245. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/adapters/darwin.rb +84 -0
  246. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/adapters/linux.rb +110 -0
  247. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/adapters/polling.rb +66 -0
  248. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/adapters/windows.rb +81 -0
  249. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/directory_record.rb +317 -0
  250. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/listener.rb +203 -0
  251. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/multi_listener.rb +121 -0
  252. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/turnstile.rb +28 -0
  253. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/version.rb +3 -0
  254. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen.rb +38 -0
  255. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/listen.gemspec +26 -0
  256. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/adapter_spec.rb +142 -0
  257. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/adapters/darwin_spec.rb +31 -0
  258. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/adapters/linux_spec.rb +41 -0
  259. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/adapters/polling_spec.rb +68 -0
  260. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/adapters/windows_spec.rb +24 -0
  261. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/directory_record_spec.rb +1034 -0
  262. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/listener_spec.rb +155 -0
  263. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/multi_listener_spec.rb +156 -0
  264. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/turnstile_spec.rb +56 -0
  265. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen_spec.rb +73 -0
  266. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/spec_helper.rb +16 -0
  267. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/support/adapter_helper.rb +716 -0
  268. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/support/directory_record_helper.rb +55 -0
  269. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/support/fixtures_helper.rb +29 -0
  270. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/support/listeners_helper.rb +144 -0
  271. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/support/platform_helper.rb +11 -0
  272. data/vendor/bundle/gems/therubyracer-0.10.1/.gitignore +13 -0
  273. data/vendor/bundle/gems/therubyracer-0.10.1/.gitmodules +3 -0
  274. data/vendor/bundle/gems/therubyracer-0.10.1/.travis.yml +9 -0
  275. data/vendor/bundle/gems/therubyracer-0.10.1/.yardopts +1 -0
  276. data/vendor/bundle/gems/therubyracer-0.10.1/Changelog.md +196 -0
  277. data/vendor/bundle/gems/therubyracer-0.10.1/Gemfile +1 -0
  278. data/vendor/bundle/gems/therubyracer-0.10.1/README.md +167 -0
  279. data/vendor/bundle/gems/therubyracer-0.10.1/Rakefile +23 -0
  280. data/vendor/bundle/gems/therubyracer-0.10.1/bin/therubyracer +11 -0
  281. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/Makefile +213 -0
  282. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/extconf.rb +26 -0
  283. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/gem_make.out +156 -0
  284. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/rr.cpp +189 -0
  285. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/rr.h +41 -0
  286. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8.cpp +48 -0
  287. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_array.cpp +48 -0
  288. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_array.h +8 -0
  289. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_callbacks.cpp +81 -0
  290. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_callbacks.h +8 -0
  291. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_context.cpp +92 -0
  292. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_context.h +6 -0
  293. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_date.cpp +34 -0
  294. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_date.h +6 -0
  295. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_debug.cpp +17 -0
  296. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_debug.h +6 -0
  297. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_exception.cpp +133 -0
  298. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_exception.h +11 -0
  299. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_external.cpp +70 -0
  300. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_external.h +8 -0
  301. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_function.cpp +69 -0
  302. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_function.h +11 -0
  303. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_handle.cpp +186 -0
  304. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_handle.h +48 -0
  305. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_locker.cpp +139 -0
  306. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_locker.h +6 -0
  307. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_message.cpp +67 -0
  308. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_message.h +10 -0
  309. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_object.cpp +122 -0
  310. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_object.h +10 -0
  311. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_script.cpp +36 -0
  312. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_script.h +8 -0
  313. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_string.cpp +52 -0
  314. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_string.h +9 -0
  315. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_template.cpp +344 -0
  316. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_template.h +8 -0
  317. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_try_catch.cpp +70 -0
  318. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_try_catch.h +5 -0
  319. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_v8.cpp +35 -0
  320. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_v8.h +6 -0
  321. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_value.cpp +175 -0
  322. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_value.h +10 -0
  323. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_weakref.cpp +61 -0
  324. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_weakref.h +29 -0
  325. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/access.rb +87 -0
  326. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/array.rb +17 -0
  327. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/c/locker.rb +18 -0
  328. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/cli.rb +133 -0
  329. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/context.rb +111 -0
  330. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/error.rb +130 -0
  331. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/function.rb +44 -0
  332. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/object.rb +69 -0
  333. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/portal/caller.rb +37 -0
  334. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/portal/constructor.rb +98 -0
  335. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/portal/function.rb +63 -0
  336. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/portal/interceptors.rb +152 -0
  337. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/portal/proxies.rb +151 -0
  338. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/portal/templates.rb +73 -0
  339. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/portal.rb +86 -0
  340. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/stack.rb +66 -0
  341. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/tap.rb +9 -0
  342. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/version.rb +3 -0
  343. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8.rb +23 -0
  344. data/vendor/bundle/gems/therubyracer-0.10.1/spec/ext/array_spec.rb +15 -0
  345. data/vendor/bundle/gems/therubyracer-0.10.1/spec/ext/cxt_spec.rb +57 -0
  346. data/vendor/bundle/gems/therubyracer-0.10.1/spec/ext/ext_spec_helper.rb +27 -0
  347. data/vendor/bundle/gems/therubyracer-0.10.1/spec/ext/func_spec.rb +64 -0
  348. data/vendor/bundle/gems/therubyracer-0.10.1/spec/ext/object_spec.rb +10 -0
  349. data/vendor/bundle/gems/therubyracer-0.10.1/spec/ext/string_spec.rb +11 -0
  350. data/vendor/bundle/gems/therubyracer-0.10.1/spec/ext/try_catch_spec.rb +60 -0
  351. data/vendor/bundle/gems/therubyracer-0.10.1/spec/redjs/.gitignore +1 -0
  352. data/vendor/bundle/gems/therubyracer-0.10.1/spec/redjs/README.txt +8 -0
  353. data/vendor/bundle/gems/therubyracer-0.10.1/spec/redjs/jsapi_spec.rb +922 -0
  354. data/vendor/bundle/gems/therubyracer-0.10.1/spec/redjs/loadme.js +1 -0
  355. data/vendor/bundle/gems/therubyracer-0.10.1/spec/redjs_helper.rb +3 -0
  356. data/vendor/bundle/gems/therubyracer-0.10.1/spec/spec_helper.rb +9 -0
  357. data/vendor/bundle/gems/therubyracer-0.10.1/spec/v8/error_spec.rb +131 -0
  358. data/vendor/bundle/gems/therubyracer-0.10.1/spec/v8/portal/proxies_spec.rb +106 -0
  359. data/vendor/bundle/gems/therubyracer-0.10.1/specmem/handle_memspec.rb +41 -0
  360. data/vendor/bundle/gems/therubyracer-0.10.1/specmem/object_memspec.rb +14 -0
  361. data/vendor/bundle/gems/therubyracer-0.10.1/specmem/proxies_memspec.rb +49 -0
  362. data/vendor/bundle/gems/therubyracer-0.10.1/specmem/spec_helper.rb +24 -0
  363. data/vendor/bundle/gems/therubyracer-0.10.1/specthread/spec_helper.rb +2 -0
  364. data/vendor/bundle/gems/therubyracer-0.10.1/specthread/threading_spec.rb +13 -0
  365. data/vendor/bundle/gems/therubyracer-0.10.1/thefrontside.png +0 -0
  366. data/vendor/bundle/gems/therubyracer-0.10.1/therubyracer.gemspec +29 -0
  367. data/vendor/bundle/specifications/libv8-3.3.10.4-x86_64-darwin-11.gemspec +33 -0
  368. data/vendor/bundle/specifications/sass-3.1.19.gemspec +35 -0
  369. metadata +365 -3
@@ -57,10 +57,9 @@ module Classiccms
57
57
  #require models
58
58
  Dir[File.join(Dir.pwd, 'app/models/*.rb')].each {|file| require file }
59
59
 
60
- #FROM Gem
60
+ #FROM App
61
61
  #require mongoid
62
- Mongoid.load!(File.join(ROOT, 'mongoid.yml'))
63
-
62
+ Mongoid.load!(File.join(Dir.pwd, 'config/mongoid.yml'))
64
63
 
65
64
  $app.configure do |d|
66
65
  d.url_format = '/assets/:job'
@@ -23,6 +23,12 @@ module Classiccms
23
23
  #copy scaffold
24
24
  FileUtils.cp_r File.join(File.dirname(__FILE__), "scaffold"), Dir.pwd + "/#{app_name}"
25
25
 
26
+ #replace database
27
+ mongoid = File.read(File.join(Dir.pwd, app_name, 'config/mongoid.yml')).gsub('$', app_name)
28
+ File.open(File.join(Dir.pwd, app_name, 'config/mongoid.yml'), 'w') do |f|
29
+ f.puts mongoid
30
+ end
31
+
26
32
  puts "#{app_name} created!"
27
33
  end
28
34
  end
@@ -1,2 +1,6 @@
1
1
  source :rubygems
2
2
  gem 'classiccms'
3
+
4
+ group :test do
5
+ gem 'rspec'
6
+ end
@@ -10,14 +10,13 @@ defaults: &defaults
10
10
 
11
11
  development:
12
12
  <<: *defaults
13
- database: <%= CONFIG[:database] %>_production
13
+ database: $_production
14
14
 
15
15
  test:
16
16
  <<: *defaults
17
- database: <%= CONFIG[:database] %>_test
17
+ database: $_test
18
18
 
19
19
  # set these environment variables on your prod server
20
20
  production:
21
21
  <<: *defaults
22
- database: <%= CONFIG[:database] %>
23
-
22
+ database: $
@@ -0,0 +1,8 @@
1
+ require 'spec_helper.rb'
2
+ describe Article do
3
+ it 'should check if Article name is nil' do
4
+ a = Article.new
5
+ a.name.should == nil
6
+ end
7
+ end
8
+
@@ -0,0 +1,24 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+
4
+ #set environment to test
5
+ ENV['RACK_ENV'] = 'test'
6
+
7
+ #include app
8
+ require 'classiccms/application'
9
+ Classiccms.boot
10
+
11
+ #include sinatra end set environment
12
+ #require 'rack/test'
13
+ require 'sinatra'
14
+
15
+ set :environment, :test
16
+
17
+ RSpec.configure do |config|
18
+
19
+ config.before(:each) do
20
+ Mongoid.master.collections.reject { |c| c.name =~ /^system./ }.each(&:drop)
21
+ end
22
+ # config.include Rack::Test::Methods
23
+ end
24
+
@@ -1,3 +1,3 @@
1
1
  module Classiccms #:nodoc
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
data/spec/cli_spec.rb CHANGED
@@ -32,6 +32,14 @@ describe :Base do
32
32
  $stdout.string.should == "#{app_name} created!\n"
33
33
  end
34
34
  end
35
+ it 'should change the mongoid databases' do
36
+ capture_log do
37
+ app_name = 'mongoidTestApp'
38
+ Classiccms::Cli.command ['new', app_name]
39
+ File.open(File.join(app_name, 'config/mongoid.yml')).read.include?(app_name).should == true
40
+ end
41
+ end
42
+
35
43
  it "should create a directory with app name" do
36
44
  capture_log do
37
45
  app_name = 'app'
@@ -0,0 +1,395 @@
1
+ // Copyright 2008 the V8 project authors. All rights reserved.
2
+ // Redistribution and use in source and binary forms, with or without
3
+ // modification, are permitted provided that the following conditions are
4
+ // met:
5
+ //
6
+ // * Redistributions of source code must retain the above copyright
7
+ // notice, this list of conditions and the following disclaimer.
8
+ // * Redistributions in binary form must reproduce the above
9
+ // copyright notice, this list of conditions and the following
10
+ // disclaimer in the documentation and/or other materials provided
11
+ // with the distribution.
12
+ // * Neither the name of Google Inc. nor the names of its
13
+ // contributors may be used to endorse or promote products derived
14
+ // from this software without specific prior written permission.
15
+ //
16
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+
28
+ #ifndef V8_V8_DEBUG_H_
29
+ #define V8_V8_DEBUG_H_
30
+
31
+ #include "v8.h"
32
+
33
+ #ifdef _WIN32
34
+ typedef int int32_t;
35
+ typedef unsigned int uint32_t;
36
+ typedef unsigned short uint16_t; // NOLINT
37
+ typedef long long int64_t; // NOLINT
38
+
39
+ // Setup for Windows DLL export/import. See v8.h in this directory for
40
+ // information on how to build/use V8 as a DLL.
41
+ #if defined(BUILDING_V8_SHARED) && defined(USING_V8_SHARED)
42
+ #error both BUILDING_V8_SHARED and USING_V8_SHARED are set - please check the\
43
+ build configuration to ensure that at most one of these is set
44
+ #endif
45
+
46
+ #ifdef BUILDING_V8_SHARED
47
+ #define EXPORT __declspec(dllexport)
48
+ #elif USING_V8_SHARED
49
+ #define EXPORT __declspec(dllimport)
50
+ #else
51
+ #define EXPORT
52
+ #endif
53
+
54
+ #else // _WIN32
55
+
56
+ // Setup for Linux shared library export. See v8.h in this directory for
57
+ // information on how to build/use V8 as shared library.
58
+ #if defined(__GNUC__) && (__GNUC__ >= 4) && defined(V8_SHARED)
59
+ #define EXPORT __attribute__ ((visibility("default")))
60
+ #else // defined(__GNUC__) && (__GNUC__ >= 4)
61
+ #define EXPORT
62
+ #endif // defined(__GNUC__) && (__GNUC__ >= 4)
63
+
64
+ #endif // _WIN32
65
+
66
+
67
+ /**
68
+ * Debugger support for the V8 JavaScript engine.
69
+ */
70
+ namespace v8 {
71
+
72
+ // Debug events which can occur in the V8 JavaScript engine.
73
+ enum DebugEvent {
74
+ Break = 1,
75
+ Exception = 2,
76
+ NewFunction = 3,
77
+ BeforeCompile = 4,
78
+ AfterCompile = 5,
79
+ ScriptCollected = 6,
80
+ BreakForCommand = 7
81
+ };
82
+
83
+
84
+ class EXPORT Debug {
85
+ public:
86
+ /**
87
+ * A client object passed to the v8 debugger whose ownership will be taken by
88
+ * it. v8 is always responsible for deleting the object.
89
+ */
90
+ class ClientData {
91
+ public:
92
+ virtual ~ClientData() {}
93
+ };
94
+
95
+
96
+ /**
97
+ * A message object passed to the debug message handler.
98
+ */
99
+ class Message {
100
+ public:
101
+ /**
102
+ * Check type of message.
103
+ */
104
+ virtual bool IsEvent() const = 0;
105
+ virtual bool IsResponse() const = 0;
106
+ virtual DebugEvent GetEvent() const = 0;
107
+
108
+ /**
109
+ * Indicate whether this is a response to a continue command which will
110
+ * start the VM running after this is processed.
111
+ */
112
+ virtual bool WillStartRunning() const = 0;
113
+
114
+ /**
115
+ * Access to execution state and event data. Don't store these cross
116
+ * callbacks as their content becomes invalid. These objects are from the
117
+ * debugger event that started the debug message loop.
118
+ */
119
+ virtual Handle<Object> GetExecutionState() const = 0;
120
+ virtual Handle<Object> GetEventData() const = 0;
121
+
122
+ /**
123
+ * Get the debugger protocol JSON.
124
+ */
125
+ virtual Handle<String> GetJSON() const = 0;
126
+
127
+ /**
128
+ * Get the context active when the debug event happened. Note this is not
129
+ * the current active context as the JavaScript part of the debugger is
130
+ * running in its own context which is entered at this point.
131
+ */
132
+ virtual Handle<Context> GetEventContext() const = 0;
133
+
134
+ /**
135
+ * Client data passed with the corresponding request if any. This is the
136
+ * client_data data value passed into Debug::SendCommand along with the
137
+ * request that led to the message or NULL if the message is an event. The
138
+ * debugger takes ownership of the data and will delete it even if there is
139
+ * no message handler.
140
+ */
141
+ virtual ClientData* GetClientData() const = 0;
142
+
143
+ virtual ~Message() {}
144
+ };
145
+
146
+
147
+ /**
148
+ * An event details object passed to the debug event listener.
149
+ */
150
+ class EventDetails {
151
+ public:
152
+ /**
153
+ * Event type.
154
+ */
155
+ virtual DebugEvent GetEvent() const = 0;
156
+
157
+ /**
158
+ * Access to execution state and event data of the debug event. Don't store
159
+ * these cross callbacks as their content becomes invalid.
160
+ */
161
+ virtual Handle<Object> GetExecutionState() const = 0;
162
+ virtual Handle<Object> GetEventData() const = 0;
163
+
164
+ /**
165
+ * Get the context active when the debug event happened. Note this is not
166
+ * the current active context as the JavaScript part of the debugger is
167
+ * running in its own context which is entered at this point.
168
+ */
169
+ virtual Handle<Context> GetEventContext() const = 0;
170
+
171
+ /**
172
+ * Client data passed with the corresponding callback when it was
173
+ * registered.
174
+ */
175
+ virtual Handle<Value> GetCallbackData() const = 0;
176
+
177
+ /**
178
+ * Client data passed to DebugBreakForCommand function. The
179
+ * debugger takes ownership of the data and will delete it even if
180
+ * there is no message handler.
181
+ */
182
+ virtual ClientData* GetClientData() const = 0;
183
+
184
+ virtual ~EventDetails() {}
185
+ };
186
+
187
+
188
+ /**
189
+ * Debug event callback function.
190
+ *
191
+ * \param event the type of the debug event that triggered the callback
192
+ * (enum DebugEvent)
193
+ * \param exec_state execution state (JavaScript object)
194
+ * \param event_data event specific data (JavaScript object)
195
+ * \param data value passed by the user to SetDebugEventListener
196
+ */
197
+ typedef void (*EventCallback)(DebugEvent event,
198
+ Handle<Object> exec_state,
199
+ Handle<Object> event_data,
200
+ Handle<Value> data);
201
+
202
+ /**
203
+ * Debug event callback function.
204
+ *
205
+ * \param event_details object providing information about the debug event
206
+ *
207
+ * A EventCallback2 does not take possession of the event data,
208
+ * and must not rely on the data persisting after the handler returns.
209
+ */
210
+ typedef void (*EventCallback2)(const EventDetails& event_details);
211
+
212
+ /**
213
+ * Debug message callback function.
214
+ *
215
+ * \param message the debug message handler message object
216
+ * \param length length of the message
217
+ * \param client_data the data value passed when registering the message handler
218
+
219
+ * A MessageHandler does not take possession of the message string,
220
+ * and must not rely on the data persisting after the handler returns.
221
+ *
222
+ * This message handler is deprecated. Use MessageHandler2 instead.
223
+ */
224
+ typedef void (*MessageHandler)(const uint16_t* message, int length,
225
+ ClientData* client_data);
226
+
227
+ /**
228
+ * Debug message callback function.
229
+ *
230
+ * \param message the debug message handler message object
231
+ *
232
+ * A MessageHandler does not take possession of the message data,
233
+ * and must not rely on the data persisting after the handler returns.
234
+ */
235
+ typedef void (*MessageHandler2)(const Message& message);
236
+
237
+ /**
238
+ * Debug host dispatch callback function.
239
+ */
240
+ typedef void (*HostDispatchHandler)();
241
+
242
+ /**
243
+ * Callback function for the host to ensure debug messages are processed.
244
+ */
245
+ typedef void (*DebugMessageDispatchHandler)();
246
+
247
+ // Set a C debug event listener.
248
+ static bool SetDebugEventListener(EventCallback that,
249
+ Handle<Value> data = Handle<Value>());
250
+ static bool SetDebugEventListener2(EventCallback2 that,
251
+ Handle<Value> data = Handle<Value>());
252
+
253
+ // Set a JavaScript debug event listener.
254
+ static bool SetDebugEventListener(v8::Handle<v8::Object> that,
255
+ Handle<Value> data = Handle<Value>());
256
+
257
+ // Schedule a debugger break to happen when JavaScript code is run
258
+ // in the given isolate. If no isolate is provided the default
259
+ // isolate is used.
260
+ static void DebugBreak(Isolate* isolate = NULL);
261
+
262
+ // Remove scheduled debugger break in given isolate if it has not
263
+ // happened yet. If no isolate is provided the default isolate is
264
+ // used.
265
+ static void CancelDebugBreak(Isolate* isolate = NULL);
266
+
267
+ // Break execution of JavaScript in the given isolate (this method
268
+ // can be invoked from a non-VM thread) for further client command
269
+ // execution on a VM thread. Client data is then passed in
270
+ // EventDetails to EventCallback at the moment when the VM actually
271
+ // stops. If no isolate is provided the default isolate is used.
272
+ static void DebugBreakForCommand(ClientData* data = NULL,
273
+ Isolate* isolate = NULL);
274
+
275
+ // Message based interface. The message protocol is JSON. NOTE the message
276
+ // handler thread is not supported any more parameter must be false.
277
+ static void SetMessageHandler(MessageHandler handler,
278
+ bool message_handler_thread = false);
279
+ static void SetMessageHandler2(MessageHandler2 handler);
280
+
281
+ // If no isolate is provided the default isolate is
282
+ // used.
283
+ static void SendCommand(const uint16_t* command, int length,
284
+ ClientData* client_data = NULL,
285
+ Isolate* isolate = NULL);
286
+
287
+ // Dispatch interface.
288
+ static void SetHostDispatchHandler(HostDispatchHandler handler,
289
+ int period = 100);
290
+
291
+ /**
292
+ * Register a callback function to be called when a debug message has been
293
+ * received and is ready to be processed. For the debug messages to be
294
+ * processed V8 needs to be entered, and in certain embedding scenarios this
295
+ * callback can be used to make sure V8 is entered for the debug message to
296
+ * be processed. Note that debug messages will only be processed if there is
297
+ * a V8 break. This can happen automatically by using the option
298
+ * --debugger-auto-break.
299
+ * \param provide_locker requires that V8 acquires v8::Locker for you before
300
+ * calling handler
301
+ */
302
+ static void SetDebugMessageDispatchHandler(
303
+ DebugMessageDispatchHandler handler, bool provide_locker = false);
304
+
305
+ /**
306
+ * Run a JavaScript function in the debugger.
307
+ * \param fun the function to call
308
+ * \param data passed as second argument to the function
309
+ * With this call the debugger is entered and the function specified is called
310
+ * with the execution state as the first argument. This makes it possible to
311
+ * get access to information otherwise not available during normal JavaScript
312
+ * execution e.g. details on stack frames. Receiver of the function call will
313
+ * be the debugger context global object, however this is a subject to change.
314
+ * The following example shows a JavaScript function which when passed to
315
+ * v8::Debug::Call will return the current line of JavaScript execution.
316
+ *
317
+ * \code
318
+ * function frame_source_line(exec_state) {
319
+ * return exec_state.frame(0).sourceLine();
320
+ * }
321
+ * \endcode
322
+ */
323
+ static Local<Value> Call(v8::Handle<v8::Function> fun,
324
+ Handle<Value> data = Handle<Value>());
325
+
326
+ /**
327
+ * Returns a mirror object for the given object.
328
+ */
329
+ static Local<Value> GetMirror(v8::Handle<v8::Value> obj);
330
+
331
+ /**
332
+ * Enable the V8 builtin debug agent. The debugger agent will listen on the
333
+ * supplied TCP/IP port for remote debugger connection.
334
+ * \param name the name of the embedding application
335
+ * \param port the TCP/IP port to listen on
336
+ * \param wait_for_connection whether V8 should pause on a first statement
337
+ * allowing remote debugger to connect before anything interesting happened
338
+ */
339
+ static bool EnableAgent(const char* name, int port,
340
+ bool wait_for_connection = false);
341
+
342
+ /**
343
+ * Makes V8 process all pending debug messages.
344
+ *
345
+ * From V8 point of view all debug messages come asynchronously (e.g. from
346
+ * remote debugger) but they all must be handled synchronously: V8 cannot
347
+ * do 2 things at one time so normal script execution must be interrupted
348
+ * for a while.
349
+ *
350
+ * Generally when message arrives V8 may be in one of 3 states:
351
+ * 1. V8 is running script; V8 will automatically interrupt and process all
352
+ * pending messages (however auto_break flag should be enabled);
353
+ * 2. V8 is suspended on debug breakpoint; in this state V8 is dedicated
354
+ * to reading and processing debug messages;
355
+ * 3. V8 is not running at all or has called some long-working C++ function;
356
+ * by default it means that processing of all debug messages will be deferred
357
+ * until V8 gets control again; however, embedding application may improve
358
+ * this by manually calling this method.
359
+ *
360
+ * It makes sense to call this method whenever a new debug message arrived and
361
+ * V8 is not already running. Method v8::Debug::SetDebugMessageDispatchHandler
362
+ * should help with the former condition.
363
+ *
364
+ * Technically this method in many senses is equivalent to executing empty
365
+ * script:
366
+ * 1. It does nothing except for processing all pending debug messages.
367
+ * 2. It should be invoked with the same precautions and from the same context
368
+ * as V8 script would be invoked from, because:
369
+ * a. with "evaluate" command it can do whatever normal script can do,
370
+ * including all native calls;
371
+ * b. no other thread should call V8 while this method is running
372
+ * (v8::Locker may be used here).
373
+ *
374
+ * "Evaluate" debug command behavior currently is not specified in scope
375
+ * of this method.
376
+ */
377
+ static void ProcessDebugMessages();
378
+
379
+ /**
380
+ * Debugger is running in its own context which is entered while debugger
381
+ * messages are being dispatched. This is an explicit getter for this
382
+ * debugger context. Note that the content of the debugger context is subject
383
+ * to change.
384
+ */
385
+ static Local<Context> GetDebugContext();
386
+ };
387
+
388
+
389
+ } // namespace v8
390
+
391
+
392
+ #undef EXPORT
393
+
394
+
395
+ #endif // V8_V8_DEBUG_H_
@@ -0,0 +1,117 @@
1
+ // Copyright 2011 the V8 project authors. All rights reserved.
2
+ // Redistribution and use in source and binary forms, with or without
3
+ // modification, are permitted provided that the following conditions are
4
+ // met:
5
+ //
6
+ // * Redistributions of source code must retain the above copyright
7
+ // notice, this list of conditions and the following disclaimer.
8
+ // * Redistributions in binary form must reproduce the above
9
+ // copyright notice, this list of conditions and the following
10
+ // disclaimer in the documentation and/or other materials provided
11
+ // with the distribution.
12
+ // * Neither the name of Google Inc. nor the names of its
13
+ // contributors may be used to endorse or promote products derived
14
+ // from this software without specific prior written permission.
15
+ //
16
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+
28
+ #ifndef PREPARSER_H
29
+ #define PREPARSER_H
30
+
31
+ #include "v8stdint.h"
32
+
33
+ #ifdef _WIN32
34
+
35
+ // Setup for Windows DLL export/import. When building the V8 DLL the
36
+ // BUILDING_V8_SHARED needs to be defined. When building a program which uses
37
+ // the V8 DLL USING_V8_SHARED needs to be defined. When either building the V8
38
+ // static library or building a program which uses the V8 static library neither
39
+ // BUILDING_V8_SHARED nor USING_V8_SHARED should be defined.
40
+ #if defined(BUILDING_V8_SHARED) && defined(USING_V8_SHARED)
41
+ #error both BUILDING_V8_SHARED and USING_V8_SHARED are set - please check the\
42
+ build configuration to ensure that at most one of these is set
43
+ #endif
44
+
45
+ #ifdef BUILDING_V8_SHARED
46
+ #define V8EXPORT __declspec(dllexport)
47
+ #elif USING_V8_SHARED
48
+ #define V8EXPORT __declspec(dllimport)
49
+ #else
50
+ #define V8EXPORT
51
+ #endif // BUILDING_V8_SHARED
52
+
53
+ #else // _WIN32
54
+
55
+ // Setup for Linux shared library export. There is no need to distinguish
56
+ // between building or using the V8 shared library, but we should not
57
+ // export symbols when we are building a static library.
58
+ #if defined(__GNUC__) && (__GNUC__ >= 4) && defined(V8_SHARED)
59
+ #define V8EXPORT __attribute__ ((visibility("default")))
60
+ #else // defined(__GNUC__) && (__GNUC__ >= 4)
61
+ #define V8EXPORT
62
+ #endif // defined(__GNUC__) && (__GNUC__ >= 4)
63
+
64
+ #endif // _WIN32
65
+
66
+
67
+ namespace v8 {
68
+
69
+ // The result of preparsing is either a stack overflow error, or an opaque
70
+ // blob of data that can be passed back into the parser.
71
+ class V8EXPORT PreParserData {
72
+ public:
73
+ PreParserData(size_t size, const uint8_t* data)
74
+ : data_(data), size_(size) { }
75
+
76
+ // Create a PreParserData value where stack_overflow reports true.
77
+ static PreParserData StackOverflow() { return PreParserData(0, NULL); }
78
+
79
+ // Whether the pre-parser stopped due to a stack overflow.
80
+ // If this is the case, size() and data() should not be used.
81
+ bool stack_overflow() { return size_ == 0u; }
82
+
83
+ // The size of the data in bytes.
84
+ size_t size() const { return size_; }
85
+
86
+ // Pointer to the data.
87
+ const uint8_t* data() const { return data_; }
88
+
89
+ private:
90
+ const uint8_t* const data_;
91
+ const size_t size_;
92
+ };
93
+
94
+
95
+ // Interface for a stream of Unicode characters.
96
+ class V8EXPORT UnicodeInputStream { // NOLINT - Thinks V8EXPORT is class name.
97
+ public:
98
+ virtual ~UnicodeInputStream();
99
+
100
+ // Returns the next Unicode code-point in the input, or a negative value when
101
+ // there is no more input in the stream.
102
+ virtual int32_t Next() = 0;
103
+ };
104
+
105
+
106
+ // Preparse a JavaScript program. The source code is provided as a
107
+ // UnicodeInputStream. The max_stack_size limits the amount of stack
108
+ // space that the preparser is allowed to use. If the preparser uses
109
+ // more stack space than the limit provided, the result's stack_overflow()
110
+ // method will return true. Otherwise the result contains preparser
111
+ // data that can be used by the V8 parser to speed up parsing.
112
+ PreParserData V8EXPORT Preparse(UnicodeInputStream* input,
113
+ size_t max_stack_size);
114
+
115
+ } // namespace v8.
116
+
117
+ #endif // PREPARSER_H