classiccms 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/classiccms/application.rb +2 -3
- data/lib/classiccms/cli.rb +6 -0
- data/lib/classiccms/scaffold/Gemfile +4 -0
- data/lib/classiccms/{mongoid.yml → scaffold/config/mongoid.yml} +3 -4
- data/lib/classiccms/scaffold/spec/models/article_spec.rb +8 -0
- data/lib/classiccms/scaffold/spec/spec_helper.rb +24 -0
- data/lib/classiccms/version.rb +1 -1
- data/spec/cli_spec.rb +8 -0
- data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/build/v8/libv8.a +0 -0
- data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/build/v8/libv8preparser.a +0 -0
- data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/v8/include/v8-debug.h +395 -0
- data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/v8/include/v8-preparser.h +117 -0
- data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/v8/include/v8-profiler.h +505 -0
- data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/v8/include/v8-testing.h +104 -0
- data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/v8/include/v8.h +4124 -0
- data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/v8/include/v8stdint.h +53 -0
- data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/version.rb +6 -0
- data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8.rb +15 -0
- data/vendor/bundle/gems/sass-3.1.19/.yardopts +11 -0
- data/vendor/bundle/gems/sass-3.1.19/CONTRIBUTING +3 -0
- data/vendor/bundle/gems/sass-3.1.19/MIT-LICENSE +20 -0
- data/vendor/bundle/gems/sass-3.1.19/README.md +200 -0
- data/vendor/bundle/gems/sass-3.1.19/REVISION +1 -0
- data/vendor/bundle/gems/sass-3.1.19/Rakefile +339 -0
- data/vendor/bundle/gems/sass-3.1.19/VERSION +1 -0
- data/vendor/bundle/gems/sass-3.1.19/VERSION_NAME +1 -0
- data/vendor/bundle/gems/sass-3.1.19/bin/sass +8 -0
- data/vendor/bundle/gems/sass-3.1.19/bin/sass-convert +7 -0
- data/vendor/bundle/gems/sass-3.1.19/bin/scss +8 -0
- data/vendor/bundle/gems/sass-3.1.19/extra/update_watch.rb +13 -0
- data/vendor/bundle/gems/sass-3.1.19/init.rb +18 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/cache_stores/base.rb +86 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/cache_stores/chain.rb +33 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/cache_stores/filesystem.rb +61 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/cache_stores/memory.rb +47 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/cache_stores/null.rb +25 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/cache_stores.rb +15 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/callbacks.rb +66 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/css.rb +390 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/engine.rb +880 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/environment.rb +180 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/error.rb +201 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/exec.rb +682 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/importers/base.rb +139 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/importers/filesystem.rb +149 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/importers.rb +22 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/less.rb +382 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/logger/base.rb +32 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/logger/log_level.rb +49 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/logger.rb +15 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin/compiler.rb +384 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin/configuration.rb +123 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin/generic.rb +15 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin/merb.rb +48 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin/rack.rb +60 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin/rails.rb +47 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin/staleness_checker.rb +183 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin.rb +132 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/railtie.rb +9 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/repl.rb +57 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/root.rb +7 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/bool.rb +18 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/color.rb +475 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/css_lexer.rb +29 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/css_parser.rb +31 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/funcall.rb +175 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/functions.rb +1381 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/interpolation.rb +79 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/lexer.rb +337 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/list.rb +84 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/literal.rb +230 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/node.rb +99 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/number.rb +452 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/operation.rb +107 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/parser.rb +474 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/string.rb +51 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/string_interpolation.rb +103 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/unary_operation.rb +64 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/variable.rb +58 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/script.rb +39 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss/css_parser.rb +46 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss/parser.rb +1055 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss/rx.rb +137 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss/sass_parser.rb +11 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss/script_lexer.rb +15 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss/script_parser.rb +25 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss/static_parser.rb +40 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss.rb +17 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/selector/abstract_sequence.rb +71 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/selector/comma_sequence.rb +86 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/selector/sequence.rb +296 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/selector/simple.rb +119 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/selector/simple_sequence.rb +154 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/selector.rb +373 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/shared.rb +76 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/charset_node.rb +22 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/comment_node.rb +90 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/debug_node.rb +18 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/directive_node.rb +28 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/each_node.rb +24 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/extend_node.rb +29 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/for_node.rb +36 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/function_node.rb +27 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/if_node.rb +52 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/import_node.rb +68 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/media_node.rb +32 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/mixin_def_node.rb +27 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/mixin_node.rb +32 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/node.rb +188 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/prop_node.rb +148 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/return_node.rb +18 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/root_node.rb +28 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/rule_node.rb +127 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/variable_node.rb +30 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/base.rb +75 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/check_nesting.rb +127 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/convert.rb +262 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/cssize.rb +206 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/deep_copy.rb +87 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/extend.rb +42 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/perform.rb +357 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/set_options.rb +97 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/to_css.rb +219 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/warn_node.rb +18 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/while_node.rb +18 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/util/multibyte_string_scanner.rb +134 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/util/subset_map.rb +101 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/util.rb +800 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass/version.rb +112 -0
- data/vendor/bundle/gems/sass-3.1.19/lib/sass.rb +73 -0
- data/vendor/bundle/gems/sass-3.1.19/rails/init.rb +1 -0
- data/vendor/bundle/gems/sass-3.1.19/test/Gemfile +4 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/cache_test.rb +89 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/callbacks_test.rb +61 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/conversion_test.rb +1245 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/css2sass_test.rb +397 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/data/hsl-rgb.txt +319 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/engine_test.rb +2730 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/extend_test.rb +1663 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/fixtures/test_staleness_check_across_importers.css +1 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/fixtures/test_staleness_check_across_importers.scss +1 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/functions_test.rb +1047 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/importer_test.rb +192 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/less_conversion_test.rb +653 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/logger_test.rb +58 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/mock_importer.rb +49 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/more_results/more1.css +9 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/more_results/more1_with_line_comments.css +26 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/more_results/more_import.css +29 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/more_templates/_more_partial.sass +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/more_templates/more1.sass +23 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/more_templates/more_import.sass +11 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/plugin_test.rb +496 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/alt.css +4 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/basic.css +9 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/compact.css +5 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/complex.css +86 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/compressed.css +1 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/expanded.css +19 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/if.css +3 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/import.css +31 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/import_charset.css +5 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/import_charset_1_8.css +5 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/import_charset_ibm866.css +5 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/line_numbers.css +49 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/mixins.css +95 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/multiline.css +24 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/nested.css +22 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/options.css +1 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/parent_ref.css +13 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/script.css +16 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/scss_import.css +31 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/scss_importee.css +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/subdir/nested_subdir/nested_subdir.css +1 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/subdir/subdir.css +3 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/units.css +11 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/warn.css +0 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/results/warn_imported.css +0 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/script_conversion_test.rb +285 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/script_test.rb +519 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/scss/css_test.rb +975 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/scss/rx_test.rb +156 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/scss/scss_test.rb +1308 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/scss/test_helper.rb +37 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/_double_import_loop2.sass +1 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/_imported_charset_ibm866.sass +4 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/_imported_charset_utf8.sass +4 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/_partial.sass +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/alt.sass +16 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/basic.sass +23 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/bork1.sass +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/bork2.sass +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/bork3.sass +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/bork4.sass +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/bork5.sass +3 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/compact.sass +17 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/complex.sass +305 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/compressed.sass +15 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/double_import_loop1.sass +1 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/expanded.sass +17 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/if.sass +11 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/import.sass +12 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/import_charset.sass +9 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/import_charset_1_8.sass +6 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/import_charset_ibm866.sass +11 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/importee.less +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/importee.sass +19 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/line_numbers.sass +13 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/mixin_bork.sass +5 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/mixins.sass +76 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/multiline.sass +20 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested.sass +25 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested_bork1.sass +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested_bork2.sass +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested_bork3.sass +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested_bork4.sass +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested_bork5.sass +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested_import.sass +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested_mixin_bork.sass +6 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/options.sass +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/parent_ref.sass +25 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/script.sass +101 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/scss_import.scss +11 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/scss_importee.scss +1 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/single_import_loop.sass +1 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +2 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +3 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/subdir/subdir.sass +6 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/units.sass +11 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/warn.sass +3 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/warn_imported.sass +4 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/test_helper.rb +8 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/util/multibyte_string_scanner_test.rb +147 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/util/subset_map_test.rb +91 -0
- data/vendor/bundle/gems/sass-3.1.19/test/sass/util_test.rb +282 -0
- data/vendor/bundle/gems/sass-3.1.19/test/test_helper.rb +70 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/CHANGELOG.md +90 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/Gemfile +35 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/Guardfile +8 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/LICENSE +20 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/README.md +312 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/Rakefile +47 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/Vagrantfile +96 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/adapter.rb +167 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/adapters/darwin.rb +84 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/adapters/linux.rb +110 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/adapters/polling.rb +66 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/adapters/windows.rb +81 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/directory_record.rb +317 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/listener.rb +203 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/multi_listener.rb +121 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/turnstile.rb +28 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/version.rb +3 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen.rb +38 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/listen.gemspec +26 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/adapter_spec.rb +142 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/adapters/darwin_spec.rb +31 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/adapters/linux_spec.rb +41 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/adapters/polling_spec.rb +68 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/adapters/windows_spec.rb +24 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/directory_record_spec.rb +1034 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/listener_spec.rb +155 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/multi_listener_spec.rb +156 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/turnstile_spec.rb +56 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen_spec.rb +73 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/spec_helper.rb +16 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/support/adapter_helper.rb +716 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/support/directory_record_helper.rb +55 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/support/fixtures_helper.rb +29 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/support/listeners_helper.rb +144 -0
- data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/support/platform_helper.rb +11 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/.gitignore +13 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/.gitmodules +3 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/.travis.yml +9 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/.yardopts +1 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/Changelog.md +196 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/Gemfile +1 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/README.md +167 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/Rakefile +23 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/bin/therubyracer +11 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/Makefile +213 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/extconf.rb +26 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/gem_make.out +156 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/rr.cpp +189 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/rr.h +41 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8.cpp +48 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_array.cpp +48 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_array.h +8 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_callbacks.cpp +81 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_callbacks.h +8 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_context.cpp +92 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_context.h +6 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_date.cpp +34 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_date.h +6 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_debug.cpp +17 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_debug.h +6 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_exception.cpp +133 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_exception.h +11 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_external.cpp +70 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_external.h +8 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_function.cpp +69 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_function.h +11 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_handle.cpp +186 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_handle.h +48 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_locker.cpp +139 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_locker.h +6 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_message.cpp +67 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_message.h +10 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_object.cpp +122 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_object.h +10 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_script.cpp +36 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_script.h +8 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_string.cpp +52 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_string.h +9 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_template.cpp +344 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_template.h +8 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_try_catch.cpp +70 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_try_catch.h +5 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_v8.cpp +35 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_v8.h +6 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_value.cpp +175 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_value.h +10 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_weakref.cpp +61 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_weakref.h +29 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/access.rb +87 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/array.rb +17 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/c/locker.rb +18 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/cli.rb +133 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/context.rb +111 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/error.rb +130 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/function.rb +44 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/object.rb +69 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/portal/caller.rb +37 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/portal/constructor.rb +98 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/portal/function.rb +63 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/portal/interceptors.rb +152 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/portal/proxies.rb +151 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/portal/templates.rb +73 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/portal.rb +86 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/stack.rb +66 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/tap.rb +9 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/version.rb +3 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8.rb +23 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/spec/ext/array_spec.rb +15 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/spec/ext/cxt_spec.rb +57 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/spec/ext/ext_spec_helper.rb +27 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/spec/ext/func_spec.rb +64 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/spec/ext/object_spec.rb +10 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/spec/ext/string_spec.rb +11 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/spec/ext/try_catch_spec.rb +60 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/spec/redjs/.gitignore +1 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/spec/redjs/README.txt +8 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/spec/redjs/jsapi_spec.rb +922 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/spec/redjs/loadme.js +1 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/spec/redjs_helper.rb +3 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/spec/spec_helper.rb +9 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/spec/v8/error_spec.rb +131 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/spec/v8/portal/proxies_spec.rb +106 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/specmem/handle_memspec.rb +41 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/specmem/object_memspec.rb +14 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/specmem/proxies_memspec.rb +49 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/specmem/spec_helper.rb +24 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/specthread/spec_helper.rb +2 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/specthread/threading_spec.rb +13 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/thefrontside.png +0 -0
- data/vendor/bundle/gems/therubyracer-0.10.1/therubyracer.gemspec +29 -0
- data/vendor/bundle/specifications/libv8-3.3.10.4-x86_64-darwin-11.gemspec +33 -0
- data/vendor/bundle/specifications/sass-3.1.19.gemspec +35 -0
- metadata +365 -3
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
#include "rr.h"
|
|
2
|
+
#include "v8_handle.h"
|
|
3
|
+
#include "v8_function.h"
|
|
4
|
+
#include "v8_template.h"
|
|
5
|
+
#include "v8_external.h"
|
|
6
|
+
#include "v8_callbacks.h"
|
|
7
|
+
|
|
8
|
+
using namespace v8;
|
|
9
|
+
|
|
10
|
+
namespace {
|
|
11
|
+
|
|
12
|
+
VALUE ObjectTemplateClass;
|
|
13
|
+
VALUE FunctionTemplateClass;
|
|
14
|
+
|
|
15
|
+
struct v8_callback_data {
|
|
16
|
+
VALUE handler;
|
|
17
|
+
VALUE getter;
|
|
18
|
+
VALUE setter;
|
|
19
|
+
VALUE query;
|
|
20
|
+
VALUE deleter;
|
|
21
|
+
VALUE enumerator;
|
|
22
|
+
VALUE data;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
void delete_v8_data(Persistent<Value> value, void* parameter) {
|
|
26
|
+
value.Dispose();
|
|
27
|
+
delete (v8_callback_data*)parameter;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
Local<External> make_v8_data(int argc, VALUE *argv, const char* argf) {
|
|
31
|
+
VALUE handler; VALUE data;
|
|
32
|
+
rb_scan_args(argc, argv, argf, &handler, &data);
|
|
33
|
+
v8_callback_data* v8_data = new v8_callback_data();
|
|
34
|
+
v8_data->handler = handler;
|
|
35
|
+
v8_data->data = data;
|
|
36
|
+
Local<External> external = External::New((void*)v8_data);
|
|
37
|
+
Persistent<External>::New(external).MakeWeak((void*)v8_data, delete_v8_data);
|
|
38
|
+
return external;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
Persistent<Template> tmpl(VALUE self) {
|
|
42
|
+
return rr_v8_handle<Template>(self);
|
|
43
|
+
}
|
|
44
|
+
Persistent<ObjectTemplate> obj(VALUE self) {
|
|
45
|
+
return rr_v8_handle<ObjectTemplate>(self);
|
|
46
|
+
}
|
|
47
|
+
Persistent<FunctionTemplate> func(VALUE self) {
|
|
48
|
+
return rr_v8_handle<FunctionTemplate>(self);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
VALUE Set(VALUE self, VALUE name, VALUE value) {
|
|
52
|
+
HandleScope handles;
|
|
53
|
+
Local<String> key = rr_rb2v8(name)->ToString();
|
|
54
|
+
Persistent<Data> data = rr_v8_handle<Data>(value);
|
|
55
|
+
tmpl(self)->Set(key, data);
|
|
56
|
+
return Qnil;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
Handle<Value> RubyInvocationCallback(const Arguments& args) {
|
|
60
|
+
Handle<External> v8_data_wrapper = Handle<External>::Cast(args.Data());
|
|
61
|
+
v8_callback_data* v8_data = (v8_callback_data*)v8_data_wrapper->Value();
|
|
62
|
+
if (RTEST(v8_data->handler)) {
|
|
63
|
+
VALUE rb_args = rr_v82rb(args);
|
|
64
|
+
rb_iv_set(rb_args, "data", v8_data->data);
|
|
65
|
+
VALUE result = rb_funcall(v8_data->handler, rb_intern("call"), 1, rb_args);
|
|
66
|
+
return rr_rb2v8(result);
|
|
67
|
+
} else {
|
|
68
|
+
return Handle<Value>();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
namespace Obj {
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
v8_callback_data* accessor_info_data(const AccessorInfo& info) {
|
|
76
|
+
Handle<External> v8_data_wrapper = Handle<External>::Cast(info.Data());
|
|
77
|
+
return (v8_callback_data*)v8_data_wrapper->Value();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
VALUE accessor_info_rb(const AccessorInfo& info) {
|
|
81
|
+
VALUE rb_data = accessor_info_data(info)->data;
|
|
82
|
+
VALUE rb_info = rr_v82rb(info);
|
|
83
|
+
rb_iv_set(rb_info, "data", rb_data);
|
|
84
|
+
return rb_info;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
Local<External> accessor_info_data(VALUE getter, VALUE setter, VALUE query, VALUE deleter, VALUE enumerator, VALUE data) {
|
|
88
|
+
v8_callback_data* v8_data = new v8_callback_data();
|
|
89
|
+
v8_data->getter = getter;
|
|
90
|
+
v8_data->setter = setter;
|
|
91
|
+
v8_data->query = query;
|
|
92
|
+
v8_data->deleter = deleter;
|
|
93
|
+
v8_data->enumerator = enumerator;
|
|
94
|
+
v8_data->data = data;
|
|
95
|
+
Local<External> external = External::New((void*)v8_data);
|
|
96
|
+
Persistent<External>::New(external).MakeWeak((void*)v8_data, delete_v8_data);
|
|
97
|
+
return external;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* NamedProperty[Getter|Setter] are used as interceptors on object.
|
|
102
|
+
* See ObjectTemplate::SetNamedPropertyHandler.
|
|
103
|
+
*/
|
|
104
|
+
Handle<Value> RubyNamedPropertyGetter(Local<String> property, const AccessorInfo& info) {
|
|
105
|
+
VALUE getter = accessor_info_data(info)->getter;
|
|
106
|
+
return rr_rb2v8(rb_funcall(getter, rb_intern("call"), 2, rr_v82rb(property), accessor_info_rb(info)));
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Returns the value if the setter intercepts the request.
|
|
111
|
+
* Otherwise, returns an empty handle.
|
|
112
|
+
*/
|
|
113
|
+
Handle<Value> RubyNamedPropertySetter(Local<String> property, Local<Value> value, const AccessorInfo& info) {
|
|
114
|
+
VALUE setter = accessor_info_data(info)->setter;
|
|
115
|
+
VALUE result = rb_funcall(setter, rb_intern("call"), 3, rr_v82rb(property), rr_v82rb(value), accessor_info_rb(info));
|
|
116
|
+
return rr_rb2v8(result);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Returns a non-empty handle if the interceptor intercepts the request.
|
|
122
|
+
* The result is true if the property exists and false otherwise.
|
|
123
|
+
*/
|
|
124
|
+
Handle<Integer> RubyNamedPropertyQuery(Local<String> property, const AccessorInfo& info) {
|
|
125
|
+
VALUE query = accessor_info_data(info)->query;
|
|
126
|
+
VALUE result = rb_funcall(query, rb_intern("call"), 2, rr_v82rb(property), accessor_info_rb(info));
|
|
127
|
+
Handle<Value> intercepts = rr_rb2v8(result);
|
|
128
|
+
return intercepts.IsEmpty() ? Handle<Integer>() : Integer::New(None);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Returns a non-empty handle if the deleter intercepts the request.
|
|
133
|
+
* The return value is true if the property could be deleted and false
|
|
134
|
+
* otherwise.
|
|
135
|
+
*/
|
|
136
|
+
Handle<Boolean> RubyNamedPropertyDeleter(Local<String> property, const AccessorInfo& info) {
|
|
137
|
+
VALUE deleter = accessor_info_data(info)->deleter;
|
|
138
|
+
VALUE result = rb_funcall(deleter, rb_intern("call"), 2, rr_v82rb(property), accessor_info_rb(info));
|
|
139
|
+
Handle<Value> intercepts = rr_rb2v8(result);
|
|
140
|
+
return intercepts.IsEmpty() ? Handle<Boolean>() : intercepts->ToBoolean();
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Returns an array containing the names of the properties the named
|
|
145
|
+
* property getter intercepts.
|
|
146
|
+
*/
|
|
147
|
+
Handle<Array> RubyNamedPropertyEnumerator(const AccessorInfo& info) {
|
|
148
|
+
VALUE enumerator = accessor_info_data(info)->enumerator;
|
|
149
|
+
VALUE result = rb_funcall(enumerator, rb_intern("call"), 1, accessor_info_rb(info));
|
|
150
|
+
Handle<Value> v(rr_rb2v8(result));
|
|
151
|
+
if (v.IsEmpty()) {
|
|
152
|
+
return Array::New();
|
|
153
|
+
} else if (!v->IsArray()) {
|
|
154
|
+
Local<Array> a = Array::New();
|
|
155
|
+
a->Set(Integer::New(0), v->ToString());
|
|
156
|
+
return a;
|
|
157
|
+
} else {
|
|
158
|
+
return (Handle<Array>)Array::Cast(*v);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Returns the value of the property if the getter intercepts the
|
|
164
|
+
* request. Otherwise, returns an empty handle.
|
|
165
|
+
*/
|
|
166
|
+
Handle<Value> RubyIndexedPropertyGetter(uint32_t index, const AccessorInfo& info) {
|
|
167
|
+
VALUE getter = accessor_info_data(info)->getter;
|
|
168
|
+
VALUE result = rb_funcall(getter, rb_intern("call"), 2, UINT2NUM(index), accessor_info_rb(info));
|
|
169
|
+
return rr_rb2v8(result);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Returns the value if the setter intercepts the request.
|
|
174
|
+
* Otherwise, returns an empty handle.
|
|
175
|
+
*/
|
|
176
|
+
Handle<Value> RubyIndexedPropertySetter(uint32_t index, Local<Value> value, const AccessorInfo& info) {
|
|
177
|
+
VALUE setter = accessor_info_data(info)->setter;
|
|
178
|
+
VALUE result = rb_funcall(setter, rb_intern("call"), 3, UINT2NUM(index), rr_v82rb(value), accessor_info_rb(info));
|
|
179
|
+
return rr_rb2v8(result);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Returns a non-empty handle if the interceptor intercepts the request.
|
|
184
|
+
* The result is true if the property exists and false otherwise.
|
|
185
|
+
*/
|
|
186
|
+
Handle<Integer> RubyIndexedPropertyQuery(uint32_t index, const AccessorInfo& info) {
|
|
187
|
+
VALUE query = accessor_info_data(info)->query;
|
|
188
|
+
VALUE result = rb_funcall(query, rb_intern("call"), 2, UINT2NUM(index), accessor_info_rb(info));
|
|
189
|
+
Handle<Value> intercepts = rr_rb2v8(result);
|
|
190
|
+
return intercepts.IsEmpty() ? Handle<Integer>() : Integer::New(None);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Returns a non-empty handle if the deleter intercepts the request.
|
|
195
|
+
* The return value is true if the property could be deleted and false
|
|
196
|
+
* otherwise.
|
|
197
|
+
*/
|
|
198
|
+
Handle<Boolean> RubyIndexedPropertyDeleter(uint32_t index, const AccessorInfo& info) {
|
|
199
|
+
VALUE deleter = accessor_info_data(info)->deleter;
|
|
200
|
+
VALUE result = rb_funcall(deleter, rb_intern("call"), 2, UINT2NUM(index), accessor_info_rb(info));
|
|
201
|
+
Handle<Value> intercepts = rr_rb2v8(result);
|
|
202
|
+
return intercepts.IsEmpty() ? Handle<Boolean>() : intercepts->ToBoolean();
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Returns an array containing the indices of the properties the
|
|
207
|
+
* indexed property getter intercepts.
|
|
208
|
+
*/
|
|
209
|
+
Handle<Array> RubyIndexedPropertyEnumerator(const AccessorInfo& info) {
|
|
210
|
+
VALUE enumerator = accessor_info_data(info)->enumerator;
|
|
211
|
+
VALUE result = rb_funcall(enumerator, rb_intern("call"), 1, accessor_info_rb(info));
|
|
212
|
+
Handle<Value> v(rr_rb2v8(result));
|
|
213
|
+
if (v.IsEmpty()) {
|
|
214
|
+
return Array::New();
|
|
215
|
+
} else if (!v->IsArray()) {
|
|
216
|
+
Local<Array> a = Array::New();
|
|
217
|
+
a->Set(Integer::New(0), v->ToString());
|
|
218
|
+
return a;
|
|
219
|
+
} else {
|
|
220
|
+
return (Handle<Array>)Array::Cast(*v);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
VALUE New(VALUE rbclass) {
|
|
225
|
+
HandleScope handles;
|
|
226
|
+
return rr_v8_handle_new(rbclass, ObjectTemplate::New());
|
|
227
|
+
}
|
|
228
|
+
VALUE NewInstance(VALUE self) {
|
|
229
|
+
HandleScope scope;
|
|
230
|
+
if (!Context::InContext()) {
|
|
231
|
+
rb_raise(rb_eScriptError, "ObjectTemplate::NewInstance() called without an entered Context");
|
|
232
|
+
return Qnil;
|
|
233
|
+
}
|
|
234
|
+
Local<Object> object(obj(self)->NewInstance());
|
|
235
|
+
if (object.IsEmpty()) {
|
|
236
|
+
rb_raise(rb_eFatal, "V8 returned empty handle on call to ObjectTemplate::NewInstance()");
|
|
237
|
+
return Qnil;
|
|
238
|
+
}
|
|
239
|
+
return rr_v82rb(object);
|
|
240
|
+
}
|
|
241
|
+
VALUE SetNamedPropertyHandler(VALUE self, VALUE getter, VALUE setter, VALUE query, VALUE deleter, VALUE enumerator, VALUE data) {
|
|
242
|
+
HandleScope handles;
|
|
243
|
+
if (!RTEST(getter)) {
|
|
244
|
+
rb_raise(rb_eArgError, "you must supply at least a getter to V8::C::ObjectTemplate#SetNamedPropertyHandler()");
|
|
245
|
+
return Qnil;
|
|
246
|
+
}
|
|
247
|
+
obj(self)->SetNamedPropertyHandler(
|
|
248
|
+
RubyNamedPropertyGetter,
|
|
249
|
+
RTEST(setter) ? RubyNamedPropertySetter : 0,
|
|
250
|
+
RTEST(query) ? RubyNamedPropertyQuery : 0,
|
|
251
|
+
RTEST(deleter) ? RubyNamedPropertyDeleter : 0,
|
|
252
|
+
RTEST(enumerator) ? RubyNamedPropertyEnumerator : 0,
|
|
253
|
+
accessor_info_data(getter, setter, query, deleter, enumerator, data)
|
|
254
|
+
);
|
|
255
|
+
return Qnil;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
VALUE SetIndexedPropertyHandler(VALUE self, VALUE getter, VALUE setter, VALUE query, VALUE deleter, VALUE enumerator, VALUE data) {
|
|
259
|
+
HandleScope scope;
|
|
260
|
+
if (!RTEST(getter)) {
|
|
261
|
+
rb_raise(rb_eArgError, "you must supply at least a getter to V8::C::ObjectTemplate#SetNamedPropertyHandler()");
|
|
262
|
+
return Qnil;
|
|
263
|
+
}
|
|
264
|
+
obj(self)->SetIndexedPropertyHandler(
|
|
265
|
+
RubyIndexedPropertyGetter,
|
|
266
|
+
RTEST(setter) ? RubyIndexedPropertySetter : 0,
|
|
267
|
+
RTEST(query) ? RubyIndexedPropertyQuery : 0,
|
|
268
|
+
RTEST(deleter) ? RubyIndexedPropertyDeleter : 0,
|
|
269
|
+
RTEST(enumerator) ? RubyIndexedPropertyEnumerator : 0,
|
|
270
|
+
accessor_info_data(getter, setter, query, deleter, enumerator, data)
|
|
271
|
+
);
|
|
272
|
+
return Qnil;
|
|
273
|
+
}
|
|
274
|
+
VALUE SetCallAsFunctionHandler(int argc, VALUE *argv, VALUE self) {
|
|
275
|
+
Handle<Value> v8_data = make_v8_data(argc, argv, "11");
|
|
276
|
+
obj(self)->SetCallAsFunctionHandler(RubyInvocationCallback, v8_data);
|
|
277
|
+
return Qnil;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
namespace Func {
|
|
282
|
+
|
|
283
|
+
VALUE New(int argc, VALUE *argv, VALUE self) {
|
|
284
|
+
HandleScope h;
|
|
285
|
+
Handle<External> v8_data = make_v8_data(argc, argv, "02");
|
|
286
|
+
Local<FunctionTemplate> t = FunctionTemplate::New(RubyInvocationCallback, v8_data);
|
|
287
|
+
VALUE handle = rr_v8_handle_new(self,t);
|
|
288
|
+
return handle;
|
|
289
|
+
}
|
|
290
|
+
VALUE SetCallHandler(int argc, VALUE *argv, VALUE self) {
|
|
291
|
+
HandleScope h;
|
|
292
|
+
Handle<Value> v8_data = make_v8_data(argc, argv, "11");
|
|
293
|
+
func(self)->SetCallHandler(RubyInvocationCallback, v8_data);
|
|
294
|
+
return Qnil;
|
|
295
|
+
}
|
|
296
|
+
VALUE PrototypeTemplate(VALUE self) {
|
|
297
|
+
HandleScope scope;
|
|
298
|
+
return rr_v8_handle_new(ObjectTemplateClass, func(self)->PrototypeTemplate());
|
|
299
|
+
}
|
|
300
|
+
VALUE InstanceTemplate(VALUE self) {
|
|
301
|
+
HandleScope scope;
|
|
302
|
+
return rr_v8_handle_new(ObjectTemplateClass, func(self)->InstanceTemplate());
|
|
303
|
+
}
|
|
304
|
+
VALUE Inherit(VALUE self, VALUE function_template) {
|
|
305
|
+
HandleScope scope;
|
|
306
|
+
func(self)->Inherit(func(function_template));
|
|
307
|
+
return Qnil;
|
|
308
|
+
}
|
|
309
|
+
VALUE SetClassName(VALUE self, VALUE name) {
|
|
310
|
+
HandleScope scope;
|
|
311
|
+
func(self)->SetClassName(rr_rb2v8(name)->ToString());
|
|
312
|
+
return Qnil;
|
|
313
|
+
}
|
|
314
|
+
VALUE GetFunction(VALUE self) {
|
|
315
|
+
HandleScope handles;
|
|
316
|
+
if (!Context::InContext()) {
|
|
317
|
+
rb_raise(rb_eScriptError, "calls to FunctionTemplate::GetFunction() require a Context to be entered");
|
|
318
|
+
return Qnil;
|
|
319
|
+
}
|
|
320
|
+
return rr_v82rb(func(self)->GetFunction());
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
void rr_init_template() {
|
|
326
|
+
VALUE Template = rr_define_class("Template", rr_v8_handle_class());
|
|
327
|
+
rr_define_method(Template, "Set", Set, 2);
|
|
328
|
+
|
|
329
|
+
ObjectTemplateClass = rr_define_class("ObjectTemplate", Template);
|
|
330
|
+
rr_define_singleton_method(ObjectTemplateClass, "New", Obj::New, 0);
|
|
331
|
+
rr_define_method(ObjectTemplateClass, "NewInstance", Obj::NewInstance, 0);
|
|
332
|
+
rr_define_method(ObjectTemplateClass, "SetNamedPropertyHandler", Obj::SetNamedPropertyHandler, 6);
|
|
333
|
+
rr_define_method(ObjectTemplateClass, "SetIndexedPropertyHandler", Obj::SetIndexedPropertyHandler, 6);
|
|
334
|
+
rr_define_method(ObjectTemplateClass, "SetCallAsFunctionHandler", Obj::SetCallAsFunctionHandler, -1);
|
|
335
|
+
|
|
336
|
+
FunctionTemplateClass = rr_define_class("FunctionTemplate", Template);
|
|
337
|
+
rr_define_singleton_method(FunctionTemplateClass, "New", Func::New, -1);
|
|
338
|
+
rr_define_method(FunctionTemplateClass, "SetCallHandler", Func::SetCallHandler, -1);
|
|
339
|
+
rr_define_method(FunctionTemplateClass, "PrototypeTemplate", Func::PrototypeTemplate, 0);
|
|
340
|
+
rr_define_method(FunctionTemplateClass, "InstanceTemplate", Func::InstanceTemplate, 0);
|
|
341
|
+
rr_define_method(FunctionTemplateClass, "Inherit", Func::Inherit, 1);
|
|
342
|
+
rr_define_method(FunctionTemplateClass, "SetClassName", Func::SetClassName, 1);
|
|
343
|
+
rr_define_method(FunctionTemplateClass, "GetFunction", Func::GetFunction, 0);
|
|
344
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#include "rr.h"
|
|
2
|
+
#include "v8_try_catch.h"
|
|
3
|
+
#include "v8_message.h"
|
|
4
|
+
|
|
5
|
+
using namespace v8;
|
|
6
|
+
|
|
7
|
+
namespace {
|
|
8
|
+
VALUE TryCatchClass;
|
|
9
|
+
|
|
10
|
+
TryCatch *unwrap(VALUE self) {
|
|
11
|
+
TryCatch *tc = 0;
|
|
12
|
+
Data_Get_Struct(self, class TryCatch, tc);
|
|
13
|
+
if (RTEST(rb_iv_get(self, "dead"))) {
|
|
14
|
+
rb_raise(rb_eScriptError, "out of scope access of %s", RSTRING_PTR(rb_inspect(self)));
|
|
15
|
+
return false;
|
|
16
|
+
} else {
|
|
17
|
+
return tc;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
VALUE Try(int argc, VALUE *argv, VALUE self) {
|
|
22
|
+
if (rb_block_given_p()) {
|
|
23
|
+
HandleScope scope;
|
|
24
|
+
TryCatch tc;
|
|
25
|
+
VALUE try_catch = Data_Wrap_Struct(TryCatchClass, 0, 0, &tc);
|
|
26
|
+
rb_iv_set(try_catch, "dead", Qfalse);
|
|
27
|
+
VALUE result = rb_yield(try_catch);
|
|
28
|
+
rb_iv_set(try_catch, "dead", Qtrue);
|
|
29
|
+
tc.Reset();
|
|
30
|
+
return result;
|
|
31
|
+
} else {
|
|
32
|
+
return Qnil;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
VALUE HasCaught(VALUE self) {
|
|
37
|
+
TryCatch *tc = unwrap(self);
|
|
38
|
+
return tc ? rr_v82rb(tc->HasCaught()) : Qnil;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
VALUE _Exception(VALUE self) {
|
|
42
|
+
TryCatch *tc = unwrap(self);
|
|
43
|
+
return tc ? rr_v82rb(tc->Exception()) : Qnil;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
VALUE _StackTrace(VALUE self) {
|
|
47
|
+
TryCatch *tc = unwrap(self);
|
|
48
|
+
return tc ? rr_v82rb(tc->StackTrace()) : Qnil;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
VALUE _Message(VALUE self) {
|
|
52
|
+
TryCatch *tc = unwrap(self);
|
|
53
|
+
return tc ? rr_v82rb(tc->Message()) : Qnil;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
VALUE CanContinue(VALUE self) {
|
|
57
|
+
TryCatch *tc = unwrap(self);
|
|
58
|
+
return tc ? rr_v82rb(tc->CanContinue()) : Qnil;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
void rr_init_v8_try_catch() {
|
|
63
|
+
TryCatchClass = rr_define_class("TryCatch");
|
|
64
|
+
rr_define_singleton_method(TryCatchClass, "try", Try, -1);
|
|
65
|
+
rr_define_method(TryCatchClass, "HasCaught", HasCaught, 0);
|
|
66
|
+
rr_define_method(TryCatchClass, "Exception", _Exception, 0);
|
|
67
|
+
rr_define_method(TryCatchClass, "StackTrace", _StackTrace, 0);
|
|
68
|
+
rr_define_method(TryCatchClass, "Message", _Message, 0);
|
|
69
|
+
rr_define_method(TryCatchClass, "CanContinue", CanContinue, 0);
|
|
70
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
#include "rr.h"
|
|
3
|
+
|
|
4
|
+
using namespace v8;
|
|
5
|
+
|
|
6
|
+
namespace {
|
|
7
|
+
|
|
8
|
+
VALUE IsDead(VALUE self) {
|
|
9
|
+
return rr_v82rb(V8::IsDead());
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
VALUE AdjustAmountOfExternalAllocatedMemory(VALUE self, VALUE bytes) {
|
|
13
|
+
V8::AdjustAmountOfExternalAllocatedMemory(NUM2INT(bytes));
|
|
14
|
+
return Qnil;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
VALUE IdleNotification(VALUE self) {
|
|
18
|
+
return rr_v82rb(V8::IdleNotification());
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
VALUE SetFlagsFromString(VALUE self, VALUE string) {
|
|
22
|
+
V8::SetFlagsFromString(RSTRING_PTR(string), RSTRING_LEN(string));
|
|
23
|
+
return Qnil;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
void rr_init_v8_v8() {
|
|
30
|
+
VALUE V8Module = rr_define_module("V8");
|
|
31
|
+
rr_define_singleton_method(V8Module, "IsDead", IsDead, 0);
|
|
32
|
+
rr_define_singleton_method(V8Module, "AdjustAmountOfExternalAllocatedMemory", AdjustAmountOfExternalAllocatedMemory, 1);
|
|
33
|
+
rr_define_singleton_method(V8Module, "IdleNotification", IdleNotification, 0);
|
|
34
|
+
rr_define_singleton_method(V8Module, "SetFlagsFromString", SetFlagsFromString, 1);
|
|
35
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
#include "v8_handle.h"
|
|
2
|
+
#include "v8_value.h"
|
|
3
|
+
|
|
4
|
+
using namespace v8;
|
|
5
|
+
namespace {
|
|
6
|
+
|
|
7
|
+
VALUE ValueClass;
|
|
8
|
+
|
|
9
|
+
Persistent<Value>& unwrap(VALUE value) {
|
|
10
|
+
return rr_v8_handle<Value>(value);
|
|
11
|
+
}
|
|
12
|
+
VALUE IsEmpty(VALUE value) {
|
|
13
|
+
return value == rr_v8_value_empty() ? Qtrue : Qfalse;
|
|
14
|
+
}
|
|
15
|
+
VALUE IsUndefined(VALUE self) {
|
|
16
|
+
HandleScope scope;
|
|
17
|
+
return rr_v82rb(unwrap(self)->IsUndefined());
|
|
18
|
+
}
|
|
19
|
+
VALUE IsNull(VALUE self) {
|
|
20
|
+
HandleScope scope;
|
|
21
|
+
return rr_v82rb(unwrap(self)->IsNull());
|
|
22
|
+
}
|
|
23
|
+
VALUE IsTrue(VALUE self) {
|
|
24
|
+
HandleScope scope;
|
|
25
|
+
return rr_v82rb(unwrap(self)->IsTrue());
|
|
26
|
+
}
|
|
27
|
+
VALUE IsFalse(VALUE self) {
|
|
28
|
+
HandleScope scope;
|
|
29
|
+
return rr_v82rb(unwrap(self)->IsFalse());
|
|
30
|
+
}
|
|
31
|
+
VALUE IsString(VALUE self) {
|
|
32
|
+
HandleScope scope;
|
|
33
|
+
return rr_v82rb(unwrap(self)->IsString());
|
|
34
|
+
}
|
|
35
|
+
VALUE IsFunction(VALUE self) {
|
|
36
|
+
HandleScope scope;
|
|
37
|
+
return rr_v82rb(unwrap(self)->IsFunction());
|
|
38
|
+
}
|
|
39
|
+
VALUE IsArray(VALUE self) {
|
|
40
|
+
HandleScope scope;
|
|
41
|
+
return rr_v82rb(unwrap(self)->IsArray());
|
|
42
|
+
}
|
|
43
|
+
VALUE IsObject(VALUE self) {
|
|
44
|
+
HandleScope scope;
|
|
45
|
+
return rr_v82rb(unwrap(self)->IsObject());
|
|
46
|
+
}
|
|
47
|
+
VALUE IsBoolean(VALUE self) {
|
|
48
|
+
HandleScope scope;
|
|
49
|
+
return rr_v82rb(unwrap(self)->IsBoolean());
|
|
50
|
+
}
|
|
51
|
+
VALUE IsNumber(VALUE self) {
|
|
52
|
+
HandleScope scope;
|
|
53
|
+
return rr_v82rb(unwrap(self)->IsNumber());
|
|
54
|
+
}
|
|
55
|
+
VALUE IsExternal(VALUE self) {
|
|
56
|
+
HandleScope scope;
|
|
57
|
+
return rr_v82rb(unwrap(self)->IsExternal());
|
|
58
|
+
}
|
|
59
|
+
VALUE IsInt32(VALUE self) {
|
|
60
|
+
HandleScope scope;
|
|
61
|
+
return rr_v82rb(unwrap(self)->IsInt32());
|
|
62
|
+
}
|
|
63
|
+
VALUE IsUint32(VALUE self) {
|
|
64
|
+
HandleScope scope;
|
|
65
|
+
return rr_v82rb(unwrap(self)->IsUint32());
|
|
66
|
+
}
|
|
67
|
+
VALUE IsDate(VALUE self) {
|
|
68
|
+
HandleScope scope;
|
|
69
|
+
return rr_v82rb(unwrap(self)->IsDate());
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
VALUE ToBoolean(VALUE self) {
|
|
73
|
+
HandleScope scope;
|
|
74
|
+
return rr_v82rb(unwrap(self)->ToBoolean());
|
|
75
|
+
}
|
|
76
|
+
VALUE ToNumber(VALUE self) {
|
|
77
|
+
HandleScope scope;
|
|
78
|
+
return rr_v82rb(unwrap(self)->ToNumber());
|
|
79
|
+
}
|
|
80
|
+
VALUE ToString(VALUE self) {
|
|
81
|
+
HandleScope scope;
|
|
82
|
+
return rr_v82rb(unwrap(self)->ToString());
|
|
83
|
+
}
|
|
84
|
+
VALUE ToDetailString(VALUE self) {
|
|
85
|
+
HandleScope scope;
|
|
86
|
+
return rr_v82rb(unwrap(self)->ToDetailString());
|
|
87
|
+
}
|
|
88
|
+
VALUE ToObject(VALUE self) {
|
|
89
|
+
HandleScope scope;
|
|
90
|
+
return rr_v82rb(unwrap(self)->ToObject());
|
|
91
|
+
}
|
|
92
|
+
VALUE ToInteger(VALUE self) {
|
|
93
|
+
HandleScope scope;
|
|
94
|
+
return rr_v82rb(unwrap(self)->ToInteger());
|
|
95
|
+
}
|
|
96
|
+
VALUE ToUint32(VALUE self) {
|
|
97
|
+
HandleScope scope;
|
|
98
|
+
return rr_v82rb(unwrap(self)->ToUint32());
|
|
99
|
+
}
|
|
100
|
+
VALUE ToInt32(VALUE self) {
|
|
101
|
+
HandleScope scope;
|
|
102
|
+
return rr_v82rb(unwrap(self)->ToInt32());
|
|
103
|
+
}
|
|
104
|
+
VALUE ToArrayIndex(VALUE self) {
|
|
105
|
+
HandleScope scope;
|
|
106
|
+
return rr_v82rb(unwrap(self)->ToArrayIndex());
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
VALUE Equals(VALUE self, VALUE that) {
|
|
110
|
+
HandleScope scope;
|
|
111
|
+
return rr_v82rb(unwrap(self)->Equals(unwrap(that)));
|
|
112
|
+
}
|
|
113
|
+
VALUE StrictEquals(VALUE self, VALUE that) {
|
|
114
|
+
HandleScope scope;
|
|
115
|
+
return rr_v82rb(unwrap(self)->StrictEquals(unwrap(that)));
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
VALUE BooleanValue(VALUE self) {
|
|
119
|
+
HandleScope scope;
|
|
120
|
+
return rr_v82rb(unwrap(self)->BooleanValue());
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
VALUE NumberValue(VALUE self) {
|
|
124
|
+
HandleScope scope;
|
|
125
|
+
return rr_v82rb(unwrap(self)->NumberValue());
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
VALUE rr_v8_value_class() {
|
|
130
|
+
return ValueClass;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
VALUE rr_v8_value_empty() {
|
|
134
|
+
return rr_const_get("Empty");
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
void rr_init_value() {
|
|
138
|
+
ValueClass = rr_define_class("Value", rr_v8_handle_class());
|
|
139
|
+
rr_define_const("Empty", rr_v8_handle_new(ValueClass, Handle<Value>()));
|
|
140
|
+
|
|
141
|
+
rr_define_method(ValueClass, "IsEmpty", IsEmpty, 0);
|
|
142
|
+
rr_define_method(ValueClass, "IsUndefined", IsUndefined, 0);
|
|
143
|
+
rr_define_method(ValueClass, "IsNull", IsNull, 0);
|
|
144
|
+
rr_define_method(ValueClass, "IsTrue", IsTrue, 0);
|
|
145
|
+
rr_define_method(ValueClass, "IsFalse", IsFalse, 0);
|
|
146
|
+
rr_define_method(ValueClass, "IsString", IsString, 0);
|
|
147
|
+
rr_define_method(ValueClass, "IsFunction", IsFunction, 0);
|
|
148
|
+
rr_define_method(ValueClass, "IsArray", IsArray, 0);
|
|
149
|
+
rr_define_method(ValueClass, "IsObject", IsObject, 0);
|
|
150
|
+
rr_define_method(ValueClass, "IsBoolean", IsBoolean, 0);
|
|
151
|
+
rr_define_method(ValueClass, "IsNumber", IsNumber, 0);
|
|
152
|
+
rr_define_method(ValueClass, "IsExternal", IsExternal, 0);
|
|
153
|
+
rr_define_method(ValueClass, "IsInt32", IsInt32, 0);
|
|
154
|
+
rr_define_method(ValueClass, "IsUint32", IsUint32, 0);
|
|
155
|
+
rr_define_method(ValueClass, "IsDate", IsDate, 0);
|
|
156
|
+
|
|
157
|
+
rr_define_method(ValueClass, "ToBoolean", ToBoolean, 0);
|
|
158
|
+
rr_define_method(ValueClass, "ToNumber", ToNumber, 0);
|
|
159
|
+
rr_define_method(ValueClass, "ToString", ToString, 0);
|
|
160
|
+
rr_define_method(ValueClass, "ToDetailString", ToDetailString, 0);
|
|
161
|
+
rr_define_method(ValueClass, "ToObject", ToObject, 0);
|
|
162
|
+
rr_define_method(ValueClass, "ToInteger", ToInteger, 0);
|
|
163
|
+
rr_define_method(ValueClass, "ToUint32", ToUint32, 0);
|
|
164
|
+
rr_define_method(ValueClass, "ToArrayIndex", ToArrayIndex, 0);
|
|
165
|
+
|
|
166
|
+
rr_define_method(ValueClass, "Equals", Equals, 1);
|
|
167
|
+
rr_define_method(ValueClass, "StrictEquals", StrictEquals, 1);
|
|
168
|
+
|
|
169
|
+
rr_define_method(ValueClass, "BooleanValue", BooleanValue, 0);
|
|
170
|
+
rr_define_method(ValueClass, "NumberValue", NumberValue, 0);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
VALUE rr_wrap_v8_value(Handle<Value>& value) {
|
|
174
|
+
return rr_v8_handle_new(ValueClass, value);
|
|
175
|
+
}
|