opal-wedge 0.9.0.dev
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/.gitmodules +7 -0
- data/.inch.yml +19 -0
- data/.jshintrc +48 -0
- data/.rspec +3 -0
- data/.spectator +2 -0
- data/.spectator-mspec +3 -0
- data/.travis.yml +60 -0
- data/.yardopts +6 -0
- data/CHANGELOG.md +571 -0
- data/CODE_OF_CONDUCT.md +15 -0
- data/CONTRIBUTING.md +192 -0
- data/Gemfile +26 -0
- data/Guardfile +77 -0
- data/LICENSE +19 -0
- data/README.md +167 -0
- data/Rakefile +15 -0
- data/benchmark/benchmarks +103 -0
- data/benchmark/bm_array_intersection_numbers.rb +7 -0
- data/benchmark/bm_array_intersection_objects.rb +7 -0
- data/benchmark/bm_array_intersection_strings.rb +7 -0
- data/benchmark/bm_array_minus_numbers.rb +7 -0
- data/benchmark/bm_array_minus_objects.rb +7 -0
- data/benchmark/bm_array_minus_strings.rb +7 -0
- data/benchmark/bm_array_union_numbers.rb +7 -0
- data/benchmark/bm_array_union_objects.rb +7 -0
- data/benchmark/bm_array_union_strings.rb +7 -0
- data/benchmark/bm_array_uniq_bang_numbers.rb +5 -0
- data/benchmark/bm_array_uniq_bang_objects.rb +5 -0
- data/benchmark/bm_array_uniq_bang_strings.rb +5 -0
- data/benchmark/bm_array_uniq_numbers.rb +5 -0
- data/benchmark/bm_array_uniq_objects.rb +5 -0
- data/benchmark/bm_array_uniq_strings.rb +5 -0
- data/benchmark/bm_dispatch_bind_table.rb +57 -0
- data/benchmark/bm_dispatch_code_gen.rb +65 -0
- data/benchmark/bm_dispatch_code_gen_if.rb +64 -0
- data/benchmark/bm_dispatch_hardcoded.rb +44 -0
- data/benchmark/bm_dispatch_send.rb +38 -0
- data/benchmark/bm_dispatch_send_table.rb +57 -0
- data/benchmark/bm_hash_assoc_object.rb +11 -0
- data/benchmark/bm_hash_assoc_string.rb +9 -0
- data/benchmark/bm_hash_clone_object.rb +9 -0
- data/benchmark/bm_hash_clone_string.rb +9 -0
- data/benchmark/bm_hash_delete_object.rb +11 -0
- data/benchmark/bm_hash_delete_string.rb +9 -0
- data/benchmark/bm_hash_each_key_object.rb +9 -0
- data/benchmark/bm_hash_each_key_string.rb +9 -0
- data/benchmark/bm_hash_each_object.rb +9 -0
- data/benchmark/bm_hash_each_string.rb +9 -0
- data/benchmark/bm_hash_each_value_object.rb +9 -0
- data/benchmark/bm_hash_each_value_string.rb +9 -0
- data/benchmark/bm_hash_element_reference_object.rb +11 -0
- data/benchmark/bm_hash_element_reference_string.rb +9 -0
- data/benchmark/bm_hash_element_set_object.rb +5 -0
- data/benchmark/bm_hash_element_set_string.rb +5 -0
- data/benchmark/bm_hash_equal_value_object.rb +14 -0
- data/benchmark/bm_hash_equal_value_string.rb +11 -0
- data/benchmark/bm_hash_fetch_object.rb +11 -0
- data/benchmark/bm_hash_fetch_string.rb +9 -0
- data/benchmark/bm_hash_flatten_object.rb +9 -0
- data/benchmark/bm_hash_flatten_string.rb +9 -0
- data/benchmark/bm_hash_has_key_object.rb +11 -0
- data/benchmark/bm_hash_has_key_string.rb +9 -0
- data/benchmark/bm_hash_has_value_object.rb +9 -0
- data/benchmark/bm_hash_has_value_string.rb +9 -0
- data/benchmark/bm_hash_hash_object.rb +9 -0
- data/benchmark/bm_hash_hash_string.rb +9 -0
- data/benchmark/bm_hash_inspect_object.rb +9 -0
- data/benchmark/bm_hash_inspect_string.rb +9 -0
- data/benchmark/bm_hash_invert_object.rb +9 -0
- data/benchmark/bm_hash_invert_string.rb +9 -0
- data/benchmark/bm_hash_keep_if_object.rb +9 -0
- data/benchmark/bm_hash_keep_if_string.rb +9 -0
- data/benchmark/bm_hash_key_object.rb +9 -0
- data/benchmark/bm_hash_key_string.rb +9 -0
- data/benchmark/bm_hash_keys_object.rb +9 -0
- data/benchmark/bm_hash_keys_string.rb +9 -0
- data/benchmark/bm_hash_literal_mixed_large.rb +3 -0
- data/benchmark/bm_hash_literal_mixed_small.rb +3 -0
- data/benchmark/bm_hash_literal_object_large.rb +4 -0
- data/benchmark/bm_hash_literal_object_small.rb +3 -0
- data/benchmark/bm_hash_literal_string_large.rb +4 -0
- data/benchmark/bm_hash_literal_string_small.rb +3 -0
- data/benchmark/bm_hash_merge_object.rb +22 -0
- data/benchmark/bm_hash_merge_string.rb +18 -0
- data/benchmark/bm_hash_rassoc_object.rb +9 -0
- data/benchmark/bm_hash_rassoc_string.rb +9 -0
- data/benchmark/bm_hash_rehash_object.rb +9 -0
- data/benchmark/bm_hash_rehash_string.rb +9 -0
- data/benchmark/bm_hash_reject_bang_object.rb +9 -0
- data/benchmark/bm_hash_reject_bang_string.rb +9 -0
- data/benchmark/bm_hash_reject_object.rb +9 -0
- data/benchmark/bm_hash_reject_string.rb +9 -0
- data/benchmark/bm_hash_replace_object.rb +18 -0
- data/benchmark/bm_hash_replace_string.rb +14 -0
- data/benchmark/bm_hash_select_bang_object.rb +9 -0
- data/benchmark/bm_hash_select_bang_string.rb +9 -0
- data/benchmark/bm_hash_select_object.rb +9 -0
- data/benchmark/bm_hash_select_string.rb +9 -0
- data/benchmark/bm_hash_shift_object.rb +10 -0
- data/benchmark/bm_hash_shift_string.rb +10 -0
- data/benchmark/bm_hash_to_a_object.rb +9 -0
- data/benchmark/bm_hash_to_a_string.rb +9 -0
- data/benchmark/bm_hash_to_h_object.rb +10 -0
- data/benchmark/bm_hash_to_h_string.rb +10 -0
- data/benchmark/bm_hash_values_object.rb +9 -0
- data/benchmark/bm_hash_values_string.rb +9 -0
- data/benchmark/run.rb +37 -0
- data/bin/opal +27 -0
- data/bin/opal-build +77 -0
- data/bin/opal-mspec +10 -0
- data/bin/opal-repl +72 -0
- data/config.ru +14 -0
- data/docs/compiler_directives.md +127 -0
- data/examples/rack/.gitignore +1 -0
- data/examples/rack/Gemfile +3 -0
- data/examples/rack/app/application.rb +13 -0
- data/examples/rack/app/user.rb +22 -0
- data/examples/rack/config.ru +20 -0
- data/examples/rack/index.html.erb +10 -0
- data/examples/sinatra/Gemfile +5 -0
- data/examples/sinatra/app/application.rb +7 -0
- data/examples/sinatra/config.ru +38 -0
- data/lib/mspec/opal/main.rb.erb +9 -0
- data/lib/mspec/opal/new.html.erb +1 -0
- data/lib/mspec/opal/rake_task.rb +248 -0
- data/lib/mspec/opal/runner.rb +281 -0
- data/lib/mspec/opal/special_calls.rb +44 -0
- data/lib/mspec/opal/sprockets.js +57 -0
- data/lib/opal-wedge.rb +4 -0
- data/lib/opal.rb +11 -0
- data/lib/opal/builder.rb +161 -0
- data/lib/opal/builder_processors.rb +149 -0
- data/lib/opal/cli.rb +162 -0
- data/lib/opal/cli_options.rb +158 -0
- data/lib/opal/cli_runners.rb +11 -0
- data/lib/opal/cli_runners/apple_script.rb +65 -0
- data/lib/opal/cli_runners/nodejs.rb +63 -0
- data/lib/opal/cli_runners/phantom.js +44 -0
- data/lib/opal/cli_runners/phantomjs.rb +28 -0
- data/lib/opal/cli_runners/server.rb +56 -0
- data/lib/opal/compiler.rb +381 -0
- data/lib/opal/config.rb +48 -0
- data/lib/opal/erb.rb +84 -0
- data/lib/opal/fragment.rb +53 -0
- data/lib/opal/hike_path_finder.rb +18 -0
- data/lib/opal/nodes.rb +26 -0
- data/lib/opal/nodes/arglist.rb +56 -0
- data/lib/opal/nodes/array.rb +54 -0
- data/lib/opal/nodes/base.rb +151 -0
- data/lib/opal/nodes/call.rb +290 -0
- data/lib/opal/nodes/call_special.rb +252 -0
- data/lib/opal/nodes/case.rb +96 -0
- data/lib/opal/nodes/class.rb +42 -0
- data/lib/opal/nodes/constants.rb +78 -0
- data/lib/opal/nodes/def.rb +281 -0
- data/lib/opal/nodes/defined.rb +113 -0
- data/lib/opal/nodes/definitions.rb +168 -0
- data/lib/opal/nodes/for.rb +48 -0
- data/lib/opal/nodes/hash.rb +67 -0
- data/lib/opal/nodes/helpers.rb +116 -0
- data/lib/opal/nodes/if.rb +81 -0
- data/lib/opal/nodes/iter.rb +136 -0
- data/lib/opal/nodes/literal.rb +247 -0
- data/lib/opal/nodes/logic.rb +217 -0
- data/lib/opal/nodes/masgn.rb +62 -0
- data/lib/opal/nodes/module.rb +45 -0
- data/lib/opal/nodes/rescue.rb +143 -0
- data/lib/opal/nodes/runtime_helpers.rb +45 -0
- data/lib/opal/nodes/scope.rb +281 -0
- data/lib/opal/nodes/singleton_class.rb +26 -0
- data/lib/opal/nodes/super.rb +97 -0
- data/lib/opal/nodes/top.rb +103 -0
- data/lib/opal/nodes/variables.rb +191 -0
- data/lib/opal/nodes/while.rb +65 -0
- data/lib/opal/nodes/yield.rb +95 -0
- data/lib/opal/parser.rb +742 -0
- data/lib/opal/parser/grammar.rb +5723 -0
- data/lib/opal/parser/grammar.y +1787 -0
- data/lib/opal/parser/keywords.rb +66 -0
- data/lib/opal/parser/lexer.rb +1260 -0
- data/lib/opal/parser/parser_scope.rb +28 -0
- data/lib/opal/parser/sexp.rb +81 -0
- data/lib/opal/path_reader.rb +35 -0
- data/lib/opal/paths.rb +55 -0
- data/lib/opal/regexp_anchors.rb +5 -0
- data/lib/opal/source_map.rb +70 -0
- data/lib/opal/sprockets.rb +3 -0
- data/lib/opal/sprockets/cache_key_fix.rb +17 -0
- data/lib/opal/sprockets/environment.rb +31 -0
- data/lib/opal/sprockets/erb.rb +23 -0
- data/lib/opal/sprockets/path_reader.rb +36 -0
- data/lib/opal/sprockets/processor.rb +167 -0
- data/lib/opal/sprockets/server.rb +160 -0
- data/lib/opal/sprockets/source_map_header_patch.rb +41 -0
- data/lib/opal/sprockets/source_map_server.rb +115 -0
- data/lib/opal/util.rb +69 -0
- data/lib/opal/version.rb +5 -0
- data/lib/tilt/opal.rb +54 -0
- data/opal.gemspec +37 -0
- data/opal/README.md +6 -0
- data/opal/corelib/array.rb +2073 -0
- data/opal/corelib/array/inheritance.rb +127 -0
- data/opal/corelib/basic_object.rb +82 -0
- data/opal/corelib/boolean.rb +47 -0
- data/opal/corelib/class.rb +55 -0
- data/opal/corelib/comparable.rb +57 -0
- data/opal/corelib/complex.rb +3 -0
- data/opal/corelib/dir.rb +20 -0
- data/opal/corelib/enumerable.rb +1138 -0
- data/opal/corelib/enumerator.rb +426 -0
- data/opal/corelib/error.rb +77 -0
- data/opal/corelib/file.rb +59 -0
- data/opal/corelib/hash.rb +951 -0
- data/opal/corelib/helpers.rb +102 -0
- data/opal/corelib/io.rb +73 -0
- data/opal/corelib/kernel.rb +1124 -0
- data/opal/corelib/main.rb +7 -0
- data/opal/corelib/match_data.rb +128 -0
- data/opal/corelib/method.rb +62 -0
- data/opal/corelib/module.rb +553 -0
- data/opal/corelib/nil_class.rb +57 -0
- data/opal/corelib/numeric.rb +564 -0
- data/opal/corelib/proc.rb +105 -0
- data/opal/corelib/process.rb +27 -0
- data/opal/corelib/range.rb +116 -0
- data/opal/corelib/rational.rb +3 -0
- data/opal/corelib/regexp.rb +203 -0
- data/opal/corelib/runtime.js +1637 -0
- data/opal/corelib/string.rb +1762 -0
- data/opal/corelib/string/inheritance.rb +117 -0
- data/opal/corelib/struct.rb +159 -0
- data/opal/corelib/time.rb +746 -0
- data/opal/corelib/variables.rb +28 -0
- data/opal/opal.rb +33 -0
- data/spec/README.md +8 -0
- data/spec/filters/bugs/array.rb +77 -0
- data/spec/filters/bugs/basicobject.rb +33 -0
- data/spec/filters/bugs/class.rb +15 -0
- data/spec/filters/bugs/comparable.rb +4 -0
- data/spec/filters/bugs/date.rb +173 -0
- data/spec/filters/bugs/enumerable.rb +62 -0
- data/spec/filters/bugs/enumerator.rb +45 -0
- data/spec/filters/bugs/exception.rb +84 -0
- data/spec/filters/bugs/fixnum.rb +35 -0
- data/spec/filters/bugs/float.rb +100 -0
- data/spec/filters/bugs/hash.rb +17 -0
- data/spec/filters/bugs/integer.rb +63 -0
- data/spec/filters/bugs/kernel.rb +395 -0
- data/spec/filters/bugs/language.rb +246 -0
- data/spec/filters/bugs/math.rb +89 -0
- data/spec/filters/bugs/method.rb +5 -0
- data/spec/filters/bugs/module.rb +372 -0
- data/spec/filters/bugs/nil.rb +7 -0
- data/spec/filters/bugs/numeric.rb +123 -0
- data/spec/filters/bugs/proc.rb +65 -0
- data/spec/filters/bugs/range.rb +148 -0
- data/spec/filters/bugs/regexp.rb +252 -0
- data/spec/filters/bugs/set.rb +51 -0
- data/spec/filters/bugs/singleton.rb +6 -0
- data/spec/filters/bugs/string.rb +99 -0
- data/spec/filters/bugs/strscan.rb +106 -0
- data/spec/filters/bugs/struct.rb +22 -0
- data/spec/filters/bugs/time.rb +28 -0
- data/spec/filters/bugs/unboundmethod.rb +22 -0
- data/spec/filters/unsupported/array.rb +176 -0
- data/spec/filters/unsupported/basicobject.rb +12 -0
- data/spec/filters/unsupported/class.rb +4 -0
- data/spec/filters/unsupported/delegator.rb +5 -0
- data/spec/filters/unsupported/enumerable.rb +8 -0
- data/spec/filters/unsupported/enumerator.rb +13 -0
- data/spec/filters/unsupported/fixnum.rb +15 -0
- data/spec/filters/unsupported/float.rb +6 -0
- data/spec/filters/unsupported/hash.rb +55 -0
- data/spec/filters/unsupported/integer.rb +3 -0
- data/spec/filters/unsupported/kernel.rb +22 -0
- data/spec/filters/unsupported/language.rb +31 -0
- data/spec/filters/unsupported/matchdata.rb +33 -0
- data/spec/filters/unsupported/math.rb +3 -0
- data/spec/filters/unsupported/module.rb +36 -0
- data/spec/filters/unsupported/pathname.rb +3 -0
- data/spec/filters/unsupported/regexp.rb +94 -0
- data/spec/filters/unsupported/set.rb +4 -0
- data/spec/filters/unsupported/singleton.rb +6 -0
- data/spec/filters/unsupported/string.rb +538 -0
- data/spec/filters/unsupported/struct.rb +3 -0
- data/spec/filters/unsupported/time.rb +208 -0
- data/spec/lib/builder_processors_spec.rb +27 -0
- data/spec/lib/builder_spec.rb +72 -0
- data/spec/lib/cli_spec.rb +150 -0
- data/spec/lib/compiler/pre_processed_conditionals_spec.rb +87 -0
- data/spec/lib/compiler_spec.rb +131 -0
- data/spec/lib/dependency_resolver_spec.rb +40 -0
- data/spec/lib/fixtures/complex_sprockets.js.rb.erb +4 -0
- data/spec/lib/fixtures/file_with_directives.js +2 -0
- data/spec/lib/fixtures/jst_file.js.jst +1 -0
- data/spec/lib/fixtures/no_requires.rb +1 -0
- data/spec/lib/fixtures/opal_file.rb +2 -0
- data/spec/lib/fixtures/require_tree_test.rb +3 -0
- data/spec/lib/fixtures/required_file.js +1 -0
- data/spec/lib/fixtures/required_tree_test/required_file1.rb +1 -0
- data/spec/lib/fixtures/required_tree_test/required_file2.rb +1 -0
- data/spec/lib/fixtures/requires.rb +7 -0
- data/spec/lib/fixtures/source_map.rb +1 -0
- data/spec/lib/fixtures/source_map/subfolder/other_file.rb +1 -0
- data/spec/lib/fixtures/sprockets_file.js.rb +3 -0
- data/spec/lib/fixtures/sprockets_require_tree_test.rb +3 -0
- data/spec/lib/hike_path_finder_spec.rb +23 -0
- data/spec/lib/lexer_spec.rb +110 -0
- data/spec/lib/parser/alias_spec.rb +26 -0
- data/spec/lib/parser/and_spec.rb +13 -0
- data/spec/lib/parser/attrasgn_spec.rb +28 -0
- data/spec/lib/parser/begin_spec.rb +42 -0
- data/spec/lib/parser/block_spec.rb +12 -0
- data/spec/lib/parser/break_spec.rb +17 -0
- data/spec/lib/parser/call_spec.rb +165 -0
- data/spec/lib/parser/class_spec.rb +35 -0
- data/spec/lib/parser/comments_spec.rb +11 -0
- data/spec/lib/parser/def_spec.rb +80 -0
- data/spec/lib/parser/if_spec.rb +26 -0
- data/spec/lib/parser/iter_spec.rb +59 -0
- data/spec/lib/parser/lambda_spec.rb +64 -0
- data/spec/lib/parser/literal_spec.rb +118 -0
- data/spec/lib/parser/masgn_spec.rb +37 -0
- data/spec/lib/parser/module_spec.rb +27 -0
- data/spec/lib/parser/not_spec.rb +21 -0
- data/spec/lib/parser/op_asgn1_spec.rb +23 -0
- data/spec/lib/parser/op_asgn2_spec.rb +23 -0
- data/spec/lib/parser/or_spec.rb +13 -0
- data/spec/lib/parser/return_spec.rb +17 -0
- data/spec/lib/parser/sclass_spec.rb +21 -0
- data/spec/lib/parser/string_spec.rb +276 -0
- data/spec/lib/parser/super_spec.rb +20 -0
- data/spec/lib/parser/unary_spec.rb +48 -0
- data/spec/lib/parser/undef_spec.rb +15 -0
- data/spec/lib/parser/unless_spec.rb +13 -0
- data/spec/lib/parser/variables_spec.rb +92 -0
- data/spec/lib/parser/while_spec.rb +15 -0
- data/spec/lib/parser/yield_spec.rb +20 -0
- data/spec/lib/path_reader_spec.rb +36 -0
- data/spec/lib/shared/path_finder_shared.rb +19 -0
- data/spec/lib/shared/path_reader_shared.rb +31 -0
- data/spec/lib/spec_helper.rb +9 -0
- data/spec/lib/sprockets/erb_spec.rb +38 -0
- data/spec/lib/sprockets/path_reader_spec.rb +41 -0
- data/spec/lib/sprockets/processor_spec.rb +67 -0
- data/spec/lib/sprockets/server_spec.rb +102 -0
- data/spec/lib/tilt/opal_spec.rb +37 -0
- data/spec/opal/compiler/irb_spec.rb +44 -0
- data/spec/opal/core/array/intersection_spec.rb +38 -0
- data/spec/opal/core/array/minus_spec.rb +38 -0
- data/spec/opal/core/array/select_spec.rb +14 -0
- data/spec/opal/core/array/set_range_to_array_spec.rb +7 -0
- data/spec/opal/core/array/union_spec.rb +38 -0
- data/spec/opal/core/array/uniq_spec.rb +49 -0
- data/spec/opal/core/date_spec.rb +177 -0
- data/spec/opal/core/enumerable/all_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/any_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/collect_break_spec.rb +13 -0
- data/spec/opal/core/enumerable/count_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/detect_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/drop_while_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/each_slice_break.rb +6 -0
- data/spec/opal/core/enumerable/each_with_index_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/each_with_object_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/find_all_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/find_index_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/grep_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/max_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/max_by_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/min_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/min_by_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/none_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/one_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/reduce_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/take_while_break_spec.rb +5 -0
- data/spec/opal/core/exception_spec.rb +13 -0
- data/spec/opal/core/fixtures/class.rb +124 -0
- data/spec/opal/core/fixtures/class_variables.rb +0 -0
- data/spec/opal/core/fixtures/constants.rb +33 -0
- data/spec/opal/core/fixtures/require_tree_files/file 1.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_files/file 2.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_files/file 3.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_files/file 4.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_files/file 5.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_files/nested/nested 1.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_files/nested/nested 2.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_files/other/other 1.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_with_dot/file 1.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_with_dot/file 2.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_with_dot/file 3.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_with_dot/index.rb +3 -0
- data/spec/opal/core/hash/has_value_spec.rb +13 -0
- data/spec/opal/core/hash/internals_spec.rb +332 -0
- data/spec/opal/core/kernel/Array_spec.rb +10 -0
- data/spec/opal/core/kernel/block_given_spec.rb +30 -0
- data/spec/opal/core/kernel/class_spec.rb +6 -0
- data/spec/opal/core/kernel/define_singleton_method_spec.rb +21 -0
- data/spec/opal/core/kernel/equal_value_spec.rb +12 -0
- data/spec/opal/core/kernel/extend_spec.rb +21 -0
- data/spec/opal/core/kernel/format_spec.rb +122 -0
- data/spec/opal/core/kernel/freeze_spec.rb +15 -0
- data/spec/opal/core/kernel/instance_eval_spec.rb +28 -0
- data/spec/opal/core/kernel/instance_variable_defined_spec.rb +15 -0
- data/spec/opal/core/kernel/instance_variable_get_spec.rb +14 -0
- data/spec/opal/core/kernel/instance_variable_set_spec.rb +10 -0
- data/spec/opal/core/kernel/loop_spec.rb +23 -0
- data/spec/opal/core/kernel/match_spec.rb +5 -0
- data/spec/opal/core/kernel/method_spec.rb +31 -0
- data/spec/opal/core/kernel/methods_spec.rb +25 -0
- data/spec/opal/core/kernel/nil_spec.rb +7 -0
- data/spec/opal/core/kernel/p_spec.rb +15 -0
- data/spec/opal/core/kernel/printf_spec.rb +11 -0
- data/spec/opal/core/kernel/proc_spec.rb +13 -0
- data/spec/opal/core/kernel/rand_spec.rb +23 -0
- data/spec/opal/core/kernel/require_tree_spec.rb +18 -0
- data/spec/opal/core/kernel/respond_to_spec.rb +41 -0
- data/spec/opal/core/kernel/send_spec.rb +56 -0
- data/spec/opal/core/kernel/sprintf_spec.rb +5 -0
- data/spec/opal/core/language/block_spec.rb +538 -0
- data/spec/opal/core/language/fixtures/array.rb +11 -0
- data/spec/opal/core/language/fixtures/block.rb +57 -0
- data/spec/opal/core/language/fixtures/break.rb +240 -0
- data/spec/opal/core/language/fixtures/ensure.rb +72 -0
- data/spec/opal/core/language/fixtures/literal_lambda.rb +7 -0
- data/spec/opal/core/language/fixtures/metaclass.rb +33 -0
- data/spec/opal/core/language/fixtures/module.rb +24 -0
- data/spec/opal/core/language/fixtures/next.rb +128 -0
- data/spec/opal/core/language/fixtures/return.rb +118 -0
- data/spec/opal/core/language/fixtures/send.rb +110 -0
- data/spec/opal/core/language/fixtures/send_1.9.rb +22 -0
- data/spec/opal/core/language/fixtures/super.rb +308 -0
- data/spec/opal/core/language/fixtures/variables.rb +58 -0
- data/spec/opal/core/language/fixtures/yield.rb +28 -0
- data/spec/opal/core/language/predefined_spec.rb +138 -0
- data/spec/opal/core/language/proc_spec.rb +263 -0
- data/spec/opal/core/language/regexp_spec.rb +20 -0
- data/spec/opal/core/language/send_spec.rb +225 -0
- data/spec/opal/core/language/string_spec.rb +44 -0
- data/spec/opal/core/language/variables_spec.rb +1366 -0
- data/spec/opal/core/language/versions/array_1.9.rb +39 -0
- data/spec/opal/core/language/versions/block_1.9.rb +0 -0
- data/spec/opal/core/language/versions/break_1.9.rb +0 -0
- data/spec/opal/core/language/versions/case_1.9.rb +20 -0
- data/spec/opal/core/language/versions/def_2_0_spec.rb +62 -0
- data/spec/opal/core/language/versions/hash_1.9.rb +18 -0
- data/spec/opal/core/language/versions/literal_lambda_1.9.rb +143 -0
- data/spec/opal/core/language/versions/not_1.9.rb +22 -0
- data/spec/opal/core/language/versions/send_1.9.rb +241 -0
- data/spec/opal/core/language/versions/symbol_1.9.rb +15 -0
- data/spec/opal/core/language/versions/variables_1.9.rb +8 -0
- data/spec/opal/core/language_spec.rb +23 -0
- data/spec/opal/core/method/to_proc_spec.rb +28 -0
- data/spec/opal/core/module/alias_method_spec.rb +28 -0
- data/spec/opal/core/module/ancestors_spec.rb +11 -0
- data/spec/opal/core/module/append_features_spec.rb +14 -0
- data/spec/opal/core/module/attr_accessor_spec.rb +26 -0
- data/spec/opal/core/module/const_defined_spec.rb +85 -0
- data/spec/opal/core/module/const_get_spec.rb +85 -0
- data/spec/opal/core/module/const_missing_spec.rb +17 -0
- data/spec/opal/core/module/const_set_spec.rb +64 -0
- data/spec/opal/core/module/constants_spec.rb +49 -0
- data/spec/opal/core/module/fixtures/classes.rb +434 -0
- data/spec/opal/core/module/method_defined_spec.rb +48 -0
- data/spec/opal/core/module/module_function_spec.rb +25 -0
- data/spec/opal/core/module/name_spec.rb +52 -0
- data/spec/opal/core/module/public_method_defined_spec.rb +18 -0
- data/spec/opal/core/module/remove_const_spec.rb +22 -0
- data/spec/opal/core/module/undef_method_spec.rb +66 -0
- data/spec/opal/core/numeric/bit_and_spec.rb +7 -0
- data/spec/opal/core/numeric/bit_or_spec.rb +8 -0
- data/spec/opal/core/numeric/bit_xor_spec.rb +6 -0
- data/spec/opal/core/numeric/ceil_spec.rb +8 -0
- data/spec/opal/core/numeric/chr_spec.rb +8 -0
- data/spec/opal/core/numeric/comparison_spec.rb +24 -0
- data/spec/opal/core/numeric/complement_spec.rb +8 -0
- data/spec/opal/core/numeric/divide_spec.rb +10 -0
- data/spec/opal/core/numeric/eql_spec.rb +9 -0
- data/spec/opal/core/numeric/exponent_spec.rb +33 -0
- data/spec/opal/core/numeric/floor_spec.rb +8 -0
- data/spec/opal/core/numeric/gt_spec.rb +11 -0
- data/spec/opal/core/numeric/gte_spec.rb +12 -0
- data/spec/opal/core/numeric/integer_spec.rb +9 -0
- data/spec/opal/core/numeric/left_shift_spec.rb +21 -0
- data/spec/opal/core/numeric/lt_spec.rb +11 -0
- data/spec/opal/core/numeric/lte_spec.rb +12 -0
- data/spec/opal/core/numeric/minus_spec.rb +8 -0
- data/spec/opal/core/numeric/modulo_spec.rb +19 -0
- data/spec/opal/core/numeric/multiply_spec.rb +9 -0
- data/spec/opal/core/numeric/next_spec.rb +9 -0
- data/spec/opal/core/numeric/ord_spec.rb +9 -0
- data/spec/opal/core/numeric/plus_spec.rb +8 -0
- data/spec/opal/core/numeric/pred_spec.rb +7 -0
- data/spec/opal/core/numeric/right_shift_spec.rb +25 -0
- data/spec/opal/core/numeric/step_spec.rb +11 -0
- data/spec/opal/core/numeric/succ_spec.rb +9 -0
- data/spec/opal/core/numeric/times_spec.rb +36 -0
- data/spec/opal/core/numeric/to_f_spec.rb +7 -0
- data/spec/opal/core/numeric/to_i_spec.rb +7 -0
- data/spec/opal/core/numeric/to_json_spec.rb +8 -0
- data/spec/opal/core/numeric/to_s_spec.rb +26 -0
- data/spec/opal/core/numeric/uminus_spec.rb +9 -0
- data/spec/opal/core/numeric/upto_spec.rb +19 -0
- data/spec/opal/core/numeric/zero_spec.rb +7 -0
- data/spec/opal/core/object_id_spec.rb +56 -0
- data/spec/opal/core/proc/call_spec.rb +21 -0
- data/spec/opal/core/proc/element_reference_spec.rb +21 -0
- data/spec/opal/core/proc/proc_tricks_spec.rb +7 -0
- data/spec/opal/core/runtime/begin_spec.rb +39 -0
- data/spec/opal/core/runtime/block_send_spec.rb +28 -0
- data/spec/opal/core/runtime/block_spec.rb +23 -0
- data/spec/opal/core/runtime/bridged_classes_spec.rb +111 -0
- data/spec/opal/core/runtime/constants_spec.rb +13 -0
- data/spec/opal/core/runtime/donate_spec.rb +53 -0
- data/spec/opal/core/runtime/eval_spec.rb +5 -0
- data/spec/opal/core/runtime/main_methods_spec.rb +27 -0
- data/spec/opal/core/runtime/method_missing_spec.rb +62 -0
- data/spec/opal/core/runtime/method_spec.rb +31 -0
- data/spec/opal/core/runtime/operator_call_spec.rb +13 -0
- data/spec/opal/core/runtime/paren_spec.rb +14 -0
- data/spec/opal/core/runtime/rescue_spec.rb +38 -0
- data/spec/opal/core/runtime/return_spec.rb +38 -0
- data/spec/opal/core/runtime/send_spec.rb +34 -0
- data/spec/opal/core/runtime/singleton_class_spec.rb +13 -0
- data/spec/opal/core/runtime/super_spec.rb +212 -0
- data/spec/opal/core/runtime/truthy_spec.rb +23 -0
- data/spec/opal/core/runtime/variables_spec.rb +20 -0
- data/spec/opal/core/runtime_spec.rb +58 -0
- data/spec/opal/core/source_map_spec.rb +15 -0
- data/spec/opal/core/string_spec.rb +11 -0
- data/spec/opal/stdlib/erb/erb_spec.rb +30 -0
- data/spec/opal/stdlib/erb/inline_block.opalerb +3 -0
- data/spec/opal/stdlib/erb/quoted.opalerb +1 -0
- data/spec/opal/stdlib/erb/simple.opalerb +1 -0
- data/spec/opal/stdlib/js_spec.rb +66 -0
- data/spec/opal/stdlib/json/ext_spec.rb +48 -0
- data/spec/opal/stdlib/json/parse_spec.rb +33 -0
- data/spec/opal/stdlib/native/alias_native_spec.rb +27 -0
- data/spec/opal/stdlib/native/each_spec.rb +13 -0
- data/spec/opal/stdlib/native/element_reference_spec.rb +16 -0
- data/spec/opal/stdlib/native/exposure_spec.rb +33 -0
- data/spec/opal/stdlib/native/ext_spec.rb +19 -0
- data/spec/opal/stdlib/native/initialize_spec.rb +17 -0
- data/spec/opal/stdlib/native/method_missing_spec.rb +51 -0
- data/spec/opal/stdlib/native/native_alias_spec.rb +19 -0
- data/spec/opal/stdlib/native/native_class_spec.rb +18 -0
- data/spec/opal/stdlib/native/native_module_spec.rb +13 -0
- data/spec/opal/stdlib/native/native_reader_spec.rb +22 -0
- data/spec/opal/stdlib/native/native_writer_spec.rb +30 -0
- data/spec/opal/stdlib/native/new_spec.rb +8 -0
- data/spec/opal/stdlib/promise/always_spec.rb +30 -0
- data/spec/opal/stdlib/promise/error_spec.rb +15 -0
- data/spec/opal/stdlib/promise/rescue_spec.rb +44 -0
- data/spec/opal/stdlib/promise/then_spec.rb +71 -0
- data/spec/opal/stdlib/promise/trace_spec.rb +52 -0
- data/spec/opal/stdlib/promise/value_spec.rb +15 -0
- data/spec/opal/stdlib/promise/when_spec.rb +34 -0
- data/spec/opal/stdlib/template/paths_spec.rb +10 -0
- data/spec/opal/stdlib/thread/mutex_spec.rb +40 -0
- data/spec/opal/stdlib/thread/thread_queue_spec.rb +32 -0
- data/spec/opal/stdlib/thread/thread_spec.rb +60 -0
- data/spec/rubyspecs +144 -0
- data/spec/spec_helper.rb +53 -0
- data/spec/support/mspec_rspec_adapter.rb +33 -0
- data/spec/support/parser_helpers.rb +37 -0
- data/stdlib/README.md +3 -0
- data/stdlib/base64.rb +152 -0
- data/stdlib/benchmark.rb +557 -0
- data/stdlib/buffer.rb +41 -0
- data/stdlib/buffer/array.rb +66 -0
- data/stdlib/buffer/view.rb +70 -0
- data/stdlib/date.rb +248 -0
- data/stdlib/delegate.rb +29 -0
- data/stdlib/dir.rb +1 -0
- data/stdlib/encoding.rb +170 -0
- data/stdlib/enumerator.rb +1 -0
- data/stdlib/erb.rb +16 -0
- data/stdlib/file.rb +1 -0
- data/stdlib/fileutils.rb +0 -0
- data/stdlib/forwardable.rb +71 -0
- data/stdlib/iconv.rb +0 -0
- data/stdlib/js.rb +56 -0
- data/stdlib/json.rb +190 -0
- data/stdlib/math.rb +370 -0
- data/stdlib/native.rb +530 -0
- data/stdlib/nodejs.rb +7 -0
- data/stdlib/nodejs/dir.rb +13 -0
- data/stdlib/nodejs/file.rb +98 -0
- data/stdlib/nodejs/fileutils.rb +26 -0
- data/stdlib/nodejs/io.rb +2 -0
- data/stdlib/nodejs/irb.rb +45 -0
- data/stdlib/nodejs/kernel.rb +33 -0
- data/stdlib/nodejs/node_modules/.bin/js-yaml +140 -0
- data/stdlib/nodejs/node_modules/glob/LICENSE +15 -0
- data/stdlib/nodejs/node_modules/glob/README.md +357 -0
- data/stdlib/nodejs/node_modules/glob/common.js +177 -0
- data/stdlib/nodejs/node_modules/glob/glob.js +649 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/inflight/.eslintrc +17 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/inflight/LICENSE +15 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/inflight/README.md +37 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/inflight/inflight.js +44 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/inflight/node_modules/wrappy/LICENSE +15 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/inflight/node_modules/wrappy/README.md +36 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/inflight/node_modules/wrappy/package.json +52 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/inflight/node_modules/wrappy/test/basic.js +51 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/inflight/node_modules/wrappy/wrappy.js +33 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/inflight/package.json +61 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/inflight/test.js +97 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/inherits/LICENSE +16 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/inherits/README.md +42 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/inherits/inherits.js +1 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/inherits/inherits_browser.js +23 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/inherits/package.json +51 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/inherits/test.js +25 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/.npmignore +1 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/.travis.yml +4 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/LICENSE +23 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/README.md +216 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/benchmark.js +15 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/browser.js +1181 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/minimatch.js +845 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore +2 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.travis.yml +3 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +121 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js +8 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +191 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore +2 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml +4 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile +6 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +80 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js +5 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +38 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +73 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js +56 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml +4 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE +18 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown +62 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js +6 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js +13 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +83 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js +39 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +75 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js +32 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt +1075 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt +182 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js +9 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js +10 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh +24 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js +15 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/nested.js +16 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/order.js +10 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/pad.js +13 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js +7 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js +50 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/package.json +60 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/test/basic.js +399 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/test/brace-expand.js +45 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/test/defaults.js +274 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/test/extglob-ending-with-state-char.js +8 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/once/LICENSE +27 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/once/README.md +51 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/once/node_modules/wrappy/LICENSE +15 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/once/node_modules/wrappy/README.md +36 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/once/node_modules/wrappy/package.json +52 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/once/node_modules/wrappy/test/basic.js +51 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/once/node_modules/wrappy/wrappy.js +33 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/once/once.js +21 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/once/package.json +60 -0
- data/stdlib/nodejs/node_modules/glob/node_modules/once/test/once.js +23 -0
- data/stdlib/nodejs/node_modules/glob/package.json +72 -0
- data/stdlib/nodejs/node_modules/glob/sync.js +409 -0
- data/stdlib/nodejs/node_modules/js-yaml/HISTORY.md +277 -0
- data/stdlib/nodejs/node_modules/js-yaml/LICENSE +21 -0
- data/stdlib/nodejs/node_modules/js-yaml/README.md +288 -0
- data/stdlib/nodejs/node_modules/js-yaml/bin/js-yaml.js +140 -0
- data/stdlib/nodejs/node_modules/js-yaml/bower.json +23 -0
- data/stdlib/nodejs/node_modules/js-yaml/dist/js-yaml.js +3666 -0
- data/stdlib/nodejs/node_modules/js-yaml/dist/js-yaml.min.js +3 -0
- data/stdlib/nodejs/node_modules/js-yaml/examples/custom_types.js +102 -0
- data/stdlib/nodejs/node_modules/js-yaml/examples/custom_types.yml +18 -0
- data/stdlib/nodejs/node_modules/js-yaml/examples/dumper.js +31 -0
- data/stdlib/nodejs/node_modules/js-yaml/examples/dumper.json +22 -0
- data/stdlib/nodejs/node_modules/js-yaml/examples/sample_document.js +18 -0
- data/stdlib/nodejs/node_modules/js-yaml/examples/sample_document.yml +197 -0
- data/stdlib/nodejs/node_modules/js-yaml/index.js +7 -0
- data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml.js +39 -0
- data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/common.js +62 -0
- data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/dumper.js +554 -0
- data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/exception.js +25 -0
- data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/loader.js +1581 -0
- data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/mark.js +78 -0
- data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/schema.js +103 -0
- data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/schema/core.js +18 -0
- data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/schema/default_full.js +25 -0
- data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js +28 -0
- data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js +17 -0
- data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/schema/json.js +25 -0
- data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type.js +61 -0
- data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/binary.js +133 -0
- data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/bool.js +37 -0
- data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/float.js +110 -0
- data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/int.js +183 -0
- data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/js/function.js +85 -0
- data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js +84 -0
- data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js +27 -0
- data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/map.js +8 -0
- data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/merge.js +12 -0
- data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/null.js +36 -0
- data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/omap.js +56 -0
- data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/pairs.js +61 -0
- data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/seq.js +8 -0
- data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/set.js +33 -0
- data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/str.js +8 -0
- data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/timestamp.js +98 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/.bin/esparse +117 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/.bin/esvalidate +177 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/HISTORY.md +115 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/LICENSE +21 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/README.md +239 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/examples/arguments.js +36 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/examples/choice.js +22 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/examples/constants.js +59 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/examples/help.js +13 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/examples/nargs.js +33 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/examples/parents.js +28 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/examples/prefix_chars.js +23 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/examples/sub_commands.js +49 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/examples/sum.js +35 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/examples/testformatters.js +270 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/index.js +1 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action.js +146 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/append.js +55 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/append/constant.js +47 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/count.js +40 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/help.js +48 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/store.js +50 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js +43 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/store/false.js +27 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/store/true.js +26 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/subparsers.js +148 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/version.js +50 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action_container.js +481 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/argparse.js +14 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/argument/error.js +50 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/argument/exclusive.js +54 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/argument/group.js +75 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/argument_parser.js +1168 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/const.js +18 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/help/added_formatters.js +88 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/help/formatter.js +798 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/namespace.js +77 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.npmignore +2 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.travis.yml +8 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/README.markdown +825 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/bower.json +33 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/component.json +11 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/foo.js +10 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/gulpfile.js +26 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/lib/underscore.string.js +673 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/libpeerconnection.log +0 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/package.json +107 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/LICENSE +23 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/README.md +22 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json +69 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js +6 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js +1415 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/package.json +62 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/esprima/README.md +73 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/esprima/bin/esparse.js +117 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js +177 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/esprima/esprima.js +3908 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/esprima/package.json +69 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/esprima/test/compat.js +239 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/esprima/test/reflect.js +422 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/esprima/test/run.js +66 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/esprima/test/runner.js +387 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/esprima/test/test.js +20238 -0
- data/stdlib/nodejs/node_modules/js-yaml/package.json +83 -0
- data/stdlib/nodejs/package.json +6 -0
- data/stdlib/nodejs/require.rb +30 -0
- data/stdlib/nodejs/rubygems.rb +68 -0
- data/stdlib/nodejs/yaml.rb +11 -0
- data/stdlib/observer.rb +202 -0
- data/stdlib/opal-parser.rb +54 -0
- data/stdlib/opal-source-maps.rb +2 -0
- data/stdlib/ostruct.rb +69 -0
- data/stdlib/pathname.rb +55 -0
- data/stdlib/phantomjs.rb +3 -0
- data/stdlib/pp.rb +35 -0
- data/stdlib/promise.rb +427 -0
- data/stdlib/racc/parser.rb +215 -0
- data/stdlib/rbconfig.rb +18 -0
- data/stdlib/securerandom.rb +12 -0
- data/stdlib/set.rb +170 -0
- data/stdlib/singleton.rb +40 -0
- data/stdlib/source_map.rb +5 -0
- data/stdlib/source_map/map.rb +220 -0
- data/stdlib/source_map/mapping.rb +26 -0
- data/stdlib/source_map/offset.rb +88 -0
- data/stdlib/source_map/version.rb +3 -0
- data/stdlib/source_map/vlq.rb +98 -0
- data/stdlib/sourcemap.rb +1 -0
- data/stdlib/stringio.rb +181 -0
- data/stdlib/strscan.rb +166 -0
- data/stdlib/template.rb +46 -0
- data/stdlib/thread.rb +164 -0
- data/stdlib/time.rb +9 -0
- data/stdlib/yaml.rb +1 -0
- data/tasks/benchmarking.rake +88 -0
- data/tasks/building.rake +58 -0
- data/tasks/documenting.rake +37 -0
- data/tasks/github.rake +19 -0
- data/tasks/linting.rake +18 -0
- data/tasks/testing.rake +125 -0
- data/vendored-minitest/minitest.rb +780 -0
- data/vendored-minitest/minitest/assertions.rb +662 -0
- data/vendored-minitest/minitest/autorun.rb +12 -0
- data/vendored-minitest/minitest/benchmark.rb +426 -0
- data/vendored-minitest/minitest/expectations.rb +281 -0
- data/vendored-minitest/minitest/hell.rb +11 -0
- data/vendored-minitest/minitest/mock.rb +220 -0
- data/vendored-minitest/minitest/parallel.rb +65 -0
- data/vendored-minitest/minitest/pride.rb +4 -0
- data/vendored-minitest/minitest/pride_plugin.rb +142 -0
- data/vendored-minitest/minitest/spec.rb +310 -0
- data/vendored-minitest/minitest/test.rb +293 -0
- data/vendored-minitest/minitest/unit.rb +45 -0
- data/vendored-minitest/test/unit.rb +28 -0
- metadata +1058 -0
@@ -0,0 +1,277 @@
|
|
1
|
+
3.2.6 / 2015-02-07
|
2
|
+
------------------
|
3
|
+
|
4
|
+
- Fixed encoding of UTF-16 surrogate pairs. (e.g. "\U0001F431" CAT FACE)
|
5
|
+
- Fixed demo dates dump (#113, thanks to @Hypercubed).
|
6
|
+
|
7
|
+
|
8
|
+
3.2.5 / 2014-12-28
|
9
|
+
------------------
|
10
|
+
|
11
|
+
- Fixed resolving of all built-in types on empty nodes.
|
12
|
+
- Fixed invalid warning on empty lines within quoted scalars and flow collections.
|
13
|
+
- Fixed bug: Tag on an empty node didn't resolve in some cases.
|
14
|
+
|
15
|
+
|
16
|
+
3.2.4 / 2014-12-19
|
17
|
+
------------------
|
18
|
+
|
19
|
+
- Fixed resolving of !!null tag on an empty node.
|
20
|
+
|
21
|
+
|
22
|
+
3.2.3 / 2014-11-08
|
23
|
+
------------------
|
24
|
+
|
25
|
+
- Implemented dumping of objects with circular and cross references.
|
26
|
+
- Partially fixed aliasing of constructed objects. (see issue #141 for details)
|
27
|
+
|
28
|
+
|
29
|
+
3.2.2 / 2014-09-07
|
30
|
+
------------------
|
31
|
+
|
32
|
+
- Fixed infinite loop on unindented block scalars.
|
33
|
+
- Rewritten base64 encode/decode in binary type, to keep code licence clear.
|
34
|
+
|
35
|
+
|
36
|
+
3.2.1 / 2014-08-24
|
37
|
+
------------------
|
38
|
+
|
39
|
+
- Nothig new. Just fix npm publish error.
|
40
|
+
|
41
|
+
|
42
|
+
3.2.0 / 2014-08-24
|
43
|
+
------------------
|
44
|
+
|
45
|
+
- Added input piping support to CLI.
|
46
|
+
- Fixed typo, that could cause hand on initial indent (#139).
|
47
|
+
|
48
|
+
|
49
|
+
3.1.0 / 2014-07-07
|
50
|
+
------------------
|
51
|
+
|
52
|
+
- 1.5x-2x speed boost.
|
53
|
+
- Removed deprecated `require('xxx.yml')` support.
|
54
|
+
- Significant code cleanup and refactoring.
|
55
|
+
- Internal API changed. If you used custom types - see updated examples.
|
56
|
+
Others are not affected.
|
57
|
+
- Even if the input string has no trailing line break character,
|
58
|
+
it will be parsed as if it has one.
|
59
|
+
- Added benchmark scripts.
|
60
|
+
- Moved bower files to /dist folder
|
61
|
+
- Bugfixes.
|
62
|
+
|
63
|
+
|
64
|
+
3.0.2 / 2014-02-27
|
65
|
+
------------------
|
66
|
+
|
67
|
+
- Fixed bug: "constructor" string parsed as `null`.
|
68
|
+
|
69
|
+
|
70
|
+
3.0.1 / 2013-12-22
|
71
|
+
------------------
|
72
|
+
|
73
|
+
- Fixed parsing of literal scalars. (issue #108)
|
74
|
+
- Prevented adding unnecessary spaces in object dumps. (issue #68)
|
75
|
+
- Fixed dumping of objects with very long (> 1024 in length) keys.
|
76
|
+
|
77
|
+
|
78
|
+
3.0.0 / 2013-12-16
|
79
|
+
------------------
|
80
|
+
|
81
|
+
- Refactored code. Changed API for custom types.
|
82
|
+
- Removed output colors in CLI, dump json by default.
|
83
|
+
- Removed big dependencies from browser version (esprima, buffer)
|
84
|
+
- load `esprima` manually, if !!js/function needed
|
85
|
+
- !!bin now returns Array in browser
|
86
|
+
- AMD support.
|
87
|
+
- Don't quote dumped strings because of `-` & `?` (if not first char).
|
88
|
+
- __Deprecated__ loading yaml files via `require()`, as not recommended
|
89
|
+
behaviour for node.
|
90
|
+
|
91
|
+
|
92
|
+
2.1.3 / 2013-10-16
|
93
|
+
------------------
|
94
|
+
|
95
|
+
- Fix wrong loading of empty block scalars.
|
96
|
+
|
97
|
+
|
98
|
+
2.1.2 / 2013-10-07
|
99
|
+
------------------
|
100
|
+
|
101
|
+
- Fix unwanted line breaks in folded scalars.
|
102
|
+
|
103
|
+
|
104
|
+
2.1.1 / 2013-10-02
|
105
|
+
------------------
|
106
|
+
|
107
|
+
- Dumper now respects deprecated booleans syntax from YAML 1.0/1.1
|
108
|
+
- Fixed reader bug in JSON-like sequences/mappings.
|
109
|
+
|
110
|
+
|
111
|
+
2.1.0 / 2013-06-05
|
112
|
+
------------------
|
113
|
+
|
114
|
+
- Add standard YAML schemas: Failsafe (`FAILSAFE_SCHEMA`),
|
115
|
+
JSON (`JSON_SCHEMA`) and Core (`CORE_SCHEMA`).
|
116
|
+
- Rename `DEFAULT_SCHEMA` to `DEFAULT_FULL_SCHEMA`
|
117
|
+
and `SAFE_SCHEMA` to `DEFAULT_SAFE_SCHEMA`.
|
118
|
+
- Bug fix: export `NIL` constant from the public interface.
|
119
|
+
- Add `skipInvalid` dumper option.
|
120
|
+
- Use `safeLoad` for `require` extension.
|
121
|
+
|
122
|
+
|
123
|
+
2.0.5 / 2013-04-26
|
124
|
+
------------------
|
125
|
+
|
126
|
+
- Close security issue in !!js/function constructor.
|
127
|
+
Big thanks to @nealpoole for security audit.
|
128
|
+
|
129
|
+
|
130
|
+
2.0.4 / 2013-04-08
|
131
|
+
------------------
|
132
|
+
|
133
|
+
- Updated .npmignore to reduce package size
|
134
|
+
|
135
|
+
|
136
|
+
2.0.3 / 2013-02-26
|
137
|
+
------------------
|
138
|
+
|
139
|
+
- Fixed dumping of empty arrays ans objects. ([] and {} instead of null)
|
140
|
+
|
141
|
+
|
142
|
+
2.0.2 / 2013-02-15
|
143
|
+
------------------
|
144
|
+
|
145
|
+
- Fixed input validation: tabs are printable characters.
|
146
|
+
|
147
|
+
|
148
|
+
2.0.1 / 2013-02-09
|
149
|
+
------------------
|
150
|
+
|
151
|
+
- Fixed error, when options not passed to function cass
|
152
|
+
|
153
|
+
|
154
|
+
2.0.0 / 2013-02-09
|
155
|
+
------------------
|
156
|
+
|
157
|
+
- Full rewrite. New architecture. Fast one-stage parsing.
|
158
|
+
- Changed custom types API.
|
159
|
+
- Added YAML dumper.
|
160
|
+
|
161
|
+
|
162
|
+
1.0.3 / 2012-11-05
|
163
|
+
------------------
|
164
|
+
|
165
|
+
- Fixed utf-8 files loading.
|
166
|
+
|
167
|
+
|
168
|
+
1.0.2 / 2012-08-02
|
169
|
+
------------------
|
170
|
+
|
171
|
+
- Pull out hand-written shims. Use ES5-Shims for old browsers support. See #44.
|
172
|
+
- Fix timstamps incorectly parsed in local time when no time part specified.
|
173
|
+
|
174
|
+
|
175
|
+
1.0.1 / 2012-07-07
|
176
|
+
------------------
|
177
|
+
|
178
|
+
- Fixes `TypeError: 'undefined' is not an object` under Safari. Thanks Phuong.
|
179
|
+
- Fix timestamps incorrectly parsed in local time. Thanks @caolan. Closes #46.
|
180
|
+
|
181
|
+
|
182
|
+
1.0.0 / 2012-07-01
|
183
|
+
------------------
|
184
|
+
|
185
|
+
- `y`, `yes`, `n`, `no`, `on`, `off` are not converted to Booleans anymore.
|
186
|
+
Fixes #42.
|
187
|
+
- `require(filename)` now returns a single document and throws an Error if
|
188
|
+
file contains more than one document.
|
189
|
+
- CLI was merged back from js-yaml.bin
|
190
|
+
|
191
|
+
|
192
|
+
0.3.7 / 2012-02-28
|
193
|
+
------------------
|
194
|
+
|
195
|
+
- Fix export of `addConstructor()`. Closes #39.
|
196
|
+
|
197
|
+
|
198
|
+
0.3.6 / 2012-02-22
|
199
|
+
------------------
|
200
|
+
|
201
|
+
- Removed AMD parts - too buggy to use. Need help to rewrite from scratch
|
202
|
+
- Removed YUI compressor warning (renamed `double` variable). Closes #40.
|
203
|
+
|
204
|
+
|
205
|
+
0.3.5 / 2012-01-10
|
206
|
+
------------------
|
207
|
+
|
208
|
+
- Workagound for .npmignore fuckup under windows. Thanks to airportyh.
|
209
|
+
|
210
|
+
|
211
|
+
0.3.4 / 2011-12-24
|
212
|
+
------------------
|
213
|
+
|
214
|
+
- Fixes str[] for oldIEs support.
|
215
|
+
- Adds better has change support for browserified demo.
|
216
|
+
- improves compact output of Error. Closes #33.
|
217
|
+
|
218
|
+
|
219
|
+
0.3.3 / 2011-12-20
|
220
|
+
------------------
|
221
|
+
|
222
|
+
- jsyaml executable moved to separate module.
|
223
|
+
- adds `compact` stringification of Errors.
|
224
|
+
|
225
|
+
|
226
|
+
0.3.2 / 2011-12-16
|
227
|
+
------------------
|
228
|
+
|
229
|
+
- Fixes ug with block style scalars. Closes #26.
|
230
|
+
- All sources are passing JSLint now.
|
231
|
+
- Fixes bug in Safari. Closes #28.
|
232
|
+
- Fixes bug in Opers. Closes #29.
|
233
|
+
- Improves browser support. Closes #20.
|
234
|
+
- Added jsyaml executable.
|
235
|
+
- Added !!js/function support. Closes #12.
|
236
|
+
|
237
|
+
|
238
|
+
0.3.1 / 2011-11-18
|
239
|
+
------------------
|
240
|
+
|
241
|
+
- Added AMD support for browserified version.
|
242
|
+
- Wrapped browserified js-yaml into closure.
|
243
|
+
- Fixed the resolvement of non-specific tags. Closes #17.
|
244
|
+
- Added permalinks for online demo YAML snippets. Now we have YPaste service, lol.
|
245
|
+
- Added !!js/regexp and !!js/undefined types. Partially solves #12.
|
246
|
+
- Fixed !!set mapping.
|
247
|
+
- Fixed month parse in dates. Closes #19.
|
248
|
+
|
249
|
+
|
250
|
+
0.3.0 / 2011-11-09
|
251
|
+
------------------
|
252
|
+
|
253
|
+
- Removed JS.Class dependency. Closes #3.
|
254
|
+
- Added browserified version. Closes #13.
|
255
|
+
- Added live demo of browserified version.
|
256
|
+
- Ported some of the PyYAML tests. See #14.
|
257
|
+
- Fixed timestamp bug when fraction was given.
|
258
|
+
|
259
|
+
|
260
|
+
0.2.2 / 2011-11-06
|
261
|
+
------------------
|
262
|
+
|
263
|
+
- Fixed crash on docs without ---. Closes #8.
|
264
|
+
- Fixed miltiline string parse
|
265
|
+
- Fixed tests/comments for using array as key
|
266
|
+
|
267
|
+
|
268
|
+
0.2.1 / 2011-11-02
|
269
|
+
------------------
|
270
|
+
|
271
|
+
- Fixed short file read (<4k). Closes #9.
|
272
|
+
|
273
|
+
|
274
|
+
0.2.0 / 2011-11-02
|
275
|
+
------------------
|
276
|
+
|
277
|
+
- First public release
|
@@ -0,0 +1,21 @@
|
|
1
|
+
(The MIT License)
|
2
|
+
|
3
|
+
Copyright (C) 2011, 2013 by Vitaly Puzrin
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
@@ -0,0 +1,288 @@
|
|
1
|
+
JS-YAML - YAML 1.2 parser and serializer for JavaScript
|
2
|
+
=======================================================
|
3
|
+
|
4
|
+
[](https://travis-ci.org/nodeca/js-yaml)
|
5
|
+
[](https://www.npmjs.org/package/js-yaml)
|
6
|
+
|
7
|
+
[Online Demo](http://nodeca.github.com/js-yaml/)
|
8
|
+
|
9
|
+
|
10
|
+
This is an implementation of [YAML](http://yaml.org/), a human friendly data
|
11
|
+
serialization language. Started as [PyYAML](http://pyyaml.org/) port, it was
|
12
|
+
completely rewritten from scratch. Now it's very fast, and supports 1.2 spec.
|
13
|
+
|
14
|
+
|
15
|
+
Installation
|
16
|
+
------------
|
17
|
+
|
18
|
+
### YAML module for node.js
|
19
|
+
|
20
|
+
```
|
21
|
+
npm install js-yaml
|
22
|
+
```
|
23
|
+
|
24
|
+
|
25
|
+
### CLI executable
|
26
|
+
|
27
|
+
If you want to inspect your YAML files from CLI, install js-yaml globally:
|
28
|
+
|
29
|
+
```
|
30
|
+
npm install -g js-yaml
|
31
|
+
```
|
32
|
+
|
33
|
+
#### Usage
|
34
|
+
|
35
|
+
```
|
36
|
+
usage: js-yaml [-h] [-v] [-c] [-t] file
|
37
|
+
|
38
|
+
Positional arguments:
|
39
|
+
file File with YAML document(s)
|
40
|
+
|
41
|
+
Optional arguments:
|
42
|
+
-h, --help Show this help message and exit.
|
43
|
+
-v, --version Show program's version number and exit.
|
44
|
+
-c, --compact Display errors in compact mode
|
45
|
+
-t, --trace Show stack trace on error
|
46
|
+
```
|
47
|
+
|
48
|
+
|
49
|
+
### Bundled YAML library for browsers
|
50
|
+
|
51
|
+
``` html
|
52
|
+
<!-- esprima required only for !!js/function -->
|
53
|
+
<script src="esprima.js"></script>
|
54
|
+
<script src="js-yaml.min.js"></script>
|
55
|
+
<script type="text/javascript">
|
56
|
+
var doc = jsyaml.load('greeting: hello\nname: world');
|
57
|
+
</script>
|
58
|
+
```
|
59
|
+
|
60
|
+
Browser support was done mostly for online demo. If you find any errors - feel
|
61
|
+
free to send pull requests with fixes. Also note, that IE and other old browsers
|
62
|
+
needs [es5-shims](https://github.com/kriskowal/es5-shim) to operate.
|
63
|
+
|
64
|
+
Notes:
|
65
|
+
|
66
|
+
1. We have no resourses to support browserified version. Don't expect it to be
|
67
|
+
well tested. Don't expect fast fixes if something goes wrong there.
|
68
|
+
2. `!!js/function` in browser bundle will not work by default. If you really need
|
69
|
+
it - load `esprima` parser first (via amd or directly).
|
70
|
+
3. `!!bin` in browser will return `Array`, because browsers do not support
|
71
|
+
node.js `Buffer` and adding Buffer shims is completely useless on practice.
|
72
|
+
|
73
|
+
|
74
|
+
API
|
75
|
+
---
|
76
|
+
|
77
|
+
Here we cover the most 'useful' methods. If you need advanced details (creating
|
78
|
+
your own tags), see [wiki](https://github.com/nodeca/js-yaml/wiki) and
|
79
|
+
[examples](https://github.com/nodeca/js-yaml/tree/master/examples) for more
|
80
|
+
info.
|
81
|
+
|
82
|
+
``` javascript
|
83
|
+
yaml = require('js-yaml');
|
84
|
+
fs = require('fs');
|
85
|
+
|
86
|
+
// Get document, or throw exception on error
|
87
|
+
try {
|
88
|
+
var doc = yaml.safeLoad(fs.readFileSync('/home/ixti/example.yml', 'utf8'));
|
89
|
+
console.log(doc);
|
90
|
+
} catch (e) {
|
91
|
+
console.log(e);
|
92
|
+
}
|
93
|
+
```
|
94
|
+
|
95
|
+
|
96
|
+
### safeLoad (string [ , options ])
|
97
|
+
|
98
|
+
**Recommended loading way.** Parses `string` as single YAML document. Returns a JavaScript
|
99
|
+
object or throws `YAMLException` on error. By default, does not support regexps,
|
100
|
+
functions and undefined. This method is safe for untrusted data.
|
101
|
+
|
102
|
+
options:
|
103
|
+
|
104
|
+
- `filename` _(default: null)_ - string to be used as a file path in
|
105
|
+
error/warning messages.
|
106
|
+
- `onWarning` _(default: null)_ - function to call on warning messages.
|
107
|
+
Loader will throw on warnings if this function is not provided.
|
108
|
+
- `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ - specifies a schema to use.
|
109
|
+
- `FAILSAFE_SCHEMA` - only strings, arrays and plain objects:
|
110
|
+
http://www.yaml.org/spec/1.2/spec.html#id2802346
|
111
|
+
- `JSON_SCHEMA` - all JSON-supported types:
|
112
|
+
http://www.yaml.org/spec/1.2/spec.html#id2803231
|
113
|
+
- `CORE_SCHEMA` - same as `JSON_SCHEMA`:
|
114
|
+
http://www.yaml.org/spec/1.2/spec.html#id2804923
|
115
|
+
- `DEFAULT_SAFE_SCHEMA` - all supported YAML types, without unsafe ones
|
116
|
+
(`!!js/undefined`, `!!js/regexp` and `!!js/function`):
|
117
|
+
http://yaml.org/type/
|
118
|
+
- `DEFAULT_FULL_SCHEMA` - all supported YAML types.
|
119
|
+
|
120
|
+
NOTE: This function **does not** understand multi-document sources, it throws
|
121
|
+
exception on those.
|
122
|
+
|
123
|
+
NOTE: JS-YAML **does not** support schema-specific tag resolution restrictions.
|
124
|
+
So, JSON schema is not as strict as defined in the YAML specification.
|
125
|
+
It allows numbers in any notaion, use `Null` and `NULL` as `null`, etc.
|
126
|
+
Core schema also has no such restrictions. It allows binary notation for integers.
|
127
|
+
|
128
|
+
|
129
|
+
### load (string [ , options ])
|
130
|
+
|
131
|
+
**Use with care with untrusted sources**. The same as `safeLoad()` but uses
|
132
|
+
`DEFAULT_FULL_SCHEMA` by default - adds some JavaScript-specific types:
|
133
|
+
`!!js/function`, `!!js/regexp` and `!!js/undefined`. For untrusted sources you
|
134
|
+
must additionally validate object structure, to avoid injections:
|
135
|
+
|
136
|
+
``` javascript
|
137
|
+
var untrusted_code = '"toString": !<tag:yaml.org,2002:js/function> "function (){very_evil_thing();}"';
|
138
|
+
|
139
|
+
// I'm just converting that string, what could possibly go wrong?
|
140
|
+
require('js-yaml').load(untrusted_code) + ''
|
141
|
+
```
|
142
|
+
|
143
|
+
|
144
|
+
### safeLoadAll (string, iterator [ , options ])
|
145
|
+
|
146
|
+
Same as `safeLoad()`, but understands multi-document sources and apply
|
147
|
+
`iterator` to each document.
|
148
|
+
|
149
|
+
``` javascript
|
150
|
+
var yaml = require('js-yaml');
|
151
|
+
|
152
|
+
yaml.safeLoadAll(data, function (doc) {
|
153
|
+
console.log(doc);
|
154
|
+
});
|
155
|
+
```
|
156
|
+
|
157
|
+
|
158
|
+
### loadAll (string, iterator [ , options ])
|
159
|
+
|
160
|
+
Same as `safeLoadAll()` but uses `DEFAULT_FULL_SCHEMA` by default.
|
161
|
+
|
162
|
+
|
163
|
+
### safeDump (object [ , options ])
|
164
|
+
|
165
|
+
Serializes `object` as YAML document. Uses `DEFAULT_SAFE_SCHEMA`, so it will
|
166
|
+
throw exception if you try to dump regexps or functions. However, you can
|
167
|
+
disable exceptions by `skipInvalid` option.
|
168
|
+
|
169
|
+
options:
|
170
|
+
|
171
|
+
- `indent` _(default: 2)_ - indentation width to use (in spaces).
|
172
|
+
- `skipInvalid` _(default: false)_ - do not throw on invalid types (like function
|
173
|
+
in the safe schema) and skip pairs and single values with such types.
|
174
|
+
- `flowLevel` (default: -1) - specifies level of nesting, when to switch from
|
175
|
+
block to flow style for collections. -1 means block style everwhere
|
176
|
+
- `styles` - "tag" => "style" map. Each tag may have own set of styles.
|
177
|
+
- `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ specifies a schema to use.
|
178
|
+
|
179
|
+
styles:
|
180
|
+
|
181
|
+
``` none
|
182
|
+
!!null
|
183
|
+
"canonical" => "~"
|
184
|
+
|
185
|
+
!!int
|
186
|
+
"binary" => "0b1", "0b101010", "0b1110001111010"
|
187
|
+
"octal" => "01", "052", "016172"
|
188
|
+
"decimal" => "1", "42", "7290"
|
189
|
+
"hexadecimal" => "0x1", "0x2A", "0x1C7A"
|
190
|
+
|
191
|
+
!!null, !!bool, !!float
|
192
|
+
"lowercase" => "null", "true", "false", ".nan", '.inf'
|
193
|
+
"uppercase" => "NULL", "TRUE", "FALSE", ".NAN", '.INF'
|
194
|
+
"camelcase" => "Null", "True", "False", ".NaN", '.Inf'
|
195
|
+
```
|
196
|
+
|
197
|
+
By default, !!int uses `decimal`, and !!null, !!bool, !!float use `lowercase`.
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
### dump (object [ , options ])
|
202
|
+
|
203
|
+
Same as `safeDump()` but without limits (uses `DEFAULT_FULL_SCHEMA` by default).
|
204
|
+
|
205
|
+
|
206
|
+
Supported YAML types
|
207
|
+
--------------------
|
208
|
+
|
209
|
+
The list of standard YAML tags and corresponding JavaScipt types. See also
|
210
|
+
[YAML tag discussion](http://pyyaml.org/wiki/YAMLTagDiscussion) and
|
211
|
+
[YAML types repository](http://yaml.org/type/).
|
212
|
+
|
213
|
+
```
|
214
|
+
!!null '' # null
|
215
|
+
!!bool 'yes' # bool
|
216
|
+
!!int '3...' # number
|
217
|
+
!!float '3.14...' # number
|
218
|
+
!!binary '...base64...' # buffer
|
219
|
+
!!timestamp 'YYYY-...' # date
|
220
|
+
!!omap [ ... ] # array of key-value pairs
|
221
|
+
!!pairs [ ... ] # array or array pairs
|
222
|
+
!!set { ... } # array of objects with given keys and null values
|
223
|
+
!!str '...' # string
|
224
|
+
!!seq [ ... ] # array
|
225
|
+
!!map { ... } # object
|
226
|
+
```
|
227
|
+
|
228
|
+
**JavaScript-specific tags**
|
229
|
+
|
230
|
+
```
|
231
|
+
!!js/regexp /pattern/gim # RegExp
|
232
|
+
!!js/undefined '' # Undefined
|
233
|
+
!!js/function 'function () {...}' # Function
|
234
|
+
```
|
235
|
+
|
236
|
+
Caveats
|
237
|
+
-------
|
238
|
+
|
239
|
+
Note, that you use arrays or objects as key in JS-YAML. JS do not allows objects
|
240
|
+
or array as keys, and stringifies (by calling .toString method) them at the
|
241
|
+
moment of adding them.
|
242
|
+
|
243
|
+
``` yaml
|
244
|
+
---
|
245
|
+
? [ foo, bar ]
|
246
|
+
: - baz
|
247
|
+
? { foo: bar }
|
248
|
+
: - baz
|
249
|
+
- baz
|
250
|
+
```
|
251
|
+
|
252
|
+
``` javascript
|
253
|
+
{ "foo,bar": ["baz"], "[object Object]": ["baz", "baz"] }
|
254
|
+
```
|
255
|
+
|
256
|
+
Also, reading of properties on implicit block mapping keys is not supported yet.
|
257
|
+
So, the following YAML document cannot be loaded.
|
258
|
+
|
259
|
+
``` yaml
|
260
|
+
&anchor foo:
|
261
|
+
foo: bar
|
262
|
+
*anchor: duplicate key
|
263
|
+
baz: bat
|
264
|
+
*anchor: duplicate key
|
265
|
+
```
|
266
|
+
|
267
|
+
|
268
|
+
Breaking changes in 2.x.x -> 3.x.x
|
269
|
+
----------------------------------
|
270
|
+
|
271
|
+
If your have not used __custom__ tags or loader classes and not loaded yaml
|
272
|
+
files via `require()` - no changes needed. Just upgrade library.
|
273
|
+
|
274
|
+
In other case, you should:
|
275
|
+
|
276
|
+
1. Replace all occurences of `require('xxxx.yml')` by `fs.readFileSync()` +
|
277
|
+
`yaml.safeLoad()`.
|
278
|
+
2. rewrite your custom tags constructors and custom loader
|
279
|
+
classes, to conform new API. See
|
280
|
+
[examples](https://github.com/nodeca/js-yaml/tree/master/examples) and
|
281
|
+
[wiki](https://github.com/nodeca/js-yaml/wiki) for details.
|
282
|
+
|
283
|
+
|
284
|
+
License
|
285
|
+
-------
|
286
|
+
|
287
|
+
View the [LICENSE](https://github.com/nodeca/js-yaml/blob/master/LICENSE) file
|
288
|
+
(MIT).
|