├── .gitignore ├── LICENSE.RUBY ├── README.md ├── build.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── lib └── jruby.jar └── src ├── main ├── java │ └── AWSLambdaJRuby.java └── resources │ ├── main.rb │ └── stdlib │ ├── .jrubydir │ ├── English.rb │ ├── Win32API.rb │ ├── abbrev.rb │ ├── ant.rb │ ├── ant │ ├── ant.rb │ ├── element.rb │ ├── project_converter.rb │ ├── rake.rb │ ├── target.rb │ └── tasks │ │ └── raketasks.rb │ ├── base64.rb │ ├── benchmark.rb │ ├── bigdecimal │ ├── jacobian.rb │ ├── ludcmp.rb │ ├── math.rb │ ├── newton.rb │ └── util.rb │ ├── cgi.rb │ ├── cgi │ ├── cookie.rb │ ├── core.rb │ ├── html.rb │ ├── session.rb │ ├── session │ │ └── pstore.rb │ └── util.rb │ ├── cmath.rb │ ├── csv.rb │ ├── date.rb │ ├── date │ ├── delta.rb │ ├── delta │ │ ├── parser.rb │ │ └── parser.ry │ └── format.rb │ ├── debug.rb │ ├── delegate.rb │ ├── digest.rb │ ├── digest │ └── sha2.rb │ ├── drb.rb │ ├── drb │ ├── acl.rb │ ├── drb.rb │ ├── eq.rb │ ├── extserv.rb │ ├── extservm.rb │ ├── gw.rb │ ├── invokemethod.rb │ ├── observer.rb │ ├── ssl.rb │ ├── timeridconv.rb │ └── unix.rb │ ├── e2mmap.rb │ ├── erb.rb │ ├── expect.rb │ ├── ffi.rb │ ├── ffi │ ├── autopointer.rb │ ├── buffer.rb │ ├── enum.rb │ ├── errno.rb │ ├── ffi.rb │ ├── io.rb │ ├── library.rb │ ├── managedstruct.rb │ ├── memorypointer.rb │ ├── platform.rb │ ├── platform │ │ ├── arm-linux │ │ │ └── types.conf │ │ ├── errno.rb.ffi │ │ ├── etc.rb.ffi │ │ ├── fcntl.rb.ffi │ │ ├── i386-darwin │ │ │ ├── errno.rb │ │ │ ├── etc.rb │ │ │ ├── fcntl.rb │ │ │ ├── platform.conf │ │ │ ├── socket.rb │ │ │ ├── stat.rb │ │ │ ├── sysconf.rb │ │ │ ├── syslog.rb │ │ │ ├── types.conf │ │ │ └── zlib.rb │ │ ├── i386-freebsd │ │ │ └── types.conf │ │ ├── i386-linux │ │ │ ├── errno.rb │ │ │ ├── etc.rb │ │ │ ├── fcntl.rb │ │ │ ├── platform.conf │ │ │ ├── socket.rb │ │ │ ├── stat.rb │ │ │ ├── sysconf.rb │ │ │ ├── syslog.rb │ │ │ ├── types.conf │ │ │ └── zlib.rb │ │ ├── i386-openbsd │ │ │ ├── errno.rb │ │ │ ├── etc.rb │ │ │ ├── fcntl.rb │ │ │ ├── platform.conf │ │ │ ├── socket.rb │ │ │ ├── stat.rb │ │ │ ├── sysconf.rb │ │ │ ├── syslog.rb │ │ │ ├── types.conf │ │ │ └── zlib.rb │ │ ├── i386-solaris │ │ │ ├── errno.rb │ │ │ ├── etc.rb │ │ │ ├── fcntl.rb │ │ │ ├── platform.conf │ │ │ ├── socket.rb │ │ │ ├── stat.rb │ │ │ ├── sysconf.rb │ │ │ ├── syslog.rb │ │ │ ├── types.conf │ │ │ └── zlib.rb │ │ ├── i386-windows │ │ │ ├── errno.rb │ │ │ ├── etc.rb │ │ │ ├── fcntl.rb │ │ │ ├── platform.conf │ │ │ ├── types.conf │ │ │ └── zlib.rb │ │ ├── i486-gnu │ │ │ └── types.conf │ │ ├── mips-linux │ │ │ └── types.conf │ │ ├── mipsel-linux │ │ │ └── types.conf │ │ ├── powerpc-aix │ │ │ ├── errno.rb │ │ │ ├── etc.rb │ │ │ ├── fcntl.rb │ │ │ ├── platform.conf │ │ │ ├── socket.rb │ │ │ ├── stat.rb │ │ │ ├── sysconf.rb │ │ │ ├── syslog.rb │ │ │ ├── types.conf │ │ │ └── zlib.rb │ │ ├── powerpc-darwin │ │ │ ├── errno.rb │ │ │ ├── etc.rb │ │ │ ├── fcntl.rb │ │ │ ├── platform.conf │ │ │ ├── socket.rb │ │ │ ├── stat.rb │ │ │ ├── sysconf.rb │ │ │ ├── syslog.rb │ │ │ ├── types.conf │ │ │ └── zlib.rb │ │ ├── powerpc-linux │ │ │ └── types.conf │ │ ├── ppc-darwin │ │ │ └── syslog.rb │ │ ├── ppc64le-linux │ │ │ └── types.conf │ │ ├── s390-linux │ │ │ └── types.conf │ │ ├── s390x-linux │ │ │ └── types.conf │ │ ├── socket.rb.ffi │ │ ├── sparc-solaris │ │ │ ├── errno.rb │ │ │ ├── etc.rb │ │ │ ├── fcntl.rb │ │ │ ├── platform.conf │ │ │ ├── socket.rb │ │ │ ├── stat.rb │ │ │ ├── sysconf.rb │ │ │ ├── syslog.rb │ │ │ ├── types.conf │ │ │ └── zlib.rb │ │ ├── sparcv9-solaris │ │ │ ├── errno.rb │ │ │ ├── etc.rb │ │ │ ├── fcntl.rb │ │ │ ├── platform.conf │ │ │ ├── socket.rb │ │ │ ├── stat.rb │ │ │ ├── sysconf.rb │ │ │ ├── syslog.rb │ │ │ ├── types.conf │ │ │ └── zlib.rb │ │ ├── stat.rb.ffi │ │ ├── sysconf.rb.ffi │ │ ├── syslog.rb.ffi │ │ ├── x86_64-darwin │ │ │ ├── errno.rb │ │ │ ├── etc.rb │ │ │ ├── fcntl.rb │ │ │ ├── platform.conf │ │ │ ├── socket.rb │ │ │ ├── stat.rb │ │ │ ├── sysconf.rb │ │ │ ├── syslog.rb │ │ │ ├── types.conf │ │ │ └── zlib.rb │ │ ├── x86_64-freebsd │ │ │ ├── syslog.rb │ │ │ └── types.conf │ │ ├── x86_64-linux │ │ │ ├── errno.rb │ │ │ ├── etc.rb │ │ │ ├── fcntl.rb │ │ │ ├── platform.conf │ │ │ ├── socket.rb │ │ │ ├── stat.rb │ │ │ ├── sysconf.rb │ │ │ ├── syslog.rb │ │ │ ├── types.conf │ │ │ └── zlib.rb │ │ ├── x86_64-openbsd │ │ │ ├── errno.rb │ │ │ ├── etc.rb │ │ │ ├── fcntl.rb │ │ │ ├── platform.conf │ │ │ ├── socket.rb │ │ │ ├── stat.rb │ │ │ ├── sysconf.rb │ │ │ ├── syslog.rb │ │ │ ├── types.conf │ │ │ └── zlib.rb │ │ ├── x86_64-solaris │ │ │ ├── errno.rb │ │ │ ├── etc.rb │ │ │ ├── fcntl.rb │ │ │ ├── platform.conf │ │ │ ├── socket.rb │ │ │ ├── stat.rb │ │ │ ├── sysconf.rb │ │ │ ├── syslog.rb │ │ │ ├── types.conf │ │ │ └── zlib.rb │ │ ├── x86_64-windows │ │ │ ├── platform.conf │ │ │ └── types.conf │ │ └── zlib.rb.ffi │ ├── pointer.rb │ ├── rbx.rb │ ├── struct.rb │ ├── struct_layout_builder.rb │ ├── tools │ │ ├── Rakefile │ │ ├── const_generator.rb │ │ ├── generator.rb │ │ ├── generator_task.rb │ │ ├── platform.rake │ │ ├── struct_generator.rb │ │ └── types_generator.rb │ ├── types.rb │ ├── union.rb │ └── variadic.rb │ ├── fiber.rb │ ├── fiddle.rb │ ├── fiddle │ ├── closure.rb │ ├── cparser.rb │ ├── function.rb │ ├── import.rb │ ├── jruby.rb │ ├── pack.rb │ ├── struct.rb │ ├── types.rb │ └── value.rb │ ├── fileutils.rb │ ├── find.rb │ ├── forwardable.rb │ ├── gauntlet_rdoc.rb │ ├── getoptlong.rb │ ├── hoe │ └── minitest.rb │ ├── io │ ├── bsd_console.rb │ ├── console.rb │ ├── linux_console.rb │ └── nonblock.rb │ ├── ipaddr.rb │ ├── irb.rb │ ├── irb │ ├── cmd │ │ ├── chws.rb │ │ ├── fork.rb │ │ ├── help.rb │ │ ├── load.rb │ │ ├── nop.rb │ │ ├── pushws.rb │ │ └── subirb.rb │ ├── completion.rb │ ├── context.rb │ ├── ext │ │ ├── change-ws.rb │ │ ├── history.rb │ │ ├── loader.rb │ │ ├── math-mode.rb │ │ ├── multi-irb.rb │ │ ├── save-history.rb │ │ ├── tracer.rb │ │ ├── use-loader.rb │ │ └── workspaces.rb │ ├── extend-command.rb │ ├── frame.rb │ ├── help.rb │ ├── init.rb │ ├── input-method.rb │ ├── inspector.rb │ ├── lc │ │ ├── error.rb │ │ ├── help-message │ │ └── ja │ │ │ ├── encoding_aliases.rb │ │ │ ├── error.rb │ │ │ └── help-message │ ├── locale.rb │ ├── magic-file.rb │ ├── notifier.rb │ ├── output-method.rb │ ├── ruby-lex.rb │ ├── ruby-token.rb │ ├── slex.rb │ ├── src_encoding.rb │ ├── version.rb │ ├── workspace.rb │ ├── ws-for-case-2.rb │ └── xmp.rb │ ├── jar-dependencies.rb │ ├── jar_dependencies.rb │ ├── jar_install_post_install_hook.rb │ ├── jar_installer.rb │ ├── jars │ ├── classpath.rb │ ├── installer.rb │ ├── jar_pom.rb │ ├── jars_lock_pom.rb │ ├── lock.rb │ ├── maven_exec.rb │ ├── post_install_hook.rb │ ├── setup.rb │ └── version.rb │ ├── java │ └── inspect.rb │ ├── jline │ └── jline │ │ └── 2.11 │ │ └── jline-2.11.jar │ ├── jopenssl.jar │ ├── jopenssl │ ├── load.rb │ └── version.rb │ ├── jopenssl18 │ ├── openssl.rb │ └── openssl │ │ ├── bn.rb │ │ ├── buffering.rb │ │ ├── cipher.rb │ │ ├── config.rb │ │ ├── digest.rb │ │ ├── pkcs7.rb │ │ ├── ssl-internal.rb │ │ ├── ssl.rb │ │ ├── x509-internal.rb │ │ └── x509.rb │ ├── jopenssl19 │ ├── openssl.rb │ └── openssl │ │ ├── bn.rb │ │ ├── buffering.rb │ │ ├── cipher.rb │ │ ├── config.rb │ │ ├── digest.rb │ │ ├── ssl-internal.rb │ │ ├── ssl.rb │ │ ├── x509-internal.rb │ │ └── x509.rb │ ├── jopenssl21 │ ├── openssl.rb │ └── openssl │ │ ├── bn.rb │ │ ├── buffering.rb │ │ ├── cipher.rb │ │ ├── config.rb │ │ ├── digest.rb │ │ ├── ssl.rb │ │ └── x509.rb │ ├── jruby │ ├── compiler.rb │ ├── compiler │ │ ├── extending.rb │ │ ├── java_class.rb │ │ └── java_signature.rb │ ├── core_ext.rb │ ├── core_ext │ │ ├── class.rb │ │ ├── method.rb │ │ ├── string.rb │ │ └── thread.rb │ ├── ext.rb │ ├── jrubyc.rb │ ├── open3_windows.rb │ ├── profiler.rb │ ├── profiler │ │ └── shutdown_hook.rb │ ├── synchronized.rb │ ├── thread_dump.rb │ ├── vm.rb │ └── win32ole │ │ └── stub.rb │ ├── json.rb │ ├── json │ ├── add │ │ ├── bigdecimal.rb │ │ ├── complex.rb │ │ ├── core.rb │ │ ├── date.rb │ │ ├── date_time.rb │ │ ├── exception.rb │ │ ├── ostruct.rb │ │ ├── range.rb │ │ ├── rational.rb │ │ ├── regexp.rb │ │ ├── struct.rb │ │ ├── symbol.rb │ │ └── time.rb │ ├── common.rb │ ├── ext.rb │ ├── ext │ │ ├── generator.jar │ │ └── parser.jar │ ├── generic_object.rb │ ├── pure.rb │ ├── pure │ │ ├── generator.rb │ │ └── parser.rb │ └── version.rb │ ├── kconv.rb │ ├── logger.rb │ ├── mathn.rb │ ├── matrix.rb │ ├── matrix │ ├── eigenvalue_decomposition.rb │ └── lup_decomposition.rb │ ├── maven.rb │ ├── maven │ ├── ruby.rb │ └── ruby │ │ ├── maven.rb │ │ ├── tasks.rb │ │ └── version.rb │ ├── minitest.rb │ ├── minitest │ ├── assertions.rb │ ├── autorun.rb │ ├── benchmark.rb │ ├── expectations.rb │ ├── hell.rb │ ├── mock.rb │ ├── parallel.rb │ ├── pride.rb │ ├── pride_plugin.rb │ ├── spec.rb │ ├── test.rb │ └── unit.rb │ ├── mkmf.rb │ ├── monitor.rb │ ├── mutex_m.rb │ ├── net │ ├── ftp.rb │ ├── http.rb │ ├── http │ │ ├── backward.rb │ │ ├── exceptions.rb │ │ ├── generic_request.rb │ │ ├── header.rb │ │ ├── proxy_delta.rb │ │ ├── request.rb │ │ ├── requests.rb │ │ ├── response.rb │ │ └── responses.rb │ ├── https.rb │ ├── imap.rb │ ├── pop.rb │ ├── protocol.rb │ ├── smtp.rb │ └── telnet.rb │ ├── observer.rb │ ├── open-uri.rb │ ├── open3.rb │ ├── openssl.rb │ ├── openssl │ ├── bn.rb │ ├── buffering.rb │ ├── cipher.rb │ ├── config.rb │ ├── digest.rb │ ├── pkcs12.rb │ ├── pkcs7.rb │ ├── ssl-internal.rb │ ├── ssl.rb │ ├── x509-internal.rb │ └── x509.rb │ ├── optionparser.rb │ ├── optparse.rb │ ├── optparse │ ├── ac.rb │ ├── date.rb │ ├── shellwords.rb │ ├── time.rb │ ├── uri.rb │ └── version.rb │ ├── org │ ├── bouncycastle │ │ ├── bcpkix-jdk15on │ │ │ └── 1.50 │ │ │ │ └── bcpkix-jdk15on-1.50.jar │ │ └── bcprov-jdk15on │ │ │ └── 1.50 │ │ │ └── bcprov-jdk15on-1.50.jar │ └── yaml │ │ └── snakeyaml │ │ ├── 1.14 │ │ └── snakeyaml-1.14.jar │ │ └── maven-metadata-local.xml │ ├── ostruct.rb │ ├── pathname.rb │ ├── power_assert.rb │ ├── power_assert │ ├── enable_tracepoint_events.rb │ └── version.rb │ ├── pp.rb │ ├── prettyprint.rb │ ├── prime.rb │ ├── profile.rb │ ├── profiler.rb │ ├── pstore.rb │ ├── psych.jar │ ├── psych.rb │ ├── psych │ ├── class_loader.rb │ ├── coder.rb │ ├── core_ext.rb │ ├── deprecated.rb │ ├── exception.rb │ ├── handler.rb │ ├── handlers │ │ ├── document_stream.rb │ │ └── recorder.rb │ ├── json │ │ ├── ruby_events.rb │ │ ├── stream.rb │ │ ├── tree_builder.rb │ │ └── yaml_events.rb │ ├── nodes.rb │ ├── nodes │ │ ├── alias.rb │ │ ├── document.rb │ │ ├── mapping.rb │ │ ├── node.rb │ │ ├── scalar.rb │ │ ├── sequence.rb │ │ └── stream.rb │ ├── omap.rb │ ├── parser.rb │ ├── scalar_scanner.rb │ ├── set.rb │ ├── stream.rb │ ├── streaming.rb │ ├── syntax_error.rb │ ├── tree_builder.rb │ ├── versions.rb │ ├── visitors.rb │ ├── visitors │ │ ├── depth_first.rb │ │ ├── emitter.rb │ │ ├── json_tree.rb │ │ ├── to_ruby.rb │ │ ├── visitor.rb │ │ └── yaml_tree.rb │ └── y.rb │ ├── psych_jars.rb │ ├── pty.rb │ ├── racc │ ├── parser.rb │ └── rdoc │ │ └── grammar.en.rdoc │ ├── rake.rb │ ├── rake │ ├── alt_system.rb │ ├── application.rb │ ├── backtrace.rb │ ├── clean.rb │ ├── cloneable.rb │ ├── contrib │ │ ├── compositepublisher.rb │ │ ├── ftptools.rb │ │ ├── publisher.rb │ │ ├── rubyforgepublisher.rb │ │ ├── sshpublisher.rb │ │ └── sys.rb │ ├── default_loader.rb │ ├── dsl_definition.rb │ ├── early_time.rb │ ├── ext │ │ ├── core.rb │ │ ├── module.rb │ │ ├── string.rb │ │ └── time.rb │ ├── file_creation_task.rb │ ├── file_list.rb │ ├── file_task.rb │ ├── file_utils.rb │ ├── file_utils_ext.rb │ ├── gempackagetask.rb │ ├── invocation_chain.rb │ ├── invocation_exception_mixin.rb │ ├── linked_list.rb │ ├── loaders │ │ └── makefile.rb │ ├── multi_task.rb │ ├── name_space.rb │ ├── packagetask.rb │ ├── pathmap.rb │ ├── phony.rb │ ├── private_reader.rb │ ├── promise.rb │ ├── pseudo_status.rb │ ├── rake_module.rb │ ├── rake_test_loader.rb │ ├── rdoctask.rb │ ├── ruby182_test_unit_fix.rb │ ├── rule_recursion_overflow_error.rb │ ├── runtest.rb │ ├── scope.rb │ ├── task.rb │ ├── task_argument_error.rb │ ├── task_arguments.rb │ ├── task_manager.rb │ ├── tasklib.rb │ ├── testtask.rb │ ├── thread_history_display.rb │ ├── thread_pool.rb │ ├── trace_output.rb │ ├── version.rb │ └── win32.rb │ ├── rbconfig │ ├── datadir.rb │ └── obsolete.rb │ ├── rdoc.rb │ ├── rdoc │ ├── alias.rb │ ├── anon_class.rb │ ├── any_method.rb │ ├── attr.rb │ ├── class_module.rb │ ├── code_object.rb │ ├── code_objects.rb │ ├── comment.rb │ ├── constant.rb │ ├── context.rb │ ├── context │ │ └── section.rb │ ├── cross_reference.rb │ ├── encoding.rb │ ├── erb_partial.rb │ ├── erbio.rb │ ├── extend.rb │ ├── generator.rb │ ├── generator │ │ ├── darkfish.rb │ │ ├── json_index.rb │ │ ├── markup.rb │ │ ├── ri.rb │ │ └── template │ │ │ ├── darkfish │ │ │ ├── _footer.rhtml │ │ │ ├── _head.rhtml │ │ │ ├── _sidebar_VCS_info.rhtml │ │ │ ├── _sidebar_classes.rhtml │ │ │ ├── _sidebar_extends.rhtml │ │ │ ├── _sidebar_in_files.rhtml │ │ │ ├── _sidebar_includes.rhtml │ │ │ ├── _sidebar_installed.rhtml │ │ │ ├── _sidebar_methods.rhtml │ │ │ ├── _sidebar_navigation.rhtml │ │ │ ├── _sidebar_pages.rhtml │ │ │ ├── _sidebar_parent.rhtml │ │ │ ├── _sidebar_search.rhtml │ │ │ ├── _sidebar_sections.rhtml │ │ │ ├── _sidebar_table_of_contents.rhtml │ │ │ ├── class.rhtml │ │ │ ├── fonts.css │ │ │ ├── fonts │ │ │ │ ├── Lato-Light.ttf │ │ │ │ ├── Lato-LightItalic.ttf │ │ │ │ ├── Lato-Regular.ttf │ │ │ │ ├── Lato-RegularItalic.ttf │ │ │ │ ├── SourceCodePro-Bold.ttf │ │ │ │ └── SourceCodePro-Regular.ttf │ │ │ ├── images │ │ │ │ ├── add.png │ │ │ │ ├── arrow_up.png │ │ │ │ ├── brick.png │ │ │ │ ├── brick_link.png │ │ │ │ ├── bug.png │ │ │ │ ├── bullet_black.png │ │ │ │ ├── bullet_toggle_minus.png │ │ │ │ ├── bullet_toggle_plus.png │ │ │ │ ├── date.png │ │ │ │ ├── delete.png │ │ │ │ ├── find.png │ │ │ │ ├── loadingAnimation.gif │ │ │ │ ├── macFFBgHack.png │ │ │ │ ├── package.png │ │ │ │ ├── page_green.png │ │ │ │ ├── page_white_text.png │ │ │ │ ├── page_white_width.png │ │ │ │ ├── plugin.png │ │ │ │ ├── ruby.png │ │ │ │ ├── tag_blue.png │ │ │ │ ├── tag_green.png │ │ │ │ ├── transparent.png │ │ │ │ ├── wrench.png │ │ │ │ ├── wrench_orange.png │ │ │ │ └── zoom.png │ │ │ ├── index.rhtml │ │ │ ├── js │ │ │ │ ├── darkfish.js │ │ │ │ ├── jquery.js │ │ │ │ └── search.js │ │ │ ├── page.rhtml │ │ │ ├── rdoc.css │ │ │ ├── servlet_not_found.rhtml │ │ │ ├── servlet_root.rhtml │ │ │ └── table_of_contents.rhtml │ │ │ └── json_index │ │ │ └── js │ │ │ ├── navigation.js │ │ │ └── searcher.js │ ├── ghost_method.rb │ ├── include.rb │ ├── known_classes.rb │ ├── markdown.kpeg │ ├── markdown.rb │ ├── markdown │ │ ├── entities.rb │ │ ├── literals_1_8.kpeg │ │ ├── literals_1_8.rb │ │ ├── literals_1_9.kpeg │ │ └── literals_1_9.rb │ ├── markup.rb │ ├── markup │ │ ├── attr_changer.rb │ │ ├── attr_span.rb │ │ ├── attribute_manager.rb │ │ ├── attributes.rb │ │ ├── blank_line.rb │ │ ├── block_quote.rb │ │ ├── document.rb │ │ ├── formatter.rb │ │ ├── formatter_test_case.rb │ │ ├── hard_break.rb │ │ ├── heading.rb │ │ ├── include.rb │ │ ├── indented_paragraph.rb │ │ ├── inline.rb │ │ ├── list.rb │ │ ├── list_item.rb │ │ ├── paragraph.rb │ │ ├── parser.rb │ │ ├── pre_process.rb │ │ ├── raw.rb │ │ ├── rule.rb │ │ ├── special.rb │ │ ├── text_formatter_test_case.rb │ │ ├── to_ansi.rb │ │ ├── to_bs.rb │ │ ├── to_html.rb │ │ ├── to_html_crossref.rb │ │ ├── to_html_snippet.rb │ │ ├── to_joined_paragraph.rb │ │ ├── to_label.rb │ │ ├── to_markdown.rb │ │ ├── to_rdoc.rb │ │ ├── to_table_of_contents.rb │ │ ├── to_test.rb │ │ ├── to_tt_only.rb │ │ └── verbatim.rb │ ├── meta_method.rb │ ├── method_attr.rb │ ├── mixin.rb │ ├── normal_class.rb │ ├── normal_module.rb │ ├── options.rb │ ├── parser.rb │ ├── parser │ │ ├── c.rb │ │ ├── changelog.rb │ │ ├── markdown.rb │ │ ├── rd.rb │ │ ├── ruby.rb │ │ ├── ruby_tools.rb │ │ ├── simple.rb │ │ └── text.rb │ ├── rd.rb │ ├── rd │ │ ├── block_parser.rb │ │ ├── block_parser.ry │ │ ├── inline.rb │ │ ├── inline_parser.rb │ │ └── inline_parser.ry │ ├── rdoc.rb │ ├── require.rb │ ├── ri.rb │ ├── ri │ │ ├── driver.rb │ │ ├── formatter.rb │ │ ├── paths.rb │ │ └── store.rb │ ├── ruby_lex.rb │ ├── ruby_token.rb │ ├── rubygems_hook.rb │ ├── servlet.rb │ ├── single_class.rb │ ├── stats.rb │ ├── stats │ │ ├── normal.rb │ │ ├── quiet.rb │ │ └── verbose.rb │ ├── store.rb │ ├── task.rb │ ├── test_case.rb │ ├── text.rb │ ├── token_stream.rb │ ├── tom_doc.rb │ └── top_level.rb │ ├── readline.jar │ ├── readline.rb │ ├── readline │ └── version.rb │ ├── resolv-replace.rb │ ├── resolv.rb │ ├── rexml │ ├── attlistdecl.rb │ ├── attribute.rb │ ├── cdata.rb │ ├── child.rb │ ├── comment.rb │ ├── doctype.rb │ ├── document.rb │ ├── dtd │ │ ├── attlistdecl.rb │ │ ├── dtd.rb │ │ ├── elementdecl.rb │ │ ├── entitydecl.rb │ │ └── notationdecl.rb │ ├── element.rb │ ├── encoding.rb │ ├── entity.rb │ ├── formatters │ │ ├── default.rb │ │ ├── pretty.rb │ │ └── transitive.rb │ ├── functions.rb │ ├── instruction.rb │ ├── light │ │ └── node.rb │ ├── namespace.rb │ ├── node.rb │ ├── output.rb │ ├── parent.rb │ ├── parseexception.rb │ ├── parsers │ │ ├── baseparser.rb │ │ ├── lightparser.rb │ │ ├── pullparser.rb │ │ ├── sax2parser.rb │ │ ├── streamparser.rb │ │ ├── treeparser.rb │ │ ├── ultralightparser.rb │ │ └── xpathparser.rb │ ├── quickpath.rb │ ├── rexml.rb │ ├── sax2listener.rb │ ├── security.rb │ ├── source.rb │ ├── streamlistener.rb │ ├── syncenumerator.rb │ ├── text.rb │ ├── undefinednamespaceexception.rb │ ├── validation │ │ ├── relaxng.rb │ │ ├── validation.rb │ │ └── validationexception.rb │ ├── xmldecl.rb │ ├── xmltokens.rb │ ├── xpath.rb │ └── xpath_parser.rb │ ├── rinda │ ├── rinda.rb │ ├── ring.rb │ └── tuplespace.rb │ ├── ripper.rb │ ├── ripper │ ├── core.rb │ ├── filter.rb │ ├── lexer.rb │ └── sexp.rb │ ├── rss.rb │ ├── rss │ ├── 0.9.rb │ ├── 1.0.rb │ ├── 2.0.rb │ ├── atom.rb │ ├── content.rb │ ├── content │ │ ├── 1.0.rb │ │ └── 2.0.rb │ ├── converter.rb │ ├── dublincore.rb │ ├── dublincore │ │ ├── 1.0.rb │ │ ├── 2.0.rb │ │ └── atom.rb │ ├── image.rb │ ├── itunes.rb │ ├── maker.rb │ ├── maker │ │ ├── 0.9.rb │ │ ├── 1.0.rb │ │ ├── 2.0.rb │ │ ├── atom.rb │ │ ├── base.rb │ │ ├── content.rb │ │ ├── dublincore.rb │ │ ├── entry.rb │ │ ├── feed.rb │ │ ├── image.rb │ │ ├── itunes.rb │ │ ├── slash.rb │ │ ├── syndication.rb │ │ ├── taxonomy.rb │ │ └── trackback.rb │ ├── parser.rb │ ├── rexmlparser.rb │ ├── rss.rb │ ├── slash.rb │ ├── syndication.rb │ ├── taxonomy.rb │ ├── trackback.rb │ ├── utils.rb │ ├── xml-stylesheet.rb │ ├── xml.rb │ ├── xmlparser.rb │ └── xmlscanner.rb │ ├── ruby-maven.rb │ ├── ruby_maven.rb │ ├── rubygems.rb │ ├── rubygems │ ├── available_set.rb │ ├── basic_specification.rb │ ├── command.rb │ ├── command_manager.rb │ ├── commands │ │ ├── build_command.rb │ │ ├── cert_command.rb │ │ ├── check_command.rb │ │ ├── cleanup_command.rb │ │ ├── contents_command.rb │ │ ├── dependency_command.rb │ │ ├── environment_command.rb │ │ ├── fetch_command.rb │ │ ├── generate_index_command.rb │ │ ├── help_command.rb │ │ ├── install_command.rb │ │ ├── list_command.rb │ │ ├── lock_command.rb │ │ ├── mirror_command.rb │ │ ├── open_command.rb │ │ ├── outdated_command.rb │ │ ├── owner_command.rb │ │ ├── pristine_command.rb │ │ ├── push_command.rb │ │ ├── query_command.rb │ │ ├── rdoc_command.rb │ │ ├── search_command.rb │ │ ├── server_command.rb │ │ ├── setup_command.rb │ │ ├── sources_command.rb │ │ ├── specification_command.rb │ │ ├── stale_command.rb │ │ ├── uninstall_command.rb │ │ ├── unpack_command.rb │ │ ├── update_command.rb │ │ ├── which_command.rb │ │ └── yank_command.rb │ ├── compatibility.rb │ ├── config_file.rb │ ├── core_ext │ │ ├── kernel_gem.rb │ │ └── kernel_require.rb │ ├── defaults.rb │ ├── defaults │ │ └── jruby.rb │ ├── dependency.rb │ ├── dependency_installer.rb │ ├── dependency_list.rb │ ├── deprecate.rb │ ├── doctor.rb │ ├── errors.rb │ ├── exceptions.rb │ ├── ext.rb │ ├── ext │ │ ├── build_error.rb │ │ ├── builder.rb │ │ ├── cmake_builder.rb │ │ ├── configure_builder.rb │ │ ├── ext_conf_builder.rb │ │ └── rake_builder.rb │ ├── gem_runner.rb │ ├── gemcutter_utilities.rb │ ├── indexer.rb │ ├── install_default_message.rb │ ├── install_message.rb │ ├── install_update_options.rb │ ├── installer.rb │ ├── installer_test_case.rb │ ├── local_remote_options.rb │ ├── mock_gem_ui.rb │ ├── name_tuple.rb │ ├── package.rb │ ├── package │ │ ├── digest_io.rb │ │ ├── file_source.rb │ │ ├── io_source.rb │ │ ├── old.rb │ │ ├── source.rb │ │ ├── tar_header.rb │ │ ├── tar_reader.rb │ │ ├── tar_reader │ │ │ └── entry.rb │ │ ├── tar_test_case.rb │ │ └── tar_writer.rb │ ├── package_task.rb │ ├── path_support.rb │ ├── platform.rb │ ├── psych_additions.rb │ ├── psych_tree.rb │ ├── rdoc.rb │ ├── remote_fetcher.rb │ ├── request.rb │ ├── request │ │ ├── connection_pools.rb │ │ ├── http_pool.rb │ │ └── https_pool.rb │ ├── request_set.rb │ ├── request_set │ │ ├── gem_dependency_api.rb │ │ ├── lockfile.rb │ │ └── lockfile │ │ │ ├── parser.rb │ │ │ └── tokenizer.rb │ ├── requirement.rb │ ├── resolver.rb │ ├── resolver │ │ ├── activation_request.rb │ │ ├── api_set.rb │ │ ├── api_specification.rb │ │ ├── best_set.rb │ │ ├── composed_set.rb │ │ ├── conflict.rb │ │ ├── current_set.rb │ │ ├── dependency_request.rb │ │ ├── git_set.rb │ │ ├── git_specification.rb │ │ ├── index_set.rb │ │ ├── index_specification.rb │ │ ├── installed_specification.rb │ │ ├── installer_set.rb │ │ ├── local_specification.rb │ │ ├── lock_set.rb │ │ ├── lock_specification.rb │ │ ├── requirement_list.rb │ │ ├── set.rb │ │ ├── spec_specification.rb │ │ ├── specification.rb │ │ ├── stats.rb │ │ ├── vendor_set.rb │ │ └── vendor_specification.rb │ ├── security.rb │ ├── security │ │ ├── policies.rb │ │ ├── policy.rb │ │ ├── signer.rb │ │ └── trust_dir.rb │ ├── server.rb │ ├── source.rb │ ├── source │ │ ├── git.rb │ │ ├── installed.rb │ │ ├── local.rb │ │ ├── lock.rb │ │ ├── specific_file.rb │ │ └── vendor.rb │ ├── source_list.rb │ ├── source_local.rb │ ├── source_specific_file.rb │ ├── spec_fetcher.rb │ ├── specification.rb │ ├── ssl_certs │ │ ├── AddTrustExternalCARoot-2048.pem │ │ ├── AddTrustExternalCARoot.pem │ │ ├── COMODORSACertificationAuthority.pem │ │ ├── COMODORSADomainValidationSecureServer.pem │ │ ├── Class3PublicPrimaryCertificationAuthority.pem │ │ ├── DigiCertHighAssuranceEVRootCA.pem │ │ ├── Entrust_net-Secure-Server-Certification-Authority.pem │ │ ├── EntrustnetSecureServerCertificationAuthority.pem │ │ ├── GeoTrustGlobalCA.pem │ │ ├── GeoTrust_Global_CA.pem │ │ └── VerisignClass3PublicPrimaryCertificationAuthority-G2.pem │ ├── stub_specification.rb │ ├── syck_hack.rb │ ├── test_case.rb │ ├── test_utilities.rb │ ├── text.rb │ ├── uninstaller.rb │ ├── uri_formatter.rb │ ├── user_interaction.rb │ ├── util.rb │ ├── util │ │ ├── list.rb │ │ └── stringio.rb │ ├── validator.rb │ ├── version.rb │ └── version_option.rb │ ├── scanf.rb │ ├── securerandom.rb │ ├── set.rb │ ├── shell.rb │ ├── shell │ ├── builtin-command.rb │ ├── command-processor.rb │ ├── error.rb │ ├── filter.rb │ ├── process-controller.rb │ ├── system-command.rb │ └── version.rb │ ├── shellwords.rb │ ├── singleton.rb │ ├── socket.rb │ ├── sync.rb │ ├── syslog.rb │ ├── tempfile.rb │ ├── test-unit.rb │ ├── test │ ├── unit.rb │ └── unit │ │ ├── assertion-failed-error.rb │ │ ├── assertions.rb │ │ ├── attribute-matcher.rb │ │ ├── attribute.rb │ │ ├── autorunner.rb │ │ ├── code-snippet-fetcher.rb │ │ ├── collector.rb │ │ ├── collector │ │ ├── descendant.rb │ │ ├── dir.rb │ │ ├── load.rb │ │ ├── objectspace.rb │ │ └── xml.rb │ │ ├── color-scheme.rb │ │ ├── color.rb │ │ ├── data.rb │ │ ├── diff.rb │ │ ├── error.rb │ │ ├── exception-handler.rb │ │ ├── failure.rb │ │ ├── fault-location-detector.rb │ │ ├── fixture.rb │ │ ├── notification.rb │ │ ├── omission.rb │ │ ├── pending.rb │ │ ├── priority.rb │ │ ├── runner │ │ ├── console.rb │ │ ├── emacs.rb │ │ └── xml.rb │ │ ├── test-suite-creator.rb │ │ ├── testcase.rb │ │ ├── testresult.rb │ │ ├── testsuite.rb │ │ ├── ui │ │ ├── console │ │ │ ├── outputlevel.rb │ │ │ └── testrunner.rb │ │ ├── emacs │ │ │ └── testrunner.rb │ │ ├── testrunner.rb │ │ ├── testrunnermediator.rb │ │ ├── testrunnerutilities.rb │ │ └── xml │ │ │ └── testrunner.rb │ │ ├── util │ │ ├── backtracefilter.rb │ │ ├── method-owner-finder.rb │ │ ├── observable.rb │ │ ├── output.rb │ │ └── procwrapper.rb │ │ └── version.rb │ ├── thwait.rb │ ├── time.rb │ ├── tmpdir.rb │ ├── tracer.rb │ ├── tsort.rb │ ├── ubygems.rb │ ├── un.rb │ ├── unicode_normalize.rb │ ├── unicode_normalize │ ├── normalize.rb │ └── tables.rb │ ├── uri.rb │ ├── uri │ ├── common.rb │ ├── ftp.rb │ ├── generic.rb │ ├── http.rb │ ├── https.rb │ ├── ldap.rb │ ├── ldaps.rb │ ├── mailto.rb │ ├── rfc2396_parser.rb │ └── rfc3986_parser.rb │ ├── webrick.rb │ ├── webrick │ ├── accesslog.rb │ ├── cgi.rb │ ├── compat.rb │ ├── config.rb │ ├── cookie.rb │ ├── htmlutils.rb │ ├── httpauth.rb │ ├── httpauth │ │ ├── authenticator.rb │ │ ├── basicauth.rb │ │ ├── digestauth.rb │ │ ├── htdigest.rb │ │ ├── htgroup.rb │ │ ├── htpasswd.rb │ │ └── userdb.rb │ ├── httpproxy.rb │ ├── httprequest.rb │ ├── httpresponse.rb │ ├── https.rb │ ├── httpserver.rb │ ├── httpservlet.rb │ ├── httpservlet │ │ ├── abstract.rb │ │ ├── cgi_runner.rb │ │ ├── cgihandler.rb │ │ ├── erbhandler.rb │ │ ├── filehandler.rb │ │ └── prochandler.rb │ ├── httpstatus.rb │ ├── httputils.rb │ ├── httpversion.rb │ ├── log.rb │ ├── server.rb │ ├── ssl.rb │ ├── utils.rb │ └── version.rb │ ├── win32 │ ├── importer.rb │ ├── registry.rb │ ├── resolv.rb │ └── sspi.rb │ ├── xmlrpc.rb │ ├── xmlrpc │ ├── README.rdoc │ ├── README.txt │ ├── base64.rb │ ├── client.rb │ ├── config.rb │ ├── create.rb │ ├── datetime.rb │ ├── marshal.rb │ ├── parser.rb │ ├── server.rb │ └── utils.rb │ ├── yaml.rb │ └── yaml │ ├── dbm.rb │ └── store.rb └── test └── java ├── AWSLambdaJRubyTestMain.java ├── MockContext.java └── MockLambdaLogger.java /.gitignore: -------------------------------------------------------------------------------- 1 | /.project 2 | /bin/ 3 | /.gradle/ 4 | /.settings/ 5 | /.classpath 6 | /build/ 7 | /.DS_Store 8 | .DS_Store -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # aws-lambda-jruby 2 | Run ruby code on JRuby on AWS Lambda Java 3 | 4 | # How to use 5 | 1. Add your ruby code to src/main/resources/main.rb 6 | 7 | 2. Build project 8 | ``` 9 | ./gradlew build 10 | ``` 11 | 3. Crate AWS Lambda fuction on AWS 12 | put "AWSLambdaJRuby::handler" to handler setting 13 | 14 | 4. Upload zip file 15 | Zip file is created into build/distributions 16 | 17 | 5. Run Lambda function -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | apply plugin: 'eclipse' 3 | apply plugin: 'idea' 4 | 5 | repositories { 6 | mavenCentral() 7 | } 8 | 9 | dependencies { 10 | compile ( 11 | 'com.amazonaws:aws-lambda-java-core:1.0.0', 12 | 'com.amazonaws:aws-lambda-java-events:1.0.0', 13 | 'com.google.code.gson:gson:2.3.1', 14 | ) 15 | compile files('lib/jruby.jar') 16 | } 17 | 18 | task buildZip(type: Zip) { 19 | from compileJava 20 | from processResources 21 | into('lib') { 22 | from configurations.runtime 23 | } 24 | } 25 | 26 | build.dependsOn buildZip -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Jun 17 11:10:34 JST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-bin.zip 7 | -------------------------------------------------------------------------------- /lib/jruby.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/lib/jruby.jar -------------------------------------------------------------------------------- /src/main/resources/main.rb: -------------------------------------------------------------------------------- 1 | require 'yaml' 2 | require 'json' 3 | 4 | return YAML.dump JSON.load $lambda_arg -------------------------------------------------------------------------------- /src/main/resources/stdlib/.jrubydir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/.jrubydir -------------------------------------------------------------------------------- /src/main/resources/stdlib/ant/rake.rb: -------------------------------------------------------------------------------- 1 | def ant_task(*args, &block) 2 | task(*args) do |t| 3 | ant.define_tasks(&block) 4 | end 5 | end 6 | 7 | class FileList 8 | def to_str 9 | join(',') 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ant/tasks/raketasks.rb: -------------------------------------------------------------------------------- 1 | require 'rubygems' 2 | require 'rake' 3 | require 'ant' 4 | 5 | class RakeWrapper 6 | def load_tasks(*args) 7 | # FIXME: Use our arguments (this sucks...let's submit a patch for Rake 8 | ARGV.clear 9 | ARGV.concat args 10 | 11 | Rake.application.tap do |application| 12 | application.init 13 | application.load_rakefile 14 | end 15 | end 16 | 17 | def execute(*args) 18 | load_tasks(*args).top_level 19 | end 20 | 21 | def invoke_task(task) 22 | Rake.application[task].invoke 23 | end 24 | 25 | def import(*args) 26 | ant = Ant.new 27 | load_tasks(*args).tasks.each { |rake_task| ant.add_target rake_task } 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/drb.rb: -------------------------------------------------------------------------------- 1 | require 'drb/drb' 2 | 3 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/drb/eq.rb: -------------------------------------------------------------------------------- 1 | module DRb 2 | class DRbObject # :nodoc: 3 | def ==(other) 4 | return false unless DRbObject === other 5 | (@ref == other.__drbref) && (@uri == other.__drburi) 6 | end 7 | 8 | def hash 9 | [@uri, @ref].hash 10 | end 11 | 12 | alias eql? == 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/drb/extserv.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | external service 3 | Copyright (c) 2000,2002 Masatoshi SEKI 4 | =end 5 | 6 | require 'drb/drb' 7 | require 'monitor' 8 | 9 | module DRb 10 | class ExtServ 11 | include MonitorMixin 12 | include DRbUndumped 13 | 14 | def initialize(there, name, server=nil) 15 | super() 16 | @server = server || DRb::primary_server 17 | @name = name 18 | ro = DRbObject.new(nil, there) 19 | synchronize do 20 | @invoker = ro.regist(name, DRbObject.new(self, @server.uri)) 21 | end 22 | end 23 | attr_reader :server 24 | 25 | def front 26 | DRbObject.new(nil, @server.uri) 27 | end 28 | 29 | def stop_service 30 | synchronize do 31 | @invoker.unregist(@name) 32 | server = @server 33 | @server = nil 34 | server.stop_service 35 | true 36 | end 37 | end 38 | 39 | def alive? 40 | @server ? @server.alive? : false 41 | end 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/drb/invokemethod.rb: -------------------------------------------------------------------------------- 1 | # for ruby-1.8.0 2 | 3 | module DRb # :nodoc: all 4 | class DRbServer 5 | module InvokeMethod18Mixin 6 | def block_yield(x) 7 | if x.size == 1 && x[0].class == Array 8 | x[0] = DRbArray.new(x[0]) 9 | end 10 | @block.call(*x) 11 | end 12 | 13 | def perform_with_block 14 | @obj.__send__(@msg_id, *@argv) do |*x| 15 | jump_error = nil 16 | begin 17 | block_value = block_yield(x) 18 | rescue LocalJumpError 19 | jump_error = $! 20 | end 21 | if jump_error 22 | case jump_error.reason 23 | when :break 24 | break(jump_error.exit_value) 25 | else 26 | raise jump_error 27 | end 28 | end 29 | block_value 30 | end 31 | end 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/drb/observer.rb: -------------------------------------------------------------------------------- 1 | require 'observer' 2 | 3 | module DRb 4 | # The Observable module extended to DRb. See Observable for details. 5 | module DRbObservable 6 | include Observable 7 | 8 | # Notifies observers of a change in state. See also 9 | # Observable#notify_observers 10 | def notify_observers(*arg) 11 | if defined? @observer_state and @observer_state 12 | if defined? @observer_peers 13 | @observer_peers.each do |observer, method| 14 | begin 15 | observer.send(method, *arg) 16 | rescue 17 | delete_observer(observer) 18 | end 19 | end 20 | end 21 | @observer_state = false 22 | end 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi.rb: -------------------------------------------------------------------------------- 1 | require 'ffi/ffi' -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/buffer.rb: -------------------------------------------------------------------------------- 1 | # This file intentionally left blank 2 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/enum.rb: -------------------------------------------------------------------------------- 1 | # The enum functionality has been migrated to Enum.java -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/memorypointer.rb: -------------------------------------------------------------------------------- 1 | # Now implemented in java 2 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform.rb: -------------------------------------------------------------------------------- 1 | require 'ffi-internal.so' 2 | 3 | module FFI 4 | module Platform 5 | # 6 | # Most of the constants are now defined in org.jruby.ext.ffi.Platform.java 7 | # 8 | FFI_DIR = File.dirname(__FILE__) 9 | CONF_DIR = File.join(FFI_DIR, "platform", NAME) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/etc.rb.ffi: -------------------------------------------------------------------------------- 1 | module Platform; end 2 | module Platform::Etc 3 | class Passwd < FFI::Struct 4 | @@@ 5 | struct do |s| 6 | s.include "sys/types.h" 7 | s.include "pwd.h" 8 | 9 | s.name "struct passwd" 10 | s.field :pw_name, :string 11 | s.field :pw_passwd, :string 12 | s.field :pw_uid, :uint 13 | s.field :pw_gid, :uint 14 | s.field :pw_dir, :string 15 | s.field :pw_shell, :string 16 | end 17 | @@@ 18 | end 19 | class Group < FFI::Struct 20 | @@@ 21 | struct do |s| 22 | s.include "sys/types.h" 23 | s.include "grp.h" 24 | 25 | s.name "struct group" 26 | s.field :gr_name, :string 27 | s.field :gr_gid, :uint 28 | end 29 | @@@ 30 | end 31 | end -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/fcntl.rb.ffi: -------------------------------------------------------------------------------- 1 | module Fcntl 2 | @@@ 3 | constants do |c| 4 | c.include 'fcntl.h' 5 | 6 | c.const 'F_DUPFD' 7 | c.const 'F_GETFD' 8 | c.const 'F_GETLK' 9 | c.const 'F_SETFD' 10 | c.const 'F_GETFL' 11 | c.const 'F_SETFL' 12 | c.const 'F_SETLK' 13 | c.const 'F_SETLKW' 14 | c.const 'FD_CLOEXEC' 15 | c.const 'F_RDLCK' 16 | c.const 'F_UNLCK' 17 | c.const 'F_WRLCK' 18 | c.const 'O_CREAT' 19 | c.const 'O_EXCL' 20 | c.const 'O_NOCTTY' 21 | c.const 'O_TRUNC' 22 | c.const 'O_APPEND' 23 | c.const 'O_NONBLOCK' 24 | c.const 'O_NDELAY' 25 | c.const 'O_RDONLY' 26 | c.const 'O_RDWR' 27 | c.const 'O_WRONLY' 28 | c.const 'O_ACCMODE' 29 | end 30 | @@@ 31 | end 32 | 33 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/i386-darwin/etc.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Platform; end 4 | module Platform::Etc 5 | class Passwd < FFI::Struct 6 | self.size = 40 7 | layout :pw_name, :string, 0, 8 | :pw_passwd, :string, 4, 9 | :pw_uid, :uint, 8, 10 | :pw_gid, :uint, 12, 11 | :pw_dir, :string, 28, 12 | :pw_shell, :string, 32 13 | 14 | 15 | 16 | 17 | 18 | 19 | end 20 | class Group < FFI::Struct 21 | self.size = 16 22 | layout :gr_name, :string, 0, 23 | :gr_gid, :uint, 8 24 | 25 | 26 | 27 | 28 | 29 | 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/i386-darwin/fcntl.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Fcntl 4 | FD_CLOEXEC = 1 5 | F_DUPFD = 0 6 | F_GETFD = 1 7 | F_GETFL = 3 8 | F_GETLK = 7 9 | F_RDLCK = 1 10 | F_SETFD = 2 11 | F_SETFL = 4 12 | F_SETLK = 8 13 | F_SETLKW = 9 14 | F_UNLCK = 2 15 | F_WRLCK = 3 16 | O_ACCMODE = 3 17 | O_APPEND = 8 18 | O_CREAT = 512 19 | O_EXCL = 2048 20 | O_NDELAY = 4 21 | O_NOCTTY = 131072 22 | O_NONBLOCK = 4 23 | O_RDONLY = 0 24 | O_RDWR = 2 25 | O_TRUNC = 1024 26 | O_WRONLY = 1 27 | 28 | 29 | 30 | 31 | 32 | end 33 | 34 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/i386-darwin/syslog.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Syslog 4 | module Constants 5 | LOG_ALERT = 1 6 | LOG_AUTH = 32 7 | LOG_AUTHPRIV = 80 8 | LOG_CONS = 2 9 | # LOG_CONSOLE not available 10 | LOG_CRIT = 2 11 | LOG_CRON = 72 12 | LOG_DAEMON = 24 13 | LOG_DEBUG = 7 14 | LOG_EMERG = 0 15 | LOG_ERR = 3 16 | LOG_FTP = 88 17 | LOG_INFO = 6 18 | LOG_KERN = 0 19 | LOG_LOCAL0 = 128 20 | LOG_LOCAL1 = 136 21 | LOG_LOCAL2 = 144 22 | LOG_LOCAL3 = 152 23 | LOG_LOCAL4 = 160 24 | LOG_LOCAL5 = 168 25 | LOG_LOCAL6 = 176 26 | LOG_LOCAL7 = 184 27 | LOG_LPR = 48 28 | LOG_MAIL = 16 29 | LOG_NDELAY = 8 30 | LOG_NEWS = 56 31 | LOG_NOTICE = 5 32 | LOG_NOWAIT = 16 33 | # LOG_NTP not available 34 | LOG_ODELAY = 4 35 | LOG_PERROR = 32 36 | LOG_PID = 1 37 | # LOG_SECURITY not available 38 | LOG_SYSLOG = 40 39 | LOG_USER = 8 40 | LOG_UUCP = 64 41 | LOG_WARNING = 4 42 | 43 | 44 | 45 | 46 | 47 | end 48 | end 49 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/i386-linux/etc.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Platform; end 4 | module Platform::Etc 5 | class Passwd < FFI::Struct 6 | self.size = 28 7 | layout :pw_name, :string, 0, 8 | :pw_passwd, :string, 4, 9 | :pw_uid, :uint, 8, 10 | :pw_gid, :uint, 12, 11 | :pw_dir, :string, 20, 12 | :pw_shell, :string, 24 13 | 14 | 15 | 16 | 17 | 18 | 19 | end 20 | class Group < FFI::Struct 21 | self.size = 16 22 | layout :gr_name, :string, 0, 23 | :gr_gid, :uint, 8 24 | 25 | 26 | 27 | 28 | 29 | 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/i386-linux/fcntl.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Fcntl 4 | FD_CLOEXEC = 1 5 | F_DUPFD = 0 6 | F_GETFD = 1 7 | F_GETFL = 3 8 | F_GETLK = 12 9 | F_RDLCK = 0 10 | F_SETFD = 2 11 | F_SETFL = 4 12 | F_SETLK = 13 13 | F_SETLKW = 14 14 | F_UNLCK = 2 15 | F_WRLCK = 1 16 | O_ACCMODE = 3 17 | O_APPEND = 1024 18 | O_CREAT = 64 19 | O_EXCL = 128 20 | O_NDELAY = 2048 21 | O_NOCTTY = 256 22 | O_NONBLOCK = 2048 23 | O_RDONLY = 0 24 | O_RDWR = 2 25 | O_TRUNC = 512 26 | O_WRONLY = 1 27 | 28 | 29 | 30 | 31 | 32 | end 33 | 34 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/i386-linux/syslog.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Syslog 4 | module Constants 5 | LOG_ALERT = 1 6 | LOG_AUTH = 32 7 | LOG_AUTHPRIV = 80 8 | LOG_CONS = 2 9 | # LOG_CONSOLE not available 10 | LOG_CRIT = 2 11 | LOG_CRON = 72 12 | LOG_DAEMON = 24 13 | LOG_DEBUG = 7 14 | LOG_EMERG = 0 15 | LOG_ERR = 3 16 | LOG_FTP = 88 17 | LOG_INFO = 6 18 | LOG_KERN = 0 19 | LOG_LOCAL0 = 128 20 | LOG_LOCAL1 = 136 21 | LOG_LOCAL2 = 144 22 | LOG_LOCAL3 = 152 23 | LOG_LOCAL4 = 160 24 | LOG_LOCAL5 = 168 25 | LOG_LOCAL6 = 176 26 | LOG_LOCAL7 = 184 27 | LOG_LPR = 48 28 | LOG_MAIL = 16 29 | LOG_NDELAY = 8 30 | LOG_NEWS = 56 31 | LOG_NOTICE = 5 32 | LOG_NOWAIT = 16 33 | # LOG_NTP not available 34 | LOG_ODELAY = 4 35 | LOG_PERROR = 32 36 | LOG_PID = 1 37 | # LOG_SECURITY not available 38 | LOG_SYSLOG = 40 39 | LOG_USER = 8 40 | LOG_UUCP = 64 41 | LOG_WARNING = 4 42 | 43 | 44 | 45 | 46 | 47 | end 48 | end 49 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/i386-openbsd/etc.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Platform; end 4 | module Platform::Etc 5 | class Passwd < FFI::Struct 6 | self.size = 40 7 | layout :pw_name, :string, 0, 8 | :pw_passwd, :string, 4, 9 | :pw_uid, :uint, 8, 10 | :pw_gid, :uint, 12, 11 | :pw_dir, :string, 28, 12 | :pw_shell, :string, 32 13 | 14 | 15 | 16 | 17 | 18 | 19 | end 20 | class Group < FFI::Struct 21 | self.size = 16 22 | layout :gr_name, :string, 0, 23 | :gr_gid, :uint, 8 24 | 25 | 26 | 27 | 28 | 29 | 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/i386-openbsd/fcntl.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Fcntl 4 | FD_CLOEXEC = 1 5 | F_DUPFD = 0 6 | F_GETFD = 1 7 | F_GETFL = 3 8 | F_GETLK = 7 9 | F_RDLCK = 1 10 | F_SETFD = 2 11 | F_SETFL = 4 12 | F_SETLK = 8 13 | F_SETLKW = 9 14 | F_UNLCK = 2 15 | F_WRLCK = 3 16 | O_ACCMODE = 3 17 | O_APPEND = 8 18 | O_CREAT = 512 19 | O_EXCL = 2048 20 | O_NDELAY = 4 21 | O_NOCTTY = 32768 22 | O_NONBLOCK = 4 23 | O_RDONLY = 0 24 | O_RDWR = 2 25 | O_TRUNC = 1024 26 | O_WRONLY = 1 27 | 28 | 29 | 30 | 31 | 32 | end 33 | 34 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/i386-solaris/etc.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Platform; end 4 | module Platform::Etc 5 | class Passwd < FFI::Struct 6 | self.size = 36 7 | layout :pw_name, :string, 0, 8 | :pw_passwd, :string, 4, 9 | :pw_uid, :uint, 8, 10 | :pw_gid, :uint, 12, 11 | :pw_dir, :string, 28, 12 | :pw_shell, :string, 32 13 | 14 | 15 | 16 | 17 | 18 | 19 | end 20 | class Group < FFI::Struct 21 | self.size = 16 22 | layout :gr_name, :string, 0, 23 | :gr_gid, :uint, 8 24 | 25 | 26 | 27 | 28 | 29 | 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/i386-solaris/fcntl.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Fcntl 4 | FD_CLOEXEC = 1 5 | F_DUPFD = 0 6 | F_GETFD = 1 7 | F_GETFL = 3 8 | F_GETLK = 33 9 | F_RDLCK = 1 10 | F_SETFD = 2 11 | F_SETFL = 4 12 | F_SETLK = 34 13 | F_SETLKW = 35 14 | F_UNLCK = 3 15 | F_WRLCK = 2 16 | O_ACCMODE = 3 17 | O_APPEND = 8 18 | O_CREAT = 256 19 | O_EXCL = 1024 20 | O_NDELAY = 4 21 | O_NOCTTY = 2048 22 | O_NONBLOCK = 128 23 | O_RDONLY = 0 24 | O_RDWR = 2 25 | O_TRUNC = 512 26 | O_WRONLY = 1 27 | 28 | 29 | 30 | 31 | 32 | end 33 | 34 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/i386-windows/etc.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Platform; end 4 | module Platform::Etc 5 | class Passwd < FFI::Struct 6 | layout :pw_name, :string, 0, 7 | :pw_passwd, :string, 4, 8 | :pw_uid, :uint, 8, 9 | :pw_gid, :uint, 12, 10 | :pw_dir, :string, 24, 11 | :pw_shell, :string, 28 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | end 20 | class Group < FFI::Struct 21 | layout :gr_name, :string, 0, 22 | :gr_gid, :uint, 8 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/i386-windows/fcntl.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Fcntl 4 | FD_CLOEXEC = 1 5 | F_DUPFD = 0 6 | F_GETFD = 1 7 | F_GETFL = 3 8 | F_GETLK = 7 9 | F_RDLCK = 1 10 | F_SETFD = 2 11 | F_SETFL = 4 12 | F_SETLK = 8 13 | F_SETLKW = 9 14 | F_UNLCK = 3 15 | F_WRLCK = 2 16 | O_ACCMODE = 3 17 | O_APPEND = 8 18 | O_CREAT = 512 19 | O_EXCL = 2048 20 | O_NDELAY = 16384 21 | O_NOCTTY = 32768 22 | O_NONBLOCK = 16384 23 | O_RDONLY = 0 24 | O_RDWR = 2 25 | O_TRUNC = 1024 26 | O_WRONLY = 1 27 | 28 | 29 | 30 | 31 | 32 | end 33 | 34 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/powerpc-aix/etc.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Platform; end 4 | module Platform::Etc 5 | class Passwd < FFI::Struct 6 | self.size = 28 7 | layout :pw_name, :string, 0, 8 | :pw_passwd, :string, 4, 9 | :pw_uid, :uint, 8, 10 | :pw_gid, :uint, 12, 11 | :pw_dir, :string, 20, 12 | :pw_shell, :string, 24 13 | 14 | 15 | 16 | 17 | 18 | 19 | end 20 | class Group < FFI::Struct 21 | self.size = 16 22 | layout :gr_name, :string, 0, 23 | :gr_gid, :uint, 8 24 | 25 | 26 | 27 | 28 | 29 | 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/powerpc-aix/fcntl.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Fcntl 4 | FD_CLOEXEC = 1 5 | F_DUPFD = 0 6 | F_GETFD = 1 7 | F_GETFL = 3 8 | F_GETLK = 5 9 | F_RDLCK = 1 10 | F_SETFD = 2 11 | F_SETFL = 4 12 | F_SETLK = 6 13 | F_SETLKW = 7 14 | F_UNLCK = 3 15 | F_WRLCK = 2 16 | O_ACCMODE = 3 17 | O_APPEND = 8 18 | O_CREAT = 256 19 | O_EXCL = 1024 20 | O_NDELAY = 32768 21 | O_NOCTTY = 2048 22 | O_NONBLOCK = 4 23 | O_RDONLY = 0 24 | O_RDWR = 2 25 | O_TRUNC = 512 26 | O_WRONLY = 1 27 | 28 | 29 | 30 | 31 | 32 | end 33 | 34 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/powerpc-darwin/etc.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Platform; end 4 | module Platform::Etc 5 | class Passwd < FFI::Struct 6 | self.size = 40 7 | layout :pw_name, :string, 0, 8 | :pw_passwd, :string, 4, 9 | :pw_uid, :uint, 8, 10 | :pw_gid, :uint, 12, 11 | :pw_dir, :string, 28, 12 | :pw_shell, :string, 32 13 | 14 | 15 | 16 | 17 | 18 | 19 | end 20 | class Group < FFI::Struct 21 | self.size = 16 22 | layout :gr_name, :string, 0, 23 | :gr_gid, :uint, 8 24 | 25 | 26 | 27 | 28 | 29 | 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/powerpc-darwin/fcntl.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Fcntl 4 | FD_CLOEXEC = 1 5 | F_DUPFD = 0 6 | F_GETFD = 1 7 | F_GETFL = 3 8 | F_GETLK = 7 9 | F_RDLCK = 1 10 | F_SETFD = 2 11 | F_SETFL = 4 12 | F_SETLK = 8 13 | F_SETLKW = 9 14 | F_UNLCK = 2 15 | F_WRLCK = 3 16 | O_ACCMODE = 3 17 | O_APPEND = 8 18 | O_CREAT = 512 19 | O_EXCL = 2048 20 | O_NDELAY = 4 21 | O_NOCTTY = 131072 22 | O_NONBLOCK = 4 23 | O_RDONLY = 0 24 | O_RDWR = 2 25 | O_TRUNC = 1024 26 | O_WRONLY = 1 27 | 28 | 29 | 30 | 31 | 32 | end 33 | 34 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/ppc-darwin/syslog.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Syslog 4 | module Constants 5 | LOG_ALERT = 1 6 | LOG_AUTH = 32 7 | LOG_AUTHPRIV = 80 8 | LOG_CONS = 2 9 | # LOG_CONSOLE not available 10 | LOG_CRIT = 2 11 | LOG_CRON = 72 12 | LOG_DAEMON = 24 13 | LOG_DEBUG = 7 14 | LOG_EMERG = 0 15 | LOG_ERR = 3 16 | LOG_FTP = 88 17 | LOG_INFO = 6 18 | LOG_KERN = 0 19 | LOG_LOCAL0 = 128 20 | LOG_LOCAL1 = 136 21 | LOG_LOCAL2 = 144 22 | LOG_LOCAL3 = 152 23 | LOG_LOCAL4 = 160 24 | LOG_LOCAL5 = 168 25 | LOG_LOCAL6 = 176 26 | LOG_LOCAL7 = 184 27 | LOG_LPR = 48 28 | LOG_MAIL = 16 29 | LOG_NDELAY = 8 30 | LOG_NEWS = 56 31 | LOG_NOTICE = 5 32 | LOG_NOWAIT = 16 33 | # LOG_NTP not available 34 | LOG_ODELAY = 4 35 | LOG_PERROR = 32 36 | LOG_PID = 1 37 | # LOG_SECURITY not available 38 | LOG_SYSLOG = 40 39 | LOG_USER = 8 40 | LOG_UUCP = 64 41 | LOG_WARNING = 4 42 | 43 | 44 | 45 | 46 | 47 | end 48 | end 49 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/sparc-solaris/etc.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Platform; end 4 | module Platform::Etc 5 | class Passwd < FFI::Struct 6 | self.size = 36 7 | layout :pw_name, :string, 0, 8 | :pw_passwd, :string, 4, 9 | :pw_uid, :uint, 8, 10 | :pw_gid, :uint, 12, 11 | :pw_dir, :string, 28, 12 | :pw_shell, :string, 32 13 | 14 | 15 | 16 | 17 | 18 | 19 | end 20 | class Group < FFI::Struct 21 | self.size = 16 22 | layout :gr_name, :string, 0, 23 | :gr_gid, :uint, 8 24 | 25 | 26 | 27 | 28 | 29 | 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/sparc-solaris/fcntl.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Fcntl 4 | FD_CLOEXEC = 1 5 | F_DUPFD = 0 6 | F_GETFD = 1 7 | F_GETFL = 3 8 | F_GETLK = 33 9 | F_RDLCK = 1 10 | F_SETFD = 2 11 | F_SETFL = 4 12 | F_SETLK = 34 13 | F_SETLKW = 35 14 | F_UNLCK = 3 15 | F_WRLCK = 2 16 | O_ACCMODE = 3 17 | O_APPEND = 8 18 | O_CREAT = 256 19 | O_EXCL = 1024 20 | O_NDELAY = 4 21 | O_NOCTTY = 2048 22 | O_NONBLOCK = 128 23 | O_RDONLY = 0 24 | O_RDWR = 2 25 | O_TRUNC = 512 26 | O_WRONLY = 1 27 | 28 | 29 | 30 | 31 | 32 | end 33 | 34 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/sparcv9-solaris/etc.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Platform; end 4 | module Platform::Etc 5 | class Passwd < FFI::Struct 6 | self.size = 36 7 | layout :pw_name, :string, 0, 8 | :pw_passwd, :string, 4, 9 | :pw_uid, :uint, 8, 10 | :pw_gid, :uint, 12, 11 | :pw_dir, :string, 28, 12 | :pw_shell, :string, 32 13 | 14 | 15 | 16 | 17 | 18 | 19 | end 20 | class Group < FFI::Struct 21 | self.size = 16 22 | layout :gr_name, :string, 0, 23 | :gr_gid, :uint, 8 24 | 25 | 26 | 27 | 28 | 29 | 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/sparcv9-solaris/fcntl.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Fcntl 4 | FD_CLOEXEC = 1 5 | F_DUPFD = 0 6 | F_GETFD = 1 7 | F_GETFL = 3 8 | F_GETLK = 33 9 | F_RDLCK = 1 10 | F_SETFD = 2 11 | F_SETFL = 4 12 | F_SETLK = 34 13 | F_SETLKW = 35 14 | F_UNLCK = 3 15 | F_WRLCK = 2 16 | O_ACCMODE = 3 17 | O_APPEND = 8 18 | O_CREAT = 256 19 | O_EXCL = 1024 20 | O_NDELAY = 4 21 | O_NOCTTY = 2048 22 | O_NONBLOCK = 128 23 | O_RDONLY = 0 24 | O_RDWR = 2 25 | O_TRUNC = 512 26 | O_WRONLY = 1 27 | 28 | 29 | 30 | 31 | 32 | end 33 | 34 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/x86_64-darwin/etc.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Platform; end 4 | module Platform::Etc 5 | class Passwd < FFI::Struct 6 | self.size = 72 7 | layout :pw_name, :string, 0, 8 | :pw_passwd, :string, 8, 9 | :pw_uid, :uint, 16, 10 | :pw_gid, :uint, 20, 11 | :pw_dir, :string, 48, 12 | :pw_shell, :string, 56 13 | 14 | 15 | 16 | 17 | 18 | 19 | end 20 | class Group < FFI::Struct 21 | self.size = 32 22 | layout :gr_name, :string, 0, 23 | :gr_gid, :uint, 16 24 | 25 | 26 | 27 | 28 | 29 | 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/x86_64-darwin/fcntl.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Fcntl 4 | FD_CLOEXEC = 1 5 | F_DUPFD = 0 6 | F_GETFD = 1 7 | F_GETFL = 3 8 | F_GETLK = 7 9 | F_RDLCK = 1 10 | F_SETFD = 2 11 | F_SETFL = 4 12 | F_SETLK = 8 13 | F_SETLKW = 9 14 | F_UNLCK = 2 15 | F_WRLCK = 3 16 | O_ACCMODE = 3 17 | O_APPEND = 8 18 | O_CREAT = 512 19 | O_EXCL = 2048 20 | O_NDELAY = 4 21 | O_NOCTTY = 131072 22 | O_NONBLOCK = 4 23 | O_RDONLY = 0 24 | O_RDWR = 2 25 | O_TRUNC = 1024 26 | O_WRONLY = 1 27 | 28 | 29 | 30 | 31 | 32 | end 33 | 34 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/x86_64-darwin/syslog.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Syslog 4 | module Constants 5 | LOG_ALERT = 1 6 | LOG_AUTH = 32 7 | LOG_AUTHPRIV = 80 8 | LOG_CONS = 2 9 | # LOG_CONSOLE not available 10 | LOG_CRIT = 2 11 | LOG_CRON = 72 12 | LOG_DAEMON = 24 13 | LOG_DEBUG = 7 14 | LOG_EMERG = 0 15 | LOG_ERR = 3 16 | LOG_FTP = 88 17 | LOG_INFO = 6 18 | LOG_KERN = 0 19 | LOG_LOCAL0 = 128 20 | LOG_LOCAL1 = 136 21 | LOG_LOCAL2 = 144 22 | LOG_LOCAL3 = 152 23 | LOG_LOCAL4 = 160 24 | LOG_LOCAL5 = 168 25 | LOG_LOCAL6 = 176 26 | LOG_LOCAL7 = 184 27 | LOG_LPR = 48 28 | LOG_MAIL = 16 29 | LOG_NDELAY = 8 30 | LOG_NEWS = 56 31 | LOG_NOTICE = 5 32 | LOG_NOWAIT = 16 33 | # LOG_NTP not available 34 | LOG_ODELAY = 4 35 | LOG_PERROR = 32 36 | LOG_PID = 1 37 | # LOG_SECURITY not available 38 | LOG_SYSLOG = 40 39 | LOG_USER = 8 40 | LOG_UUCP = 64 41 | LOG_WARNING = 4 42 | 43 | 44 | 45 | 46 | 47 | end 48 | end 49 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/x86_64-freebsd/syslog.rb: -------------------------------------------------------------------------------- 1 | # This file hand crafted for FreeBSD, not via Rake 2 | 3 | module Syslog 4 | module Constants 5 | LOG_ALERT = 1 6 | LOG_AUTH = 32 7 | LOG_AUTHPRIV = 80 8 | LOG_CONS = 2 9 | LOG_CONSOLE = 112 10 | LOG_CRIT = 2 11 | LOG_CRON = 72 12 | LOG_DAEMON = 24 13 | LOG_DEBUG = 7 14 | LOG_EMERG = 0 15 | LOG_ERR = 3 16 | LOG_FTP = 88 17 | LOG_INFO = 6 18 | LOG_KERN = 0 19 | LOG_LOCAL0 = 128 20 | LOG_LOCAL1 = 136 21 | LOG_LOCAL2 = 144 22 | LOG_LOCAL3 = 152 23 | LOG_LOCAL4 = 160 24 | LOG_LOCAL5 = 168 25 | LOG_LOCAL6 = 176 26 | LOG_LOCAL7 = 184 27 | LOG_LPR = 48 28 | LOG_MAIL = 16 29 | LOG_NEWS = 56 30 | LOG_NOTICE = 5 31 | LOG_NOWAIT = 16 32 | LOG_NTP = 96 33 | LOG_ODELAY = 4 34 | LOG_NDELAY = 8 35 | LOG_PERROR = 32 36 | LOG_PID = 1 37 | LOG_SECURITY = 104 38 | LOG_SYSLOG = 40 39 | LOG_USER = 8 40 | LOG_UUCP = 64 41 | LOG_WARNING = 4 42 | end 43 | end -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/x86_64-linux/etc.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Platform; end 4 | module Platform::Etc 5 | class Passwd < FFI::Struct 6 | self.size = 48 7 | layout :pw_name, :string, 0, 8 | :pw_passwd, :string, 8, 9 | :pw_uid, :uint, 16, 10 | :pw_gid, :uint, 20, 11 | :pw_dir, :string, 32, 12 | :pw_shell, :string, 40 13 | 14 | 15 | 16 | 17 | 18 | 19 | end 20 | class Group < FFI::Struct 21 | self.size = 32 22 | layout :gr_name, :string, 0, 23 | :gr_gid, :uint, 16 24 | 25 | 26 | 27 | 28 | 29 | 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/x86_64-linux/fcntl.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Fcntl 4 | FD_CLOEXEC = 1 5 | F_DUPFD = 0 6 | F_GETFD = 1 7 | F_GETFL = 3 8 | F_GETLK = 5 9 | F_RDLCK = 0 10 | F_SETFD = 2 11 | F_SETFL = 4 12 | F_SETLK = 6 13 | F_SETLKW = 7 14 | F_UNLCK = 2 15 | F_WRLCK = 1 16 | O_ACCMODE = 3 17 | O_APPEND = 1024 18 | O_CREAT = 64 19 | O_EXCL = 128 20 | O_NDELAY = 2048 21 | O_NOCTTY = 256 22 | O_NONBLOCK = 2048 23 | O_RDONLY = 0 24 | O_RDWR = 2 25 | O_TRUNC = 512 26 | O_WRONLY = 1 27 | 28 | 29 | 30 | 31 | 32 | end 33 | 34 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/x86_64-linux/syslog.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Syslog 4 | module Constants 5 | LOG_ALERT = 1 6 | LOG_AUTH = 32 7 | LOG_AUTHPRIV = 80 8 | LOG_CONS = 2 9 | # LOG_CONSOLE not available 10 | LOG_CRIT = 2 11 | LOG_CRON = 72 12 | LOG_DAEMON = 24 13 | LOG_DEBUG = 7 14 | LOG_EMERG = 0 15 | LOG_ERR = 3 16 | LOG_FTP = 88 17 | LOG_INFO = 6 18 | LOG_KERN = 0 19 | LOG_LOCAL0 = 128 20 | LOG_LOCAL1 = 136 21 | LOG_LOCAL2 = 144 22 | LOG_LOCAL3 = 152 23 | LOG_LOCAL4 = 160 24 | LOG_LOCAL5 = 168 25 | LOG_LOCAL6 = 176 26 | LOG_LOCAL7 = 184 27 | LOG_LPR = 48 28 | LOG_MAIL = 16 29 | LOG_NDELAY = 8 30 | LOG_NEWS = 56 31 | LOG_NOTICE = 5 32 | LOG_NOWAIT = 16 33 | # LOG_NTP not available 34 | LOG_ODELAY = 4 35 | LOG_PERROR = 32 36 | LOG_PID = 1 37 | # LOG_SECURITY not available 38 | LOG_SYSLOG = 40 39 | LOG_USER = 8 40 | LOG_UUCP = 64 41 | LOG_WARNING = 4 42 | 43 | 44 | 45 | 46 | 47 | end 48 | end 49 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/x86_64-openbsd/etc.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Platform; end 4 | module Platform::Etc 5 | class Passwd < FFI::Struct 6 | self.size = 72 7 | layout :pw_name, :string, 0, 8 | :pw_passwd, :string, 8, 9 | :pw_uid, :uint, 16, 10 | :pw_gid, :uint, 20, 11 | :pw_dir, :string, 48, 12 | :pw_shell, :string, 56 13 | 14 | 15 | 16 | 17 | 18 | 19 | end 20 | class Group < FFI::Struct 21 | self.size = 32 22 | layout :gr_name, :string, 0, 23 | :gr_gid, :uint, 16 24 | 25 | 26 | 27 | 28 | 29 | 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/x86_64-openbsd/fcntl.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Fcntl 4 | FD_CLOEXEC = 1 5 | F_DUPFD = 0 6 | F_GETFD = 1 7 | F_GETFL = 3 8 | F_GETLK = 7 9 | F_RDLCK = 1 10 | F_SETFD = 2 11 | F_SETFL = 4 12 | F_SETLK = 8 13 | F_SETLKW = 9 14 | F_UNLCK = 2 15 | F_WRLCK = 3 16 | O_ACCMODE = 3 17 | O_APPEND = 8 18 | O_CREAT = 512 19 | O_EXCL = 2048 20 | O_NDELAY = 4 21 | O_NOCTTY = 32768 22 | O_NONBLOCK = 4 23 | O_RDONLY = 0 24 | O_RDWR = 2 25 | O_TRUNC = 1024 26 | O_WRONLY = 1 27 | 28 | 29 | 30 | 31 | 32 | end 33 | 34 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/x86_64-solaris/etc.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Platform; end 4 | module Platform::Etc 5 | class Passwd < FFI::Struct 6 | self.size = 64 7 | layout :pw_name, :string, 0, 8 | :pw_passwd, :string, 8, 9 | :pw_uid, :uint, 16, 10 | :pw_gid, :uint, 20, 11 | :pw_dir, :string, 48, 12 | :pw_shell, :string, 56 13 | 14 | 15 | 16 | 17 | 18 | 19 | end 20 | class Group < FFI::Struct 21 | self.size = 32 22 | layout :gr_name, :string, 0, 23 | :gr_gid, :uint, 16 24 | 25 | 26 | 27 | 28 | 29 | 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/platform/x86_64-solaris/fcntl.rb: -------------------------------------------------------------------------------- 1 | # This file is generated by rake. Do not edit. 2 | 3 | module Fcntl 4 | FD_CLOEXEC = 1 5 | F_DUPFD = 0 6 | F_GETFD = 1 7 | F_GETFL = 3 8 | F_GETLK = 14 9 | F_RDLCK = 1 10 | F_SETFD = 2 11 | F_SETFL = 4 12 | F_SETLK = 6 13 | F_SETLKW = 7 14 | F_UNLCK = 3 15 | F_WRLCK = 2 16 | O_ACCMODE = 3 17 | O_APPEND = 8 18 | O_CREAT = 256 19 | O_EXCL = 1024 20 | O_NDELAY = 4 21 | O_NOCTTY = 2048 22 | O_NONBLOCK = 128 23 | O_RDONLY = 0 24 | O_RDWR = 2 25 | O_TRUNC = 512 26 | O_WRONLY = 1 27 | 28 | 29 | 30 | 31 | 32 | end 33 | 34 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/pointer.rb: -------------------------------------------------------------------------------- 1 | # All FFI::Pointer functionality is implemented in java 2 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/rbx.rb: -------------------------------------------------------------------------------- 1 | # This file intentionally left blank 2 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ffi/tools/generator_task.rb: -------------------------------------------------------------------------------- 1 | begin 2 | require 'ffi/struct_generator' 3 | require 'ffi/const_generator' 4 | require 'ffi/generator' 5 | rescue LoadError 6 | # from Rakefile 7 | require 'lib/ffi/struct_generator' 8 | require 'lib/ffi/const_generator' 9 | require 'lib/ffi/generator' 10 | end 11 | 12 | require 'rake' 13 | require 'rake/tasklib' 14 | require 'tempfile' 15 | 16 | ## 17 | # Rake task that calculates C structs for FFI::Struct. 18 | 19 | class FFI::Generator::Task < Rake::TaskLib 20 | 21 | def initialize(rb_names) 22 | task :clean do rm_f rb_names end 23 | 24 | rb_names.each do |rb_name| 25 | ffi_name = "#{rb_name}.ffi" 26 | 27 | file rb_name => ffi_name do |t| 28 | puts "Generating #{rb_name}..." if Rake.application.options.trace 29 | 30 | FFI::Generator.new ffi_name, rb_name 31 | end 32 | end 33 | end 34 | 35 | end 36 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/fiber.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # Extensions to Fiber. In JRuby, these are all still defined in the normal 3 | # Fiber class, so we alias them to the right names here. 4 | # 5 | class Fiber 6 | class << self 7 | alias current __current__ 8 | end 9 | 10 | alias transfer __transfer__ 11 | alias alive? __alive__ 12 | end -------------------------------------------------------------------------------- /src/main/resources/stdlib/fiddle/function.rb: -------------------------------------------------------------------------------- 1 | module Fiddle 2 | class Function 3 | # The ABI of the Function. 4 | attr_reader :abi 5 | 6 | # The address of this function 7 | attr_reader :ptr 8 | 9 | # The name of this function 10 | attr_reader :name 11 | 12 | # The integer memory location of this function 13 | def to_i 14 | ptr.to_i 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/hoe/minitest.rb: -------------------------------------------------------------------------------- 1 | # :stopdoc: 2 | 3 | class Hoe 4 | end 5 | 6 | module Hoe::Minitest 7 | def initialize_minitest 8 | dir = "../../minitest/dev/lib" 9 | Hoe.add_include_dirs dir if File.directory? dir 10 | 11 | gem "minitest" 12 | require "minitest" 13 | version = Minitest::VERSION.split(/\./).first(2).join(".") 14 | 15 | dependency "minitest", "~> #{version}", :development unless 16 | self.name == "minitest" or ENV["MT_NO_ISOLATE"] 17 | end 18 | 19 | def define_minitest_tasks 20 | self.testlib = :minitest 21 | 22 | # make sure we use the gemmed minitest on 1.9 23 | self.test_prelude = 'gem "minitest"' unless 24 | self.name == "minitest" or ENV["MT_NO_ISOLATE"] 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/io/nonblock.rb: -------------------------------------------------------------------------------- 1 | class IO 2 | public 3 | def nonblock? 4 | !JRuby.reference(self).blocking? 5 | end 6 | 7 | def nonblock=(nonblocking) 8 | JRuby.reference(self).blocking = !nonblocking 9 | end 10 | 11 | def nonblock(nonblocking = true) 12 | JRuby.reference(self).blocking = !nonblocking; 13 | if block_given? 14 | begin 15 | yield self 16 | ensure 17 | JRuby.reference(self).blocking = nonblocking; 18 | end 19 | end 20 | end 21 | end -------------------------------------------------------------------------------- /src/main/resources/stdlib/irb/cmd/chws.rb: -------------------------------------------------------------------------------- 1 | # 2 | # change-ws.rb - 3 | # $Release Version: 0.9.6$ 4 | # $Revision$ 5 | # by Keiju ISHITSUKA(keiju@ruby-lang.org) 6 | # 7 | # -- 8 | # 9 | # 10 | # 11 | 12 | require "irb/cmd/nop.rb" 13 | require "irb/ext/change-ws.rb" 14 | 15 | # :stopdoc: 16 | module IRB 17 | module ExtendCommand 18 | 19 | class CurrentWorkingWorkspace Encoding::EUC_JP, 6 | 'euc' => Encoding::EUC_JP 7 | }.freeze 8 | end 9 | end 10 | # :startdoc: 11 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/irb/lc/ja/error.rb: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # irb/lc/ja/error.rb - 3 | # $Release Version: 0.9.6$ 4 | # $Revision$ 5 | # by Keiju ISHITSUKA(keiju@ruby-lang.org) 6 | # 7 | # -- 8 | # 9 | # 10 | # 11 | require "e2mmap" 12 | 13 | # :stopdoc: 14 | module IRB 15 | # exceptions 16 | extend Exception2MessageMapper 17 | def_exception :UnrecognizedSwitch, 'スイッチ(%s)が分りません' 18 | def_exception :NotImplementedError, '`%s\'の定義が必要です' 19 | def_exception :CantReturnToNormalMode, 'Normalモードに戻れません.' 20 | def_exception :IllegalParameter, 'パラメータ(%s)が間違っています.' 21 | def_exception :IrbAlreadyDead, 'Irbは既に死んでいます.' 22 | def_exception :IrbSwitchedToCurrentThread, 'カレントスレッドに切り替わりました.' 23 | def_exception :NoSuchJob, 'そのようなジョブ(%s)はありません.' 24 | def_exception :CantShiftToMultiIrbMode, 'multi-irb modeに移れません.' 25 | def_exception :CantChangeBinding, 'バインディング(%s)に変更できません.' 26 | def_exception :UndefinedPromptMode, 'プロンプトモード(%s)は定義されていません.' 27 | def_exception :IllegalRCNameGenerator, 'RC_NAME_GENERATORが正しく定義されていません.' 28 | end 29 | # :startdoc: 30 | # vim:fileencoding=utf-8 31 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/irb/src_encoding.rb: -------------------------------------------------------------------------------- 1 | # DO NOT WRITE ANY MAGIC COMMENT HERE. 2 | def default_src_encoding 3 | return __ENCODING__ 4 | end 5 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/irb/version.rb: -------------------------------------------------------------------------------- 1 | # 2 | # irb/version.rb - irb version definition file 3 | # $Release Version: 0.9.6$ 4 | # $Revision$ 5 | # by Keiju ISHITSUKA(keiju@ishitsuka.com) 6 | # 7 | # -- 8 | # 9 | # 10 | # 11 | 12 | module IRB # :nodoc: 13 | @RELEASE_VERSION = "0.9.6" 14 | @LAST_UPDATE_DATE = "09/06/30" 15 | end 16 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/irb/ws-for-case-2.rb: -------------------------------------------------------------------------------- 1 | # 2 | # irb/ws-for-case-2.rb - 3 | # $Release Version: 0.9.6$ 4 | # $Revision$ 5 | # by Keiju ISHITSUKA(keiju@ruby-lang.org) 6 | # 7 | # -- 8 | # 9 | # 10 | # 11 | 12 | while true 13 | IRB::BINDING_QUEUE.push _ = binding 14 | end 15 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/jar_installer.rb: -------------------------------------------------------------------------------- 1 | require 'jars/installer' 2 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/jars/jar_pom.rb: -------------------------------------------------------------------------------- 1 | # this file is maven DSL and used by maven via jars/maven_exec.rb 2 | 3 | specfile = java.lang.System.getProperty('jars.specfile') 4 | 5 | # needed since the gemspec does not allow absolute files 6 | basedir( File.dirname( specfile ) ) 7 | 8 | # add jruby as provided for compilation when used vi Jars::Classpath#classpath 9 | jar 'org.jruby:jruby-core', JRUBY_VERSION, :scope => :provided 10 | 11 | # get ALL dependencies from the specfile 12 | gemspec File.basename( specfile ) 13 | 14 | # we do not want those gem dependencies, each gem takes care of its 15 | # own jar dependencies 16 | gems = model.dependencies.select do |d| 17 | d.group_id == 'rubygems' 18 | end 19 | gems.each do |d| 20 | model.dependencies.remove( d ) 21 | end 22 | 23 | # some output 24 | model.dependencies.each do |d| 25 | puts " " + d.group_id + ':' + d.artifact_id + (d.classifier ? ":" + d.classifier : "" ) + ":" + d.version unless d.artifact_id == 'jruby-core' 26 | end 27 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/jars/jars_lock_pom.rb: -------------------------------------------------------------------------------- 1 | # this file is maven DSL and used by maven via jars/maven_exec.rb 2 | 3 | require_relative 'lock' 4 | require_relative '../jar_dependencies' 5 | 6 | lock = Jars::Lock.new( ENV_JAVA['jars.lock'] ) 7 | 8 | lock.process( :all ) do |coord| 9 | 10 | options = { :scope => coord.scope } 11 | options[ :systemPath ] = coord[ -1 ] if coord.scope == :system 12 | options[ :classifier ] = coord.classifier 13 | 14 | jar coord.group_id, coord.artifact_id, coord.version, options 15 | 16 | end 17 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/jars/setup.rb: -------------------------------------------------------------------------------- 1 | # to do as bundler does and allow to load Jars.lock via 2 | # require 'jars/setup'. can be useful via commandline -rjars/setup 3 | # or tell bundler autorequire to load it 4 | 5 | require 'jar_dependencies' 6 | 7 | Jars.require_jars_lock! 8 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/jars/version.rb: -------------------------------------------------------------------------------- 1 | module Jars 2 | VERSION = '0.1.15'.freeze 3 | end 4 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/java/inspect.rb: -------------------------------------------------------------------------------- 1 | require 'jruby' 2 | 3 | class Java::JavaLang::Object 4 | def inspect() 5 | # '<#Java::MyPackage::TheClass:0xDECAFBAD ' 6 | header = "#<#{self.class}:0x#{Java::JavaLang::System::identity_hash_code(self).to_s(16)} " 7 | # Bail quickly if looping 8 | return header + "...>" if JRuby.runtime.inspecting?(self) 9 | begin 10 | fs = self.java_class.declared_fields # get fields 11 | fvals = [] 12 | JRuby.runtime.register_inspecting(self) # loop protection 13 | fs.each do |f| 14 | f.accessible=true # let us prod everything. Invasive :-( 15 | fvals << "@#{f.name} = #{f.value(self).inspect}" if !f.static? 16 | end 17 | header + "#{fvals.join(', ')}>" 18 | ensure 19 | JRuby.runtime.unregister_inspecting(self) # undo loop protection 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/jline/jline/2.11/jline-2.11.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/jline/jline/2.11/jline-2.11.jar -------------------------------------------------------------------------------- /src/main/resources/stdlib/jopenssl.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/jopenssl.jar -------------------------------------------------------------------------------- /src/main/resources/stdlib/jopenssl/load.rb: -------------------------------------------------------------------------------- 1 | warn 'Loading jruby-openssl in a non-JRuby interpreter' unless defined? JRUBY_VERSION 2 | 3 | require 'java' 4 | require 'jopenssl/version' 5 | 6 | version = Jopenssl::Version::BOUNCY_CASTLE_VERSION 7 | bc_jars = nil 8 | begin 9 | # if we have jar-dependencies we let it track the jars 10 | require_jar( 'org.bouncycastle', 'bcpkix-jdk15on', version ) 11 | require_jar( 'org.bouncycastle', 'bcprov-jdk15on', version ) 12 | bc_jars = true 13 | rescue LoadError 14 | end if defined?(Jars) && ( ! Jars.skip? ) rescue nil 15 | unless bc_jars 16 | load "org/bouncycastle/bcpkix-jdk15on/#{version}/bcpkix-jdk15on-#{version}.jar" 17 | load "org/bouncycastle/bcprov-jdk15on/#{version}/bcprov-jdk15on-#{version}.jar" 18 | end 19 | 20 | require 'jruby' 21 | require 'jopenssl.jar' 22 | org.jruby.ext.openssl.OpenSSL.load(JRuby.runtime) 23 | 24 | if RUBY_VERSION >= '2.1.0' 25 | load('jopenssl21/openssl.rb') 26 | elsif RUBY_VERSION >= '1.9.0' 27 | load('jopenssl19/openssl.rb') 28 | else 29 | load('jopenssl18/openssl.rb') 30 | end 31 | 32 | require 'openssl/pkcs12' 33 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/jopenssl/version.rb: -------------------------------------------------------------------------------- 1 | module Jopenssl 2 | module Version 3 | VERSION = '0.9.7' 4 | BOUNCY_CASTLE_VERSION = '1.50' 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/jopenssl18/openssl.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | = $RCSfile$ -- Loader for all OpenSSL C-space and Ruby-space definitions 3 | 4 | = Info 5 | 'OpenSSL for Ruby 2' project 6 | Copyright (C) 2002 Michal Rokos 7 | All rights reserved. 8 | 9 | = Licence 10 | This program is licenced under the same licence as Ruby. 11 | (See the file 'LICENCE'.) 12 | 13 | = Version 14 | $Id: openssl.rb 12496 2007-06-08 15:02:04Z technorama $ 15 | =end 16 | 17 | require 'openssl/bn' 18 | require 'openssl/cipher' 19 | require 'openssl/config' 20 | require 'openssl/digest' 21 | require 'openssl/pkcs7' 22 | require 'openssl/ssl-internal' 23 | require 'openssl/x509-internal' 24 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/jopenssl18/openssl/bn.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | = $RCSfile$ -- Ruby-space definitions that completes C-space funcs for BN 3 | 4 | = Info 5 | 'OpenSSL for Ruby 2' project 6 | Copyright (C) 2002 Michal Rokos 7 | All rights reserved. 8 | 9 | = Licence 10 | This program is licenced under the same licence as Ruby. 11 | (See the file 'LICENCE'.) 12 | 13 | = Version 14 | $Id$ 15 | =end 16 | 17 | ## 18 | # Add double dispatch to Integer 19 | # 20 | class Integer 21 | def to_bn 22 | OpenSSL::BN::new(self.to_s(16), 16) 23 | end 24 | end # Integer 25 | 26 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/jopenssl18/openssl/cipher.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | = $RCSfile$ -- Ruby-space predefined Cipher subclasses 3 | 4 | = Info 5 | 'OpenSSL for Ruby 2' project 6 | Copyright (C) 2002 Michal Rokos 7 | All rights reserved. 8 | 9 | = Licence 10 | This program is licenced under the same licence as Ruby. 11 | (See the file 'LICENCE'.) 12 | 13 | = Version 14 | $Id$ 15 | =end 16 | 17 | ## 18 | # Should we care what if somebody require this file directly? 19 | #require 'openssl' 20 | 21 | module OpenSSL 22 | class Cipher 23 | # This class is only provided for backwards compatibility. Use OpenSSL::Digest in the future. 24 | class Cipher < Cipher 25 | # add warning 26 | end 27 | end # Cipher 28 | end # OpenSSL -------------------------------------------------------------------------------- /src/main/resources/stdlib/jopenssl18/openssl/digest.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | = $RCSfile$ -- Ruby-space predefined Digest subclasses 3 | 4 | = Info 5 | 'OpenSSL for Ruby 2' project 6 | Copyright (C) 2002 Michal Rokos 7 | All rights reserved. 8 | 9 | = Licence 10 | This program is licenced under the same licence as Ruby. 11 | (See the file 'LICENCE'.) 12 | 13 | = Version 14 | $Id$ 15 | =end 16 | 17 | ## 18 | # Should we care what if somebody require this file directly? 19 | #require 'openssl' 20 | 21 | module OpenSSL 22 | class Digest 23 | # This class is only provided for backwards compatibility. Use OpenSSL::Digest in the future. 24 | class Digest < Digest 25 | def initialize(*args) 26 | # add warning 27 | super(*args) 28 | end 29 | end 30 | end # Digest 31 | end # OpenSSL 32 | 33 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/jopenssl18/openssl/pkcs7.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | = $RCSfile$ -- PKCS7 3 | 4 | = Licence 5 | This program is licenced under the same licence as Ruby. 6 | (See the file 'LICENCE'.) 7 | 8 | = Version 9 | $Id: digest.rb 12148 2007-04-05 05:59:22Z technorama $ 10 | =end 11 | 12 | module OpenSSL 13 | class PKCS7 14 | # This class is only provided for backwards compatibility. Use OpenSSL::PKCS7 in the future. 15 | class PKCS7 < PKCS7 16 | def initialize(*args) 17 | super(*args) 18 | 19 | warn("Warning: OpenSSL::PKCS7::PKCS7 is deprecated after Ruby 1.9; use OpenSSL::PKCS7 instead") 20 | end 21 | end 22 | 23 | end # PKCS7 24 | end # OpenSSL 25 | 26 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/jopenssl18/openssl/ssl.rb: -------------------------------------------------------------------------------- 1 | require 'openssl' 2 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/jopenssl18/openssl/x509.rb: -------------------------------------------------------------------------------- 1 | require 'openssl' 2 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/jopenssl19/openssl.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | = $RCSfile$ -- Loader for all OpenSSL C-space and Ruby-space definitions 3 | 4 | = Info 5 | 'OpenSSL for Ruby 2' project 6 | Copyright (C) 2002 Michal Rokos 7 | All rights reserved. 8 | 9 | = Licence 10 | This program is licenced under the same licence as Ruby. 11 | (See the file 'LICENCE'.) 12 | 13 | = Version 14 | $Id$ 15 | =end 16 | 17 | require 'openssl/bn' 18 | require 'openssl/cipher' 19 | require 'openssl/config' 20 | require 'openssl/digest' 21 | require 'openssl/ssl-internal' 22 | require 'openssl/x509-internal' 23 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/jopenssl19/openssl/bn.rb: -------------------------------------------------------------------------------- 1 | #-- 2 | # 3 | # $RCSfile$ 4 | # 5 | # = Ruby-space definitions that completes C-space funcs for BN 6 | # 7 | # = Info 8 | # 'OpenSSL for Ruby 2' project 9 | # Copyright (C) 2002 Michal Rokos 10 | # All rights reserved. 11 | # 12 | # = Licence 13 | # This program is licenced under the same licence as Ruby. 14 | # (See the file 'LICENCE'.) 15 | # 16 | # = Version 17 | # $Id$ 18 | # 19 | #++ 20 | 21 | ## 22 | # Add double dispatch to Integer 23 | # 24 | class Integer 25 | def to_bn 26 | OpenSSL::BN::new(self) 27 | end 28 | end # Integer 29 | 30 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/jopenssl19/openssl/cipher.rb: -------------------------------------------------------------------------------- 1 | #-- 2 | # 3 | # $RCSfile$ 4 | # 5 | # = Ruby-space predefined Cipher subclasses 6 | # 7 | # = Info 8 | # 'OpenSSL for Ruby 2' project 9 | # Copyright (C) 2002 Michal Rokos 10 | # All rights reserved. 11 | # 12 | # = Licence 13 | # This program is licenced under the same licence as Ruby. 14 | # (See the file 'LICENCE'.) 15 | # 16 | # = Version 17 | # $Id$ 18 | # 19 | #++ 20 | 21 | module OpenSSL 22 | class Cipher 23 | # This class is only provided for backwards compatibility. Use OpenSSL::Cipher in the future. 24 | class Cipher < Cipher 25 | # add warning 26 | end 27 | end # Cipher 28 | end # OpenSSL -------------------------------------------------------------------------------- /src/main/resources/stdlib/jopenssl19/openssl/digest.rb: -------------------------------------------------------------------------------- 1 | #-- 2 | # 3 | # $RCSfile$ 4 | # 5 | # = Ruby-space predefined Digest subclasses 6 | # 7 | # = Info 8 | # 'OpenSSL for Ruby 2' project 9 | # Copyright (C) 2002 Michal Rokos 10 | # All rights reserved. 11 | # 12 | # = Licence 13 | # This program is licenced under the same licence as Ruby. 14 | # (See the file 'LICENCE'.) 15 | # 16 | # = Version 17 | # $Id$ 18 | # 19 | #++ 20 | 21 | module OpenSSL 22 | class Digest 23 | # This class is only provided for backwards compatibility. Use OpenSSL::Digest in the future. 24 | class Digest < Digest 25 | def initialize(*args) 26 | # add warning 27 | super(*args) 28 | end 29 | end 30 | end # Digest 31 | end # OpenSSL 32 | 33 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/jopenssl19/openssl/ssl.rb: -------------------------------------------------------------------------------- 1 | warn 'deprecated openssl/ssl use: require "openssl" instead of "openssl/ssl"' 2 | require 'openssl' 3 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/jopenssl19/openssl/x509.rb: -------------------------------------------------------------------------------- 1 | warn 'deprecated openssl/x509 use: require "openssl" instead of "openssl/x509"' 2 | require 'openssl' 3 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/jopenssl21/openssl.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | = $RCSfile$ -- Loader for all OpenSSL C-space and Ruby-space definitions 3 | 4 | = Info 5 | 'OpenSSL for Ruby 2' project 6 | Copyright (C) 2002 Michal Rokos 7 | All rights reserved. 8 | 9 | = Licence 10 | This program is licenced under the same licence as Ruby. 11 | (See the file 'LICENCE'.) 12 | 13 | = Version 14 | $Id$ 15 | =end 16 | 17 | require 'openssl/bn' 18 | require 'openssl/cipher' 19 | require 'openssl/config' 20 | require 'openssl/digest' 21 | require 'openssl/x509' 22 | require 'openssl/ssl' 23 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/jopenssl21/openssl/bn.rb: -------------------------------------------------------------------------------- 1 | #-- 2 | # 3 | # $RCSfile$ 4 | # 5 | # = Ruby-space definitions that completes C-space funcs for BN 6 | # 7 | # = Info 8 | # 'OpenSSL for Ruby 2' project 9 | # Copyright (C) 2002 Michal Rokos 10 | # All rights reserved. 11 | # 12 | # = Licence 13 | # This program is licenced under the same licence as Ruby. 14 | # (See the file 'LICENCE'.) 15 | # 16 | # = Version 17 | # $Id$ 18 | # 19 | #++ 20 | 21 | ## 22 | # Add double dispatch to Integer 23 | # 24 | class Integer 25 | def to_bn 26 | OpenSSL::BN::new(self) 27 | end 28 | end # Integer 29 | 30 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/jopenssl21/openssl/cipher.rb: -------------------------------------------------------------------------------- 1 | #-- 2 | # 3 | # $RCSfile$ 4 | # 5 | # = Ruby-space predefined Cipher subclasses 6 | # 7 | # = Info 8 | # 'OpenSSL for Ruby 2' project 9 | # Copyright (C) 2002 Michal Rokos 10 | # All rights reserved. 11 | # 12 | # = Licence 13 | # This program is licenced under the same licence as Ruby. 14 | # (See the file 'LICENCE'.) 15 | # 16 | # = Version 17 | # $Id$ 18 | # 19 | #++ 20 | 21 | module OpenSSL 22 | class Cipher 23 | # This class is only provided for backwards compatibility. Use OpenSSL::Cipher in the future. 24 | class Cipher < Cipher 25 | # add warning 26 | end 27 | end # Cipher 28 | end # OpenSSL -------------------------------------------------------------------------------- /src/main/resources/stdlib/jruby/core_ext.rb: -------------------------------------------------------------------------------- 1 | require 'jruby/core_ext/class' 2 | require 'jruby/core_ext/string' 3 | require 'jruby/core_ext/thread' -------------------------------------------------------------------------------- /src/main/resources/stdlib/jruby/core_ext/method.rb: -------------------------------------------------------------------------------- 1 | require 'jruby' 2 | 3 | class Method 4 | def parameters 5 | self_r = JRuby.reference0(self) 6 | method = self_r.get_method 7 | args_ary = [] 8 | 9 | case method 10 | when MethodArgs2 11 | return Helpers.parameter_list_to_parameters(JRuby.runtime, method.parameter_list, true) 12 | else 13 | if method.arity == Arity::OPTIONAL 14 | args_ary << [:rest] 15 | end 16 | end 17 | 18 | args_ary 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/jruby/core_ext/string.rb: -------------------------------------------------------------------------------- 1 | require 'java' 2 | require 'jruby' 3 | 4 | class String 5 | RubyString = org.jruby.RubyString 6 | 7 | # Construct a new string with a buffer of the specified size. The buffer is 8 | # filled with null bytes to start. 9 | # 10 | # May be useful in cases where you know how large a string will grow, and want 11 | # to pre-allocate the buffer for that size. 12 | def self.alloc(size) 13 | RubyString.new_string_light(JRuby.runtime, size) 14 | end 15 | end -------------------------------------------------------------------------------- /src/main/resources/stdlib/jruby/core_ext/thread.rb: -------------------------------------------------------------------------------- 1 | require 'java' 2 | 3 | class Thread 4 | ThreadBean = java.lang.management.ManagementFactory.thread_mx_bean 5 | 6 | # Get true CPU times for the current thread. 7 | def times 8 | cpu = ThreadBean.current_thread_cpu_time 9 | user = ThreadBean.curent_thread_user_time 10 | 11 | cpu = 0 if cpu < 0 12 | user = 0 if user < 0 13 | 14 | system_f = (cpu - user) / 1000000000.0 15 | user_f = user / 1000000000.0 16 | 17 | Struct::Tms.new user_f, system_f, 0.0, 0.0 18 | end 19 | end -------------------------------------------------------------------------------- /src/main/resources/stdlib/jruby/jrubyc.rb: -------------------------------------------------------------------------------- 1 | require 'jruby/compiler' 2 | 3 | # For compatibility with libraries that used it directly in 1.4- 4 | JRubyCompiler = JRuby::Compiler -------------------------------------------------------------------------------- /src/main/resources/stdlib/jruby/profiler/shutdown_hook.rb: -------------------------------------------------------------------------------- 1 | require 'jruby' 2 | 3 | trap 'INT' do 4 | runtime = JRuby.runtime 5 | runtime.thread_service.ruby_thread_map.each do |t, rubythread| 6 | context = JRuby.reference(rubythread).context 7 | runtime.printProfileData(context.profile_collection) 8 | end 9 | exit 10 | end 11 | STDERR.puts "Profiling enabled; ^C shutdown will now dump profile info" 12 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/jruby/synchronized.rb: -------------------------------------------------------------------------------- 1 | require 'jruby' 2 | 3 | module JRuby 4 | # Include into a class to make all of that class's instance methods be 5 | # "synchronized" against the object itself. In Ruby parlance, it is as if 6 | # each method on the class locks against a reentrant, per-object Mutex. 7 | module Synchronized 8 | def self.append_features(cls) 9 | raise TypeError, "#{self} can only be included into classes" unless Class === cls 10 | cls_r = JRuby.reference0(cls) 11 | cls_r.become_synchronized 12 | 13 | super 14 | end 15 | 16 | def self.extend_object(obj) 17 | obj_r = JRuby.reference0(obj) 18 | singleton_class = obj_r.singleton_class 19 | JRuby.reference(singleton_class).become_synchronized 20 | 21 | super 22 | end 23 | end 24 | end -------------------------------------------------------------------------------- /src/main/resources/stdlib/jruby/win32ole/stub.rb: -------------------------------------------------------------------------------- 1 | tried_gem = false 2 | begin 3 | require 'jruby-win32ole' 4 | rescue LoadError 5 | if tried_gem 6 | warn "!!!! Missing jruby-win32ole gem: jruby -S gem install jruby-win32ole" 7 | raise $! 8 | end 9 | require 'rubygems' 10 | begin 11 | gem 'jruby-win32ole' 12 | rescue LoadError 13 | end 14 | tried_gem = true 15 | retry 16 | end 17 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/json/add/bigdecimal.rb: -------------------------------------------------------------------------------- 1 | unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED 2 | require 'json' 3 | end 4 | defined?(::BigDecimal) or require 'bigdecimal' 5 | 6 | class BigDecimal 7 | # Import a JSON Marshalled object. 8 | # 9 | # method used for JSON marshalling support. 10 | def self.json_create(object) 11 | BigDecimal._load object['b'] 12 | end 13 | 14 | # Marshal the object to JSON. 15 | # 16 | # method used for JSON marshalling support. 17 | def as_json(*) 18 | { 19 | JSON.create_id => self.class.name, 20 | 'b' => _dump, 21 | } 22 | end 23 | 24 | # return the JSON value 25 | def to_json(*) 26 | as_json.to_json 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/json/add/complex.rb: -------------------------------------------------------------------------------- 1 | unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED 2 | require 'json' 3 | end 4 | defined?(::Complex) or require 'complex' 5 | 6 | class Complex 7 | def self.json_create(object) 8 | Complex(object['r'], object['i']) 9 | end 10 | 11 | def as_json(*) 12 | { 13 | JSON.create_id => self.class.name, 14 | 'r' => real, 15 | 'i' => imag, 16 | } 17 | end 18 | 19 | def to_json(*) 20 | as_json.to_json 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/json/add/core.rb: -------------------------------------------------------------------------------- 1 | # This file requires the implementations of ruby core's custom objects for 2 | # serialisation/deserialisation. 3 | 4 | require 'json/add/date' 5 | require 'json/add/date_time' 6 | require 'json/add/exception' 7 | require 'json/add/range' 8 | require 'json/add/regexp' 9 | require 'json/add/struct' 10 | require 'json/add/symbol' 11 | require 'json/add/time' 12 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/json/add/date.rb: -------------------------------------------------------------------------------- 1 | unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED 2 | require 'json' 3 | end 4 | require 'date' 5 | 6 | # Date serialization/deserialization 7 | class Date 8 | 9 | # Deserializes JSON string by converting Julian year y, month 10 | # m, day d and Day of Calendar Reform sg to Date. 11 | def self.json_create(object) 12 | civil(*object.values_at('y', 'm', 'd', 'sg')) 13 | end 14 | 15 | alias start sg unless method_defined?(:start) 16 | 17 | # Returns a hash, that will be turned into a JSON object and represent this 18 | # object. 19 | def as_json(*) 20 | { 21 | JSON.create_id => self.class.name, 22 | 'y' => year, 23 | 'm' => month, 24 | 'd' => day, 25 | 'sg' => start, 26 | } 27 | end 28 | 29 | # Stores class name (Date) with Julian year y, month m, day 30 | # d and Day of Calendar Reform sg as JSON string 31 | def to_json(*args) 32 | as_json.to_json(*args) 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/json/add/exception.rb: -------------------------------------------------------------------------------- 1 | unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED 2 | require 'json' 3 | end 4 | 5 | # Exception serialization/deserialization 6 | class Exception 7 | 8 | # Deserializes JSON string by constructing new Exception object with message 9 | # m and backtrace b serialized with to_json 10 | def self.json_create(object) 11 | result = new(object['m']) 12 | result.set_backtrace object['b'] 13 | result 14 | end 15 | 16 | # Returns a hash, that will be turned into a JSON object and represent this 17 | # object. 18 | def as_json(*) 19 | { 20 | JSON.create_id => self.class.name, 21 | 'm' => message, 22 | 'b' => backtrace, 23 | } 24 | end 25 | 26 | # Stores class name (Exception) with message m and backtrace array 27 | # b as JSON string 28 | def to_json(*args) 29 | as_json.to_json(*args) 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/json/add/ostruct.rb: -------------------------------------------------------------------------------- 1 | unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED 2 | require 'json' 3 | end 4 | require 'ostruct' 5 | 6 | # OpenStruct serialization/deserialization 7 | class OpenStruct 8 | 9 | # Deserializes JSON string by constructing new Struct object with values 10 | # v serialized by to_json. 11 | def self.json_create(object) 12 | new(object['t'] || object[:t]) 13 | end 14 | 15 | # Returns a hash, that will be turned into a JSON object and represent this 16 | # object. 17 | def as_json(*) 18 | klass = self.class.name 19 | klass.to_s.empty? and raise JSON::JSONError, "Only named structs are supported!" 20 | { 21 | JSON.create_id => klass, 22 | 't' => table, 23 | } 24 | end 25 | 26 | # Stores class name (OpenStruct) with this struct's values v as a 27 | # JSON string. 28 | def to_json(*args) 29 | as_json.to_json(*args) 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/json/add/range.rb: -------------------------------------------------------------------------------- 1 | unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED 2 | require 'json' 3 | end 4 | 5 | # Range serialization/deserialization 6 | class Range 7 | 8 | # Deserializes JSON string by constructing new Range object with arguments 9 | # a serialized by to_json. 10 | def self.json_create(object) 11 | new(*object['a']) 12 | end 13 | 14 | # Returns a hash, that will be turned into a JSON object and represent this 15 | # object. 16 | def as_json(*) 17 | { 18 | JSON.create_id => self.class.name, 19 | 'a' => [ first, last, exclude_end? ] 20 | } 21 | end 22 | 23 | # Stores class name (Range) with JSON array of arguments a which 24 | # include first (integer), last (integer), and 25 | # exclude_end? (boolean) as JSON string. 26 | def to_json(*args) 27 | as_json.to_json(*args) 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/json/add/rational.rb: -------------------------------------------------------------------------------- 1 | unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED 2 | require 'json' 3 | end 4 | defined?(::Rational) or require 'rational' 5 | 6 | class Rational 7 | def self.json_create(object) 8 | Rational(object['n'], object['d']) 9 | end 10 | 11 | def as_json(*) 12 | { 13 | JSON.create_id => self.class.name, 14 | 'n' => numerator, 15 | 'd' => denominator, 16 | } 17 | end 18 | 19 | def to_json(*) 20 | as_json.to_json 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/json/add/regexp.rb: -------------------------------------------------------------------------------- 1 | unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED 2 | require 'json' 3 | end 4 | 5 | # Regexp serialization/deserialization 6 | class Regexp 7 | 8 | # Deserializes JSON string by constructing new Regexp object with source 9 | # s (Regexp or String) and options o serialized by 10 | # to_json 11 | def self.json_create(object) 12 | new(object['s'], object['o']) 13 | end 14 | 15 | # Returns a hash, that will be turned into a JSON object and represent this 16 | # object. 17 | def as_json(*) 18 | { 19 | JSON.create_id => self.class.name, 20 | 'o' => options, 21 | 's' => source, 22 | } 23 | end 24 | 25 | # Stores class name (Regexp) with options o and source s 26 | # (Regexp or String) as JSON string 27 | def to_json(*) 28 | as_json.to_json 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/json/add/struct.rb: -------------------------------------------------------------------------------- 1 | unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED 2 | require 'json' 3 | end 4 | 5 | # Struct serialization/deserialization 6 | class Struct 7 | 8 | # Deserializes JSON string by constructing new Struct object with values 9 | # v serialized by to_json. 10 | def self.json_create(object) 11 | new(*object['v']) 12 | end 13 | 14 | # Returns a hash, that will be turned into a JSON object and represent this 15 | # object. 16 | def as_json(*) 17 | klass = self.class.name 18 | klass.to_s.empty? and raise JSON::JSONError, "Only named structs are supported!" 19 | { 20 | JSON.create_id => klass, 21 | 'v' => values, 22 | } 23 | end 24 | 25 | # Stores class name (Struct) with Struct values v as a JSON string. 26 | # Only named structs are supported. 27 | def to_json(*args) 28 | as_json.to_json(*args) 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/json/add/symbol.rb: -------------------------------------------------------------------------------- 1 | unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED 2 | require 'json' 3 | end 4 | 5 | # Symbol serialization/deserialization 6 | class Symbol 7 | # Returns a hash, that will be turned into a JSON object and represent this 8 | # object. 9 | def as_json(*) 10 | { 11 | JSON.create_id => self.class.name, 12 | 's' => to_s, 13 | } 14 | end 15 | 16 | # Stores class name (Symbol) with String representation of Symbol as a JSON string. 17 | def to_json(*a) 18 | as_json.to_json(*a) 19 | end 20 | 21 | # Deserializes JSON string by converting the string value stored in the object to a Symbol 22 | def self.json_create(o) 23 | o['s'].to_sym 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/json/ext.rb: -------------------------------------------------------------------------------- 1 | if ENV['SIMPLECOV_COVERAGE'].to_i == 1 2 | require 'simplecov' 3 | SimpleCov.start do 4 | add_filter "/tests/" 5 | end 6 | end 7 | require 'json/common' 8 | 9 | module JSON 10 | # This module holds all the modules/classes that implement JSON's 11 | # functionality as C extensions. 12 | module Ext 13 | require 'json/ext/parser' 14 | require 'json/ext/generator' 15 | $DEBUG and warn "Using Ext extension for JSON." 16 | JSON.parser = Parser 17 | JSON.generator = Generator 18 | end 19 | 20 | JSON_LOADED = true unless defined?(::JSON::JSON_LOADED) 21 | end 22 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/json/ext/generator.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/json/ext/generator.jar -------------------------------------------------------------------------------- /src/main/resources/stdlib/json/ext/parser.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/json/ext/parser.jar -------------------------------------------------------------------------------- /src/main/resources/stdlib/json/pure.rb: -------------------------------------------------------------------------------- 1 | if ENV['SIMPLECOV_COVERAGE'].to_i == 1 2 | require 'simplecov' 3 | SimpleCov.start do 4 | add_filter "/tests/" 5 | end 6 | end 7 | require 'json/common' 8 | require 'json/pure/parser' 9 | require 'json/pure/generator' 10 | 11 | module JSON 12 | # This module holds all the modules/classes that implement JSON's 13 | # functionality in pure ruby. 14 | module Pure 15 | $DEBUG and warn "Using Pure library for JSON." 16 | JSON.parser = Parser 17 | JSON.generator = Generator 18 | end 19 | 20 | JSON_LOADED = true unless defined?(::JSON::JSON_LOADED) 21 | end 22 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/json/version.rb: -------------------------------------------------------------------------------- 1 | module JSON 2 | # JSON version 3 | VERSION = '1.8.0' 4 | VERSION_ARRAY = VERSION.split(/\./).map { |x| x.to_i } # :nodoc: 5 | VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc: 6 | VERSION_MINOR = VERSION_ARRAY[1] # :nodoc: 7 | VERSION_BUILD = VERSION_ARRAY[2] # :nodoc: 8 | end 9 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/maven.rb: -------------------------------------------------------------------------------- 1 | module Maven 2 | 3 | VERSION = '3.3.3'.freeze 4 | 5 | def self.exec( *args ) 6 | if args.member?( '-Dverbose=true' ) || args.member?( '-Dverbose' ) || args.member?( '-X' ) 7 | puts "mvn #{args.join(' ')}" 8 | end 9 | system "#{Maven.bin( 'mvn' )} #{args.join( ' ' )}" 10 | end 11 | 12 | def self.home 13 | @home ||= begin 14 | dir = File.dirname( File.expand_path( __FILE__ ) ) 15 | File.expand_path( "#{dir}/../maven-home" ) 16 | end 17 | end 18 | 19 | def self.bin( file = nil ) 20 | if file 21 | File.join( path( 'bin' ), file ) 22 | else 23 | path( 'bin' ) 24 | end 25 | end 26 | 27 | def self.lib 28 | path( 'lib' ) 29 | end 30 | 31 | def self.conf 32 | path( 'conf' ) 33 | end 34 | 35 | def self.boot 36 | path( 'boot' ) 37 | end 38 | 39 | private 40 | 41 | def self.path( name ) 42 | File.join( home, name ) 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/maven/ruby/version.rb: -------------------------------------------------------------------------------- 1 | module Maven 2 | module Ruby 3 | VERSION = '3.3.3'.freeze 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/minitest/autorun.rb: -------------------------------------------------------------------------------- 1 | begin 2 | require "rubygems" 3 | gem "minitest" 4 | rescue Gem::LoadError 5 | # do nothing 6 | end 7 | 8 | require "minitest" 9 | require "minitest/spec" 10 | require "minitest/mock" 11 | 12 | Minitest.autorun 13 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/minitest/hell.rb: -------------------------------------------------------------------------------- 1 | require "minitest/parallel" 2 | 3 | class Minitest::Test 4 | class << self 5 | alias :old_test_order :test_order # :nodoc: 6 | 7 | def test_order # :nodoc: 8 | :parallel 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/minitest/pride.rb: -------------------------------------------------------------------------------- 1 | require "minitest" 2 | 3 | Minitest.load_plugins 4 | Minitest::PrideIO.pride! 5 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/mkmf.rb: -------------------------------------------------------------------------------- 1 | raise NotImplementedError, "C extensions are not supported" 2 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/net/http/backward.rb: -------------------------------------------------------------------------------- 1 | # for backward compatibility 2 | 3 | # :enddoc: 4 | 5 | class Net::HTTP 6 | ProxyMod = ProxyDelta 7 | end 8 | 9 | module Net 10 | HTTPSession = Net::HTTP 11 | end 12 | 13 | module Net::NetPrivate 14 | HTTPRequest = ::Net::HTTPRequest 15 | end 16 | 17 | Net::HTTPInformationCode = Net::HTTPInformation 18 | Net::HTTPSuccessCode = Net::HTTPSuccess 19 | Net::HTTPRedirectionCode = Net::HTTPRedirection 20 | Net::HTTPRetriableCode = Net::HTTPRedirection 21 | Net::HTTPClientErrorCode = Net::HTTPClientError 22 | Net::HTTPFatalErrorCode = Net::HTTPClientError 23 | Net::HTTPServerErrorCode = Net::HTTPServerError 24 | Net::HTTPResponceReceiver = Net::HTTPResponse 25 | 26 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/net/http/exceptions.rb: -------------------------------------------------------------------------------- 1 | # Net::HTTP exception class. 2 | # You cannot use Net::HTTPExceptions directly; instead, you must use 3 | # its subclasses. 4 | module Net::HTTPExceptions 5 | def initialize(msg, res) #:nodoc: 6 | super msg 7 | @response = res 8 | end 9 | attr_reader :response 10 | alias data response #:nodoc: obsolete 11 | end 12 | class Net::HTTPError < Net::ProtocolError 13 | include Net::HTTPExceptions 14 | end 15 | class Net::HTTPRetriableError < Net::ProtoRetriableError 16 | include Net::HTTPExceptions 17 | end 18 | class Net::HTTPServerException < Net::ProtoServerError 19 | # We cannot use the name "HTTPServerError", it is the name of the response. 20 | include Net::HTTPExceptions 21 | end 22 | class Net::HTTPFatalError < Net::ProtoFatalError 23 | include Net::HTTPExceptions 24 | end 25 | 26 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/net/http/proxy_delta.rb: -------------------------------------------------------------------------------- 1 | module Net::HTTP::ProxyDelta #:nodoc: internal use only 2 | private 3 | 4 | def conn_address 5 | proxy_address() 6 | end 7 | 8 | def conn_port 9 | proxy_port() 10 | end 11 | 12 | def edit_path(path) 13 | use_ssl? ? path : "http://#{addr_port()}#{path}" 14 | end 15 | end 16 | 17 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/net/http/request.rb: -------------------------------------------------------------------------------- 1 | # HTTP request class. 2 | # This class wraps together the request header and the request path. 3 | # You cannot use this class directly. Instead, you should use one of its 4 | # subclasses: Net::HTTP::Get, Net::HTTP::Post, Net::HTTP::Head. 5 | # 6 | class Net::HTTPRequest < Net::HTTPGenericRequest 7 | # Creates an HTTP request object for +path+. 8 | # 9 | # +initheader+ are the default headers to use. Net::HTTP adds 10 | # Accept-Encoding to enable compression of the response body unless 11 | # Accept-Encoding or Range are supplied in +initheader+. 12 | 13 | def initialize(path, initheader = nil) 14 | super self.class::METHOD, 15 | self.class::REQUEST_HAS_BODY, 16 | self.class::RESPONSE_HAS_BODY, 17 | path, initheader 18 | end 19 | end 20 | 21 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/net/https.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | 3 | = net/https -- SSL/TLS enhancement for Net::HTTP. 4 | 5 | This file has been merged with net/http. There is no longer any need to 6 | require 'net/https' to use HTTPS. 7 | 8 | See Net::HTTP for details on how to make HTTPS connections. 9 | 10 | == Info 11 | 'OpenSSL for Ruby 2' project 12 | Copyright (C) 2001 GOTOU Yuuzou 13 | All rights reserved. 14 | 15 | == Licence 16 | This program is licenced under the same licence as Ruby. 17 | (See the file 'LICENCE'.) 18 | 19 | =end 20 | 21 | require 'net/http' 22 | require 'openssl' 23 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/openssl.rb: -------------------------------------------------------------------------------- 1 | require 'jopenssl/load' -------------------------------------------------------------------------------- /src/main/resources/stdlib/openssl/bn.rb: -------------------------------------------------------------------------------- 1 | if RUBY_VERSION >= '2.1.0' 2 | load('jopenssl21/openssl/bn.rb') 3 | elsif RUBY_VERSION >= '1.9.0' 4 | load('jopenssl19/openssl/bn.rb') 5 | else 6 | load('jopenssl18/openssl/bn.rb') 7 | end 8 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/openssl/buffering.rb: -------------------------------------------------------------------------------- 1 | if RUBY_VERSION >= '2.1.0' 2 | load('jopenssl21/openssl/buffering.rb') 3 | elsif RUBY_VERSION >= '1.9.0' 4 | load('jopenssl19/openssl/buffering.rb') 5 | else 6 | load('jopenssl18/openssl/buffering.rb') 7 | end 8 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/openssl/cipher.rb: -------------------------------------------------------------------------------- 1 | if RUBY_VERSION >= '2.1.0' 2 | load('jopenssl21/openssl/cipher.rb') 3 | elsif RUBY_VERSION >= '1.9.0' 4 | load('jopenssl19/openssl/cipher.rb') 5 | else 6 | load('jopenssl18/openssl/cipher.rb') 7 | end 8 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/openssl/config.rb: -------------------------------------------------------------------------------- 1 | if RUBY_VERSION >= '2.1.0' 2 | load('jopenssl21/openssl/config.rb') 3 | elsif RUBY_VERSION >= '1.9.0' 4 | load('jopenssl19/openssl/config.rb') 5 | else 6 | load('jopenssl18/openssl/config.rb') 7 | end 8 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/openssl/digest.rb: -------------------------------------------------------------------------------- 1 | if RUBY_VERSION >= '2.1.0' 2 | load('jopenssl21/openssl/digest.rb') 3 | elsif RUBY_VERSION >= '1.9.0' 4 | load('jopenssl19/openssl/digest.rb') 5 | else 6 | load('jopenssl18/openssl/digest.rb') 7 | end 8 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/openssl/pkcs7.rb: -------------------------------------------------------------------------------- 1 | if RUBY_VERSION >= '2.1.0' 2 | raise LoadError, "no such library in 2.1: openssl/pkcs7" 3 | elsif RUBY_VERSION >= '1.9.0' 4 | raise LoadError, "no such library in 1.9: openssl/pkcs7" 5 | else 6 | load('jopenssl18/openssl/pkcs7.rb') 7 | end 8 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/openssl/ssl-internal.rb: -------------------------------------------------------------------------------- 1 | if RUBY_VERSION >= '2.1.0' 2 | raise LoadError, "no such library in 2.1: openssl/ssl-internal.rb" 3 | elsif RUBY_VERSION >= '1.9.0' 4 | load('jopenssl19/openssl/ssl-internal.rb') 5 | else 6 | load('jopenssl18/openssl/ssl-internal.rb') 7 | end 8 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/openssl/ssl.rb: -------------------------------------------------------------------------------- 1 | if RUBY_VERSION >= '2.1.0' 2 | load('jopenssl21/openssl/ssl.rb') 3 | elsif RUBY_VERSION >= '1.9.0' 4 | load('jopenssl19/openssl/ssl.rb') 5 | else 6 | load('jopenssl18/openssl/ssl.rb') 7 | end 8 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/openssl/x509-internal.rb: -------------------------------------------------------------------------------- 1 | if RUBY_VERSION >= '2.1.0' 2 | raise LoadError, "no such library in 2.1: openssl/x509-internal.rb" 3 | elsif RUBY_VERSION >= '1.9.0' 4 | load('jopenssl19/openssl/x509-internal.rb') 5 | else 6 | load('jopenssl18/openssl/x509-internal.rb') 7 | end 8 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/openssl/x509.rb: -------------------------------------------------------------------------------- 1 | if RUBY_VERSION >= '2.1.0' 2 | load('jopenssl21/openssl/x509.rb') 3 | elsif RUBY_VERSION >= '1.9.0' 4 | load('jopenssl19/openssl/x509.rb') 5 | else 6 | load('jopenssl18/openssl/x509.rb') 7 | end 8 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/optionparser.rb: -------------------------------------------------------------------------------- 1 | require_relative 'optparse' 2 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/optparse/date.rb: -------------------------------------------------------------------------------- 1 | require 'optparse' 2 | require 'date' 3 | 4 | OptionParser.accept(DateTime) do |s,| 5 | begin 6 | DateTime.parse(s) if s 7 | rescue ArgumentError 8 | raise OptionParser::InvalidArgument, s 9 | end 10 | end 11 | OptionParser.accept(Date) do |s,| 12 | begin 13 | Date.parse(s) if s 14 | rescue ArgumentError 15 | raise OptionParser::InvalidArgument, s 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/optparse/shellwords.rb: -------------------------------------------------------------------------------- 1 | # -*- ruby -*- 2 | 3 | require 'shellwords' 4 | require 'optparse' 5 | 6 | OptionParser.accept(Shellwords) {|s,| Shellwords.shellwords(s)} 7 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/optparse/time.rb: -------------------------------------------------------------------------------- 1 | require 'optparse' 2 | require 'time' 3 | 4 | OptionParser.accept(Time) do |s,| 5 | begin 6 | (Time.httpdate(s) rescue Time.parse(s)) if s 7 | rescue 8 | raise OptionParser::InvalidArgument, s 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/optparse/uri.rb: -------------------------------------------------------------------------------- 1 | # -*- ruby -*- 2 | 3 | require 'optparse' 4 | require 'uri' 5 | 6 | OptionParser.accept(URI) {|s,| URI.parse(s) if s} 7 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/org/bouncycastle/bcpkix-jdk15on/1.50/bcpkix-jdk15on-1.50.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/org/bouncycastle/bcpkix-jdk15on/1.50/bcpkix-jdk15on-1.50.jar -------------------------------------------------------------------------------- /src/main/resources/stdlib/org/bouncycastle/bcprov-jdk15on/1.50/bcprov-jdk15on-1.50.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/org/bouncycastle/bcprov-jdk15on/1.50/bcprov-jdk15on-1.50.jar -------------------------------------------------------------------------------- /src/main/resources/stdlib/org/yaml/snakeyaml/1.14/snakeyaml-1.14.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/org/yaml/snakeyaml/1.14/snakeyaml-1.14.jar -------------------------------------------------------------------------------- /src/main/resources/stdlib/org/yaml/snakeyaml/maven-metadata-local.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.yaml 4 | snakeyaml 5 | 6 | 1.14 7 | 8 | 1.14 9 | 10 | 20150721172742 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/power_assert/version.rb: -------------------------------------------------------------------------------- 1 | module PowerAssert 2 | VERSION = "0.2.3" 3 | end 4 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/profile.rb: -------------------------------------------------------------------------------- 1 | require 'profiler' 2 | 3 | # Commented out since JRuby doesn't have RubyVM namespace. 4 | # JRuby will warn to pass --debug for equivalent functionality. 5 | #RubyVM::InstructionSequence.compile_option = { 6 | # :trace_instruction => true, 7 | # :specialized_instruction => false 8 | #} 9 | END { 10 | Profiler__::print_profile(STDERR) 11 | } 12 | Profiler__::start_profile 13 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/psych.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/psych.jar -------------------------------------------------------------------------------- /src/main/resources/stdlib/psych/core_ext.rb: -------------------------------------------------------------------------------- 1 | class Object 2 | def self.yaml_tag url 3 | Psych.add_tag(url, self) 4 | end 5 | 6 | # FIXME: rename this to "to_yaml" when syck is removed 7 | 8 | ### 9 | # call-seq: to_yaml(options = {}) 10 | # 11 | # Convert an object to YAML. See Psych.dump for more information on the 12 | # available +options+. 13 | def psych_to_yaml options = {} 14 | Psych.dump self, options 15 | end 16 | remove_method :to_yaml rescue nil 17 | alias :to_yaml :psych_to_yaml 18 | end 19 | 20 | class Module 21 | def psych_yaml_as url 22 | return if caller[0].end_with?('rubytypes.rb') 23 | if $VERBOSE 24 | warn "#{caller[0]}: yaml_as is deprecated, please use yaml_tag" 25 | end 26 | Psych.add_tag(url, self) 27 | end 28 | 29 | remove_method :yaml_as rescue nil 30 | alias :yaml_as :psych_yaml_as 31 | end 32 | 33 | if defined?(::IRB) 34 | require 'psych/y' 35 | end 36 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/psych/exception.rb: -------------------------------------------------------------------------------- 1 | module Psych 2 | class Exception < RuntimeError 3 | end 4 | 5 | class BadAlias < Exception 6 | end 7 | 8 | class DisallowedClass < Exception 9 | def initialize klass_name 10 | super "Tried to load unspecified class: #{klass_name}" 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/psych/handlers/document_stream.rb: -------------------------------------------------------------------------------- 1 | require 'psych/tree_builder' 2 | 3 | module Psych 4 | module Handlers 5 | class DocumentStream < Psych::TreeBuilder # :nodoc: 6 | def initialize &block 7 | super 8 | @block = block 9 | end 10 | 11 | def start_document version, tag_directives, implicit 12 | n = Nodes::Document.new version, tag_directives, implicit 13 | push n 14 | end 15 | 16 | def end_document implicit_end = !streaming? 17 | @last.implicit_end = implicit_end 18 | @block.call pop 19 | end 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/psych/handlers/recorder.rb: -------------------------------------------------------------------------------- 1 | require 'psych/handler' 2 | 3 | module Psych 4 | module Handlers 5 | ### 6 | # This handler will capture an event and record the event. Recorder events 7 | # are available vial Psych::Handlers::Recorder#events. 8 | # 9 | # For example: 10 | # 11 | # recorder = Psych::Handlers::Recorder.new 12 | # parser = Psych::Parser.new recorder 13 | # parser.parse '--- foo' 14 | # 15 | # recorder.events # => [list of events] 16 | # 17 | # # Replay the events 18 | # 19 | # emitter = Psych::Emitter.new $stdout 20 | # recorder.events.each do |m, args| 21 | # emitter.send m, *args 22 | # end 23 | 24 | class Recorder < Psych::Handler 25 | attr_reader :events 26 | 27 | def initialize 28 | @events = [] 29 | super 30 | end 31 | 32 | EVENTS.each do |event| 33 | define_method event do |*args| 34 | @events << [event, args] 35 | end 36 | end 37 | end 38 | end 39 | end 40 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/psych/json/ruby_events.rb: -------------------------------------------------------------------------------- 1 | module Psych 2 | module JSON 3 | module RubyEvents # :nodoc: 4 | def visit_Time o 5 | formatted = format_time o 6 | @emitter.scalar formatted, nil, nil, false, true, Nodes::Scalar::DOUBLE_QUOTED 7 | end 8 | 9 | def visit_DateTime o 10 | visit_Time o.to_time 11 | end 12 | 13 | def visit_String o 14 | @emitter.scalar o.to_s, nil, nil, false, true, Nodes::Scalar::DOUBLE_QUOTED 15 | end 16 | alias :visit_Symbol :visit_String 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/psych/json/stream.rb: -------------------------------------------------------------------------------- 1 | require 'psych/json/ruby_events' 2 | require 'psych/json/yaml_events' 3 | 4 | module Psych 5 | module JSON 6 | class Stream < Psych::Visitors::JSONTree 7 | include Psych::JSON::RubyEvents 8 | include Psych::Streaming 9 | extend Psych::Streaming::ClassMethods 10 | 11 | class Emitter < Psych::Stream::Emitter # :nodoc: 12 | include Psych::JSON::YAMLEvents 13 | end 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/psych/json/tree_builder.rb: -------------------------------------------------------------------------------- 1 | require 'psych/json/yaml_events' 2 | 3 | module Psych 4 | module JSON 5 | ### 6 | # Psych::JSON::TreeBuilder is an event based AST builder. Events are sent 7 | # to an instance of Psych::JSON::TreeBuilder and a JSON AST is constructed. 8 | class TreeBuilder < Psych::TreeBuilder 9 | include Psych::JSON::YAMLEvents 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/psych/json/yaml_events.rb: -------------------------------------------------------------------------------- 1 | module Psych 2 | module JSON 3 | module YAMLEvents # :nodoc: 4 | def start_document version, tag_directives, implicit 5 | super(version, tag_directives, !streaming?) 6 | end 7 | 8 | def end_document implicit_end = !streaming? 9 | super(implicit_end) 10 | end 11 | 12 | def start_mapping anchor, tag, implicit, style 13 | super(anchor, nil, true, Nodes::Mapping::FLOW) 14 | end 15 | 16 | def start_sequence anchor, tag, implicit, style 17 | super(anchor, nil, true, Nodes::Sequence::FLOW) 18 | end 19 | 20 | def scalar value, anchor, tag, plain, quoted, style 21 | if "tag:yaml.org,2002:null" == tag 22 | super('null', nil, nil, true, false, Nodes::Scalar::PLAIN) 23 | else 24 | super 25 | end 26 | end 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/psych/nodes/alias.rb: -------------------------------------------------------------------------------- 1 | module Psych 2 | module Nodes 3 | ### 4 | # This class represents a {YAML Alias}[http://yaml.org/spec/1.1/#alias]. 5 | # It points to an +anchor+. 6 | # 7 | # A Psych::Nodes::Alias is a terminal node and may have no children. 8 | class Alias < Psych::Nodes::Node 9 | # The anchor this alias links to 10 | attr_accessor :anchor 11 | 12 | # Create a new Alias that points to an +anchor+ 13 | def initialize anchor 14 | @anchor = anchor 15 | end 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/psych/omap.rb: -------------------------------------------------------------------------------- 1 | module Psych 2 | class Omap < ::Hash 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/psych/set.rb: -------------------------------------------------------------------------------- 1 | module Psych 2 | class Set < ::Hash 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/psych/stream.rb: -------------------------------------------------------------------------------- 1 | module Psych 2 | ### 3 | # Psych::Stream is a streaming YAML emitter. It will not buffer your YAML, 4 | # but send it straight to an IO. 5 | # 6 | # Here is an example use: 7 | # 8 | # stream = Psych::Stream.new($stdout) 9 | # stream.start 10 | # stream.push({:foo => 'bar'}) 11 | # stream.finish 12 | # 13 | # YAML will be immediately emitted to $stdout with no buffering. 14 | # 15 | # Psych::Stream#start will take a block and ensure that Psych::Stream#finish 16 | # is called, so you can do this form: 17 | # 18 | # stream = Psych::Stream.new($stdout) 19 | # stream.start do |em| 20 | # em.push(:foo => 'bar') 21 | # end 22 | # 23 | class Stream < Psych::Visitors::YAMLTree 24 | class Emitter < Psych::Emitter # :nodoc: 25 | def end_document implicit_end = !streaming? 26 | super 27 | end 28 | 29 | def streaming? 30 | true 31 | end 32 | end 33 | 34 | include Psych::Streaming 35 | extend Psych::Streaming::ClassMethods 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/psych/streaming.rb: -------------------------------------------------------------------------------- 1 | module Psych 2 | module Streaming 3 | module ClassMethods 4 | ### 5 | # Create a new streaming emitter. Emitter will print to +io+. See 6 | # Psych::Stream for an example. 7 | def new io 8 | emitter = const_get(:Emitter).new(io) 9 | class_loader = ClassLoader.new 10 | ss = ScalarScanner.new class_loader 11 | super(emitter, ss, {}) 12 | end 13 | end 14 | 15 | ### 16 | # Start streaming using +encoding+ 17 | def start encoding = Nodes::Stream::UTF8 18 | super.tap { yield self if block_given? } 19 | ensure 20 | finish if block_given? 21 | end 22 | 23 | private 24 | def register target, obj 25 | end 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/psych/syntax_error.rb: -------------------------------------------------------------------------------- 1 | require 'psych/exception' 2 | 3 | module Psych 4 | class SyntaxError < Psych::Exception 5 | attr_reader :file, :line, :column, :offset, :problem, :context 6 | 7 | def initialize file, line, col, offset, problem, context 8 | err = [problem, context].compact.join ' ' 9 | filename = file || '' 10 | message = "(%s): %s at line %d column %d" % [filename, err, line, col] 11 | 12 | @file = file 13 | @line = line 14 | @column = col 15 | @offset = offset 16 | @problem = problem 17 | @context = context 18 | super(message) 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/psych/versions.rb: -------------------------------------------------------------------------------- 1 | module Psych 2 | DEFAULT_SNAKEYAML_VERSION = '1.14'.freeze 3 | end 4 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/psych/visitors.rb: -------------------------------------------------------------------------------- 1 | require 'psych/visitors/visitor' 2 | require 'psych/visitors/to_ruby' 3 | require 'psych/visitors/emitter' 4 | require 'psych/visitors/yaml_tree' 5 | require 'psych/visitors/json_tree' 6 | require 'psych/visitors/depth_first' 7 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/psych/visitors/depth_first.rb: -------------------------------------------------------------------------------- 1 | module Psych 2 | module Visitors 3 | class DepthFirst < Psych::Visitors::Visitor 4 | def initialize block 5 | @block = block 6 | end 7 | 8 | private 9 | 10 | def nary o 11 | o.children.each { |x| visit x } 12 | @block.call o 13 | end 14 | alias :visit_Psych_Nodes_Stream :nary 15 | alias :visit_Psych_Nodes_Document :nary 16 | alias :visit_Psych_Nodes_Sequence :nary 17 | alias :visit_Psych_Nodes_Mapping :nary 18 | 19 | def terminal o 20 | @block.call o 21 | end 22 | alias :visit_Psych_Nodes_Scalar :terminal 23 | alias :visit_Psych_Nodes_Alias :terminal 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/psych/visitors/json_tree.rb: -------------------------------------------------------------------------------- 1 | require 'psych/json/ruby_events' 2 | 3 | module Psych 4 | module Visitors 5 | class JSONTree < YAMLTree 6 | include Psych::JSON::RubyEvents 7 | 8 | def self.create options = {} 9 | emitter = Psych::JSON::TreeBuilder.new 10 | class_loader = ClassLoader.new 11 | ss = ScalarScanner.new class_loader 12 | new(emitter, ss, options) 13 | end 14 | 15 | def accept target 16 | if target.respond_to?(:encode_with) 17 | dump_coder target 18 | else 19 | send(@dispatch_cache[target.class], target) 20 | end 21 | end 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/psych/visitors/visitor.rb: -------------------------------------------------------------------------------- 1 | module Psych 2 | module Visitors 3 | class Visitor 4 | def accept target 5 | visit target 6 | end 7 | 8 | private 9 | 10 | DISPATCH = Hash.new do |hash, klass| 11 | hash[klass] = "visit_#{klass.name.gsub('::', '_')}" 12 | end 13 | 14 | def visit target 15 | send DISPATCH[target.class], target 16 | end 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/psych/y.rb: -------------------------------------------------------------------------------- 1 | module Kernel 2 | ### 3 | # An alias for Psych.dump_stream meant to be used with IRB. 4 | def y *objects 5 | puts Psych.dump_stream(*objects) 6 | end 7 | private :y 8 | end 9 | 10 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/psych_jars.rb: -------------------------------------------------------------------------------- 1 | require 'psych/versions' 2 | require 'psych.jar' 3 | 4 | require 'jar-dependencies' 5 | require_jar('org.yaml', 'snakeyaml', Psych::DEFAULT_SNAKEYAML_VERSION) 6 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rake/backtrace.rb: -------------------------------------------------------------------------------- 1 | module Rake 2 | module Backtrace 3 | SYS_KEYS = RbConfig::CONFIG.keys.grep(/(prefix|libdir)/) 4 | SYS_PATHS = RbConfig::CONFIG.values_at(*SYS_KEYS).uniq + 5 | [ File.join(File.dirname(__FILE__), "..") ] 6 | 7 | SUPPRESSED_PATHS = SYS_PATHS. 8 | map { |s| s.gsub("\\", "/") }. 9 | map { |f| File.expand_path(f) }. 10 | reject { |s| s.nil? || s =~ /^ *$/ } 11 | SUPPRESSED_PATHS_RE = SUPPRESSED_PATHS.map { |f| Regexp.quote(f) }.join("|") 12 | SUPPRESS_PATTERN = %r!(\A(#{SUPPRESSED_PATHS_RE})|bin/rake:\d+)!i 13 | 14 | def self.collapse(backtrace) 15 | pattern = Rake.application.options.suppress_backtrace_pattern || 16 | SUPPRESS_PATTERN 17 | backtrace.reject { |elem| elem =~ pattern } 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rake/cloneable.rb: -------------------------------------------------------------------------------- 1 | module Rake 2 | # ########################################################################## 3 | # Mixin for creating easily cloned objects. 4 | # 5 | module Cloneable 6 | # The hook that invoked by 'clone' and 'dup' methods. 7 | def initialize_copy(source) 8 | super 9 | source.instance_variables.each do |var| 10 | src_value = source.instance_variable_get(var) 11 | value = src_value.clone rescue src_value 12 | instance_variable_set(var, value) 13 | end 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rake/contrib/compositepublisher.rb: -------------------------------------------------------------------------------- 1 | module Rake 2 | 3 | # Manage several publishers as a single entity. 4 | class CompositePublisher 5 | def initialize 6 | @publishers = [] 7 | end 8 | 9 | # Add a publisher to the composite. 10 | def add(pub) 11 | @publishers << pub 12 | end 13 | 14 | # Upload all the individual publishers. 15 | def upload 16 | @publishers.each { |p| p.upload } 17 | end 18 | end 19 | 20 | end 21 | 22 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rake/contrib/rubyforgepublisher.rb: -------------------------------------------------------------------------------- 1 | require 'rake/contrib/sshpublisher' 2 | 3 | module Rake 4 | 5 | class RubyForgePublisher < SshDirPublisher 6 | attr_reader :project, :proj_id, :user 7 | 8 | def initialize(projname, user) 9 | super( 10 | "#{user}@rubyforge.org", 11 | "/var/www/gforge-projects/#{projname}", 12 | "html") 13 | end 14 | end 15 | 16 | end 17 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rake/contrib/sys.rb: -------------------------------------------------------------------------------- 1 | fail "ERROR: 'rake/contrib/sys' is obsolete and no longer supported. " + 2 | "Use 'FileUtils' instead." 3 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rake/default_loader.rb: -------------------------------------------------------------------------------- 1 | module Rake 2 | 3 | # Default Rakefile loader used by +import+. 4 | class DefaultLoader 5 | def load(fn) 6 | Rake.load_rakefile(File.expand_path(fn)) 7 | end 8 | end 9 | 10 | end 11 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rake/early_time.rb: -------------------------------------------------------------------------------- 1 | module Rake 2 | 3 | # EarlyTime is a fake timestamp that occurs _before_ any other time value. 4 | class EarlyTime 5 | include Comparable 6 | include Singleton 7 | 8 | def <=>(other) 9 | -1 10 | end 11 | 12 | def to_s 13 | "" 14 | end 15 | end 16 | 17 | EARLY = EarlyTime.instance 18 | end 19 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rake/ext/core.rb: -------------------------------------------------------------------------------- 1 | ###################################################################### 2 | # Core extension library 3 | # 4 | class Module 5 | # Check for an existing method in the current class before extending. IF 6 | # the method already exists, then a warning is printed and the extension is 7 | # not added. Otherwise the block is yielded and any definitions in the 8 | # block will take effect. 9 | # 10 | # Usage: 11 | # 12 | # class String 13 | # rake_extension("xyz") do 14 | # def xyz 15 | # ... 16 | # end 17 | # end 18 | # end 19 | # 20 | def rake_extension(method) 21 | if method_defined?(method) 22 | $stderr.puts "WARNING: Possible conflict with Rake extension: " + 23 | "#{self}##{method} already exists" 24 | else 25 | yield 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rake/ext/module.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rake/ext/module.rb -------------------------------------------------------------------------------- /src/main/resources/stdlib/rake/ext/time.rb: -------------------------------------------------------------------------------- 1 | #-- 2 | # Extensions to time to allow comparisons with an early time class. 3 | 4 | require 'rake/early_time' 5 | 6 | class Time 7 | alias rake_original_time_compare :<=> 8 | def <=>(other) 9 | if Rake::EarlyTime === other 10 | - other.<=>(self) 11 | else 12 | rake_original_time_compare(other) 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rake/file_creation_task.rb: -------------------------------------------------------------------------------- 1 | require 'rake/file_task' 2 | require 'rake/early_time' 3 | 4 | module Rake 5 | 6 | # A FileCreationTask is a file task that when used as a dependency will be 7 | # needed if and only if the file has not been created. Once created, it is 8 | # not re-triggered if any of its dependencies are newer, nor does trigger 9 | # any rebuilds of tasks that depend on it whenever it is updated. 10 | # 11 | class FileCreationTask < FileTask 12 | # Is this file task needed? Yes if it doesn't exist. 13 | def needed? 14 | ! File.exist?(name) 15 | end 16 | 17 | # Time stamp for file creation task. This time stamp is earlier 18 | # than any other time stamp. 19 | def timestamp 20 | Rake::EARLY 21 | end 22 | end 23 | 24 | end 25 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rake/gempackagetask.rb: -------------------------------------------------------------------------------- 1 | fail "ERROR: 'rake/gempackagetask' is obsolete and no longer supported. " + 2 | "Use 'rubygems/packagetask' instead." 3 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rake/invocation_exception_mixin.rb: -------------------------------------------------------------------------------- 1 | module Rake 2 | module InvocationExceptionMixin 3 | # Return the invocation chain (list of Rake tasks) that were in 4 | # effect when this exception was detected by rake. May be null if 5 | # no tasks were active. 6 | def chain 7 | @rake_invocation_chain ||= nil 8 | end 9 | 10 | # Set the invocation chain in effect when this exception was 11 | # detected. 12 | def chain=(value) 13 | @rake_invocation_chain = value 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rake/multi_task.rb: -------------------------------------------------------------------------------- 1 | module Rake 2 | 3 | # Same as a regular task, but the immediate prerequisites are done in 4 | # parallel using Ruby threads. 5 | # 6 | class MultiTask < Task 7 | private 8 | def invoke_prerequisites(task_args, invocation_chain) # :nodoc: 9 | invoke_prerequisites_concurrently(task_args, invocation_chain) 10 | end 11 | end 12 | 13 | end 14 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rake/name_space.rb: -------------------------------------------------------------------------------- 1 | module Rake 2 | 3 | # The NameSpace class will lookup task names in the the scope 4 | # defined by a +namespace+ command. 5 | # 6 | class NameSpace 7 | 8 | # Create a namespace lookup object using the given task manager 9 | # and the list of scopes. 10 | def initialize(task_manager, scope_list) 11 | @task_manager = task_manager 12 | @scope = scope_list.dup 13 | end 14 | 15 | # Lookup a task named +name+ in the namespace. 16 | def [](name) 17 | @task_manager.lookup(name, @scope) 18 | end 19 | 20 | # Return the list of tasks defined in this and nested namespaces. 21 | def tasks 22 | @task_manager.tasks_in_scope(@scope) 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rake/pathmap.rb: -------------------------------------------------------------------------------- 1 | require 'rake/ext/string' 2 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rake/phony.rb: -------------------------------------------------------------------------------- 1 | # Defines a :phony task that you can use as a dependency. This allows 2 | # file-based tasks to use non-file-based tasks as prerequisites 3 | # without forcing them to rebuild. 4 | # 5 | # See FileTask#out_of_date? and Task#timestamp for more info. 6 | 7 | require 'rake' 8 | 9 | task :phony 10 | 11 | Rake::Task[:phony].tap do |task| 12 | def task.timestamp # :nodoc: 13 | Time.at 0 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rake/private_reader.rb: -------------------------------------------------------------------------------- 1 | module Rake 2 | 3 | # Include PrivateReader to use +private_reader+. 4 | module PrivateReader # :nodoc: all 5 | 6 | def self.included(base) 7 | base.extend(ClassMethods) 8 | end 9 | 10 | module ClassMethods 11 | 12 | # Declare a list of private accessors 13 | def private_reader(*names) 14 | attr_reader(*names) 15 | private(*names) 16 | end 17 | end 18 | 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rake/pseudo_status.rb: -------------------------------------------------------------------------------- 1 | module Rake 2 | 3 | #################################################################### 4 | # Exit status class for times the system just gives us a nil. 5 | class PseudoStatus 6 | attr_reader :exitstatus 7 | 8 | def initialize(code=0) 9 | @exitstatus = code 10 | end 11 | 12 | def to_i 13 | @exitstatus << 8 14 | end 15 | 16 | def >>(n) 17 | to_i >> n 18 | end 19 | 20 | def stopped? 21 | false 22 | end 23 | 24 | def exited? 25 | true 26 | end 27 | end 28 | 29 | end 30 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rake/rake_module.rb: -------------------------------------------------------------------------------- 1 | require 'rake/application' 2 | 3 | module Rake 4 | 5 | # Rake module singleton methods. 6 | # 7 | class << self 8 | # Current Rake Application 9 | def application 10 | @application ||= Rake::Application.new 11 | end 12 | 13 | # Set the current Rake application object. 14 | def application=(app) 15 | @application = app 16 | end 17 | 18 | # Return the original directory where the Rake application was started. 19 | def original_dir 20 | application.original_dir 21 | end 22 | 23 | # Load a rakefile. 24 | def load_rakefile(path) 25 | load(path) 26 | end 27 | 28 | # Add files to the rakelib list 29 | def add_rakelib(*files) 30 | application.options.rakelib ||= [] 31 | files.each do |file| 32 | application.options.rakelib << file 33 | end 34 | end 35 | end 36 | 37 | end 38 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rake/rake_test_loader.rb: -------------------------------------------------------------------------------- 1 | require 'rake' 2 | 3 | # Load the test files from the command line. 4 | argv = ARGV.select do |argument| 5 | case argument 6 | when /^-/ then 7 | argument 8 | when /\*/ then 9 | FileList[argument].to_a.each do |file| 10 | require File.expand_path file 11 | end 12 | 13 | false 14 | else 15 | require File.expand_path argument 16 | 17 | false 18 | end 19 | end 20 | 21 | ARGV.replace argv 22 | 23 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rake/rdoctask.rb: -------------------------------------------------------------------------------- 1 | fail "ERROR: 'rake/rdoctask' is obsolete and no longer supported. " + 2 | "Use 'rdoc/task' (available in RDoc 2.4.2+) instead." 3 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rake/ruby182_test_unit_fix.rb: -------------------------------------------------------------------------------- 1 | # Local Rake override to fix bug in Ruby 0.8.2 2 | module Test # :nodoc: 3 | # Local Rake override to fix bug in Ruby 0.8.2 4 | module Unit # :nodoc: 5 | # Local Rake override to fix bug in Ruby 0.8.2 6 | module Collector # :nodoc: 7 | # Local Rake override to fix bug in Ruby 0.8.2 8 | class Dir # :nodoc: 9 | undef collect_file 10 | def collect_file(name, suites, already_gathered) # :nodoc: 11 | dir = File.dirname(File.expand_path(name)) 12 | $:.unshift(dir) unless $:.first == dir 13 | if @req 14 | @req.require(name) 15 | else 16 | require(name) 17 | end 18 | find_test_cases(already_gathered).each do |t| 19 | add_suite(suites, t.suite) 20 | end 21 | ensure 22 | $:.delete_at $:.rindex(dir) 23 | end 24 | end 25 | end 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rake/rule_recursion_overflow_error.rb: -------------------------------------------------------------------------------- 1 | 2 | module Rake 3 | 4 | # Error indicating a recursion overflow error in task selection. 5 | class RuleRecursionOverflowError < StandardError 6 | def initialize(*args) 7 | super 8 | @targets = [] 9 | end 10 | 11 | def add_target(target) 12 | @targets << target 13 | end 14 | 15 | def message 16 | super + ": [" + @targets.reverse.join(' => ') + "]" 17 | end 18 | end 19 | 20 | end 21 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rake/runtest.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'test/unit/assertions' 3 | require 'rake/file_list' 4 | 5 | module Rake 6 | include Test::Unit::Assertions 7 | 8 | def run_tests(pattern='test/test*.rb', log_enabled=false) 9 | FileList.glob(pattern).each do |fn| 10 | $stderr.puts fn if log_enabled 11 | begin 12 | require fn 13 | rescue Exception => ex 14 | $stderr.puts "Error in #{fn}: #{ex.message}" 15 | $stderr.puts ex.backtrace 16 | assert false 17 | end 18 | end 19 | end 20 | 21 | extend self 22 | end 23 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rake/scope.rb: -------------------------------------------------------------------------------- 1 | module Rake 2 | class Scope < LinkedList 3 | 4 | # Path for the scope. 5 | def path 6 | map { |item| item.to_s }.reverse.join(":") 7 | end 8 | 9 | # Path for the scope + the named path. 10 | def path_with_task_name(task_name) 11 | "#{path}:#{task_name}" 12 | end 13 | 14 | # Trim +n+ innermost scope levels from the scope. In no case will 15 | # this trim beyond the toplevel scope. 16 | def trim(n) 17 | result = self 18 | while n > 0 && ! result.empty? 19 | result = result.tail 20 | n -= 1 21 | end 22 | result 23 | end 24 | 25 | # Scope lists always end with an EmptyScope object. See Null 26 | # Object Pattern) 27 | class EmptyScope < EmptyLinkedList 28 | @parent = Scope 29 | 30 | def path 31 | "" 32 | end 33 | 34 | def path_with_task_name(task_name) 35 | task_name 36 | end 37 | end 38 | 39 | # Singleton null object for an empty scope. 40 | EMPTY = EmptyScope.new 41 | end 42 | end 43 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rake/task_argument_error.rb: -------------------------------------------------------------------------------- 1 | module Rake 2 | 3 | # Error indicating an ill-formed task declaration. 4 | class TaskArgumentError < ArgumentError 5 | end 6 | 7 | end 8 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rake/tasklib.rb: -------------------------------------------------------------------------------- 1 | require 'rake' 2 | 3 | module Rake 4 | 5 | # Base class for Task Libraries. 6 | class TaskLib 7 | include Cloneable 8 | include Rake::DSL 9 | 10 | # Make a symbol by pasting two strings together. 11 | # 12 | # NOTE: DEPRECATED! This method is kinda stupid. I don't know why 13 | # I didn't just use string interpolation. But now other task 14 | # libraries depend on this so I can't remove it without breaking 15 | # other people's code. So for now it stays for backwards 16 | # compatibility. BUT DON'T USE IT. 17 | def paste(a, b) # :nodoc: 18 | (a.to_s + b.to_s).intern 19 | end 20 | end 21 | 22 | end 23 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rake/trace_output.rb: -------------------------------------------------------------------------------- 1 | module Rake 2 | module TraceOutput 3 | 4 | # Write trace output to output stream +out+. 5 | # 6 | # The write is done as a single IO call (to print) to lessen the 7 | # chance that the trace output is interrupted by other tasks also 8 | # producing output. 9 | def trace_on(out, *strings) 10 | sep = $\ || "\n" 11 | if strings.empty? 12 | output = sep 13 | else 14 | output = strings.map { |s| 15 | next if s.nil? 16 | s =~ /#{sep}$/ ? s : s + sep 17 | }.join 18 | end 19 | out.print(output) 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rake/version.rb: -------------------------------------------------------------------------------- 1 | module Rake 2 | VERSION = '10.1.0' 3 | 4 | module Version # :nodoc: all 5 | MAJOR, MINOR, BUILD, *OTHER = Rake::VERSION.split '.' 6 | 7 | NUMBERS = [MAJOR, MINOR, BUILD, *OTHER] 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rbconfig/datadir.rb: -------------------------------------------------------------------------------- 1 | #-- 2 | # Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others. 3 | # All rights reserved. 4 | # See LICENSE.txt for permissions. 5 | #++ 6 | 7 | # N.B. This file is used by Config.datadir in rubygems.rb, and must not be 8 | # removed before that require is removed. I require to avoid warning more than 9 | # once. 10 | 11 | warn 'rbconfig/datadir.rb and {Rb}Config.datadir is being deprecated from '\ 12 | 'RubyGems. It will be removed completely on or after June 2011. If you '\ 13 | 'wish to rely on a datadir, please use Gem.datadir.' 14 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rbconfig/obsolete.rb: -------------------------------------------------------------------------------- 1 | module ::RbConfig 2 | module Obsolete 3 | end 4 | class << Obsolete 5 | def _warn_ 6 | loc, = caller_locations(2, 1) 7 | loc = "#{loc.to_s}: " if loc 8 | warn "#{loc}Use RbConfig instead of obsolete and deprecated Config." 9 | self 10 | end 11 | 12 | def const_missing(name) 13 | _warn_ 14 | ::RbConfig.const_get(name) 15 | end 16 | 17 | def method_missing(*args, &block) 18 | _warn_ 19 | rbconfig = ::RbConfig 20 | result = rbconfig.__send__(*args, &block) 21 | result = rbconfig if rbconfig.equal?(result) 22 | result 23 | end 24 | 25 | def respond_to_missing?(*args, &block) 26 | _warn_ 27 | ::RbConfig.send(:respond_to_missing?, *args, &block) 28 | end 29 | end 30 | end 31 | 32 | ::Config = ::RbConfig::Obsolete._warn_ 33 | =begin 34 | def Object.const_missing(name) 35 | return super unless name == :Config 36 | ::RbConfig::Obsolete._warn_ 37 | end 38 | =end 39 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/anon_class.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # An anonymous class like: 3 | # 4 | # c = Class.new do end 5 | # 6 | # AnonClass is currently not used. 7 | 8 | class RDoc::AnonClass < RDoc::ClassModule 9 | end 10 | 11 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/code_objects.rb: -------------------------------------------------------------------------------- 1 | # This file was used to load all the RDoc::CodeObject subclasses at once. Now 2 | # autoload handles this. 3 | 4 | require 'rdoc' 5 | 6 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/erb_partial.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # Allows an ERB template to be rendered in the context (binding) of an 3 | # existing ERB template evaluation. 4 | 5 | class RDoc::ERBPartial < ERB 6 | 7 | ## 8 | # Overrides +compiler+ startup to set the +eoutvar+ to an empty string only 9 | # if it isn't already set. 10 | 11 | def set_eoutvar compiler, eoutvar = '_erbout' 12 | super 13 | 14 | compiler.pre_cmd = ["#{eoutvar} ||= ''"] 15 | end 16 | 17 | end 18 | 19 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/erbio.rb: -------------------------------------------------------------------------------- 1 | require 'erb' 2 | 3 | ## 4 | # A subclass of ERB that writes directly to an IO. Credit to Aaron Patterson 5 | # and Masatoshi SEKI. 6 | # 7 | # To use: 8 | # 9 | # erbio = RDoc::ERBIO.new '<%= "hello world" %>', nil, nil 10 | # 11 | # open 'hello.txt', 'w' do |io| 12 | # erbio.result binding 13 | # end 14 | # 15 | # Note that binding must enclose the io you wish to output on. 16 | 17 | class RDoc::ERBIO < ERB 18 | 19 | ## 20 | # Defaults +eoutvar+ to 'io', otherwise is identical to ERB's initialize 21 | 22 | def initialize str, safe_level = nil, trim_mode = nil, eoutvar = 'io' 23 | super 24 | end 25 | 26 | ## 27 | # Instructs +compiler+ how to write to +io_variable+ 28 | 29 | def set_eoutvar compiler, io_variable 30 | compiler.put_cmd = "#{io_variable}.write" 31 | compiler.insert_cmd = "#{io_variable}.write" 32 | compiler.pre_cmd = [] 33 | compiler.post_cmd = [] 34 | end 35 | 36 | end 37 | 38 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/extend.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # A Module extension to a class with \#extend 3 | # 4 | # RDoc::Extend.new 'Enumerable', 'comment ...' 5 | 6 | class RDoc::Extend < RDoc::Mixin 7 | 8 | end 9 | 10 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/ri.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # Generates ri data files 3 | 4 | class RDoc::Generator::RI 5 | 6 | RDoc::RDoc.add_generator self 7 | 8 | ## 9 | # Description of this generator 10 | 11 | DESCRIPTION = 'creates ri data files' 12 | 13 | ## 14 | # Set up a new ri generator 15 | 16 | def initialize store, options #:not-new: 17 | @options = options 18 | @store = store 19 | @store.path = '.' 20 | end 21 | 22 | ## 23 | # Writes the parsed data store to disk for use by ri. 24 | 25 | def generate 26 | @store.save 27 | end 28 | 29 | end 30 | 31 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/_footer.rhtml: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/_head.rhtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | <%= h @title %> 4 | 5 | 6 | 7 | <% if @options.template_stylesheets.flatten.any? then %> 8 | <% @options.template_stylesheets.flatten.each do |stylesheet| %> 9 | 10 | <% end %> 11 | <% end %> 12 | 13 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml: -------------------------------------------------------------------------------- 1 | <% if !svninfo.empty? then %> 2 | 19 | <% end %> 20 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml: -------------------------------------------------------------------------------- 1 | <% unless klass.extends.empty? then %> 2 | 15 | <% end %> 16 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml: -------------------------------------------------------------------------------- 1 | <% unless klass.includes.empty? then %> 2 | 15 | <% end %> 16 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml: -------------------------------------------------------------------------------- 1 | 16 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml: -------------------------------------------------------------------------------- 1 | <% unless klass.method_list.empty? then %> 2 | 3 | 12 | <% end %> 13 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml: -------------------------------------------------------------------------------- 1 | <% simple_files = @files.select { |f| f.text? } %> 2 | <% unless simple_files.empty? then %> 3 | 12 | <% end %> 13 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml: -------------------------------------------------------------------------------- 1 | <% if klass.type == 'class' then %> 2 | 11 | <% end %> 12 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/_sidebar_search.rhtml: -------------------------------------------------------------------------------- 1 | 15 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml: -------------------------------------------------------------------------------- 1 | <% unless klass.sections.length == 1 then %> 2 | 11 | <% end %> 12 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml: -------------------------------------------------------------------------------- 1 | <% comment = if current.respond_to? :comment_location then 2 | current.comment_location 3 | else 4 | current.comment 5 | end 6 | table = current.parse(comment).table_of_contents 7 | 8 | if table.length > 1 then %> 9 | 18 | <% end %> 19 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/fonts/Lato-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/fonts/Lato-Light.ttf -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/fonts/Lato-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/fonts/Lato-LightItalic.ttf -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/fonts/Lato-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/fonts/Lato-Regular.ttf -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/fonts/Lato-RegularItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/fonts/Lato-RegularItalic.ttf -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttf -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttf -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/images/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/images/add.png -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/images/arrow_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/images/arrow_up.png -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/images/brick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/images/brick.png -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/images/brick_link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/images/brick_link.png -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/images/bug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/images/bug.png -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/images/bullet_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/images/bullet_black.png -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.png -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/images/date.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/images/date.png -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/images/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/images/delete.png -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/images/find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/images/find.png -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/images/loadingAnimation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/images/loadingAnimation.gif -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/images/macFFBgHack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/images/macFFBgHack.png -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/images/package.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/images/package.png -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/images/page_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/images/page_green.png -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/images/page_white_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/images/page_white_text.png -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/images/page_white_width.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/images/page_white_width.png -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/images/plugin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/images/plugin.png -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/images/ruby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/images/ruby.png -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/images/tag_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/images/tag_blue.png -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/images/tag_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/images/tag_green.png -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/images/transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/images/transparent.png -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/images/wrench.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/images/wrench.png -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/images/wrench_orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/images/wrench_orange.png -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/images/zoom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/rdoc/generator/template/darkfish/images/zoom.png -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/index.rhtml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 |
16 | <% if @options.main_page and 17 | main_page = @files.find { |f| f.full_name == @options.main_page } then %> 18 | <%= main_page.description %> 19 | <% else %> 20 |

