laser 0.7.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.rspec +1 -0
- data/Gemfile +14 -0
- data/LICENSE +661 -0
- data/README.md +158 -0
- data/Rakefile +104 -0
- data/VERSION +1 -0
- data/bin/laser +7 -0
- data/design_docs/goals.md +57 -0
- data/design_docs/object_regex.md +426 -0
- data/design_docs/type_annotations.md +80 -0
- data/ext/laser/BasicBlock.cpp +572 -0
- data/ext/laser/BasicBlock.h +118 -0
- data/ext/laser/extconf.rb +3 -0
- data/features/laser.feature +25 -0
- data/features/step_definitions/laser_steps.rb +39 -0
- data/features/support/env.rb +14 -0
- data/features/support/testdata/1_input +1 -0
- data/features/support/testdata/1_output +1 -0
- data/features/support/testdata/2_input +4 -0
- data/features/support/testdata/2_output +4 -0
- data/features/support/testdata/3_input +8 -0
- data/features/support/testdata/3_output +11 -0
- data/features/support/testdata/4_input +5 -0
- data/features/support/testdata/4_output +5 -0
- data/features/support/testdata/5_input +13 -0
- data/laser.gemspec +382 -0
- data/lib/laser.rb +98 -0
- data/lib/laser/analysis/annotations.rb +95 -0
- data/lib/laser/analysis/annotations/annotation_config.yaml +3 -0
- data/lib/laser/analysis/annotations/comment_attachment_annotation.rb +66 -0
- data/lib/laser/analysis/annotations/node_pointers_annotation.rb +36 -0
- data/lib/laser/analysis/annotations/runtime_annotation.rb +55 -0
- data/lib/laser/analysis/argument_expansion.rb +132 -0
- data/lib/laser/analysis/arity.rb +34 -0
- data/lib/laser/analysis/bindings.rb +144 -0
- data/lib/laser/analysis/bootstrap/bootstrap.rb +298 -0
- data/lib/laser/analysis/bootstrap/laser_class.rb +106 -0
- data/lib/laser/analysis/bootstrap/laser_method.rb +255 -0
- data/lib/laser/analysis/bootstrap/laser_module.rb +403 -0
- data/lib/laser/analysis/bootstrap/laser_module_copy.rb +74 -0
- data/lib/laser/analysis/bootstrap/laser_object.rb +69 -0
- data/lib/laser/analysis/bootstrap/laser_proc.rb +150 -0
- data/lib/laser/analysis/bootstrap/laser_singleton_class.rb +44 -0
- data/lib/laser/analysis/comments.rb +35 -0
- data/lib/laser/analysis/control_flow.rb +28 -0
- data/lib/laser/analysis/control_flow/alias_analysis.rb +31 -0
- data/lib/laser/analysis/control_flow/basic_block.rb +105 -0
- data/lib/laser/analysis/control_flow/cfg_builder.rb +2505 -0
- data/lib/laser/analysis/control_flow/cfg_instruction.rb +190 -0
- data/lib/laser/analysis/control_flow/constant_propagation.rb +742 -0
- data/lib/laser/analysis/control_flow/control_flow_graph.rb +370 -0
- data/lib/laser/analysis/control_flow/lifetime_analysis.rb +91 -0
- data/lib/laser/analysis/control_flow/method_call_search.rb +26 -0
- data/lib/laser/analysis/control_flow/raise_properties.rb +25 -0
- data/lib/laser/analysis/control_flow/simulation.rb +385 -0
- data/lib/laser/analysis/control_flow/static_single_assignment.rb +185 -0
- data/lib/laser/analysis/control_flow/unreachability_analysis.rb +57 -0
- data/lib/laser/analysis/control_flow/unused_variables.rb +91 -0
- data/lib/laser/analysis/control_flow/yield_properties.rb +103 -0
- data/lib/laser/analysis/errors.rb +131 -0
- data/lib/laser/analysis/laser_utils.rb +18 -0
- data/lib/laser/analysis/lexical_analysis.rb +172 -0
- data/lib/laser/analysis/method_call.rb +68 -0
- data/lib/laser/analysis/protocol_registry.rb +30 -0
- data/lib/laser/analysis/scope.rb +118 -0
- data/lib/laser/analysis/sexp.rb +159 -0
- data/lib/laser/analysis/sexp_analysis.rb +40 -0
- data/lib/laser/analysis/sexp_extensions/constant_extraction.rb +115 -0
- data/lib/laser/analysis/sexp_extensions/source_location.rb +164 -0
- data/lib/laser/analysis/sexp_extensions/type_inference.rb +47 -0
- data/lib/laser/analysis/signature.rb +76 -0
- data/lib/laser/analysis/special_methods/send.rb +67 -0
- data/lib/laser/analysis/unused_methods.rb +21 -0
- data/lib/laser/analysis/visitor.rb +141 -0
- data/lib/laser/annotation_parser/annotations.treetop +126 -0
- data/lib/laser/annotation_parser/annotations_parser.rb +748 -0
- data/lib/laser/annotation_parser/class_annotations.treetop +82 -0
- data/lib/laser/annotation_parser/class_annotations_parser.rb +654 -0
- data/lib/laser/annotation_parser/overload.treetop +24 -0
- data/lib/laser/annotation_parser/overload_parser.rb +167 -0
- data/lib/laser/annotation_parser/parsers.rb +6 -0
- data/lib/laser/annotation_parser/structural.treetop +37 -0
- data/lib/laser/annotation_parser/structural_parser.rb +406 -0
- data/lib/laser/annotation_parser/useful_parsers.treetop +47 -0
- data/lib/laser/annotation_parser/useful_parsers_parser.rb +674 -0
- data/lib/laser/rake/task.rb +46 -0
- data/lib/laser/runner.rb +189 -0
- data/lib/laser/scanner.rb +169 -0
- data/lib/laser/standard_library/_thread.rb +110 -0
- data/lib/laser/standard_library/abbrev.rb +103 -0
- data/lib/laser/standard_library/array.rb +418 -0
- data/lib/laser/standard_library/base64.rb +91 -0
- data/lib/laser/standard_library/basic_object.rb +55 -0
- data/lib/laser/standard_library/benchmark.rb +556 -0
- data/lib/laser/standard_library/bignum.rb +185 -0
- data/lib/laser/standard_library/cgi.rb +275 -0
- data/lib/laser/standard_library/cgi/cookie.rb +147 -0
- data/lib/laser/standard_library/cgi/core.rb +791 -0
- data/lib/laser/standard_library/cgi/html.rb +1021 -0
- data/lib/laser/standard_library/cgi/session.rb +537 -0
- data/lib/laser/standard_library/cgi/session/pstore.rb +111 -0
- data/lib/laser/standard_library/cgi/util.rb +188 -0
- data/lib/laser/standard_library/class_definitions.rb +333 -0
- data/lib/laser/standard_library/comparable.rb +125 -0
- data/lib/laser/standard_library/complex.rb +162 -0
- data/lib/laser/standard_library/enumerable.rb +178 -0
- data/lib/laser/standard_library/exceptions.rb +135 -0
- data/lib/laser/standard_library/fixnum.rb +188 -0
- data/lib/laser/standard_library/float.rb +180 -0
- data/lib/laser/standard_library/hash.rb +237 -0
- data/lib/laser/standard_library/integer.rb +123 -0
- data/lib/laser/standard_library/laser_magic.rb +7 -0
- data/lib/laser/standard_library/nil_false_true.rb +113 -0
- data/lib/laser/standard_library/numbers.rb +192 -0
- data/lib/laser/standard_library/proc.rb +31 -0
- data/lib/laser/standard_library/set.rb +1348 -0
- data/lib/laser/standard_library/string.rb +666 -0
- data/lib/laser/standard_library/stringio.rb +2 -0
- data/lib/laser/standard_library/symbol.rb +125 -0
- data/lib/laser/standard_library/tsort.rb +242 -0
- data/lib/laser/support/acts_as_struct.rb +66 -0
- data/lib/laser/support/frequency.rb +55 -0
- data/lib/laser/support/inheritable_attributes.rb +145 -0
- data/lib/laser/support/module_extensions.rb +94 -0
- data/lib/laser/support/placeholder_object.rb +13 -0
- data/lib/laser/third_party/rgl/adjacency.rb +221 -0
- data/lib/laser/third_party/rgl/base.rb +228 -0
- data/lib/laser/third_party/rgl/bidirectional.rb +39 -0
- data/lib/laser/third_party/rgl/condensation.rb +47 -0
- data/lib/laser/third_party/rgl/connected_components.rb +138 -0
- data/lib/laser/third_party/rgl/control_flow.rb +170 -0
- data/lib/laser/third_party/rgl/depth_first_spanning_tree.rb +37 -0
- data/lib/laser/third_party/rgl/dominators.rb +124 -0
- data/lib/laser/third_party/rgl/dot.rb +93 -0
- data/lib/laser/third_party/rgl/graphxml.rb +51 -0
- data/lib/laser/third_party/rgl/implicit.rb +174 -0
- data/lib/laser/third_party/rgl/mutable.rb +117 -0
- data/lib/laser/third_party/rgl/rdot.rb +445 -0
- data/lib/laser/third_party/rgl/topsort.rb +72 -0
- data/lib/laser/third_party/rgl/transitivity.rb +180 -0
- data/lib/laser/third_party/rgl/traversal.rb +348 -0
- data/lib/laser/types/types.rb +433 -0
- data/lib/laser/version.rb +14 -0
- data/lib/laser/warning.rb +149 -0
- data/lib/laser/warning_sets/default.yml +13 -0
- data/lib/laser/warnings/assignment_in_condition.rb +20 -0
- data/lib/laser/warnings/comment_spacing.rb +31 -0
- data/lib/laser/warnings/extra_blank_lines.rb +30 -0
- data/lib/laser/warnings/extra_whitespace.rb +16 -0
- data/lib/laser/warnings/hash_symbol_18_warning.rb +63 -0
- data/lib/laser/warnings/hash_symbol_19_warning.rb +29 -0
- data/lib/laser/warnings/line_length.rb +115 -0
- data/lib/laser/warnings/misaligned_unindentation.rb +17 -0
- data/lib/laser/warnings/operator_spacing.rb +68 -0
- data/lib/laser/warnings/parens_on_declaration.rb +30 -0
- data/lib/laser/warnings/rescue_exception.rb +42 -0
- data/lib/laser/warnings/semicolon.rb +25 -0
- data/lib/laser/warnings/sexp_errors.rb +24 -0
- data/lib/laser/warnings/uncalled_method_warning.rb +7 -0
- data/lib/laser/warnings/useless_double_quotes.rb +38 -0
- data/spec/analysis_specs/annotations_spec.rb +47 -0
- data/spec/analysis_specs/annotations_specs/comment_attachment_spec.rb +68 -0
- data/spec/analysis_specs/annotations_specs/node_pointers_annotation_spec.rb +90 -0
- data/spec/analysis_specs/annotations_specs/runtime_annotation_spec.rb +135 -0
- data/spec/analysis_specs/annotations_specs/spec_helper.rb +33 -0
- data/spec/analysis_specs/argument_expansion_spec.rb +113 -0
- data/spec/analysis_specs/bindings_spec.rb +36 -0
- data/spec/analysis_specs/comment_spec.rb +93 -0
- data/spec/analysis_specs/control_flow_specs/cfg_instruction_spec.rb +111 -0
- data/spec/analysis_specs/control_flow_specs/constant_propagation_spec.rb +560 -0
- data/spec/analysis_specs/control_flow_specs/control_flow_graph_spec.rb +5 -0
- data/spec/analysis_specs/control_flow_specs/raise_properties_spec.rb +310 -0
- data/spec/analysis_specs/control_flow_specs/raise_type_inference_spec.rb +301 -0
- data/spec/analysis_specs/control_flow_specs/return_type_inference_spec.rb +431 -0
- data/spec/analysis_specs/control_flow_specs/simulation_spec.rb +158 -0
- data/spec/analysis_specs/control_flow_specs/spec_helper.rb +110 -0
- data/spec/analysis_specs/control_flow_specs/tuple_misuse_inference_spec.rb +125 -0
- data/spec/analysis_specs/control_flow_specs/unreachability_analysis_spec.rb +76 -0
- data/spec/analysis_specs/control_flow_specs/unused_variable_spec.rb +99 -0
- data/spec/analysis_specs/control_flow_specs/yield_properties_spec.rb +372 -0
- data/spec/analysis_specs/error_spec.rb +30 -0
- data/spec/analysis_specs/laser_class_spec.rb +322 -0
- data/spec/analysis_specs/lexical_analysis_spec.rb +184 -0
- data/spec/analysis_specs/protocol_registry_spec.rb +63 -0
- data/spec/analysis_specs/scope_annotation_spec.rb +1013 -0
- data/spec/analysis_specs/scope_spec.rb +126 -0
- data/spec/analysis_specs/sexp_analysis_spec.rb +30 -0
- data/spec/analysis_specs/sexp_extension_specs/constant_extraction_spec.rb +309 -0
- data/spec/analysis_specs/sexp_extension_specs/source_location_spec.rb +231 -0
- data/spec/analysis_specs/sexp_extension_specs/spec_helper.rb +1 -0
- data/spec/analysis_specs/sexp_extension_specs/type_inference_spec.rb +252 -0
- data/spec/analysis_specs/sexp_spec.rb +167 -0
- data/spec/analysis_specs/spec_helper.rb +27 -0
- data/spec/analysis_specs/unused_methods_spec.rb +65 -0
- data/spec/analysis_specs/visitor_spec.rb +64 -0
- data/spec/annotation_parser_specs/annotations_parser_spec.rb +89 -0
- data/spec/annotation_parser_specs/class_annotation_parser_spec.rb +120 -0
- data/spec/annotation_parser_specs/overload_parser_spec.rb +39 -0
- data/spec/annotation_parser_specs/parsers_spec.rb +14 -0
- data/spec/annotation_parser_specs/spec_helper.rb +1 -0
- data/spec/annotation_parser_specs/structural_parser_spec.rb +67 -0
- data/spec/laser_spec.rb +14 -0
- data/spec/rake_specs/spec_helper.rb +1 -0
- data/spec/rake_specs/task_spec.rb +67 -0
- data/spec/runner_spec.rb +207 -0
- data/spec/scanner_spec.rb +75 -0
- data/spec/spec_helper.rb +121 -0
- data/spec/standard_library/exceptions_spec.rb +19 -0
- data/spec/standard_library/globals_spec.rb +14 -0
- data/spec/standard_library/set_spec.rb +31 -0
- data/spec/standard_library/spec_helper.rb +1 -0
- data/spec/standard_library/standard_library_spec.rb +302 -0
- data/spec/support_specs/acts_as_struct_spec.rb +94 -0
- data/spec/support_specs/frequency_spec.rb +23 -0
- data/spec/support_specs/module_extensions_spec.rb +117 -0
- data/spec/support_specs/spec_helper.rb +1 -0
- data/spec/type_specs/spec_helper.rb +1 -0
- data/spec/type_specs/types_spec.rb +133 -0
- data/spec/warning_spec.rb +95 -0
- data/spec/warning_specs/assignment_in_condition_spec.rb +68 -0
- data/spec/warning_specs/comment_spacing_spec.rb +65 -0
- data/spec/warning_specs/extra_blank_lines_spec.rb +70 -0
- data/spec/warning_specs/extra_whitespace_spec.rb +33 -0
- data/spec/warning_specs/hash_symbol_18_warning_spec.rb +89 -0
- data/spec/warning_specs/hash_symbol_19_warning_spec.rb +63 -0
- data/spec/warning_specs/line_length_spec.rb +173 -0
- data/spec/warning_specs/misaligned_unindentation_spec.rb +35 -0
- data/spec/warning_specs/operator_spacing_spec.rb +104 -0
- data/spec/warning_specs/parens_on_declaration_spec.rb +57 -0
- data/spec/warning_specs/rescue_exception_spec.rb +105 -0
- data/spec/warning_specs/semicolon_spec.rb +58 -0
- data/spec/warning_specs/spec_helper.rb +1 -0
- data/spec/warning_specs/useless_double_quotes_spec.rb +74 -0
- data/status_reports/2010/12/2010-12-14.md +163 -0
- data/status_reports/2010/12/2010-12-23.md +298 -0
- data/status_reports/2010/12/2010-12-24.md +6 -0
- data/test/third_party_tests/rgl_tests/TestComponents.rb +65 -0
- data/test/third_party_tests/rgl_tests/TestCycles.rb +61 -0
- data/test/third_party_tests/rgl_tests/TestDirectedGraph.rb +125 -0
- data/test/third_party_tests/rgl_tests/TestDot.rb +18 -0
- data/test/third_party_tests/rgl_tests/TestEdge.rb +34 -0
- data/test/third_party_tests/rgl_tests/TestGraph.rb +71 -0
- data/test/third_party_tests/rgl_tests/TestGraphXML.rb +57 -0
- data/test/third_party_tests/rgl_tests/TestImplicit.rb +52 -0
- data/test/third_party_tests/rgl_tests/TestRdot.rb +863 -0
- data/test/third_party_tests/rgl_tests/TestTransitivity.rb +129 -0
- data/test/third_party_tests/rgl_tests/TestTraversal.rb +220 -0
- data/test/third_party_tests/rgl_tests/TestUnDirectedGraph.rb +102 -0
- data/test/third_party_tests/rgl_tests/examples/north/Graph.log +128 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.0.graphml +28 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.1.graphml +28 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.11.graphml +31 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.12.graphml +27 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.13.graphml +27 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.14.graphml +27 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.15.graphml +26 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.16.graphml +26 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.17.graphml +26 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.19.graphml +37 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.2.graphml +28 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.20.graphml +38 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.22.graphml +43 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.24.graphml +30 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.25.graphml +45 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.27.graphml +38 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.28.graphml +30 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.29.graphml +38 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.3.graphml +26 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.30.graphml +34 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.31.graphml +42 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.34.graphml +42 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.37.graphml +28 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.38.graphml +38 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.39.graphml +36 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.4.graphml +26 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.40.graphml +37 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.41.graphml +37 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.42.graphml +26 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.45.graphml +28 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.46.graphml +32 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.5.graphml +31 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.50.graphml +30 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.56.graphml +29 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.57.graphml +32 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.58.graphml +32 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.6.graphml +26 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.60.graphml +32 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.61.graphml +34 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.62.graphml +34 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.68.graphml +30 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.69.graphml +32 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.7.graphml +29 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.70.graphml +26 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.71.graphml +27 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.72.graphml +28 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.74.graphml +29 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.75.graphml +29 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.78.graphml +27 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.79.graphml +34 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.8.graphml +29 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.80.graphml +34 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.82.graphml +35 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.83.graphml +32 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.85.graphml +34 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.86.graphml +34 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.88.graphml +37 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.89.graphml +29 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.9.graphml +26 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.90.graphml +32 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.91.graphml +31 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.92.graphml +26 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.93.graphml +32 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.10.94.graphml +34 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.12.8.graphml +40 -0
- data/test/third_party_tests/rgl_tests/examples/north/g.14.9.graphml +36 -0
- data/test/third_party_tests/rgl_tests/test_helper.rb +7 -0
- data/test/third_party_tests/test_inheritable_attributes.rb +187 -0
- metadata +470 -0
@@ -0,0 +1,111 @@
|
|
1
|
+
#
|
2
|
+
# cgi/session/pstore.rb - persistent storage of marshalled session data
|
3
|
+
#
|
4
|
+
# Documentation: William Webber (william@williamwebber.com)
|
5
|
+
#
|
6
|
+
# == Overview
|
7
|
+
#
|
8
|
+
# This file provides the CGI::Session::PStore class, which builds
|
9
|
+
# persistent of session data on top of the pstore library. See
|
10
|
+
# cgi/session.rb for more details on session storage managers.
|
11
|
+
|
12
|
+
require 'cgi/session'
|
13
|
+
require 'pstore'
|
14
|
+
|
15
|
+
class CGI
|
16
|
+
class Session
|
17
|
+
# PStore-based session storage class.
|
18
|
+
#
|
19
|
+
# This builds upon the top-level PStore class provided by the
|
20
|
+
# library file pstore.rb. Session data is marshalled and stored
|
21
|
+
# in a file. File locking and transaction services are provided.
|
22
|
+
class PStore
|
23
|
+
# Create a new CGI::Session::PStore instance
|
24
|
+
#
|
25
|
+
# This constructor is used internally by CGI::Session. The
|
26
|
+
# user does not generally need to call it directly.
|
27
|
+
#
|
28
|
+
# +session+ is the session for which this instance is being
|
29
|
+
# created. The session id must only contain alphanumeric
|
30
|
+
# characters; automatically generated session ids observe
|
31
|
+
# this requirement.
|
32
|
+
#
|
33
|
+
# +option+ is a hash of options for the initializer. The
|
34
|
+
# following options are recognised:
|
35
|
+
#
|
36
|
+
# tmpdir:: the directory to use for storing the PStore
|
37
|
+
# file. Defaults to Dir::tmpdir (generally "/tmp"
|
38
|
+
# on Unix systems).
|
39
|
+
# prefix:: the prefix to add to the session id when generating
|
40
|
+
# the filename for this session's PStore file.
|
41
|
+
# Defaults to the empty string.
|
42
|
+
#
|
43
|
+
# This session's PStore file will be created if it does
|
44
|
+
# not exist, or opened if it does.
|
45
|
+
def initialize(session, option={})
|
46
|
+
dir = option['tmpdir'] || Dir::tmpdir
|
47
|
+
prefix = option['prefix'] || ''
|
48
|
+
id = session.session_id
|
49
|
+
require 'digest/md5'
|
50
|
+
md5 = Digest::MD5.hexdigest(id)[0,16]
|
51
|
+
path = dir+"/"+prefix+md5
|
52
|
+
path.untaint
|
53
|
+
if File::exist?(path)
|
54
|
+
@hash = nil
|
55
|
+
else
|
56
|
+
unless session.new_session
|
57
|
+
raise CGI::Session::NoSession, "uninitialized session"
|
58
|
+
end
|
59
|
+
@hash = {}
|
60
|
+
end
|
61
|
+
@p = ::PStore.new(path)
|
62
|
+
@p.transaction do |p|
|
63
|
+
File.chmod(0600, p.path)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
# Restore session state from the session's PStore file.
|
68
|
+
#
|
69
|
+
# Returns the session state as a hash.
|
70
|
+
def restore
|
71
|
+
unless @hash
|
72
|
+
@p.transaction do
|
73
|
+
@hash = @p['hash'] || {}
|
74
|
+
end
|
75
|
+
end
|
76
|
+
@hash
|
77
|
+
end
|
78
|
+
|
79
|
+
# Save session state to the session's PStore file.
|
80
|
+
def update
|
81
|
+
@p.transaction do
|
82
|
+
@p['hash'] = @hash
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
# Update and close the session's PStore file.
|
87
|
+
def close
|
88
|
+
update
|
89
|
+
end
|
90
|
+
|
91
|
+
# Close and delete the session's PStore file.
|
92
|
+
def delete
|
93
|
+
path = @p.path
|
94
|
+
File::unlink path
|
95
|
+
end
|
96
|
+
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
if $0 == __FILE__
|
102
|
+
# :enddoc:
|
103
|
+
STDIN.reopen("/dev/null")
|
104
|
+
cgi = CGI.new
|
105
|
+
session = CGI::Session.new(cgi, 'database_manager' => CGI::Session::PStore)
|
106
|
+
session['key'] = {'k' => 'v'}
|
107
|
+
puts session['key'].class
|
108
|
+
fail unless Hash === session['key']
|
109
|
+
puts session['key'].inspect
|
110
|
+
fail unless session['key'].inspect == '{"k"=>"v"}'
|
111
|
+
end
|
@@ -0,0 +1,188 @@
|
|
1
|
+
class CGI
|
2
|
+
@@accept_charset="UTF-8" unless defined?(@@accept_charset)
|
3
|
+
# URL-encode a string.
|
4
|
+
# url_encoded_string = CGI::escape("'Stop!' said Fred")
|
5
|
+
# # => "%27Stop%21%27+said+Fred"
|
6
|
+
def CGI::escape(string)
|
7
|
+
string.gsub(/([^ a-zA-Z0-9_.-]+)/) do
|
8
|
+
'%' + $1.unpack('H2' * $1.bytesize).join('%').upcase
|
9
|
+
end.tr(' ', '+')
|
10
|
+
end
|
11
|
+
|
12
|
+
|
13
|
+
# URL-decode a string with encoding(optional).
|
14
|
+
# string = CGI::unescape("%27Stop%21%27+said+Fred")
|
15
|
+
# # => "'Stop!' said Fred"
|
16
|
+
def CGI::unescape(string,encoding=@@accept_charset)
|
17
|
+
str=string.tr('+', ' ').force_encoding(Encoding::ASCII_8BIT).gsub(/((?:%[0-9a-fA-F]{2})+)/) do
|
18
|
+
[$1.delete('%')].pack('H*')
|
19
|
+
end.force_encoding(encoding)
|
20
|
+
str.valid_encoding? ? str : str.force_encoding(string.encoding)
|
21
|
+
end
|
22
|
+
|
23
|
+
TABLE_FOR_ESCAPE_HTML__ = {
|
24
|
+
'&' => '&',
|
25
|
+
'"' => '"',
|
26
|
+
'<' => '<',
|
27
|
+
'>' => '>',
|
28
|
+
}
|
29
|
+
|
30
|
+
# Escape special characters in HTML, namely &\"<>
|
31
|
+
# CGI::escapeHTML('Usage: foo "bar" <baz>')
|
32
|
+
# # => "Usage: foo "bar" <baz>"
|
33
|
+
def CGI::escapeHTML(string)
|
34
|
+
string.gsub(/[&\"<>]/, TABLE_FOR_ESCAPE_HTML__)
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
# Unescape a string that has been HTML-escaped
|
39
|
+
# CGI::unescapeHTML("Usage: foo "bar" <baz>")
|
40
|
+
# # => "Usage: foo \"bar\" <baz>"
|
41
|
+
def CGI::unescapeHTML(string)
|
42
|
+
enc = string.encoding
|
43
|
+
if [Encoding::UTF_16BE, Encoding::UTF_16LE, Encoding::UTF_32BE, Encoding::UTF_32LE].include?(enc)
|
44
|
+
return string.gsub(Regexp.new('&(amp|quot|gt|lt|#[0-9]+|#x[0-9A-Fa-f]+);'.encode(enc))) do
|
45
|
+
case $1.encode("US-ASCII")
|
46
|
+
when 'amp' then '&'.encode(enc)
|
47
|
+
when 'quot' then '"'.encode(enc)
|
48
|
+
when 'gt' then '>'.encode(enc)
|
49
|
+
when 'lt' then '<'.encode(enc)
|
50
|
+
when /\A#0*(\d+)\z/ then $1.to_i.chr(enc)
|
51
|
+
when /\A#x([0-9a-f]+)\z/i then $1.hex.chr(enc)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
asciicompat = Encoding.compatible?(string, "a")
|
56
|
+
string.gsub(/&(amp|quot|gt|lt|\#[0-9]+|\#x[0-9A-Fa-f]+);/) do
|
57
|
+
match = $1.dup
|
58
|
+
case match
|
59
|
+
when 'amp' then '&'
|
60
|
+
when 'quot' then '"'
|
61
|
+
when 'gt' then '>'
|
62
|
+
when 'lt' then '<'
|
63
|
+
when /\A#0*(\d+)\z/
|
64
|
+
n = $1.to_i
|
65
|
+
if enc == Encoding::UTF_8 or
|
66
|
+
enc == Encoding::ISO_8859_1 && n < 256 or
|
67
|
+
asciicompat && n < 128
|
68
|
+
n.chr(enc)
|
69
|
+
else
|
70
|
+
"&##{$1};"
|
71
|
+
end
|
72
|
+
when /\A#x([0-9a-f]+)\z/i
|
73
|
+
n = $1.hex
|
74
|
+
if enc == Encoding::UTF_8 or
|
75
|
+
enc == Encoding::ISO_8859_1 && n < 256 or
|
76
|
+
asciicompat && n < 128
|
77
|
+
n.chr(enc)
|
78
|
+
else
|
79
|
+
"&#x#{$1};"
|
80
|
+
end
|
81
|
+
else
|
82
|
+
"&#{match};"
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
def CGI::escape_html(str)
|
87
|
+
escapeHTML(str)
|
88
|
+
end
|
89
|
+
def CGI::unescape_html(str)
|
90
|
+
unescapeHTML(str)
|
91
|
+
end
|
92
|
+
|
93
|
+
# Escape only the tags of certain HTML elements in +string+.
|
94
|
+
#
|
95
|
+
# Takes an element or elements or array of elements. Each element
|
96
|
+
# is specified by the name of the element, without angle brackets.
|
97
|
+
# This matches both the start and the end tag of that element.
|
98
|
+
# The attribute list of the open tag will also be escaped (for
|
99
|
+
# instance, the double-quotes surrounding attribute values).
|
100
|
+
#
|
101
|
+
# print CGI::escapeElement('<BR><A HREF="url"></A>', "A", "IMG")
|
102
|
+
# # "<BR><A HREF="url"></A>"
|
103
|
+
#
|
104
|
+
# print CGI::escapeElement('<BR><A HREF="url"></A>', ["A", "IMG"])
|
105
|
+
# # "<BR><A HREF="url"></A>"
|
106
|
+
def CGI::escapeElement(string, *elements)
|
107
|
+
elements = elements[0] if elements[0].kind_of?(Array)
|
108
|
+
unless elements.empty?
|
109
|
+
string.gsub(/<\/?(?:#{elements.join("|")})(?!\w)(?:.|\n)*?>/i) do
|
110
|
+
CGI::escapeHTML($&)
|
111
|
+
end
|
112
|
+
else
|
113
|
+
string
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
|
118
|
+
# Undo escaping such as that done by CGI::escapeElement()
|
119
|
+
#
|
120
|
+
# print CGI::unescapeElement(
|
121
|
+
# CGI::escapeHTML('<BR><A HREF="url"></A>'), "A", "IMG")
|
122
|
+
# # "<BR><A HREF="url"></A>"
|
123
|
+
#
|
124
|
+
# print CGI::unescapeElement(
|
125
|
+
# CGI::escapeHTML('<BR><A HREF="url"></A>'), ["A", "IMG"])
|
126
|
+
# # "<BR><A HREF="url"></A>"
|
127
|
+
def CGI::unescapeElement(string, *elements)
|
128
|
+
elements = elements[0] if elements[0].kind_of?(Array)
|
129
|
+
unless elements.empty?
|
130
|
+
string.gsub(/<\/?(?:#{elements.join("|")})(?!\w)(?:.|\n)*?>/i) do
|
131
|
+
CGI::unescapeHTML($&)
|
132
|
+
end
|
133
|
+
else
|
134
|
+
string
|
135
|
+
end
|
136
|
+
end
|
137
|
+
def CGI::escape_element(str)
|
138
|
+
escapeElement(str)
|
139
|
+
end
|
140
|
+
def CGI::unescape_element(str)
|
141
|
+
unescapeElement(str)
|
142
|
+
end
|
143
|
+
|
144
|
+
# Abbreviated day-of-week names specified by RFC 822
|
145
|
+
RFC822_DAYS = %w[ Sun Mon Tue Wed Thu Fri Sat ]
|
146
|
+
|
147
|
+
# Abbreviated month names specified by RFC 822
|
148
|
+
RFC822_MONTHS = %w[ Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ]
|
149
|
+
|
150
|
+
# Format a +Time+ object as a String using the format specified by RFC 1123.
|
151
|
+
#
|
152
|
+
# CGI::rfc1123_date(Time.now)
|
153
|
+
# # Sat, 01 Jan 2000 00:00:00 GMT
|
154
|
+
def CGI::rfc1123_date(time)
|
155
|
+
t = time.clone.gmtime
|
156
|
+
return format("%s, %.2d %s %.4d %.2d:%.2d:%.2d GMT",
|
157
|
+
RFC822_DAYS[t.wday], t.day, RFC822_MONTHS[t.month-1], t.year,
|
158
|
+
t.hour, t.min, t.sec)
|
159
|
+
end
|
160
|
+
|
161
|
+
# Prettify (indent) an HTML string.
|
162
|
+
#
|
163
|
+
# +string+ is the HTML string to indent. +shift+ is the indentation
|
164
|
+
# unit to use; it defaults to two spaces.
|
165
|
+
#
|
166
|
+
# print CGI::pretty("<HTML><BODY></BODY></HTML>")
|
167
|
+
# # <HTML>
|
168
|
+
# # <BODY>
|
169
|
+
# # </BODY>
|
170
|
+
# # </HTML>
|
171
|
+
#
|
172
|
+
# print CGI::pretty("<HTML><BODY></BODY></HTML>", "\t")
|
173
|
+
# # <HTML>
|
174
|
+
# # <BODY>
|
175
|
+
# # </BODY>
|
176
|
+
# # </HTML>
|
177
|
+
#
|
178
|
+
def CGI::pretty(string, shift = " ")
|
179
|
+
lines = string.gsub(/(?!\A)<.*?>/m, "\n\\0").gsub(/<.*?>(?!\n)/m, "\\0\n")
|
180
|
+
end_pos = 0
|
181
|
+
while end_pos = lines.index(/^<\/(\w+)/, end_pos)
|
182
|
+
element = $1.dup
|
183
|
+
start_pos = lines.rindex(/^\s*<#{element}/i, end_pos)
|
184
|
+
lines[start_pos ... end_pos] = "__" + lines[start_pos ... end_pos].gsub(/\n(?!\z)/, "\n" + shift) + "__"
|
185
|
+
end
|
186
|
+
lines.gsub(/^((?:#{Regexp::quote(shift)})*)__(?=<\/?\w)/, '\1')
|
187
|
+
end
|
188
|
+
end
|
@@ -0,0 +1,333 @@
|
|
1
|
+
class Class < Module
|
2
|
+
# special: true
|
3
|
+
# pure: true
|
4
|
+
def self.new(superklass=Object)
|
5
|
+
end
|
6
|
+
def new(*args)
|
7
|
+
result = allocate
|
8
|
+
result.send(:initialize, *args)
|
9
|
+
result
|
10
|
+
end
|
11
|
+
# pure: true
|
12
|
+
# builtin: true
|
13
|
+
def superclass
|
14
|
+
end
|
15
|
+
end
|
16
|
+
class String
|
17
|
+
end
|
18
|
+
class Symbol
|
19
|
+
end
|
20
|
+
class Array
|
21
|
+
# builtin: true
|
22
|
+
# returns: Array
|
23
|
+
def self.new(arg1=0, val=nil)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
class Proc
|
27
|
+
end
|
28
|
+
class Hash
|
29
|
+
end
|
30
|
+
# Still not sure why this exists.
|
31
|
+
class Data
|
32
|
+
end
|
33
|
+
#
|
34
|
+
RUBY_VERSION = '1.9.2'
|
35
|
+
$/ = "\n"
|
36
|
+
ENV = {"RUBY_VERSION"=>"ruby-1.9.2-p136"}
|
37
|
+
|
38
|
+
class << self
|
39
|
+
# special: true
|
40
|
+
def private(*args)
|
41
|
+
end
|
42
|
+
# special: true
|
43
|
+
def public(*args)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
class Module
|
47
|
+
# special: true
|
48
|
+
# pure: true
|
49
|
+
def self.new
|
50
|
+
end
|
51
|
+
# special: true
|
52
|
+
def module_eval(text, filename='(eval)', line=1)
|
53
|
+
end
|
54
|
+
# pure: true
|
55
|
+
# raises: never
|
56
|
+
# builtin: true
|
57
|
+
# returns: String
|
58
|
+
def name
|
59
|
+
end
|
60
|
+
# pure: true
|
61
|
+
# raises: never
|
62
|
+
# builtin: true
|
63
|
+
# returns: Boolean
|
64
|
+
def ===(other)
|
65
|
+
end
|
66
|
+
# pure: true
|
67
|
+
# builtin: true
|
68
|
+
def instance_method(name)
|
69
|
+
end
|
70
|
+
# pure: true
|
71
|
+
# builtin: true
|
72
|
+
def method_defined?(name)
|
73
|
+
end
|
74
|
+
# pure: true
|
75
|
+
# builtin: true
|
76
|
+
def instance_methods(include_super = true)
|
77
|
+
end
|
78
|
+
# pure: true
|
79
|
+
# builtin: true
|
80
|
+
def public_instance_method(name)
|
81
|
+
end
|
82
|
+
# pure: true
|
83
|
+
# builtin: true
|
84
|
+
def public_instance_methods(include_super = true)
|
85
|
+
end
|
86
|
+
# pure: true
|
87
|
+
# builtin: true
|
88
|
+
def protected_instance_methods(include_super = true)
|
89
|
+
end
|
90
|
+
# pure: true
|
91
|
+
# builtin: true
|
92
|
+
def private_instance_methods(include_super = true)
|
93
|
+
end
|
94
|
+
# special: true
|
95
|
+
# mutation: true
|
96
|
+
# yield_usage: optional
|
97
|
+
def define_method(name, body=nil)
|
98
|
+
end
|
99
|
+
# builtin: true
|
100
|
+
# mutation: true
|
101
|
+
def remove_method(name)
|
102
|
+
end
|
103
|
+
# builtin: true
|
104
|
+
# mutation: true
|
105
|
+
def undef_method(name)
|
106
|
+
end
|
107
|
+
# builtin: true
|
108
|
+
# mutation: true
|
109
|
+
def const_set(sym, val)
|
110
|
+
end
|
111
|
+
# builtin: true
|
112
|
+
def const_defined?(sym, inherit=true)
|
113
|
+
end
|
114
|
+
# builtin: true
|
115
|
+
def const_get(sym, inherit=true)
|
116
|
+
end
|
117
|
+
# builtin: true
|
118
|
+
# mutation: true
|
119
|
+
def private(*args)
|
120
|
+
end
|
121
|
+
private :private
|
122
|
+
private
|
123
|
+
# builtin: true
|
124
|
+
# mutation: true
|
125
|
+
def include(*mods)
|
126
|
+
end
|
127
|
+
# builtin: true
|
128
|
+
# mutation: true
|
129
|
+
def extend(*mods)
|
130
|
+
end
|
131
|
+
# builtin: true
|
132
|
+
# mutation: true
|
133
|
+
def public(*args)
|
134
|
+
end
|
135
|
+
# builtin: true
|
136
|
+
# mutation: true
|
137
|
+
def protected(*args)
|
138
|
+
end
|
139
|
+
# pure: true
|
140
|
+
def attr_reader(*syms)
|
141
|
+
syms.each do |sym|
|
142
|
+
module_eval("def #{sym}; @#{sym}; end")
|
143
|
+
end
|
144
|
+
end
|
145
|
+
# pure: true
|
146
|
+
def attr_writer(*syms)
|
147
|
+
syms.each do |sym|
|
148
|
+
module_eval("def #{sym}=(val); @#{sym} = val; end")
|
149
|
+
end
|
150
|
+
end
|
151
|
+
# pure: true
|
152
|
+
def attr_accessor(*syms)
|
153
|
+
attr_reader(*syms)
|
154
|
+
attr_writer(*syms)
|
155
|
+
end
|
156
|
+
# builtin: true
|
157
|
+
# mutation: true
|
158
|
+
def module_function(*args)
|
159
|
+
end
|
160
|
+
# builtin: true
|
161
|
+
# mutation: true
|
162
|
+
# returns: Module
|
163
|
+
def alias_method(to, from)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
module Kernel
|
167
|
+
# pure: true
|
168
|
+
# builtin: true
|
169
|
+
# raises: never
|
170
|
+
def eql?(other)
|
171
|
+
end
|
172
|
+
# pure: true
|
173
|
+
# builtin: true
|
174
|
+
# raises: never
|
175
|
+
def equal?(other)
|
176
|
+
end
|
177
|
+
# builtin: true
|
178
|
+
# klass: Module
|
179
|
+
# raises: never
|
180
|
+
def is_a?(klass)
|
181
|
+
end
|
182
|
+
alias kind_of? is_a?
|
183
|
+
# pure: true
|
184
|
+
# raises: never
|
185
|
+
# builtin: true
|
186
|
+
def singleton_class
|
187
|
+
end
|
188
|
+
# pure: true
|
189
|
+
# raises: never
|
190
|
+
# builtin: true
|
191
|
+
# returns: Class=
|
192
|
+
def class
|
193
|
+
end
|
194
|
+
# pure: true
|
195
|
+
# raises: never
|
196
|
+
def inspect
|
197
|
+
end
|
198
|
+
# builtin: true
|
199
|
+
def instance_variable_get(name)
|
200
|
+
end
|
201
|
+
# builtin: true
|
202
|
+
def instance_variable_defined?(name)
|
203
|
+
end
|
204
|
+
# builtin: true
|
205
|
+
def instance_variable_set(name, val)
|
206
|
+
end
|
207
|
+
private
|
208
|
+
# yield_usage: required
|
209
|
+
def proc
|
210
|
+
unless block_given?
|
211
|
+
raise ArgumentError.new('tried to create Proc object without a block')
|
212
|
+
end
|
213
|
+
Proc.new
|
214
|
+
end
|
215
|
+
# special: true
|
216
|
+
def require(path)
|
217
|
+
end
|
218
|
+
# raises: never
|
219
|
+
def p(*args)
|
220
|
+
args
|
221
|
+
end
|
222
|
+
def eval(string, bndg = nil, filename = nil, lineno = nil)
|
223
|
+
end
|
224
|
+
def autoload(sym, path)
|
225
|
+
end
|
226
|
+
alias fail raise
|
227
|
+
# predictable: false
|
228
|
+
# returns: String=
|
229
|
+
# raises: maybe
|
230
|
+
def gets(opt_arg_1 = :__unset__, opt_arg_2 = :__unset__)
|
231
|
+
end
|
232
|
+
# predictable: false
|
233
|
+
def puts(*to_put)
|
234
|
+
end
|
235
|
+
# returns: Boolean
|
236
|
+
# raises: never
|
237
|
+
def block_given?
|
238
|
+
end
|
239
|
+
alias iterator? block_given?
|
240
|
+
# builtin: true
|
241
|
+
# raises: never
|
242
|
+
# pure: false
|
243
|
+
# predictable: false
|
244
|
+
# overload: () -> Float
|
245
|
+
# overload: Fixnum= -> Fixnum= | Bignum=
|
246
|
+
# overload: Bignum= -> Fixnum= | Bignum=
|
247
|
+
def rand(n=nil)
|
248
|
+
end
|
249
|
+
end
|
250
|
+
|
251
|
+
require 'basic_object'
|
252
|
+
require 'nil_false_true'
|
253
|
+
require 'exceptions'
|
254
|
+
require 'comparable'
|
255
|
+
require 'enumerable'
|
256
|
+
require 'array'
|
257
|
+
require 'string'
|
258
|
+
require 'symbol'
|
259
|
+
require 'numbers'
|
260
|
+
require '_thread'
|
261
|
+
|
262
|
+
class Range
|
263
|
+
# this is here because early in testing Class#new wasn't smart about purity.
|
264
|
+
# pure: true
|
265
|
+
# builtin: true
|
266
|
+
def self.new(start, stop, exclusive=false)
|
267
|
+
end
|
268
|
+
|
269
|
+
# pure: true
|
270
|
+
# builtin: true
|
271
|
+
def initialize(start, stop, exclusive=false)
|
272
|
+
end
|
273
|
+
|
274
|
+
# pure: true
|
275
|
+
# builtin: true
|
276
|
+
def to_a
|
277
|
+
end
|
278
|
+
end
|
279
|
+
require 'proc'
|
280
|
+
require 'hash'
|
281
|
+
class Symbol
|
282
|
+
end
|
283
|
+
class Regexp
|
284
|
+
# pure: true
|
285
|
+
# builtin: true
|
286
|
+
def self.new(body, opts=nil)
|
287
|
+
end
|
288
|
+
end
|
289
|
+
|
290
|
+
class Encoding
|
291
|
+
end
|
292
|
+
class Encoding::UndefinedConversionError < EncodingError
|
293
|
+
end
|
294
|
+
class Encoding::InvalidByteSequenceError < EncodingError
|
295
|
+
end
|
296
|
+
class Encoding::ConverterNotFoundError < EncodingError
|
297
|
+
end
|
298
|
+
class Encoding::CompatibilityError < EncodingError
|
299
|
+
end
|
300
|
+
|
301
|
+
class Struct
|
302
|
+
end
|
303
|
+
|
304
|
+
class IO
|
305
|
+
# predictable: false
|
306
|
+
def read(len=nil)
|
307
|
+
end
|
308
|
+
end
|
309
|
+
|
310
|
+
class File < IO
|
311
|
+
end
|
312
|
+
|
313
|
+
class Time
|
314
|
+
def self.at(x)
|
315
|
+
end
|
316
|
+
def self.gm(first, *rest)
|
317
|
+
end
|
318
|
+
def self.local(first, *rest)
|
319
|
+
end
|
320
|
+
class << self
|
321
|
+
alias mktime local
|
322
|
+
end
|
323
|
+
# predictable: false
|
324
|
+
def self.now
|
325
|
+
new
|
326
|
+
end
|
327
|
+
end
|
328
|
+
|
329
|
+
|
330
|
+
# ARGV: [String]
|
331
|
+
ARGV = []
|
332
|
+
# DATA: File | NilClass
|
333
|
+
DATA = nil
|