This is the API documentation for <%= @title %>. 21 | <% end %> 22 |

23 | 24 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/page.rhtml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 |
16 | <%= file.description %> 17 |
18 | 19 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/generator/template/darkfish/servlet_not_found.rhtml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 |
14 |

Not Found

15 | 16 |

<%= message %> 17 |

18 | 19 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/ghost_method.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # GhostMethod represents a method referenced only by a comment 3 | 4 | class RDoc::GhostMethod < RDoc::AnyMethod 5 | end 6 | 7 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/include.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # A Module included in a class with \#include 3 | # 4 | # RDoc::Include.new 'Enumerable', 'comment ...' 5 | 6 | class RDoc::Include < RDoc::Mixin 7 | 8 | end 9 | 10 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/markdown/literals_1_8.kpeg: -------------------------------------------------------------------------------- 1 | %% name = RDoc::Markdown::Literals 2 | 3 | %% header { 4 | # :markup: markdown 5 | 6 | ## 7 | # Provides Literals appropriate for your ruby version. 8 | #-- 9 | # This set of literals is for Ruby 1.8 regular expressions. 10 | } 11 | 12 | Alphanumeric = /[0-9A-Za-z\200-\377]/ 13 | AlphanumericAscii = /[A-Za-z0-9]/ 14 | BOM = "\357\273\277" 15 | Newline = /\n|\r\n?/ 16 | NonAlphanumeric = /[\000-\057\072-\100\133-\140\173-\177]/ 17 | Spacechar = / |\t/ 18 | 19 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/markdown/literals_1_9.kpeg: -------------------------------------------------------------------------------- 1 | %% name = RDoc::Markdown::Literals 2 | 3 | %% header { 4 | # coding: UTF-8 5 | # :markup: markdown 6 | 7 | ## 8 | #-- 9 | # This set of literals is for Ruby 1.9 regular expressions and gives full 10 | # unicode support. 11 | # 12 | # Unlike peg-markdown, this set of literals recognizes Unicode alphanumeric 13 | # characters, newlines and spaces. 14 | } 15 | 16 | Alphanumeric = /\p{Word}/ 17 | AlphanumericAscii = /[A-Za-z0-9]/ 18 | BOM = "\uFEFF" 19 | Newline = /\n|\r\n?|\p{Zl}|\p{Zp}/ 20 | NonAlphanumeric = /\p{^Word}/ 21 | Spacechar = /\t|\p{Zs}/ 22 | 23 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/markup/attr_changer.rb: -------------------------------------------------------------------------------- 1 | class RDoc::Markup 2 | 3 | AttrChanger = Struct.new :turn_on, :turn_off # :nodoc: 4 | 5 | end 6 | 7 | ## 8 | # An AttrChanger records a change in attributes. It contains a bitmap of the 9 | # attributes to turn on, and a bitmap of those to turn off. 10 | 11 | class RDoc::Markup::AttrChanger 12 | 13 | def to_s # :nodoc: 14 | "Attr: +#{turn_on}/-#{turn_off}" 15 | end 16 | 17 | def inspect # :nodoc: 18 | '+%d/-%d' % [turn_on, turn_off] 19 | end 20 | 21 | end 22 | 23 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/markup/attr_span.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # An array of attributes which parallels the characters in a string. 3 | 4 | class RDoc::Markup::AttrSpan 5 | 6 | ## 7 | # Creates a new AttrSpan for +length+ characters 8 | 9 | def initialize(length) 10 | @attrs = Array.new(length, 0) 11 | end 12 | 13 | ## 14 | # Toggles +bits+ from +start+ to +length+ 15 | def set_attrs(start, length, bits) 16 | for i in start ... (start+length) 17 | @attrs[i] |= bits 18 | end 19 | end 20 | 21 | ## 22 | # Accesses flags for character +n+ 23 | 24 | def [](n) 25 | @attrs[n] 26 | end 27 | 28 | end 29 | 30 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/markup/blank_line.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # An empty line. This class is a singleton. 3 | 4 | class RDoc::Markup::BlankLine 5 | 6 | @instance = new 7 | 8 | ## 9 | # RDoc::Markup::BlankLine is a singleton 10 | 11 | def self.new 12 | @instance 13 | end 14 | 15 | ## 16 | # Calls #accept_blank_line on +visitor+ 17 | 18 | def accept visitor 19 | visitor.accept_blank_line self 20 | end 21 | 22 | def pretty_print q # :nodoc: 23 | q.text 'blankline' 24 | end 25 | 26 | end 27 | 28 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/markup/block_quote.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # A quoted section which contains markup items. 3 | 4 | class RDoc::Markup::BlockQuote < RDoc::Markup::Raw 5 | 6 | ## 7 | # Calls #accept_block_quote on +visitor+ 8 | 9 | def accept visitor 10 | visitor.accept_block_quote self 11 | end 12 | 13 | end 14 | 15 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/markup/hard_break.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # A hard-break in the middle of a paragraph. 3 | 4 | class RDoc::Markup::HardBreak 5 | 6 | @instance = new 7 | 8 | ## 9 | # RDoc::Markup::HardBreak is a singleton 10 | 11 | def self.new 12 | @instance 13 | end 14 | 15 | ## 16 | # Calls #accept_hard_break on +visitor+ 17 | 18 | def accept visitor 19 | visitor.accept_hard_break self 20 | end 21 | 22 | def == other # :nodoc: 23 | self.class === other 24 | end 25 | 26 | def pretty_print q # :nodoc: 27 | q.text "[break]" 28 | end 29 | 30 | end 31 | 32 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/markup/include.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # A file included at generation time. Objects of this class are created by 3 | # RDoc::RD for an extension-less include. 4 | # 5 | # This implementation in incomplete. 6 | 7 | class RDoc::Markup::Include 8 | 9 | ## 10 | # The filename to be included, without extension 11 | 12 | attr_reader :file 13 | 14 | ## 15 | # Directories to search for #file 16 | 17 | attr_reader :include_path 18 | 19 | ## 20 | # Creates a new include that will import +file+ from +include_path+ 21 | 22 | def initialize file, include_path 23 | @file = file 24 | @include_path = include_path 25 | end 26 | 27 | def == other # :nodoc: 28 | self.class === other and 29 | @file == other.file and @include_path == other.include_path 30 | end 31 | 32 | def pretty_print q # :nodoc: 33 | q.group 2, '[incl ', ']' do 34 | q.text file 35 | q.breakable 36 | q.text 'from ' 37 | q.pp include_path 38 | end 39 | end 40 | 41 | end 42 | 43 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/markup/inline.rb: -------------------------------------------------------------------------------- 1 | warn "requiring rdoc/markup/inline is deprecated and will be removed in RDoc 4." if $-w 2 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/markup/paragraph.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # A Paragraph of text 3 | 4 | class RDoc::Markup::Paragraph < RDoc::Markup::Raw 5 | 6 | ## 7 | # Calls #accept_paragraph on +visitor+ 8 | 9 | def accept visitor 10 | visitor.accept_paragraph self 11 | end 12 | 13 | ## 14 | # Joins the raw paragraph text and converts inline HardBreaks to the 15 | # +hard_break+ text. 16 | 17 | def text hard_break = '' 18 | @parts.map do |part| 19 | if RDoc::Markup::HardBreak === part then 20 | hard_break 21 | else 22 | part 23 | end 24 | end.join 25 | end 26 | 27 | end 28 | 29 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/markup/rule.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # A horizontal rule with a weight 3 | 4 | class RDoc::Markup::Rule < Struct.new :weight 5 | 6 | ## 7 | # Calls #accept_rule on +visitor+ 8 | 9 | def accept visitor 10 | visitor.accept_rule self 11 | end 12 | 13 | def pretty_print q # :nodoc: 14 | q.group 2, '[rule:', ']' do 15 | q.pp weight 16 | end 17 | end 18 | 19 | end 20 | 21 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/markup/special.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # Hold details of a special sequence 3 | 4 | class RDoc::Markup::Special 5 | 6 | ## 7 | # Special type 8 | 9 | attr_reader :type 10 | 11 | ## 12 | # Special text 13 | 14 | attr_accessor :text 15 | 16 | ## 17 | # Creates a new special sequence of +type+ with +text+ 18 | 19 | def initialize(type, text) 20 | @type, @text = type, text 21 | end 22 | 23 | ## 24 | # Specials are equal when the have the same text and type 25 | 26 | def ==(o) 27 | self.text == o.text && self.type == o.type 28 | end 29 | 30 | def inspect # :nodoc: 31 | "#" % [ 32 | object_id, @type, text.dump] 33 | end 34 | 35 | def to_s # :nodoc: 36 | "Special: type=#{type} text=#{text.dump}" 37 | end 38 | 39 | end 40 | 41 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/meta_method.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # MetaMethod represents a meta-programmed method 3 | 4 | class RDoc::MetaMethod < RDoc::AnyMethod 5 | end 6 | 7 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/parser/markdown.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # Parse a Markdown format file. The parsed RDoc::Markup::Document is attached 3 | # as a file comment. 4 | 5 | class RDoc::Parser::Markdown < RDoc::Parser 6 | 7 | include RDoc::Parser::Text 8 | 9 | parse_files_matching(/\.(md|markdown)(?:\.[^.]+)?$/) 10 | 11 | ## 12 | # Creates an Markdown-format TopLevel for the given file. 13 | 14 | def scan 15 | comment = RDoc::Comment.new @content, @top_level 16 | comment.format = 'markdown' 17 | 18 | @top_level.comment = comment 19 | end 20 | 21 | end 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/parser/rd.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # Parse a RD format file. The parsed RDoc::Markup::Document is attached as a 3 | # file comment. 4 | 5 | class RDoc::Parser::RD < RDoc::Parser 6 | 7 | include RDoc::Parser::Text 8 | 9 | parse_files_matching(/\.rd(?:\.[^.]+)?$/) 10 | 11 | ## 12 | # Creates an rd-format TopLevel for the given file. 13 | 14 | def scan 15 | comment = RDoc::Comment.new @content, @top_level 16 | comment.format = 'rd' 17 | 18 | @top_level.comment = comment 19 | end 20 | 21 | end 22 | 23 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/parser/text.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # Indicates this parser is text and doesn't contain code constructs. 3 | # 4 | # Include this module in a RDoc::Parser subclass to make it show up as a file, 5 | # not as part of a class or module. 6 | #-- 7 | # This is not named File to avoid overriding ::File 8 | 9 | module RDoc::Parser::Text 10 | end 11 | 12 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/ri.rb: -------------------------------------------------------------------------------- 1 | require 'rdoc' 2 | 3 | ## 4 | # Namespace for the ri command line tool's implementation. 5 | # 6 | # See ri --help for details. 7 | 8 | module RDoc::RI 9 | 10 | ## 11 | # Base RI error class 12 | 13 | class Error < RDoc::Error; end 14 | 15 | autoload :Driver, 'rdoc/ri/driver' 16 | autoload :Paths, 'rdoc/ri/paths' 17 | autoload :Store, 'rdoc/ri/store' 18 | 19 | end 20 | 21 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/ri/formatter.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # For RubyGems backwards compatibility 3 | 4 | module RDoc::RI::Formatter # :nodoc: 5 | end 6 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/ri/store.rb: -------------------------------------------------------------------------------- 1 | module RDoc::RI 2 | 3 | Store = RDoc::Store # :nodoc: 4 | 5 | end 6 | 7 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rdoc/single_class.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # A singleton class 3 | 4 | class RDoc::SingleClass < RDoc::ClassModule 5 | 6 | ## 7 | # Adds the superclass to the included modules. 8 | 9 | def ancestors 10 | superclass ? super + [superclass] : super 11 | end 12 | 13 | ## 14 | # The definition of this singleton class, class << MyClassName 15 | 16 | def definition 17 | "class << #{full_name}" 18 | end 19 | 20 | end 21 | 22 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/readline.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9katayama/aws-lambda-jruby/b0b05dcde54e605a8457e2a77e02924df43980d9/src/main/resources/stdlib/readline.jar -------------------------------------------------------------------------------- /src/main/resources/stdlib/readline.rb: -------------------------------------------------------------------------------- 1 | require 'readline/version' 2 | 3 | require 'jar-dependencies' 4 | require_jar( 'jline', 'jline', Readline::Version::JLINE_VERSION ) 5 | 6 | require "readline.jar" 7 | 8 | # boot extension 9 | begin 10 | org.jruby.ext.readline.ReadlineService.new.load(JRuby.runtime, false) 11 | rescue NameError => ne 12 | raise NameError, "unable to load readline subsystem: #{ne.message}", ne.backtrace 13 | end 14 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/readline/version.rb: -------------------------------------------------------------------------------- 1 | module Readline 2 | module Version 3 | VERSION = "1.0" 4 | JLINE_VERSION = "2.11" 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rexml/dtd/attlistdecl.rb: -------------------------------------------------------------------------------- 1 | require "rexml/child" 2 | module REXML 3 | module DTD 4 | class AttlistDecl < Child 5 | START = ")/um 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rexml/dtd/elementdecl.rb: -------------------------------------------------------------------------------- 1 | require "rexml/child" 2 | module REXML 3 | module DTD 4 | class ElementDecl < Child 5 | START = "/um 8 | PATTERN_RE = /^\s*#{START}\s+((?:[:\w][-\.\w]*:)?[-!\*\.\w]*)(.*?)>/ 9 | #\s*((((["']).*?\5)|[^\/'">]*)*?)(\/)?>/um, true) 10 | 11 | def initialize match 12 | @name = match[1] 13 | @rest = match[2] 14 | end 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rexml/output.rb: -------------------------------------------------------------------------------- 1 | require 'rexml/encoding' 2 | 3 | module REXML 4 | class Output 5 | include Encoding 6 | 7 | attr_reader :encoding 8 | 9 | def initialize real_IO, encd="iso-8859-1" 10 | @output = real_IO 11 | self.encoding = encd 12 | 13 | @to_utf = encoding != 'UTF-8' 14 | 15 | if encoding == "UTF-16" 16 | @output << "\ufeff".encode("UTF-16BE") 17 | self.encoding = "UTF-16BE" 18 | end 19 | end 20 | 21 | def <<( content ) 22 | @output << (@to_utf ? self.encode(content) : content) 23 | end 24 | 25 | def to_s 26 | "Output[#{encoding}]" 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rexml/security.rb: -------------------------------------------------------------------------------- 1 | module REXML 2 | module Security 3 | @@entity_expansion_limit = 10_000 4 | 5 | # Set the entity expansion limit. By default the limit is set to 10000. 6 | def self.entity_expansion_limit=( val ) 7 | @@entity_expansion_limit = val 8 | end 9 | 10 | # Get the entity expansion limit. By default the limit is set to 10000. 11 | def self.entity_expansion_limit 12 | return @@entity_expansion_limit 13 | end 14 | 15 | @@entity_expansion_text_limit = 10_240 16 | 17 | # Set the entity expansion limit. By default the limit is set to 10240. 18 | def self.entity_expansion_text_limit=( val ) 19 | @@entity_expansion_text_limit = val 20 | end 21 | 22 | # Get the entity expansion limit. By default the limit is set to 10240. 23 | def self.entity_expansion_text_limit 24 | return @@entity_expansion_text_limit 25 | end 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rexml/syncenumerator.rb: -------------------------------------------------------------------------------- 1 | module REXML 2 | class SyncEnumerator 3 | include Enumerable 4 | 5 | # Creates a new SyncEnumerator which enumerates rows of given 6 | # Enumerable objects. 7 | def initialize(*enums) 8 | @gens = enums 9 | @length = @gens.collect {|x| x.size }.max 10 | end 11 | 12 | # Returns the number of enumerated Enumerable objects, i.e. the size 13 | # of each row. 14 | def size 15 | @gens.size 16 | end 17 | 18 | # Returns the number of enumerated Enumerable objects, i.e. the size 19 | # of each row. 20 | def length 21 | @gens.length 22 | end 23 | 24 | # Enumerates rows of the Enumerable objects. 25 | def each 26 | @length.times {|i| 27 | yield @gens.collect {|x| x[i]} 28 | } 29 | self 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rexml/undefinednamespaceexception.rb: -------------------------------------------------------------------------------- 1 | require 'rexml/parseexception' 2 | module REXML 3 | class UndefinedNamespaceException < ParseException 4 | def initialize( prefix, source, parser ) 5 | super( "Undefined prefix #{prefix} found" ) 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rexml/validation/validationexception.rb: -------------------------------------------------------------------------------- 1 | module REXML 2 | module Validation 3 | class ValidationException < RuntimeError 4 | def initialize msg 5 | super 6 | end 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rss/content.rb: -------------------------------------------------------------------------------- 1 | require "rss/rss" 2 | 3 | module RSS 4 | # The prefix for the Content XML namespace. 5 | CONTENT_PREFIX = 'content' 6 | # The URI of the Content specification. 7 | CONTENT_URI = "http://purl.org/rss/1.0/modules/content/" 8 | 9 | module ContentModel 10 | extend BaseModel 11 | 12 | ELEMENTS = ["#{CONTENT_PREFIX}_encoded"] 13 | 14 | def self.append_features(klass) 15 | super 16 | 17 | klass.install_must_call_validator(CONTENT_PREFIX, CONTENT_URI) 18 | ELEMENTS.each do |full_name| 19 | name = full_name[(CONTENT_PREFIX.size + 1)..-1] 20 | klass.install_text_element(name, CONTENT_URI, "?", full_name) 21 | end 22 | end 23 | end 24 | 25 | prefix_size = CONTENT_PREFIX.size + 1 26 | ContentModel::ELEMENTS.each do |full_name| 27 | name = full_name[prefix_size..-1] 28 | BaseListener.install_get_text_element(CONTENT_URI, name, full_name) 29 | end 30 | end 31 | 32 | require 'rss/content/1.0' 33 | require 'rss/content/2.0' 34 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rss/content/1.0.rb: -------------------------------------------------------------------------------- 1 | require 'rss/1.0' 2 | 3 | module RSS 4 | RDF.install_ns(CONTENT_PREFIX, CONTENT_URI) 5 | 6 | class RDF 7 | class Item; include ContentModel; end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rss/content/2.0.rb: -------------------------------------------------------------------------------- 1 | require "rss/2.0" 2 | 3 | module RSS 4 | Rss.install_ns(CONTENT_PREFIX, CONTENT_URI) 5 | 6 | class Rss 7 | class Channel 8 | class Item; include ContentModel; end 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rss/dublincore/1.0.rb: -------------------------------------------------------------------------------- 1 | require "rss/1.0" 2 | 3 | module RSS 4 | RDF.install_ns(DC_PREFIX, DC_URI) 5 | 6 | class RDF 7 | class Channel; include DublinCoreModel; end 8 | class Image; include DublinCoreModel; end 9 | class Item; include DublinCoreModel; end 10 | class Textinput; include DublinCoreModel; end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rss/dublincore/2.0.rb: -------------------------------------------------------------------------------- 1 | require "rss/2.0" 2 | 3 | module RSS 4 | Rss.install_ns(DC_PREFIX, DC_URI) 5 | 6 | class Rss 7 | class Channel 8 | include DublinCoreModel 9 | class Item; include DublinCoreModel; end 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rss/dublincore/atom.rb: -------------------------------------------------------------------------------- 1 | require "rss/atom" 2 | 3 | module RSS 4 | module Atom 5 | Feed.install_ns(DC_PREFIX, DC_URI) 6 | 7 | class Feed 8 | include DublinCoreModel 9 | class Entry; include DublinCoreModel; end 10 | end 11 | 12 | class Entry 13 | include DublinCoreModel 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rss/maker/content.rb: -------------------------------------------------------------------------------- 1 | require 'rss/content' 2 | require 'rss/maker/1.0' 3 | require 'rss/maker/2.0' 4 | 5 | module RSS 6 | module Maker 7 | module ContentModel 8 | def self.append_features(klass) 9 | super 10 | 11 | ::RSS::ContentModel::ELEMENTS.each do |name| 12 | klass.def_other_element(name) 13 | end 14 | end 15 | end 16 | 17 | class ItemsBase 18 | class ItemBase; include ContentModel; end 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rss/maker/slash.rb: -------------------------------------------------------------------------------- 1 | require 'rss/slash' 2 | require 'rss/maker/1.0' 3 | 4 | module RSS 5 | module Maker 6 | module SlashModel 7 | def self.append_features(klass) 8 | super 9 | 10 | ::RSS::SlashModel::ELEMENT_INFOS.each do |name, type| 11 | full_name = "#{RSS::SLASH_PREFIX}_#{name}" 12 | case type 13 | when :csv_integer 14 | klass.def_csv_element(full_name, :integer) 15 | else 16 | klass.def_other_element(full_name) 17 | end 18 | end 19 | 20 | klass.module_eval do 21 | alias_method(:slash_hit_parades, :slash_hit_parade) 22 | alias_method(:slash_hit_parades=, :slash_hit_parade=) 23 | end 24 | end 25 | end 26 | 27 | class ItemsBase 28 | class ItemBase 29 | include SlashModel 30 | end 31 | end 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rss/maker/syndication.rb: -------------------------------------------------------------------------------- 1 | require 'rss/syndication' 2 | require 'rss/maker/1.0' 3 | 4 | module RSS 5 | module Maker 6 | module SyndicationModel 7 | def self.append_features(klass) 8 | super 9 | 10 | ::RSS::SyndicationModel::ELEMENTS.each do |name| 11 | klass.def_other_element(name) 12 | end 13 | end 14 | end 15 | 16 | class ChannelBase; include SyndicationModel; end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rubygems/commands/mirror_command.rb: -------------------------------------------------------------------------------- 1 | require 'rubygems/command' 2 | 3 | unless defined? Gem::Commands::MirrorCommand 4 | class Gem::Commands::MirrorCommand < Gem::Command 5 | def initialize 6 | super('mirror', 'Mirror all gem files (requires rubygems-mirror)') 7 | begin 8 | Gem::Specification.find_by_name('rubygems-mirror').activate 9 | rescue Gem::LoadError 10 | # no-op 11 | end 12 | end 13 | 14 | def description # :nodoc: 15 | <<-EOF 16 | The mirror command has been moved to the rubygems-mirror gem. 17 | EOF 18 | end 19 | 20 | def execute 21 | alert_error "Install the rubygems-mirror gem for the mirror command" 22 | end 23 | 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rubygems/commands/outdated_command.rb: -------------------------------------------------------------------------------- 1 | require 'rubygems/command' 2 | require 'rubygems/local_remote_options' 3 | require 'rubygems/spec_fetcher' 4 | require 'rubygems/version_option' 5 | 6 | class Gem::Commands::OutdatedCommand < Gem::Command 7 | 8 | include Gem::LocalRemoteOptions 9 | include Gem::VersionOption 10 | 11 | def initialize 12 | super 'outdated', 'Display all gems that need updates' 13 | 14 | add_local_remote_options 15 | add_platform_option 16 | end 17 | 18 | def description # :nodoc: 19 | <<-EOF 20 | The outdated command lists gems you may wish to upgrade to a newer version. 21 | 22 | You can check for dependency mismatches using the dependency command and 23 | update the gems with the update or install commands. 24 | EOF 25 | end 26 | 27 | def execute 28 | Gem::Specification.outdated_and_latest_version.each do |spec, remote_version| 29 | say "#{spec.name} (#{spec.version} < #{remote_version})" 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rubygems/commands/search_command.rb: -------------------------------------------------------------------------------- 1 | require 'rubygems/command' 2 | require 'rubygems/commands/query_command' 3 | 4 | class Gem::Commands::SearchCommand < Gem::Commands::QueryCommand 5 | 6 | def initialize 7 | super 'search', 'Display remote gems whose name matches REGEXP' 8 | 9 | remove_option '--name-matches' 10 | 11 | defaults[:domain] = :remote 12 | end 13 | 14 | def arguments # :nodoc: 15 | "REGEXP regexp to search for in gem name" 16 | end 17 | 18 | def defaults_str # :nodoc: 19 | "--remote --no-details" 20 | end 21 | 22 | def description # :nodoc: 23 | <<-EOF 24 | The search command displays remote gems whose name matches the given 25 | regexp. 26 | 27 | The --details option displays additional details from the gem but will 28 | take a little longer to complete as it must download the information 29 | individually from the index. 30 | 31 | To list local gems use the list command. 32 | EOF 33 | end 34 | 35 | def usage # :nodoc: 36 | "#{program_name} [REGEXP]" 37 | end 38 | 39 | end 40 | 41 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rubygems/ext.rb: -------------------------------------------------------------------------------- 1 | #-- 2 | # Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others. 3 | # All rights reserved. 4 | # See LICENSE.txt for permissions. 5 | #++ 6 | 7 | ## 8 | # Classes for building C extensions live here. 9 | 10 | module Gem::Ext; end 11 | 12 | require 'rubygems/ext/build_error' 13 | require 'rubygems/ext/builder' 14 | require 'rubygems/ext/configure_builder' 15 | require 'rubygems/ext/ext_conf_builder' 16 | require 'rubygems/ext/rake_builder' 17 | require 'rubygems/ext/cmake_builder' 18 | 19 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rubygems/ext/build_error.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # Raised when there is an error while building extensions. 3 | 4 | class Gem::Ext::BuildError < Gem::InstallError 5 | end 6 | 7 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rubygems/ext/cmake_builder.rb: -------------------------------------------------------------------------------- 1 | require 'rubygems/command' 2 | 3 | class Gem::Ext::CmakeBuilder < Gem::Ext::Builder 4 | def self.build(extension, directory, dest_path, results, args=[], lib_dir=nil) 5 | unless File.exist?('Makefile') then 6 | cmd = "cmake . -DCMAKE_INSTALL_PREFIX=#{dest_path}" 7 | cmd << " #{Gem::Command.build_args.join ' '}" unless Gem::Command.build_args.empty? 8 | 9 | run cmd, results 10 | end 11 | 12 | make dest_path, results 13 | 14 | results 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rubygems/ext/configure_builder.rb: -------------------------------------------------------------------------------- 1 | #-- 2 | # Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others. 3 | # All rights reserved. 4 | # See LICENSE.txt for permissions. 5 | #++ 6 | 7 | class Gem::Ext::ConfigureBuilder < Gem::Ext::Builder 8 | 9 | def self.build(extension, directory, dest_path, results, args=[], lib_dir=nil) 10 | unless File.exist?('Makefile') then 11 | cmd = "sh ./configure --prefix=#{dest_path}" 12 | cmd << " #{args.join ' '}" unless args.empty? 13 | 14 | run cmd, results 15 | end 16 | 17 | make dest_path, results 18 | 19 | results 20 | end 21 | 22 | end 23 | 24 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rubygems/install_default_message.rb: -------------------------------------------------------------------------------- 1 | require 'rubygems' 2 | require 'rubygems/user_interaction' 3 | 4 | ## 5 | # A post-install hook that displays "Successfully installed 6 | # some_gem-1.0 as a default gem" 7 | 8 | Gem.post_install do |installer| 9 | ui = Gem::DefaultUserInteraction.ui 10 | ui.say "Successfully installed #{installer.spec.full_name} as a default gem" 11 | end 12 | 13 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rubygems/install_message.rb: -------------------------------------------------------------------------------- 1 | require 'rubygems' 2 | require 'rubygems/user_interaction' 3 | 4 | ## 5 | # A default post-install hook that displays "Successfully installed 6 | # some_gem-1.0" 7 | 8 | Gem.post_install do |installer| 9 | ui = Gem::DefaultUserInteraction.ui 10 | ui.say "Successfully installed #{installer.spec.full_name}" 11 | end 12 | 13 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rubygems/package/file_source.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # The primary source of gems is a file on disk, including all usages 3 | # internal to rubygems. 4 | # 5 | # This is a private class, do not depend on it directly. Instead, pass a path 6 | # object to `Gem::Package.new`. 7 | 8 | class Gem::Package::FileSource < Gem::Package::Source # :nodoc: all 9 | 10 | attr_reader :path 11 | 12 | def initialize path 13 | @path = path 14 | end 15 | 16 | def start 17 | @start ||= File.read path, 20 18 | end 19 | 20 | def present? 21 | File.exist? path 22 | end 23 | 24 | def with_write_io &block 25 | open path, 'wb', &block 26 | end 27 | 28 | def with_read_io &block 29 | open path, 'rb', &block 30 | end 31 | 32 | end 33 | 34 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rubygems/package/io_source.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # Supports reading and writing gems from/to a generic IO object. This is 3 | # useful for other applications built on top of rubygems, such as 4 | # rubygems.org. 5 | # 6 | # This is a private class, do not depend on it directly. Instead, pass an IO 7 | # object to `Gem::Package.new`. 8 | 9 | class Gem::Package::IOSource < Gem::Package::Source # :nodoc: all 10 | 11 | attr_reader :io 12 | 13 | def initialize io 14 | @io = io 15 | end 16 | 17 | def start 18 | @start ||= begin 19 | if io.pos > 0 20 | raise Gem::Package::Error, "Cannot read start unless IO is at start" 21 | end 22 | 23 | value = io.read 20 24 | io.rewind 25 | value 26 | end 27 | end 28 | 29 | def present? 30 | true 31 | end 32 | 33 | def with_read_io 34 | yield io 35 | end 36 | 37 | def with_write_io 38 | yield io 39 | end 40 | 41 | def path 42 | end 43 | 44 | end 45 | 46 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rubygems/package/source.rb: -------------------------------------------------------------------------------- 1 | class Gem::Package::Source # :nodoc: 2 | end 3 | 4 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rubygems/psych_additions.rb: -------------------------------------------------------------------------------- 1 | # This exists just to satisfy bugs in marshal'd gemspecs that 2 | # contain a reference to YAML::PrivateType. We prune these out 3 | # in Specification._load, but if we don't have the constant, Marshal 4 | # blows up. 5 | 6 | module Psych # :nodoc: 7 | class PrivateType # :nodoc: 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rubygems/psych_tree.rb: -------------------------------------------------------------------------------- 1 | module Gem 2 | if defined? ::Psych::Visitors 3 | class NoAliasYAMLTree < Psych::Visitors::YAMLTree 4 | def self.create 5 | new({}) 6 | end unless respond_to? :create 7 | 8 | def visit_String(str) 9 | return super unless str == '=' # or whatever you want 10 | 11 | quote = Psych::Nodes::Scalar::SINGLE_QUOTED 12 | @emitter.scalar str, nil, nil, false, true, quote 13 | end 14 | 15 | # Noop this out so there are no anchors 16 | def register(target, obj) 17 | end 18 | 19 | # This is ported over from the yaml_tree in 1.9.3 20 | def format_time time 21 | if time.utc? 22 | time.strftime("%Y-%m-%d %H:%M:%S.%9N Z") 23 | else 24 | time.strftime("%Y-%m-%d %H:%M:%S.%9N %:z") 25 | end 26 | end 27 | 28 | private :format_time 29 | end 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rubygems/request/https_pool.rb: -------------------------------------------------------------------------------- 1 | class Gem::Request::HTTPSPool < Gem::Request::HTTPPool # :nodoc: 2 | private 3 | 4 | def setup_connection connection 5 | Gem::Request.configure_connection_for_https(connection, @cert_files) 6 | super 7 | end 8 | end 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rubygems/resolver/current_set.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # A set which represents the installed gems. Respects 3 | # all the normal settings that control where to look 4 | # for installed gems. 5 | 6 | class Gem::Resolver::CurrentSet < Gem::Resolver::Set 7 | 8 | def find_all req 9 | req.dependency.matching_specs 10 | end 11 | 12 | end 13 | 14 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rubygems/resolver/local_specification.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # A LocalSpecification comes from a .gem file on the local filesystem. 3 | 4 | class Gem::Resolver::LocalSpecification < Gem::Resolver::SpecSpecification 5 | 6 | ## 7 | # Returns +true+ if this gem is installable for the current platform. 8 | 9 | def installable_platform? 10 | return true if @source.kind_of? Gem::Source::SpecificFile 11 | 12 | super 13 | end 14 | 15 | def local? # :nodoc: 16 | true 17 | end 18 | 19 | def pretty_print q # :nodoc: 20 | q.group 2, '[LocalSpecification', ']' do 21 | q.breakable 22 | q.text "name: #{name}" 23 | 24 | q.breakable 25 | q.text "version: #{version}" 26 | 27 | q.breakable 28 | q.text "platform: #{platform}" 29 | 30 | q.breakable 31 | q.text 'dependencies:' 32 | q.breakable 33 | q.pp dependencies 34 | 35 | q.breakable 36 | q.text "source: #{@source.path}" 37 | end 38 | end 39 | 40 | end 41 | 42 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rubygems/resolver/vendor_specification.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # A VendorSpecification represents a gem that has been unpacked into a project 3 | # and is being loaded through a gem dependencies file through the +path:+ 4 | # option. 5 | 6 | class Gem::Resolver::VendorSpecification < Gem::Resolver::SpecSpecification 7 | 8 | def == other # :nodoc: 9 | self.class === other and 10 | @set == other.set and 11 | @spec == other.spec and 12 | @source == other.source 13 | end 14 | 15 | ## 16 | # This is a null install as this gem was unpacked into a directory. 17 | # +options+ are ignored. 18 | 19 | def install options = {} 20 | yield nil 21 | end 22 | 23 | end 24 | 25 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rubygems/source/installed.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # Represents an installed gem. This is used for dependency resolution. 3 | 4 | class Gem::Source::Installed < Gem::Source 5 | 6 | def initialize # :nodoc: 7 | @uri = nil 8 | end 9 | 10 | ## 11 | # Installed sources sort before all other sources 12 | 13 | def <=> other 14 | case other 15 | when Gem::Source::Git, 16 | Gem::Source::Lock, 17 | Gem::Source::Vendor then 18 | -1 19 | when Gem::Source::Installed then 20 | 0 21 | when Gem::Source then 22 | 1 23 | else 24 | nil 25 | end 26 | end 27 | 28 | ## 29 | # We don't need to download an installed gem 30 | 31 | def download spec, path 32 | nil 33 | end 34 | 35 | def pretty_print q # :nodoc: 36 | q.text '[Installed]' 37 | end 38 | 39 | end 40 | 41 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rubygems/source/lock.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # A Lock source wraps an installed gem's source and sorts before other sources 3 | # during dependency resolution. This allows RubyGems to prefer gems from 4 | # dependency lock files. 5 | 6 | class Gem::Source::Lock < Gem::Source 7 | 8 | ## 9 | # The wrapped Gem::Source 10 | 11 | attr_reader :wrapped 12 | 13 | ## 14 | # Creates a new Lock source that wraps +source+ and moves it earlier in the 15 | # sort list. 16 | 17 | def initialize source 18 | @wrapped = source 19 | end 20 | 21 | def <=> other # :nodoc: 22 | case other 23 | when Gem::Source::Lock then 24 | @wrapped <=> other.wrapped 25 | when Gem::Source then 26 | 1 27 | else 28 | nil 29 | end 30 | end 31 | 32 | def == other # :nodoc: 33 | 0 == (self <=> other) 34 | end 35 | 36 | ## 37 | # Delegates to the wrapped source's fetch_spec method. 38 | 39 | def fetch_spec name_tuple 40 | @wrapped.fetch_spec name_tuple 41 | end 42 | 43 | def uri # :nodoc: 44 | @wrapped.uri 45 | end 46 | 47 | end 48 | 49 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rubygems/source/vendor.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # This represents a vendored source that is similar to an installed gem. 3 | 4 | class Gem::Source::Vendor < Gem::Source::Installed 5 | 6 | ## 7 | # Creates a new Vendor source for a gem that was unpacked at +path+. 8 | 9 | def initialize path 10 | @uri = path 11 | end 12 | 13 | def <=> other 14 | case other 15 | when Gem::Source::Lock then 16 | -1 17 | when Gem::Source::Vendor then 18 | 0 19 | when Gem::Source then 20 | 1 21 | else 22 | nil 23 | end 24 | end 25 | 26 | end 27 | 28 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rubygems/source_local.rb: -------------------------------------------------------------------------------- 1 | require 'rubygems/source' 2 | require 'rubygems/source_local' 3 | 4 | # TODO warn upon require, this file is deprecated. 5 | 6 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rubygems/source_specific_file.rb: -------------------------------------------------------------------------------- 1 | require 'rubygems/source/specific_file' 2 | 3 | # TODO warn upon require, this file is deprecated. 4 | 5 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rubygems/ssl_certs/Class3PublicPrimaryCertificationAuthority.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG 3 | A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz 4 | cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2 5 | MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV 6 | BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt 7 | YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN 8 | ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE 9 | BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is 10 | I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G 11 | CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do 12 | lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc 13 | AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k 14 | -----END CERTIFICATE----- 15 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rubygems/uri_formatter.rb: -------------------------------------------------------------------------------- 1 | require 'cgi' 2 | require 'uri' 3 | 4 | ## 5 | # The UriFormatter handles URIs from user-input and escaping. 6 | # 7 | # uf = Gem::UriFormatter.new 'example.com' 8 | # 9 | # p uf.normalize #=> 'http://example.com' 10 | 11 | class Gem::UriFormatter 12 | 13 | ## 14 | # The URI to be formatted. 15 | 16 | attr_reader :uri 17 | 18 | ## 19 | # Creates a new URI formatter for +uri+. 20 | 21 | def initialize uri 22 | @uri = uri 23 | end 24 | 25 | ## 26 | # Escapes the #uri for use as a CGI parameter 27 | 28 | def escape 29 | return unless @uri 30 | CGI.escape @uri 31 | end 32 | 33 | ## 34 | # Normalize the URI by adding "http://" if it is missing. 35 | 36 | def normalize 37 | (@uri =~ /^(https?|ftp|file):/i) ? @uri : "http://#{@uri}" 38 | end 39 | 40 | ## 41 | # Unescapes the #uri which came from a CGI parameter 42 | 43 | def unescape 44 | return unless @uri 45 | CGI.unescape @uri 46 | end 47 | 48 | end 49 | 50 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rubygems/util/list.rb: -------------------------------------------------------------------------------- 1 | module Gem 2 | List = Struct.new(:value, :tail) 3 | 4 | class List 5 | def each 6 | n = self 7 | while n 8 | yield n.value 9 | n = n.tail 10 | end 11 | end 12 | 13 | def to_a 14 | ary = [] 15 | n = self 16 | while n 17 | ary.unshift n.value 18 | n = n.tail 19 | end 20 | 21 | ary 22 | end 23 | 24 | def find 25 | n = self 26 | while n 27 | v = n.value 28 | return v if yield(v) 29 | n = n.tail 30 | end 31 | 32 | nil 33 | end 34 | 35 | def prepend(value) 36 | List.new value, self 37 | end 38 | 39 | def pretty_print q # :nodoc: 40 | q.pp to_a 41 | end 42 | 43 | def self.prepend(list, value) 44 | return List.new(value) unless list 45 | List.new value, list 46 | end 47 | end 48 | end 49 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/rubygems/util/stringio.rb: -------------------------------------------------------------------------------- 1 | class Gem::StringSink 2 | def initialize 3 | @string = "" 4 | end 5 | 6 | attr_reader :string 7 | 8 | def write(s) 9 | @string += s 10 | s.size 11 | end 12 | 13 | def set_encoding(enc) 14 | @string.force_encoding enc 15 | end 16 | end 17 | 18 | class Gem::StringSource 19 | def initialize(str) 20 | @string = str.dup 21 | end 22 | 23 | def read(count=nil) 24 | if count 25 | @string.slice!(0,count) 26 | else 27 | s = @string 28 | @string = "" 29 | s 30 | end 31 | end 32 | 33 | alias_method :readpartial, :read 34 | end 35 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/shell/error.rb: -------------------------------------------------------------------------------- 1 | # 2 | # shell/error.rb - 3 | # $Release Version: 0.7 $ 4 | # $Revision$ 5 | # by Keiju ISHITSUKA(keiju@ruby-lang.org) 6 | # 7 | # -- 8 | # 9 | # 10 | # 11 | 12 | require "e2mmap" 13 | 14 | class Shell 15 | module Error 16 | extend Exception2MessageMapper 17 | def_e2message TypeError, "wrong argument type %s (expected %s)" 18 | 19 | def_exception :DirStackEmpty, "Directory stack empty." 20 | def_exception :CantDefine, "Can't define method(%s, %s)." 21 | def_exception :CantApplyMethod, "This method(%s) does not apply to this type(%s)." 22 | def_exception :CommandNotFound, "Command not found(%s)." 23 | end 24 | end 25 | 26 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/shell/version.rb: -------------------------------------------------------------------------------- 1 | # 2 | # version.rb - shell version definition file 3 | # $Release Version: 0.7$ 4 | # $Revision$ 5 | # by Keiju ISHITSUKA(keiju@ruby-lang.org) 6 | # 7 | # -- 8 | # 9 | # 10 | # 11 | 12 | class Shell # :nodoc: 13 | @RELEASE_VERSION = "0.7" 14 | @LAST_UPDATE_DATE = "07/03/20" 15 | end 16 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/test/unit/assertion-failed-error.rb: -------------------------------------------------------------------------------- 1 | #-- 2 | # 3 | # Author:: Nathaniel Talbott. 4 | # Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved. 5 | # License:: Ruby license. 6 | 7 | module Test 8 | module Unit 9 | 10 | # Thrown by Test::Unit::Assertions when an assertion fails. 11 | class AssertionFailedError < StandardError 12 | attr_accessor :expected, :actual, :user_message 13 | attr_accessor :inspected_expected, :inspected_actual 14 | def initialize(message=nil, options=nil) 15 | options ||= {} 16 | @expected = options[:expected] 17 | @actual = options[:actual] 18 | @inspected_expected = options[:inspected_expected] 19 | @inspected_actual = options[:inspected_actual] 20 | @user_message = options[:user_message] 21 | super(message) 22 | end 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/test/unit/attribute-matcher.rb: -------------------------------------------------------------------------------- 1 | module Test 2 | module Unit 3 | class AttributeMatcher 4 | def initialize(test) 5 | @test = test 6 | end 7 | 8 | def match?(expression) 9 | matched = instance_eval(expression) 10 | if matched.nil? 11 | false 12 | else 13 | matched 14 | end 15 | end 16 | 17 | def method_missing(name, *args) 18 | if args.empty? 19 | @test[name] 20 | else 21 | super 22 | end 23 | end 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/test/unit/code-snippet-fetcher.rb: -------------------------------------------------------------------------------- 1 | module Test 2 | module Unit 3 | class CodeSnippetFetcher 4 | def initialize 5 | @sources = {} 6 | end 7 | 8 | def fetch(file, line, options={}) 9 | n_context_line = options[:n_context_line] || 3 10 | lines = source(file) 11 | return [] if lines.nil? 12 | min_line = [line - n_context_line, 1].max 13 | max_line = [line + n_context_line, lines.length].min 14 | window = min_line..max_line 15 | window.collect do |n| 16 | attributes = {:target_line? => (n == line)} 17 | [n, lines[n - 1].chomp, attributes] 18 | end 19 | end 20 | 21 | def source(file) 22 | @sources[file] ||= read_source(file) 23 | end 24 | 25 | private 26 | def read_source(file) 27 | return nil unless File.exist?(file) 28 | File.readlines(file) 29 | end 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/test/unit/collector/descendant.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit/collector' 2 | 3 | module Test 4 | module Unit 5 | module Collector 6 | class Descendant 7 | include Collector 8 | 9 | NAME = 'collected from the subclasses of TestCase' 10 | 11 | def collect(name=NAME) 12 | suite = TestSuite.new(name) 13 | add_test_cases(suite, TestCase::DESCENDANTS) 14 | suite 15 | end 16 | end 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/test/unit/collector/objectspace.rb: -------------------------------------------------------------------------------- 1 | # Author:: Nathaniel Talbott. 2 | # Copyright:: Copyright (c) 2000-2003 Nathaniel Talbott. All rights reserved. 3 | # License:: Ruby license. 4 | 5 | require 'test/unit/collector' 6 | 7 | module Test 8 | module Unit 9 | module Collector 10 | class ObjectSpace 11 | include Collector 12 | 13 | NAME = 'collected from the ObjectSpace' 14 | 15 | def initialize(source=::ObjectSpace) 16 | super() 17 | @source = source 18 | end 19 | 20 | def collect(name=NAME) 21 | suite = TestSuite.new(name) 22 | sub_suites = [] 23 | @source.each_object(Class) do |klass| 24 | if(Test::Unit::TestCase > klass) 25 | add_suite(sub_suites, klass.suite) 26 | end 27 | end 28 | sort(sub_suites).each{|s| suite << s} 29 | suite 30 | end 31 | end 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/test/unit/runner/emacs.rb: -------------------------------------------------------------------------------- 1 | module Test 2 | module Unit 3 | AutoRunner.register_runner(:emacs) do |auto_runner| 4 | require 'test/unit/ui/emacs/testrunner' 5 | Test::Unit::UI::Emacs::TestRunner 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/test/unit/runner/xml.rb: -------------------------------------------------------------------------------- 1 | module Test 2 | module Unit 3 | AutoRunner.register_runner(:xml) do |auto_runner| 4 | require 'test/unit/ui/xml/testrunner' 5 | Test::Unit::UI::XML::TestRunner 6 | end 7 | 8 | AutoRunner.setup_option do |auto_runner, opts| 9 | opts.on("--output-file-descriptor=FD", Integer, 10 | "Outputs to file descriptor FD") do |fd| 11 | auto_runner.runner_options[:output_file_descriptor] = fd 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/test/unit/ui/console/outputlevel.rb: -------------------------------------------------------------------------------- 1 | module Test 2 | module Unit 3 | module UI 4 | module Console 5 | module OutputLevel 6 | SILENT = 0 7 | PROGRESS_ONLY = 1 8 | IMPORTANT_FAULTS_ONLY = 2 9 | NORMAL = 3 10 | VERBOSE = 4 11 | end 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/test/unit/util/method-owner-finder.rb: -------------------------------------------------------------------------------- 1 | module Test 2 | module Unit 3 | module Util 4 | module MethodOwnerFinder 5 | module_function 6 | def find(object, method_name) 7 | method = object.method(method_name) 8 | return method.owner if method.respond_to?(:owner) 9 | 10 | if /\((.+?)\)\#/ =~ method.to_s 11 | owner_name = $1 12 | if /\A# ["stdout\n", "stderr\n"] 14 | def capture_output 15 | require 'stringio' 16 | 17 | output = StringIO.new 18 | error = StringIO.new 19 | stdout_save, stderr_save = $stdout, $stderr 20 | $stdout, $stderr = output, error 21 | begin 22 | yield 23 | [output.string, error.string] 24 | ensure 25 | $stdout, $stderr = stdout_save, stderr_save 26 | end 27 | end 28 | end 29 | end 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/test/unit/version.rb: -------------------------------------------------------------------------------- 1 | module Test 2 | module Unit 3 | VERSION = '3.0.3' 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/ubygems.rb: -------------------------------------------------------------------------------- 1 | # This file allows for the running of rubygems with a nice 2 | # command line look-and-feel: ruby -rubygems foo.rb 3 | #-- 4 | # Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others. 5 | # All rights reserved. 6 | # See LICENSE.txt for permissions. 7 | #++ 8 | 9 | 10 | require 'rubygems' 11 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/uri/https.rb: -------------------------------------------------------------------------------- 1 | # = uri/https.rb 2 | # 3 | # Author:: Akira Yamada 4 | # License:: You can redistribute it and/or modify it under the same term as Ruby. 5 | # Revision:: $Id$ 6 | # 7 | # See URI for general documentation 8 | # 9 | 10 | require 'uri/http' 11 | 12 | module URI 13 | 14 | # The default port for HTTPS URIs is 443, and the scheme is 'https:' rather 15 | # than 'http:'. Other than that, HTTPS URIs are identical to HTTP URIs; 16 | # see URI::HTTP. 17 | class HTTPS < HTTP 18 | # A Default port of 443 for URI::HTTPS 19 | DEFAULT_PORT = 443 20 | end 21 | @@schemes['HTTPS'] = HTTPS 22 | end 23 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/uri/ldaps.rb: -------------------------------------------------------------------------------- 1 | # = uri/ldap.rb 2 | # 3 | # License:: You can redistribute it and/or modify it under the same term as Ruby. 4 | # 5 | # See URI for general documentation 6 | # 7 | 8 | require 'uri/ldap' 9 | 10 | module URI 11 | 12 | # The default port for LDAPS URIs is 636, and the scheme is 'ldaps:' rather 13 | # than 'ldap:'. Other than that, LDAPS URIs are identical to LDAP URIs; 14 | # see URI::LDAP. 15 | class LDAPS < LDAP 16 | # A Default port of 636 for URI::LDAPS 17 | DEFAULT_PORT = 636 18 | end 19 | @@schemes['LDAPS'] = LDAPS 20 | end 21 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/webrick/compat.rb: -------------------------------------------------------------------------------- 1 | # 2 | # compat.rb -- cross platform compatibility 3 | # 4 | # Author: IPR -- Internet Programming with Ruby -- writers 5 | # Copyright (c) 2002 GOTOU Yuuzou 6 | # Copyright (c) 2002 Internet Programming with Ruby writers. All rights 7 | # reserved. 8 | # 9 | # $IPR: compat.rb,v 1.6 2002/10/01 17:16:32 gotoyuzo Exp $ 10 | 11 | ## 12 | # System call error module used by webrick for cross platform compatibility. 13 | # 14 | # EPROTO:: protocol error 15 | # ECONNRESET:: remote host reset the connection request 16 | # ECONNABORTED:: Client sent TCP reset (RST) before server has accepted the 17 | # connection requested by client. 18 | # 19 | module Errno 20 | ## 21 | # Protocol error. 22 | 23 | class EPROTO < SystemCallError; end 24 | 25 | ## 26 | # Remote host reset the connection request. 27 | 28 | class ECONNRESET < SystemCallError; end 29 | 30 | ## 31 | # Client sent TCP reset (RST) before server has accepted the connection 32 | # requested by client. 33 | 34 | class ECONNABORTED < SystemCallError; end 35 | end 36 | -------------------------------------------------------------------------------- /src/main/resources/stdlib/webrick/htmlutils.rb: -------------------------------------------------------------------------------- 1 | #-- 2 | # htmlutils.rb -- HTMLUtils Module 3 | # 4 | # Author: IPR -- Internet Programming with Ruby -- writers 5 | # Copyright (c) 2000, 2001 TAKAHASHI Masayoshi, GOTOU Yuuzou 6 | # Copyright (c) 2002 Internet Programming with Ruby writers. All rights 7 | # reserved. 8 | # 9 | # $IPR: htmlutils.rb,v 1.7 2002/09/21 12:23:35 gotoyuzo Exp $ 10 | 11 | module WEBrick 12 | module HTMLUtils 13 | 14 | ## 15 | # Escapes &, ", > and < in +string+ 16 | 17 | def escape(string) 18 | return "" unless string 19 | str = string.b 20 | str.gsub!(/&/n, '&') 21 | str.gsub!(/\"/n, '"') 22 | str.gsub!(/>/n, '>') 23 | str.gsub!(/