rb2exe 0.1.11 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +22 -0
- data/README.md +18 -22
- data/bin/build +24 -0
- data/bin/decompress +17 -0
- data/bin/installer +19 -0
- data/bin/rb2exe +3 -0
- data/bin/rb2exe.rb +49 -0
- data/bin/traveling-ruby-2.2.2/bin.real/bundle +23 -0
- data/bin/traveling-ruby-2.2.2/bin.real/bundler +23 -0
- data/bin/traveling-ruby-2.2.2/bin.real/gem +25 -0
- data/bin/traveling-ruby-2.2.2/bin.real/irb +11 -0
- data/bin/traveling-ruby-2.2.2/bin.real/nokogiri +23 -0
- data/bin/traveling-ruby-2.2.2/bin.real/posix-spawn-benchmark +23 -0
- data/bin/traveling-ruby-2.2.2/bin.real/puma +23 -0
- data/bin/traveling-ruby-2.2.2/bin.real/pumactl +23 -0
- data/bin/traveling-ruby-2.2.2/bin.real/rackup +23 -0
- data/bin/traveling-ruby-2.2.2/bin.real/rake +33 -0
- data/bin/traveling-ruby-2.2.2/bin.real/redcarpet +23 -0
- data/bin/traveling-ruby-2.2.2/bin.real/redcloth +23 -0
- data/bin/traveling-ruby-2.2.2/bin.real/ruby +0 -0
- data/bin/traveling-ruby-2.2.2/bin.real/thin +23 -0
- data/bin/traveling-ruby-2.2.2/bin.real/unicorn +23 -0
- data/bin/traveling-ruby-2.2.2/bin.real/unicorn_rails +23 -0
- data/bin/traveling-ruby-2.2.2/bin/gem +6 -0
- data/bin/traveling-ruby-2.2.2/bin/irb +6 -0
- data/bin/traveling-ruby-2.2.2/bin/rake +6 -0
- data/bin/traveling-ruby-2.2.2/bin/ruby +6 -0
- data/bin/traveling-ruby-2.2.2/bin/ruby_environment +33 -0
- data/bin/traveling-ruby-2.2.2/info/GEM_EXTENSION_API_VERSION +1 -0
- data/bin/traveling-ruby-2.2.2/info/GEM_PLATFORM +1 -0
- data/bin/traveling-ruby-2.2.2/info/RUBY_ARCH +1 -0
- data/bin/traveling-ruby-2.2.2/info/RUBY_COMPAT_VERSION +1 -0
- data/bin/traveling-ruby-2.2.2/lib/ca-bundle.crt +13885 -0
- data/bin/traveling-ruby-2.2.2/lib/libffi.so.6 +0 -0
- data/bin/traveling-ruby-2.2.2/lib/libreadline.so.5 +0 -0
- data/bin/traveling-ruby-2.2.2/lib/libtermcap.so.2 +0 -0
- data/bin/traveling-ruby-2.2.2/lib/libz.so.1 +0 -0
- data/bin/traveling-ruby-2.2.2/lib/restore_environment.rb +17 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/English.rb +185 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/abbrev.rb +131 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/base64.rb +91 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/benchmark.rb +557 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/bigdecimal/jacobian.rb +87 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/bigdecimal/ludcmp.rb +88 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/bigdecimal/math.rb +231 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/bigdecimal/newton.rb +79 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/bigdecimal/util.rb +127 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/cgi.rb +295 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/cgi/cookie.rb +170 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/cgi/core.rb +880 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/cgi/html.rb +1034 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/cgi/session.rb +531 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/cgi/session/pstore.rb +100 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/cgi/util.rb +194 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/cmath.rb +400 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/csv.rb +2341 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/date.rb +60 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/debug.rb +1087 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/delegate.rb +417 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/digest.rb +108 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/digest/sha2.rb +107 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/drb.rb +2 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/drb/acl.rb +232 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/drb/drb.rb +1864 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/drb/eq.rb +14 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/drb/extserv.rb +43 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/drb/extservm.rb +93 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/drb/gw.rb +160 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/drb/invokemethod.rb +34 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/drb/observer.rb +25 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/drb/ssl.rb +345 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/drb/timeridconv.rb +101 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/drb/unix.rb +117 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/e2mmap.rb +172 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/erb.rb +1022 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/expect.rb +71 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/fiddle.rb +55 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/fiddle/closure.rb +48 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/fiddle/cparser.rb +176 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/fiddle/function.rb +17 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/fiddle/import.rb +314 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/fiddle/pack.rb +128 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/fiddle/struct.rb +243 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/fiddle/types.rb +71 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/fiddle/value.rb +112 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/fileutils.rb +1761 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/find.rb +88 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/forwardable.rb +289 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/getoptlong.rb +612 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/bigdecimal.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/continuation.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/date_core.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/digest.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/digest/bubblebabble.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/digest/md5.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/digest/rmd160.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/digest/sha1.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/digest/sha2.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/big5.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/cp949.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/emacs_mule.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/encdb.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/euc_jp.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/euc_kr.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/euc_tw.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/gb18030.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/gb2312.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/gbk.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/iso_8859_1.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/iso_8859_10.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/iso_8859_11.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/iso_8859_13.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/iso_8859_14.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/iso_8859_15.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/iso_8859_16.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/iso_8859_2.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/iso_8859_3.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/iso_8859_4.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/iso_8859_5.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/iso_8859_6.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/iso_8859_7.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/iso_8859_8.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/iso_8859_9.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/koi8_r.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/koi8_u.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/shift_jis.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/trans/big5.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/trans/chinese.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/trans/emoji.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/trans/emoji_iso2022_kddi.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/trans/emoji_sjis_docomo.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/trans/emoji_sjis_kddi.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/trans/emoji_sjis_softbank.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/trans/escape.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/trans/gb18030.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/trans/gbk.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/trans/iso2022.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/trans/japanese.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/trans/japanese_euc.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/trans/japanese_sjis.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/trans/korean.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/trans/single_byte.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/trans/transdb.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/trans/utf8_mac.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/trans/utf_16_32.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/utf_16be.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/utf_16le.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/utf_32be.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/utf_32le.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/windows_1251.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/enc/windows_31j.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/etc.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/fcntl.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/fiber.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/fiddle.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/io/console.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/io/nonblock.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/io/wait.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/json/ext/generator.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/json/ext/parser.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/mathn/complex.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/mathn/rational.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/nkf.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/objspace.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/openssl.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/pathname.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/psych.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/pty.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/racc/cparse.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/rbconfig.rb +279 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/rbconfig/sizeof.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/readline.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/ripper.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/socket.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/stringio.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/strscan.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/syslog.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/thread.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/i686-linux/zlib.so +0 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/io/console/size.rb +22 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/ipaddr.rb +658 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb.rb +703 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/cmd/chws.rb +33 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/cmd/fork.rb +38 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/cmd/help.rb +41 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/cmd/load.rb +66 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/cmd/nop.rb +38 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/cmd/pushws.rb +40 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/cmd/subirb.rb +42 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/completion.rb +227 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/context.rb +419 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/ext/change-ws.rb +45 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/ext/history.rb +118 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/ext/loader.rb +128 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/ext/math-mode.rb +47 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/ext/multi-irb.rb +265 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/ext/save-history.rb +103 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/ext/tracer.rb +71 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/ext/use-loader.rb +73 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/ext/workspaces.rb +66 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/extend-command.rb +308 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/frame.rb +80 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/help.rb +36 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/init.rb +304 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/input-method.rb +191 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/inspector.rb +131 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/lc/error.rb +31 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/lc/help-message +50 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/lc/ja/encoding_aliases.rb +10 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/lc/ja/error.rb +30 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/lc/ja/help-message +53 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/locale.rb +181 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/magic-file.rb +37 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/notifier.rb +231 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/output-method.rb +91 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/ruby-lex.rb +1170 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/ruby-token.rb +266 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/slex.rb +281 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/src_encoding.rb +4 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/version.rb +15 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/workspace.rb +114 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/ws-for-case-2.rb +14 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/irb/xmp.rb +169 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/json.rb +62 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/json/add/bigdecimal.rb +28 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/json/add/complex.rb +22 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/json/add/core.rb +11 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/json/add/date.rb +34 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/json/add/date_time.rb +50 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/json/add/exception.rb +31 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/json/add/ostruct.rb +31 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/json/add/range.rb +29 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/json/add/rational.rb +22 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/json/add/regexp.rb +30 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/json/add/struct.rb +30 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/json/add/symbol.rb +25 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/json/add/time.rb +38 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/json/common.rb +484 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/json/ext.rb +21 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/json/generic_object.rb +70 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/json/version.rb +8 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/kconv.rb +282 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/logger.rb +737 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/mathn.rb +191 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/matrix.rb +2161 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/matrix/eigenvalue_decomposition.rb +882 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/matrix/lup_decomposition.rb +218 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb +2677 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/monitor.rb +300 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/mutex_m.rb +111 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/net/ftp.rb +1126 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/net/http.rb +1559 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/net/http/backward.rb +25 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/net/http/exceptions.rb +25 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/net/http/generic_request.rb +332 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/net/http/header.rb +452 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/net/http/proxy_delta.rb +16 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/net/http/request.rb +20 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/net/http/requests.rb +122 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/net/http/response.rb +414 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/net/http/responses.rb +273 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/net/https.rb +22 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/net/imap.rb +3616 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/net/pop.rb +1021 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/net/protocol.rb +420 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/net/smtp.rb +1073 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/net/telnet.rb +763 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/observer.rb +203 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/open-uri.rb +801 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/open3.rb +663 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/openssl.rb +24 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/openssl/bn.rb +45 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/openssl/buffering.rb +457 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/openssl/cipher.rb +65 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/openssl/config.rb +472 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/openssl/digest.rb +88 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/openssl/ssl.rb +308 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/openssl/x509.rb +182 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/optionparser.rb +1 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/optparse.rb +1997 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/optparse/ac.rb +50 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/optparse/date.rb +17 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/optparse/shellwords.rb +6 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/optparse/time.rb +10 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/optparse/uri.rb +6 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/optparse/version.rb +70 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/ostruct.rb +286 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/pathname.rb +579 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/pp.rb +546 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/prettyprint.rb +554 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/prime.rb +487 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/profile.rb +10 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/profiler.rb +148 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/pstore.rb +484 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych.rb +498 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/class_loader.rb +101 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/coder.rb +94 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/core_ext.rb +35 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/deprecated.rb +85 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/exception.rb +13 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/handler.rb +249 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/handlers/document_stream.rb +22 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/handlers/recorder.rb +39 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/json/ruby_events.rb +19 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/json/stream.rb +16 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/json/tree_builder.rb +12 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/json/yaml_events.rb +29 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/nodes.rb +77 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/nodes/alias.rb +18 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/nodes/document.rb +60 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/nodes/mapping.rb +56 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/nodes/node.rb +55 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/nodes/scalar.rb +67 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/nodes/sequence.rb +81 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/nodes/stream.rb +37 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/omap.rb +4 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/parser.rb +51 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/scalar_scanner.rb +149 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/set.rb +4 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/stream.rb +37 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/streaming.rb +27 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/syntax_error.rb +21 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/tree_builder.rb +96 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/visitors.rb +6 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/visitors/depth_first.rb +26 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/visitors/emitter.rb +51 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/visitors/json_tree.rb +24 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb +389 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/visitors/visitor.rb +19 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/visitors/yaml_tree.rb +565 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/psych/y.rb +9 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/racc/parser.rb +622 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake.rb +79 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/alt_system.rb +110 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb +790 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/backtrace.rb +23 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/clean.rb +76 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/cloneable.rb +16 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/contrib/compositepublisher.rb +21 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/contrib/ftptools.rb +137 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/contrib/publisher.rb +81 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/contrib/rubyforgepublisher.rb +18 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/contrib/sshpublisher.rb +61 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/contrib/sys.rb +4 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/cpu_counter.rb +125 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/default_loader.rb +14 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/dsl_definition.rb +201 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/early_time.rb +21 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/ext/core.rb +25 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/ext/module.rb +2 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/ext/pathname.rb +25 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/ext/string.rb +173 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/ext/time.rb +16 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/file_creation_task.rb +24 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/file_list.rb +428 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/file_task.rb +46 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/file_utils.rb +128 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/file_utils_ext.rb +144 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/gempackagetask.rb +4 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/invocation_chain.rb +56 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/invocation_exception_mixin.rb +16 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/late_time.rb +17 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/linked_list.rb +103 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/loaders/makefile.rb +40 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/multi_task.rb +13 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/name_space.rb +38 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/packagetask.rb +199 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/pathmap.rb +3 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/phony.rb +15 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/private_reader.rb +20 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/promise.rb +99 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/pseudo_status.rb +29 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/rake_module.rb +38 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/rake_test_loader.rb +22 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/rdoctask.rb +4 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/ruby182_test_unit_fix.rb +29 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/rule_recursion_overflow_error.rb +20 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/runtest.rb +27 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/scope.rb +42 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb +383 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/task_argument_error.rb +7 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/task_arguments.rb +98 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/task_manager.rb +310 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/tasklib.rb +24 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/testtask.rb +212 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/thread_history_display.rb +48 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/thread_pool.rb +164 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/trace_output.rb +22 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/version.rb +7 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rake/win32.rb +56 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rbconfig/datadir.rb +13 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc.rb +185 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/alias.rb +111 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/anon_class.rb +10 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/any_method.rb +316 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/attr.rb +175 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/class_module.rb +799 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/code_object.rb +429 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/code_objects.rb +5 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/comment.rb +229 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/constant.rb +186 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/context.rb +1211 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/context/section.rb +238 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/cross_reference.rb +183 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/encoding.rb +99 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/erb_partial.rb +18 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/erbio.rb +37 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/extend.rb +9 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/generator.rb +51 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/ghost_method.rb +6 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/i18n.rb +9 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/i18n/locale.rb +101 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/i18n/text.rb +125 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/include.rb +9 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/known_classes.rb +72 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markdown.rb +16133 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markdown/entities.rb +2131 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markdown/literals_1_9.rb +420 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup.rb +869 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/attr_changer.rb +22 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/attr_span.rb +29 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/attribute_manager.rb +343 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/attributes.rb +70 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/blank_line.rb +27 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/block_quote.rb +14 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/document.rb +164 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/formatter.rb +264 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/formatter_test_case.rb +767 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/hard_break.rb +31 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/heading.rb +78 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/include.rb +42 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/indented_paragraph.rb +47 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/inline.rb +1 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/list.rb +101 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/list_item.rb +99 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/paragraph.rb +28 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/parser.rb +558 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/pre_process.rb +293 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/raw.rb +69 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/rule.rb +20 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/special.rb +40 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/text_formatter_test_case.rb +114 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/to_ansi.rb +93 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/to_bs.rb +78 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/to_html.rb +398 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/to_html_crossref.rb +160 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/to_html_snippet.rb +284 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/to_joined_paragraph.rb +71 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/to_label.rb +74 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/to_markdown.rb +191 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/to_rdoc.rb +333 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/to_table_of_contents.rb +87 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/to_test.rb +69 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/to_tt_only.rb +120 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/markup/verbatim.rb +83 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/meta_method.rb +6 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/method_attr.rb +418 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/mixin.rb +120 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/normal_class.rb +92 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/normal_module.rb +73 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/options.rb +1251 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/parser.rb +310 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/parser/c.rb +1229 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/parser/changelog.rb +198 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/parser/markdown.rb +23 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/parser/rd.rb +22 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/parser/ruby.rb +2160 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/parser/ruby_tools.rb +167 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/parser/simple.rb +61 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/parser/text.rb +11 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/rd.rb +99 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/rd/block_parser.rb +1055 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/rd/inline.rb +71 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/rd/inline_parser.rb +1207 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/rdoc.rb +570 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/require.rb +51 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/ri.rb +20 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/ri/driver.rb +1497 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/ri/formatter.rb +5 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/ri/paths.rb +187 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/ri/store.rb +6 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/ri/task.rb +71 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/ruby_lex.rb +1377 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/ruby_token.rb +460 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/rubygems_hook.rb +253 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/servlet.rb +441 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/single_class.rb +25 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/stats.rb +461 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/stats/normal.rb +59 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/stats/quiet.rb +59 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/stats/verbose.rb +45 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/store.rb +979 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/task.rb +330 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/test_case.rb +217 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/text.rb +324 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/token_stream.rb +95 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/tom_doc.rb +257 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rdoc/top_level.rb +282 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/resolv-replace.rb +74 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/resolv.rb +2836 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/attlistdecl.rb +62 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/attribute.rb +191 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/cdata.rb +67 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/child.rb +96 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/comment.rb +79 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/doctype.rb +269 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/document.rb +290 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/dtd/attlistdecl.rb +10 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/dtd/dtd.rb +46 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/dtd/elementdecl.rb +17 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/dtd/entitydecl.rb +56 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/dtd/notationdecl.rb +39 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/element.rb +1240 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/encoding.rb +50 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/entity.rb +173 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/formatters/default.rb +111 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/formatters/pretty.rb +141 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/formatters/transitive.rb +57 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/functions.rb +394 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/instruction.rb +70 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/light/node.rb +195 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/namespace.rb +47 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/node.rb +75 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/output.rb +29 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/parent.rb +165 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/parseexception.rb +51 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/parsers/baseparser.rb +532 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/parsers/lightparser.rb +58 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/parsers/pullparser.rb +196 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/parsers/sax2parser.rb +272 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/parsers/streamparser.rb +52 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/parsers/treeparser.rb +100 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/parsers/ultralightparser.rb +56 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/parsers/xpathparser.rb +656 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/quickpath.rb +265 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/rexml.rb +31 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/sax2listener.rb +97 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/security.rb +27 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/source.rb +296 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/streamlistener.rb +92 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/syncenumerator.rb +32 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/text.rb +425 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/undefinednamespaceexception.rb +8 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/validation/relaxng.rb +538 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/validation/validation.rb +143 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/validation/validationexception.rb +9 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/xmldecl.rb +115 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/xmltokens.rb +84 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/xpath.rb +80 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rexml/xpath_parser.rb +703 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rinda/rinda.rb +327 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rinda/ring.rb +480 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rinda/tuplespace.rb +642 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/ripper.rb +73 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/ripper/core.rb +70 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/ripper/filter.rb +77 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/ripper/lexer.rb +186 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/ripper/sexp.rb +118 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss.rb +91 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/0.9.rb +461 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/1.0.rb +484 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/2.0.rb +142 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/atom.rb +839 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/content.rb +33 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/content/1.0.rb +9 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/content/2.0.rb +11 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/converter.rb +170 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/dublincore.rb +163 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/dublincore/1.0.rb +12 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/dublincore/2.0.rb +12 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/dublincore/atom.rb +16 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/image.rb +197 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/itunes.rb +412 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/maker.rb +78 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/maker/0.9.rb +508 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/maker/1.0.rb +435 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/maker/2.0.rb +223 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/maker/atom.rb +172 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/maker/base.rb +944 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/maker/content.rb +21 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/maker/dublincore.rb +121 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/maker/entry.rb +163 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/maker/feed.rb +426 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/maker/image.rb +111 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/maker/itunes.rb +242 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/maker/slash.rb +33 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/maker/syndication.rb +18 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/maker/taxonomy.rb +118 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/maker/trackback.rb +61 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/parser.rb +570 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/rexmlparser.rb +49 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/rss.rb +1352 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/slash.rb +51 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/syndication.rb +68 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/taxonomy.rb +147 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/trackback.rb +290 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/utils.rb +199 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/xml-stylesheet.rb +105 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/xml.rb +71 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/xmlparser.rb +94 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rss/xmlscanner.rb +121 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems.rb +1245 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/available_set.rb +164 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/basic_specification.rb +290 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/command.rb +582 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/command_manager.rb +218 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/build_command.rb +60 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/cert_command.rb +276 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/check_command.rb +93 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/cleanup_command.rb +165 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/contents_command.rb +190 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/dependency_command.rb +207 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/environment_command.rb +158 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/fetch_command.rb +77 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/generate_index_command.rb +84 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/help_command.rb +384 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/install_command.rb +347 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/list_command.rb +40 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/lock_command.rb +110 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/mirror_command.rb +25 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/open_command.rb +74 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/outdated_command.rb +32 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/owner_command.rb +99 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/pristine_command.rb +165 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/push_command.rb +98 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/query_command.rb +343 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/rdoc_command.rb +96 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/search_command.rb +40 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/server_command.rb +86 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/setup_command.rb +483 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/sources_command.rb +210 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/specification_command.rb +145 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/stale_command.rb +38 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/uninstall_command.rb +164 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/unpack_command.rb +182 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/update_command.rb +277 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/which_command.rb +90 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/commands/yank_command.rb +107 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/compatibility.rb +59 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/config_file.rb +483 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_gem.rb +73 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb +139 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/defaults.rb +177 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/dependency.rb +334 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/dependency_installer.rb +480 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/dependency_list.rb +240 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/deprecate.rb +70 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/doctor.rb +131 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/errors.rb +137 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/exceptions.rb +270 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/ext.rb +18 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/ext/build_error.rb +6 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/ext/builder.rb +218 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/ext/cmake_builder.rb +16 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/ext/configure_builder.rb +23 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/ext/ext_conf_builder.rb +78 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/ext/rake_builder.rb +36 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/gem_runner.rb +81 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/gemcutter_utilities.rb +154 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/indexer.rb +498 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/install_default_message.rb +12 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/install_message.rb +12 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/install_update_options.rb +186 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/installer.rb +819 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/installer_test_case.rb +193 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/local_remote_options.rb +148 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/mock_gem_ui.rb +88 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/name_tuple.rb +123 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/package.rb +613 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/package/digest_io.rb +64 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/package/file_source.rb +33 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/package/io_source.rb +45 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/package/old.rb +178 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/package/source.rb +3 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/package/tar_header.rb +229 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/package/tar_reader.rb +123 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/package/tar_reader/entry.rb +147 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/package/tar_test_case.rb +137 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/package/tar_writer.rb +326 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/package_task.rb +128 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/path_support.rb +87 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/platform.rb +204 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/psych_additions.rb +9 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/psych_tree.rb +31 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/rdoc.rb +335 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/remote_fetcher.rb +398 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/request.rb +244 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/request/connection_pools.rb +83 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/request/http_pool.rb +47 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/request/https_pool.rb +10 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/request_set.rb +413 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/request_set/gem_dependency_api.rb +801 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/request_set/lockfile.rb +650 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/requirement.rb +273 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/resolver.rb +485 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/resolver/activation_request.rb +172 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/resolver/api_set.rb +125 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/resolver/api_specification.rb +85 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/resolver/best_set.rb +78 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/resolver/composed_set.rb +66 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/resolver/conflict.rb +160 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/resolver/current_set.rb +13 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/resolver/dependency_request.rb +116 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/resolver/git_set.rb +122 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/resolver/git_specification.rb +59 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/resolver/index_set.rb +80 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/resolver/index_specification.rb +69 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/resolver/installed_specification.rb +58 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/resolver/installer_set.rb +224 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/resolver/local_specification.rb +41 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/resolver/lock_set.rb +84 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/resolver/lock_specification.rb +84 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/resolver/requirement_list.rb +81 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/resolver/set.rb +56 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/resolver/spec_specification.rb +56 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/resolver/specification.rb +110 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/resolver/stats.rb +44 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/resolver/vendor_set.rb +87 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/resolver/vendor_specification.rb +24 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/security.rb +595 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/security/policies.rb +115 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/security/policy.rb +295 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/security/signer.rb +154 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/security/trust_dir.rb +118 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/server.rb +868 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/source.rb +234 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/source/git.rb +240 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/source/installed.rb +40 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/source/local.rb +129 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/source/lock.rb +48 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/source/specific_file.rb +72 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/source/vendor.rb +27 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/source_list.rb +149 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/source_local.rb +5 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/source_specific_file.rb +4 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/spec_fetcher.rb +269 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/specification.rb +2800 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/ssl_certs/AddTrustExternalCARoot-2048.pem +25 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/ssl_certs/AddTrustExternalCARoot.pem +32 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/ssl_certs/Class3PublicPrimaryCertificationAuthority.pem +14 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/ssl_certs/DigiCertHighAssuranceEVRootCA.pem +23 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/ssl_certs/EntrustnetSecureServerCertificationAuthority.pem +28 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/ssl_certs/GeoTrustGlobalCA.pem +20 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/stub_specification.rb +196 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/syck_hack.rb +76 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/test_case.rb +1430 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/test_utilities.rb +383 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/text.rb +75 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/uninstaller.rb +345 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/uri_formatter.rb +49 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/user_interaction.rb +711 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/util.rb +134 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/util/list.rb +48 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/util/stringio.rb +34 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/validator.rb +165 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/version.rb +356 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/rubygems/version_option.rb +71 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/scanf.rb +776 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/securerandom.rb +293 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/set.rb +787 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/shell.rb +458 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/shell/builtin-command.rb +146 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/shell/command-processor.rb +667 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/shell/error.rb +25 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/shell/filter.rb +137 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/shell/process-controller.rb +310 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/shell/system-command.rb +158 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/shell/version.rb +15 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/shellwords.rb +215 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/singleton.rb +172 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/socket.rb +871 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/sync.rb +328 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/syslog/logger.rb +208 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/tempfile.rb +367 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/thwait.rb +140 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/time.rb +676 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/timeout.rb +130 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/tmpdir.rb +139 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/tracer.rb +286 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/tsort.rb +450 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/ubygems.rb +10 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/un.rb +375 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/unicode_normalize.rb +78 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/unicode_normalize/normalize.rb +168 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/unicode_normalize/tables.rb +1163 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/uri.rb +111 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/uri/common.rb +720 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/uri/ftp.rb +266 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/uri/generic.rb +1557 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/uri/http.rb +106 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/uri/https.rb +22 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/uri/ldap.rb +260 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/uri/ldaps.rb +20 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/uri/mailto.rb +286 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/uri/rfc2396_parser.rb +543 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/uri/rfc3986_parser.rb +124 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/weakref.rb +106 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick.rb +226 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/accesslog.rb +158 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/cgi.rb +308 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/compat.rb +35 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/config.rb +151 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/cookie.rb +171 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/htmlutils.rb +29 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/httpauth.rb +95 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/httpauth/authenticator.rb +116 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/httpauth/basicauth.rb +108 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/httpauth/digestauth.rb +408 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/httpauth/htdigest.rb +131 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/httpauth/htgroup.rb +93 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/httpauth/htpasswd.rb +124 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/httpauth/userdb.rb +52 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/httpproxy.rb +337 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/httprequest.rb +584 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/httpresponse.rb +466 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/https.rb +86 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb +278 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/httpservlet.rb +22 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/httpservlet/abstract.rb +153 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/httpservlet/cgi_runner.rb +46 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/httpservlet/cgihandler.rb +120 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/httpservlet/erbhandler.rb +87 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/httpservlet/filehandler.rb +521 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/httpservlet/prochandler.rb +46 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/httpstatus.rb +196 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/httputils.rb +509 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/httpversion.rb +75 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/log.rb +155 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/server.rb +365 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/ssl.rb +196 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/utils.rb +230 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/webrick/version.rb +17 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/xmlrpc.rb +301 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/xmlrpc/base64.rb +62 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/xmlrpc/client.rb +614 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/xmlrpc/config.rb +43 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/xmlrpc/create.rb +286 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/xmlrpc/datetime.rb +129 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/xmlrpc/marshal.rb +66 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/xmlrpc/parser.rb +870 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/xmlrpc/server.rb +707 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/xmlrpc/utils.rb +171 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/yaml.rb +59 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/yaml/dbm.rb +279 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/yaml/store.rb +81 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/build_info/charlock_holmes-0.7.3.info +1 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/build_info/eventmachine-1.0.4.info +1 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/build_info/eventmachine-1.0.6.info +1 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/build_info/puma-2.11.2.info +1 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/build_info/rugged-0.21.4.info +1 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/build_info/rugged-0.22.0b5.info +1 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/bin/bundle +21 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/bin/bundle_ruby +56 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/bin/bundler +21 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/bundler.gemspec +32 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler.rb +446 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/anonymizable_uri.rb +32 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/capistrano.rb +16 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/cli.rb +407 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/cli/binstubs.rb +38 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/cli/cache.rb +35 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/cli/check.rb +35 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/cli/clean.rb +26 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/cli/common.rb +56 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/cli/config.rb +84 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/cli/console.rb +38 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/cli/exec.rb +44 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/cli/gem.rb +195 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/cli/init.rb +33 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/cli/inject.rb +33 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/cli/install.rb +156 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/cli/open.rb +23 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/cli/outdated.rb +80 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/cli/package.rb +45 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/cli/platform.rb +43 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/cli/show.rb +74 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/cli/update.rb +73 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/cli/viz.rb +27 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/constants.rb +5 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/current_ruby.rb +183 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/definition.rb +628 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/dep_proxy.rb +43 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/dependency.rb +110 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/deployment.rb +59 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/deprecate.rb +15 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/dsl.rb +331 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/endpoint_specification.rb +76 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/env.rb +75 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/environment.rb +42 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/fetcher.rb +423 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/friendly_errors.rb +85 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/gem_helper.rb +180 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/gem_helpers.rb +26 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/gem_installer.rb +9 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/gem_path_manipulation.rb +8 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/gem_tasks.rb +2 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/graph.rb +169 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/index.rb +197 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/injector.rb +64 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/installer.rb +339 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/lazy_specification.rb +83 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/lockfile_parser.rb +167 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/man/bundle +119 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/man/bundle-config +217 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/man/bundle-exec +159 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/man/bundle-install +345 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/man/bundle-package +52 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/man/bundle-platform +61 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/man/bundle-update +213 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/man/gemfile.5 +669 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/match_platform.rb +13 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/psyched_yaml.rb +26 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/remote_specification.rb +57 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/resolver.rb +334 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/retry.rb +60 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/ruby_dsl.rb +11 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/ruby_version.rb +117 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/rubygems_ext.rb +170 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/rubygems_integration.rb +619 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/runtime.rb +289 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/settings.rb +208 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/setup.rb +24 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/shared_helpers.rb +149 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/similarity_detector.rb +63 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/source.rb +46 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/source/git.rb +294 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/source/git/git_proxy.rb +162 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/source/path.rb +226 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/source/path/installer.rb +43 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/source/rubygems.rb +381 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/source_list.rb +101 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/spec_set.rb +154 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/ssl_certs/.document +1 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/ssl_certs/AddTrustExternalCARoot-2048.pem +25 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/ssl_certs/AddTrustExternalCARoot.pem +32 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/ssl_certs/Class3PublicPrimaryCertificationAuthority.pem +14 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/ssl_certs/DigiCertHighAssuranceEVRootCA.pem +23 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/ssl_certs/EntrustnetSecureServerCertificationAuthority.pem +28 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/ssl_certs/GeoTrustGlobalCA.pem +20 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/ssl_certs/certificate_manager.rb +65 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/ui.rb +7 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/ui/rg_proxy.rb +21 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/ui/shell.rb +103 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/ui/silent.rb +44 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/molinillo/lib/molinillo.rb +5 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +266 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +69 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +3 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +90 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +63 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +415 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +43 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +43 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/net/http/faster.rb +26 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/net/http/persistent.rb +1230 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/net/http/persistent/ssl_reuse.rb +128 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor.rb +484 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/actions.rb +319 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +103 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +59 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +118 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +135 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +316 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +107 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/base.rb +656 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/command.rb +133 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +77 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +10 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +98 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/error.rb +32 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/group.rb +281 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/invocation.rb +178 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/line_editor.rb +17 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +35 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +88 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +73 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +175 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/parser/option.rb +125 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/parser/options.rb +218 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +71 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/runner.rb +322 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/shell.rb +81 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +421 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/shell/color.rb +149 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/shell/html.rb +126 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/util.rb +267 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/version.rb +3 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendored_molinillo.rb +2 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendored_persistent.rb +11 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendored_thor.rb +3 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/version.rb +6 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vlad.rb +11 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/worker.rb +73 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/specifications/bundler-1.9.9.gemspec +47 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/specifications/default/bigdecimal-1.2.6.gemspec +20 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/specifications/default/io-console-0.4.3.gemspec +23 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/specifications/default/json-1.8.1.gemspec +7 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/specifications/default/psych-2.0.8.gemspec +25 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/specifications/default/rake-10.4.2.gemspec +7 -0
- data/bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/specifications/default/rdoc-4.2.0.gemspec +7 -0
- data/bin/traveling-ruby-2.2.2/test +1 -0
- data/bin/traveling-ruby-2.2.2/test-rake +1 -0
- data/lib/rb2exe/version.rb +1 -1
- data/rb2exe.gemspec +0 -1
- metadata +1003 -16
- data/.gitignore +0 -9
@@ -0,0 +1,282 @@
|
|
1
|
+
##
|
2
|
+
# A TopLevel context is a representation of the contents of a single file
|
3
|
+
|
4
|
+
class RDoc::TopLevel < RDoc::Context
|
5
|
+
|
6
|
+
MARSHAL_VERSION = 0 # :nodoc:
|
7
|
+
|
8
|
+
##
|
9
|
+
# This TopLevel's File::Stat struct
|
10
|
+
|
11
|
+
attr_accessor :file_stat
|
12
|
+
|
13
|
+
##
|
14
|
+
# Relative name of this file
|
15
|
+
|
16
|
+
attr_accessor :relative_name
|
17
|
+
|
18
|
+
##
|
19
|
+
# Absolute name of this file
|
20
|
+
|
21
|
+
attr_accessor :absolute_name
|
22
|
+
|
23
|
+
##
|
24
|
+
# All the classes or modules that were declared in
|
25
|
+
# this file. These are assigned to either +#classes_hash+
|
26
|
+
# or +#modules_hash+ once we know what they really are.
|
27
|
+
|
28
|
+
attr_reader :classes_or_modules
|
29
|
+
|
30
|
+
attr_accessor :diagram # :nodoc:
|
31
|
+
|
32
|
+
##
|
33
|
+
# The parser class that processed this file
|
34
|
+
|
35
|
+
attr_accessor :parser
|
36
|
+
|
37
|
+
##
|
38
|
+
# Creates a new TopLevel for the file at +absolute_name+. If documentation
|
39
|
+
# is being generated outside the source dir +relative_name+ is relative to
|
40
|
+
# the source directory.
|
41
|
+
|
42
|
+
def initialize absolute_name, relative_name = absolute_name
|
43
|
+
super()
|
44
|
+
@name = nil
|
45
|
+
@absolute_name = absolute_name
|
46
|
+
@relative_name = relative_name
|
47
|
+
@file_stat = File.stat(absolute_name) rescue nil # HACK for testing
|
48
|
+
@diagram = nil
|
49
|
+
@parser = nil
|
50
|
+
|
51
|
+
@classes_or_modules = []
|
52
|
+
end
|
53
|
+
|
54
|
+
##
|
55
|
+
# An RDoc::TopLevel is equal to another with the same relative_name
|
56
|
+
|
57
|
+
def == other
|
58
|
+
self.class === other and @relative_name == other.relative_name
|
59
|
+
end
|
60
|
+
|
61
|
+
alias eql? ==
|
62
|
+
|
63
|
+
##
|
64
|
+
# Adds +an_alias+ to +Object+ instead of +self+.
|
65
|
+
|
66
|
+
def add_alias(an_alias)
|
67
|
+
object_class.record_location self
|
68
|
+
return an_alias unless @document_self
|
69
|
+
object_class.add_alias an_alias
|
70
|
+
end
|
71
|
+
|
72
|
+
##
|
73
|
+
# Adds +constant+ to +Object+ instead of +self+.
|
74
|
+
|
75
|
+
def add_constant constant
|
76
|
+
object_class.record_location self
|
77
|
+
return constant unless @document_self
|
78
|
+
object_class.add_constant constant
|
79
|
+
end
|
80
|
+
|
81
|
+
##
|
82
|
+
# Adds +include+ to +Object+ instead of +self+.
|
83
|
+
|
84
|
+
def add_include(include)
|
85
|
+
object_class.record_location self
|
86
|
+
return include unless @document_self
|
87
|
+
object_class.add_include include
|
88
|
+
end
|
89
|
+
|
90
|
+
##
|
91
|
+
# Adds +method+ to +Object+ instead of +self+.
|
92
|
+
|
93
|
+
def add_method(method)
|
94
|
+
object_class.record_location self
|
95
|
+
return method unless @document_self
|
96
|
+
object_class.add_method method
|
97
|
+
end
|
98
|
+
|
99
|
+
##
|
100
|
+
# Adds class or module +mod+. Used in the building phase
|
101
|
+
# by the Ruby parser.
|
102
|
+
|
103
|
+
def add_to_classes_or_modules mod
|
104
|
+
@classes_or_modules << mod
|
105
|
+
end
|
106
|
+
|
107
|
+
##
|
108
|
+
# Base name of this file
|
109
|
+
|
110
|
+
def base_name
|
111
|
+
File.basename @relative_name
|
112
|
+
end
|
113
|
+
|
114
|
+
alias name base_name
|
115
|
+
|
116
|
+
##
|
117
|
+
# Only a TopLevel that contains text file) will be displayed. See also
|
118
|
+
# RDoc::CodeObject#display?
|
119
|
+
|
120
|
+
def display?
|
121
|
+
text? and super
|
122
|
+
end
|
123
|
+
|
124
|
+
##
|
125
|
+
# See RDoc::TopLevel::find_class_or_module
|
126
|
+
#--
|
127
|
+
# TODO Why do we search through all classes/modules found, not just the
|
128
|
+
# ones of this instance?
|
129
|
+
|
130
|
+
def find_class_or_module name
|
131
|
+
@store.find_class_or_module name
|
132
|
+
end
|
133
|
+
|
134
|
+
##
|
135
|
+
# Finds a class or module named +symbol+
|
136
|
+
|
137
|
+
def find_local_symbol(symbol)
|
138
|
+
find_class_or_module(symbol) || super
|
139
|
+
end
|
140
|
+
|
141
|
+
##
|
142
|
+
# Finds a module or class with +name+
|
143
|
+
|
144
|
+
def find_module_named(name)
|
145
|
+
find_class_or_module(name)
|
146
|
+
end
|
147
|
+
|
148
|
+
##
|
149
|
+
# Returns the relative name of this file
|
150
|
+
|
151
|
+
def full_name
|
152
|
+
@relative_name
|
153
|
+
end
|
154
|
+
|
155
|
+
##
|
156
|
+
# An RDoc::TopLevel has the same hash as another with the same
|
157
|
+
# relative_name
|
158
|
+
|
159
|
+
def hash
|
160
|
+
@relative_name.hash
|
161
|
+
end
|
162
|
+
|
163
|
+
##
|
164
|
+
# URL for this with a +prefix+
|
165
|
+
|
166
|
+
def http_url(prefix)
|
167
|
+
path = [prefix, @relative_name.tr('.', '_')]
|
168
|
+
|
169
|
+
File.join(*path.compact) + '.html'
|
170
|
+
end
|
171
|
+
|
172
|
+
def inspect # :nodoc:
|
173
|
+
"#<%s:0x%x %p modules: %p classes: %p>" % [
|
174
|
+
self.class, object_id,
|
175
|
+
base_name,
|
176
|
+
@modules.map { |n,m| m },
|
177
|
+
@classes.map { |n,c| c }
|
178
|
+
]
|
179
|
+
end
|
180
|
+
|
181
|
+
##
|
182
|
+
# Time this file was last modified, if known
|
183
|
+
|
184
|
+
def last_modified
|
185
|
+
@file_stat ? file_stat.mtime : nil
|
186
|
+
end
|
187
|
+
|
188
|
+
##
|
189
|
+
# Dumps this TopLevel for use by ri. See also #marshal_load
|
190
|
+
|
191
|
+
def marshal_dump
|
192
|
+
[
|
193
|
+
MARSHAL_VERSION,
|
194
|
+
@relative_name,
|
195
|
+
@parser,
|
196
|
+
parse(@comment),
|
197
|
+
]
|
198
|
+
end
|
199
|
+
|
200
|
+
##
|
201
|
+
# Loads this TopLevel from +array+.
|
202
|
+
|
203
|
+
def marshal_load array # :nodoc:
|
204
|
+
initialize array[1]
|
205
|
+
|
206
|
+
@parser = array[2]
|
207
|
+
@comment = array[3]
|
208
|
+
|
209
|
+
@file_stat = nil
|
210
|
+
end
|
211
|
+
|
212
|
+
##
|
213
|
+
# Returns the NormalClass "Object", creating it if not found.
|
214
|
+
#
|
215
|
+
# Records +self+ as a location in "Object".
|
216
|
+
|
217
|
+
def object_class
|
218
|
+
@object_class ||= begin
|
219
|
+
oc = @store.find_class_named('Object') || add_class(RDoc::NormalClass, 'Object')
|
220
|
+
oc.record_location self
|
221
|
+
oc
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
##
|
226
|
+
# Base name of this file without the extension
|
227
|
+
|
228
|
+
def page_name
|
229
|
+
basename = File.basename @relative_name
|
230
|
+
basename =~ /\.(rb|rdoc|txt|md)$/i
|
231
|
+
|
232
|
+
$` || basename
|
233
|
+
end
|
234
|
+
|
235
|
+
##
|
236
|
+
# Path to this file for use with HTML generator output.
|
237
|
+
|
238
|
+
def path
|
239
|
+
http_url @store.rdoc.generator.file_dir
|
240
|
+
end
|
241
|
+
|
242
|
+
def pretty_print q # :nodoc:
|
243
|
+
q.group 2, "[#{self.class}: ", "]" do
|
244
|
+
q.text "base name: #{base_name.inspect}"
|
245
|
+
q.breakable
|
246
|
+
|
247
|
+
items = @modules.map { |n,m| m }
|
248
|
+
items.concat @modules.map { |n,c| c }
|
249
|
+
q.seplist items do |mod| q.pp mod end
|
250
|
+
end
|
251
|
+
end
|
252
|
+
|
253
|
+
##
|
254
|
+
# Search record used by RDoc::Generator::JsonIndex
|
255
|
+
|
256
|
+
def search_record
|
257
|
+
return unless @parser < RDoc::Parser::Text
|
258
|
+
|
259
|
+
[
|
260
|
+
page_name,
|
261
|
+
'',
|
262
|
+
page_name,
|
263
|
+
'',
|
264
|
+
path,
|
265
|
+
'',
|
266
|
+
snippet(@comment),
|
267
|
+
]
|
268
|
+
end
|
269
|
+
|
270
|
+
##
|
271
|
+
# Is this TopLevel from a text file instead of a source code file?
|
272
|
+
|
273
|
+
def text?
|
274
|
+
@parser and @parser.ancestors.include? RDoc::Parser::Text
|
275
|
+
end
|
276
|
+
|
277
|
+
def to_s # :nodoc:
|
278
|
+
"file #{full_name}"
|
279
|
+
end
|
280
|
+
|
281
|
+
end
|
282
|
+
|
@@ -0,0 +1,74 @@
|
|
1
|
+
require 'socket'
|
2
|
+
require 'resolv'
|
3
|
+
|
4
|
+
class << IPSocket
|
5
|
+
# :stopdoc:
|
6
|
+
alias original_resolv_getaddress getaddress
|
7
|
+
# :startdoc:
|
8
|
+
def getaddress(host)
|
9
|
+
begin
|
10
|
+
return Resolv.getaddress(host).to_s
|
11
|
+
rescue Resolv::ResolvError
|
12
|
+
raise SocketError, "Hostname not known: #{host}"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
class TCPSocket < IPSocket
|
18
|
+
# :stopdoc:
|
19
|
+
alias original_resolv_initialize initialize
|
20
|
+
# :startdoc:
|
21
|
+
def initialize(host, serv, *rest)
|
22
|
+
rest[0] = IPSocket.getaddress(rest[0]) if rest[0]
|
23
|
+
original_resolv_initialize(IPSocket.getaddress(host), serv, *rest)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
class UDPSocket < IPSocket
|
28
|
+
# :stopdoc:
|
29
|
+
alias original_resolv_bind bind
|
30
|
+
# :startdoc:
|
31
|
+
def bind(host, port)
|
32
|
+
host = IPSocket.getaddress(host) if host != ""
|
33
|
+
original_resolv_bind(host, port)
|
34
|
+
end
|
35
|
+
|
36
|
+
# :stopdoc:
|
37
|
+
alias original_resolv_connect connect
|
38
|
+
# :startdoc:
|
39
|
+
def connect(host, port)
|
40
|
+
original_resolv_connect(IPSocket.getaddress(host), port)
|
41
|
+
end
|
42
|
+
|
43
|
+
# :stopdoc:
|
44
|
+
alias original_resolv_send send
|
45
|
+
# :startdoc:
|
46
|
+
def send(mesg, flags, *rest)
|
47
|
+
if rest.length == 2
|
48
|
+
host, port = rest
|
49
|
+
begin
|
50
|
+
addrs = Resolv.getaddresses(host)
|
51
|
+
rescue Resolv::ResolvError
|
52
|
+
raise SocketError, "Hostname not known: #{host}"
|
53
|
+
end
|
54
|
+
addrs[0...-1].each {|addr|
|
55
|
+
begin
|
56
|
+
return original_resolv_send(mesg, flags, addr, port)
|
57
|
+
rescue SystemCallError
|
58
|
+
end
|
59
|
+
}
|
60
|
+
original_resolv_send(mesg, flags, addrs[-1], port)
|
61
|
+
else
|
62
|
+
original_resolv_send(mesg, flags, *rest)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
class SOCKSSocket < TCPSocket
|
68
|
+
# :stopdoc:
|
69
|
+
alias original_resolv_initialize initialize
|
70
|
+
# :startdoc:
|
71
|
+
def initialize(host, serv)
|
72
|
+
original_resolv_initialize(IPSocket.getaddress(host), port)
|
73
|
+
end
|
74
|
+
end if defined? SOCKSSocket
|
@@ -0,0 +1,2836 @@
|
|
1
|
+
require 'socket'
|
2
|
+
require 'timeout'
|
3
|
+
require 'thread'
|
4
|
+
|
5
|
+
begin
|
6
|
+
require 'securerandom'
|
7
|
+
rescue LoadError
|
8
|
+
end
|
9
|
+
|
10
|
+
# Resolv is a thread-aware DNS resolver library written in Ruby. Resolv can
|
11
|
+
# handle multiple DNS requests concurrently without blocking the entire Ruby
|
12
|
+
# interpreter.
|
13
|
+
#
|
14
|
+
# See also resolv-replace.rb to replace the libc resolver with Resolv.
|
15
|
+
#
|
16
|
+
# Resolv can look up various DNS resources using the DNS module directly.
|
17
|
+
#
|
18
|
+
# Examples:
|
19
|
+
#
|
20
|
+
# p Resolv.getaddress "www.ruby-lang.org"
|
21
|
+
# p Resolv.getname "210.251.121.214"
|
22
|
+
#
|
23
|
+
# Resolv::DNS.open do |dns|
|
24
|
+
# ress = dns.getresources "www.ruby-lang.org", Resolv::DNS::Resource::IN::A
|
25
|
+
# p ress.map { |r| r.address }
|
26
|
+
# ress = dns.getresources "ruby-lang.org", Resolv::DNS::Resource::IN::MX
|
27
|
+
# p ress.map { |r| [r.exchange.to_s, r.preference] }
|
28
|
+
# end
|
29
|
+
#
|
30
|
+
#
|
31
|
+
# == Bugs
|
32
|
+
#
|
33
|
+
# * NIS is not supported.
|
34
|
+
# * /etc/nsswitch.conf is not supported.
|
35
|
+
|
36
|
+
class Resolv
|
37
|
+
|
38
|
+
##
|
39
|
+
# Looks up the first IP address for +name+.
|
40
|
+
|
41
|
+
def self.getaddress(name)
|
42
|
+
DefaultResolver.getaddress(name)
|
43
|
+
end
|
44
|
+
|
45
|
+
##
|
46
|
+
# Looks up all IP address for +name+.
|
47
|
+
|
48
|
+
def self.getaddresses(name)
|
49
|
+
DefaultResolver.getaddresses(name)
|
50
|
+
end
|
51
|
+
|
52
|
+
##
|
53
|
+
# Iterates over all IP addresses for +name+.
|
54
|
+
|
55
|
+
def self.each_address(name, &block)
|
56
|
+
DefaultResolver.each_address(name, &block)
|
57
|
+
end
|
58
|
+
|
59
|
+
##
|
60
|
+
# Looks up the hostname of +address+.
|
61
|
+
|
62
|
+
def self.getname(address)
|
63
|
+
DefaultResolver.getname(address)
|
64
|
+
end
|
65
|
+
|
66
|
+
##
|
67
|
+
# Looks up all hostnames for +address+.
|
68
|
+
|
69
|
+
def self.getnames(address)
|
70
|
+
DefaultResolver.getnames(address)
|
71
|
+
end
|
72
|
+
|
73
|
+
##
|
74
|
+
# Iterates over all hostnames for +address+.
|
75
|
+
|
76
|
+
def self.each_name(address, &proc)
|
77
|
+
DefaultResolver.each_name(address, &proc)
|
78
|
+
end
|
79
|
+
|
80
|
+
##
|
81
|
+
# Creates a new Resolv using +resolvers+.
|
82
|
+
|
83
|
+
def initialize(resolvers=[Hosts.new, DNS.new])
|
84
|
+
@resolvers = resolvers
|
85
|
+
end
|
86
|
+
|
87
|
+
##
|
88
|
+
# Looks up the first IP address for +name+.
|
89
|
+
|
90
|
+
def getaddress(name)
|
91
|
+
each_address(name) {|address| return address}
|
92
|
+
raise ResolvError.new("no address for #{name}")
|
93
|
+
end
|
94
|
+
|
95
|
+
##
|
96
|
+
# Looks up all IP address for +name+.
|
97
|
+
|
98
|
+
def getaddresses(name)
|
99
|
+
ret = []
|
100
|
+
each_address(name) {|address| ret << address}
|
101
|
+
return ret
|
102
|
+
end
|
103
|
+
|
104
|
+
##
|
105
|
+
# Iterates over all IP addresses for +name+.
|
106
|
+
|
107
|
+
def each_address(name)
|
108
|
+
if AddressRegex =~ name
|
109
|
+
yield name
|
110
|
+
return
|
111
|
+
end
|
112
|
+
yielded = false
|
113
|
+
@resolvers.each {|r|
|
114
|
+
r.each_address(name) {|address|
|
115
|
+
yield address.to_s
|
116
|
+
yielded = true
|
117
|
+
}
|
118
|
+
return if yielded
|
119
|
+
}
|
120
|
+
end
|
121
|
+
|
122
|
+
##
|
123
|
+
# Looks up the hostname of +address+.
|
124
|
+
|
125
|
+
def getname(address)
|
126
|
+
each_name(address) {|name| return name}
|
127
|
+
raise ResolvError.new("no name for #{address}")
|
128
|
+
end
|
129
|
+
|
130
|
+
##
|
131
|
+
# Looks up all hostnames for +address+.
|
132
|
+
|
133
|
+
def getnames(address)
|
134
|
+
ret = []
|
135
|
+
each_name(address) {|name| ret << name}
|
136
|
+
return ret
|
137
|
+
end
|
138
|
+
|
139
|
+
##
|
140
|
+
# Iterates over all hostnames for +address+.
|
141
|
+
|
142
|
+
def each_name(address)
|
143
|
+
yielded = false
|
144
|
+
@resolvers.each {|r|
|
145
|
+
r.each_name(address) {|name|
|
146
|
+
yield name.to_s
|
147
|
+
yielded = true
|
148
|
+
}
|
149
|
+
return if yielded
|
150
|
+
}
|
151
|
+
end
|
152
|
+
|
153
|
+
##
|
154
|
+
# Indicates a failure to resolve a name or address.
|
155
|
+
|
156
|
+
class ResolvError < StandardError; end
|
157
|
+
|
158
|
+
##
|
159
|
+
# Indicates a timeout resolving a name or address.
|
160
|
+
|
161
|
+
class ResolvTimeout < Timeout::Error; end
|
162
|
+
|
163
|
+
##
|
164
|
+
# Resolv::Hosts is a hostname resolver that uses the system hosts file.
|
165
|
+
|
166
|
+
class Hosts
|
167
|
+
begin
|
168
|
+
raise LoadError unless /mswin|mingw|cygwin/ =~ RUBY_PLATFORM
|
169
|
+
require 'win32/resolv'
|
170
|
+
DefaultFileName = Win32::Resolv.get_hosts_path
|
171
|
+
rescue LoadError
|
172
|
+
DefaultFileName = '/etc/hosts'
|
173
|
+
end
|
174
|
+
|
175
|
+
##
|
176
|
+
# Creates a new Resolv::Hosts, using +filename+ for its data source.
|
177
|
+
|
178
|
+
def initialize(filename = DefaultFileName)
|
179
|
+
@filename = filename
|
180
|
+
@mutex = Mutex.new
|
181
|
+
@initialized = nil
|
182
|
+
end
|
183
|
+
|
184
|
+
def lazy_initialize # :nodoc:
|
185
|
+
@mutex.synchronize {
|
186
|
+
unless @initialized
|
187
|
+
@name2addr = {}
|
188
|
+
@addr2name = {}
|
189
|
+
open(@filename, 'rb') {|f|
|
190
|
+
f.each {|line|
|
191
|
+
line.sub!(/#.*/, '')
|
192
|
+
addr, hostname, *aliases = line.split(/\s+/)
|
193
|
+
next unless addr
|
194
|
+
addr.untaint
|
195
|
+
hostname.untaint
|
196
|
+
@addr2name[addr] = [] unless @addr2name.include? addr
|
197
|
+
@addr2name[addr] << hostname
|
198
|
+
@addr2name[addr] += aliases
|
199
|
+
@name2addr[hostname] = [] unless @name2addr.include? hostname
|
200
|
+
@name2addr[hostname] << addr
|
201
|
+
aliases.each {|n|
|
202
|
+
n.untaint
|
203
|
+
@name2addr[n] = [] unless @name2addr.include? n
|
204
|
+
@name2addr[n] << addr
|
205
|
+
}
|
206
|
+
}
|
207
|
+
}
|
208
|
+
@name2addr.each {|name, arr| arr.reverse!}
|
209
|
+
@initialized = true
|
210
|
+
end
|
211
|
+
}
|
212
|
+
self
|
213
|
+
end
|
214
|
+
|
215
|
+
##
|
216
|
+
# Gets the IP address of +name+ from the hosts file.
|
217
|
+
|
218
|
+
def getaddress(name)
|
219
|
+
each_address(name) {|address| return address}
|
220
|
+
raise ResolvError.new("#{@filename} has no name: #{name}")
|
221
|
+
end
|
222
|
+
|
223
|
+
##
|
224
|
+
# Gets all IP addresses for +name+ from the hosts file.
|
225
|
+
|
226
|
+
def getaddresses(name)
|
227
|
+
ret = []
|
228
|
+
each_address(name) {|address| ret << address}
|
229
|
+
return ret
|
230
|
+
end
|
231
|
+
|
232
|
+
##
|
233
|
+
# Iterates over all IP addresses for +name+ retrieved from the hosts file.
|
234
|
+
|
235
|
+
def each_address(name, &proc)
|
236
|
+
lazy_initialize
|
237
|
+
if @name2addr.include?(name)
|
238
|
+
@name2addr[name].each(&proc)
|
239
|
+
end
|
240
|
+
end
|
241
|
+
|
242
|
+
##
|
243
|
+
# Gets the hostname of +address+ from the hosts file.
|
244
|
+
|
245
|
+
def getname(address)
|
246
|
+
each_name(address) {|name| return name}
|
247
|
+
raise ResolvError.new("#{@filename} has no address: #{address}")
|
248
|
+
end
|
249
|
+
|
250
|
+
##
|
251
|
+
# Gets all hostnames for +address+ from the hosts file.
|
252
|
+
|
253
|
+
def getnames(address)
|
254
|
+
ret = []
|
255
|
+
each_name(address) {|name| ret << name}
|
256
|
+
return ret
|
257
|
+
end
|
258
|
+
|
259
|
+
##
|
260
|
+
# Iterates over all hostnames for +address+ retrieved from the hosts file.
|
261
|
+
|
262
|
+
def each_name(address, &proc)
|
263
|
+
lazy_initialize
|
264
|
+
if @addr2name.include?(address)
|
265
|
+
@addr2name[address].each(&proc)
|
266
|
+
end
|
267
|
+
end
|
268
|
+
end
|
269
|
+
|
270
|
+
##
|
271
|
+
# Resolv::DNS is a DNS stub resolver.
|
272
|
+
#
|
273
|
+
# Information taken from the following places:
|
274
|
+
#
|
275
|
+
# * STD0013
|
276
|
+
# * RFC 1035
|
277
|
+
# * ftp://ftp.isi.edu/in-notes/iana/assignments/dns-parameters
|
278
|
+
# * etc.
|
279
|
+
|
280
|
+
class DNS
|
281
|
+
|
282
|
+
##
|
283
|
+
# Default DNS Port
|
284
|
+
|
285
|
+
Port = 53
|
286
|
+
|
287
|
+
##
|
288
|
+
# Default DNS UDP packet size
|
289
|
+
|
290
|
+
UDPSize = 512
|
291
|
+
|
292
|
+
##
|
293
|
+
# Creates a new DNS resolver. See Resolv::DNS.new for argument details.
|
294
|
+
#
|
295
|
+
# Yields the created DNS resolver to the block, if given, otherwise
|
296
|
+
# returns it.
|
297
|
+
|
298
|
+
def self.open(*args)
|
299
|
+
dns = new(*args)
|
300
|
+
return dns unless block_given?
|
301
|
+
begin
|
302
|
+
yield dns
|
303
|
+
ensure
|
304
|
+
dns.close
|
305
|
+
end
|
306
|
+
end
|
307
|
+
|
308
|
+
##
|
309
|
+
# Creates a new DNS resolver.
|
310
|
+
#
|
311
|
+
# +config_info+ can be:
|
312
|
+
#
|
313
|
+
# nil:: Uses /etc/resolv.conf.
|
314
|
+
# String:: Path to a file using /etc/resolv.conf's format.
|
315
|
+
# Hash:: Must contain :nameserver, :search and :ndots keys.
|
316
|
+
# :nameserver_port can be used to specify port number of nameserver address.
|
317
|
+
#
|
318
|
+
# The value of :nameserver should be an address string or
|
319
|
+
# an array of address strings.
|
320
|
+
# - :nameserver => '8.8.8.8'
|
321
|
+
# - :nameserver => ['8.8.8.8', '8.8.4.4']
|
322
|
+
#
|
323
|
+
# The value of :nameserver_port should be an array of
|
324
|
+
# pair of nameserver address and port number.
|
325
|
+
# - :nameserver_port => [['8.8.8.8', 53], ['8.8.4.4', 53]]
|
326
|
+
#
|
327
|
+
# Example:
|
328
|
+
#
|
329
|
+
# Resolv::DNS.new(:nameserver => ['210.251.121.21'],
|
330
|
+
# :search => ['ruby-lang.org'],
|
331
|
+
# :ndots => 1)
|
332
|
+
|
333
|
+
def initialize(config_info=nil)
|
334
|
+
@mutex = Mutex.new
|
335
|
+
@config = Config.new(config_info)
|
336
|
+
@initialized = nil
|
337
|
+
end
|
338
|
+
|
339
|
+
# Sets the resolver timeouts. This may be a single positive number
|
340
|
+
# or an array of positive numbers representing timeouts in seconds.
|
341
|
+
# If an array is specified, a DNS request will retry and wait for
|
342
|
+
# each successive interval in the array until a successful response
|
343
|
+
# is received. Specifying +nil+ reverts to the default timeouts:
|
344
|
+
# [ 5, second = 5 * 2 / nameserver_count, 2 * second, 4 * second ]
|
345
|
+
#
|
346
|
+
# Example:
|
347
|
+
#
|
348
|
+
# dns.timeouts = 3
|
349
|
+
#
|
350
|
+
def timeouts=(values)
|
351
|
+
@config.timeouts = values
|
352
|
+
end
|
353
|
+
|
354
|
+
def lazy_initialize # :nodoc:
|
355
|
+
@mutex.synchronize {
|
356
|
+
unless @initialized
|
357
|
+
@config.lazy_initialize
|
358
|
+
@initialized = true
|
359
|
+
end
|
360
|
+
}
|
361
|
+
self
|
362
|
+
end
|
363
|
+
|
364
|
+
##
|
365
|
+
# Closes the DNS resolver.
|
366
|
+
|
367
|
+
def close
|
368
|
+
@mutex.synchronize {
|
369
|
+
if @initialized
|
370
|
+
@initialized = false
|
371
|
+
end
|
372
|
+
}
|
373
|
+
end
|
374
|
+
|
375
|
+
##
|
376
|
+
# Gets the IP address of +name+ from the DNS resolver.
|
377
|
+
#
|
378
|
+
# +name+ can be a Resolv::DNS::Name or a String. Retrieved address will
|
379
|
+
# be a Resolv::IPv4 or Resolv::IPv6
|
380
|
+
|
381
|
+
def getaddress(name)
|
382
|
+
each_address(name) {|address| return address}
|
383
|
+
raise ResolvError.new("DNS result has no information for #{name}")
|
384
|
+
end
|
385
|
+
|
386
|
+
##
|
387
|
+
# Gets all IP addresses for +name+ from the DNS resolver.
|
388
|
+
#
|
389
|
+
# +name+ can be a Resolv::DNS::Name or a String. Retrieved addresses will
|
390
|
+
# be a Resolv::IPv4 or Resolv::IPv6
|
391
|
+
|
392
|
+
def getaddresses(name)
|
393
|
+
ret = []
|
394
|
+
each_address(name) {|address| ret << address}
|
395
|
+
return ret
|
396
|
+
end
|
397
|
+
|
398
|
+
##
|
399
|
+
# Iterates over all IP addresses for +name+ retrieved from the DNS
|
400
|
+
# resolver.
|
401
|
+
#
|
402
|
+
# +name+ can be a Resolv::DNS::Name or a String. Retrieved addresses will
|
403
|
+
# be a Resolv::IPv4 or Resolv::IPv6
|
404
|
+
|
405
|
+
def each_address(name)
|
406
|
+
each_resource(name, Resource::IN::A) {|resource| yield resource.address}
|
407
|
+
if use_ipv6?
|
408
|
+
each_resource(name, Resource::IN::AAAA) {|resource| yield resource.address}
|
409
|
+
end
|
410
|
+
end
|
411
|
+
|
412
|
+
def use_ipv6? # :nodoc:
|
413
|
+
begin
|
414
|
+
list = Socket.ip_address_list
|
415
|
+
rescue NotImplementedError
|
416
|
+
return true
|
417
|
+
end
|
418
|
+
list.any? {|a| a.ipv6? && !a.ipv6_loopback? && !a.ipv6_linklocal? }
|
419
|
+
end
|
420
|
+
private :use_ipv6?
|
421
|
+
|
422
|
+
##
|
423
|
+
# Gets the hostname for +address+ from the DNS resolver.
|
424
|
+
#
|
425
|
+
# +address+ must be a Resolv::IPv4, Resolv::IPv6 or a String. Retrieved
|
426
|
+
# name will be a Resolv::DNS::Name.
|
427
|
+
|
428
|
+
def getname(address)
|
429
|
+
each_name(address) {|name| return name}
|
430
|
+
raise ResolvError.new("DNS result has no information for #{address}")
|
431
|
+
end
|
432
|
+
|
433
|
+
##
|
434
|
+
# Gets all hostnames for +address+ from the DNS resolver.
|
435
|
+
#
|
436
|
+
# +address+ must be a Resolv::IPv4, Resolv::IPv6 or a String. Retrieved
|
437
|
+
# names will be Resolv::DNS::Name instances.
|
438
|
+
|
439
|
+
def getnames(address)
|
440
|
+
ret = []
|
441
|
+
each_name(address) {|name| ret << name}
|
442
|
+
return ret
|
443
|
+
end
|
444
|
+
|
445
|
+
##
|
446
|
+
# Iterates over all hostnames for +address+ retrieved from the DNS
|
447
|
+
# resolver.
|
448
|
+
#
|
449
|
+
# +address+ must be a Resolv::IPv4, Resolv::IPv6 or a String. Retrieved
|
450
|
+
# names will be Resolv::DNS::Name instances.
|
451
|
+
|
452
|
+
def each_name(address)
|
453
|
+
case address
|
454
|
+
when Name
|
455
|
+
ptr = address
|
456
|
+
when IPv4::Regex
|
457
|
+
ptr = IPv4.create(address).to_name
|
458
|
+
when IPv6::Regex
|
459
|
+
ptr = IPv6.create(address).to_name
|
460
|
+
else
|
461
|
+
raise ResolvError.new("cannot interpret as address: #{address}")
|
462
|
+
end
|
463
|
+
each_resource(ptr, Resource::IN::PTR) {|resource| yield resource.name}
|
464
|
+
end
|
465
|
+
|
466
|
+
##
|
467
|
+
# Look up the +typeclass+ DNS resource of +name+.
|
468
|
+
#
|
469
|
+
# +name+ must be a Resolv::DNS::Name or a String.
|
470
|
+
#
|
471
|
+
# +typeclass+ should be one of the following:
|
472
|
+
#
|
473
|
+
# * Resolv::DNS::Resource::IN::A
|
474
|
+
# * Resolv::DNS::Resource::IN::AAAA
|
475
|
+
# * Resolv::DNS::Resource::IN::ANY
|
476
|
+
# * Resolv::DNS::Resource::IN::CNAME
|
477
|
+
# * Resolv::DNS::Resource::IN::HINFO
|
478
|
+
# * Resolv::DNS::Resource::IN::MINFO
|
479
|
+
# * Resolv::DNS::Resource::IN::MX
|
480
|
+
# * Resolv::DNS::Resource::IN::NS
|
481
|
+
# * Resolv::DNS::Resource::IN::PTR
|
482
|
+
# * Resolv::DNS::Resource::IN::SOA
|
483
|
+
# * Resolv::DNS::Resource::IN::TXT
|
484
|
+
# * Resolv::DNS::Resource::IN::WKS
|
485
|
+
#
|
486
|
+
# Returned resource is represented as a Resolv::DNS::Resource instance,
|
487
|
+
# i.e. Resolv::DNS::Resource::IN::A.
|
488
|
+
|
489
|
+
def getresource(name, typeclass)
|
490
|
+
each_resource(name, typeclass) {|resource| return resource}
|
491
|
+
raise ResolvError.new("DNS result has no information for #{name}")
|
492
|
+
end
|
493
|
+
|
494
|
+
##
|
495
|
+
# Looks up all +typeclass+ DNS resources for +name+. See #getresource for
|
496
|
+
# argument details.
|
497
|
+
|
498
|
+
def getresources(name, typeclass)
|
499
|
+
ret = []
|
500
|
+
each_resource(name, typeclass) {|resource| ret << resource}
|
501
|
+
return ret
|
502
|
+
end
|
503
|
+
|
504
|
+
##
|
505
|
+
# Iterates over all +typeclass+ DNS resources for +name+. See
|
506
|
+
# #getresource for argument details.
|
507
|
+
|
508
|
+
def each_resource(name, typeclass, &proc)
|
509
|
+
fetch_resource(name, typeclass) {|reply, reply_name|
|
510
|
+
extract_resources(reply, reply_name, typeclass, &proc)
|
511
|
+
}
|
512
|
+
end
|
513
|
+
|
514
|
+
def fetch_resource(name, typeclass)
|
515
|
+
lazy_initialize
|
516
|
+
requester = make_udp_requester
|
517
|
+
senders = {}
|
518
|
+
begin
|
519
|
+
@config.resolv(name) {|candidate, tout, nameserver, port|
|
520
|
+
msg = Message.new
|
521
|
+
msg.rd = 1
|
522
|
+
msg.add_question(candidate, typeclass)
|
523
|
+
unless sender = senders[[candidate, nameserver, port]]
|
524
|
+
sender = requester.sender(msg, candidate, nameserver, port)
|
525
|
+
next if !sender
|
526
|
+
senders[[candidate, nameserver, port]] = sender
|
527
|
+
end
|
528
|
+
reply, reply_name = requester.request(sender, tout)
|
529
|
+
case reply.rcode
|
530
|
+
when RCode::NoError
|
531
|
+
if reply.tc == 1 and not Requester::TCP === requester
|
532
|
+
requester.close
|
533
|
+
# Retry via TCP:
|
534
|
+
requester = make_tcp_requester(nameserver, port)
|
535
|
+
senders = {}
|
536
|
+
# This will use TCP for all remaining candidates (assuming the
|
537
|
+
# current candidate does not already respond successfully via
|
538
|
+
# TCP). This makes sense because we already know the full
|
539
|
+
# response will not fit in an untruncated UDP packet.
|
540
|
+
redo
|
541
|
+
else
|
542
|
+
yield(reply, reply_name)
|
543
|
+
end
|
544
|
+
return
|
545
|
+
when RCode::NXDomain
|
546
|
+
raise Config::NXDomain.new(reply_name.to_s)
|
547
|
+
else
|
548
|
+
raise Config::OtherResolvError.new(reply_name.to_s)
|
549
|
+
end
|
550
|
+
}
|
551
|
+
ensure
|
552
|
+
requester.close
|
553
|
+
end
|
554
|
+
end
|
555
|
+
|
556
|
+
def make_udp_requester # :nodoc:
|
557
|
+
nameserver_port = @config.nameserver_port
|
558
|
+
if nameserver_port.length == 1
|
559
|
+
Requester::ConnectedUDP.new(*nameserver_port[0])
|
560
|
+
else
|
561
|
+
Requester::UnconnectedUDP.new(*nameserver_port)
|
562
|
+
end
|
563
|
+
end
|
564
|
+
|
565
|
+
def make_tcp_requester(host, port) # :nodoc:
|
566
|
+
return Requester::TCP.new(host, port)
|
567
|
+
end
|
568
|
+
|
569
|
+
def extract_resources(msg, name, typeclass) # :nodoc:
|
570
|
+
if typeclass < Resource::ANY
|
571
|
+
n0 = Name.create(name)
|
572
|
+
msg.each_answer {|n, ttl, data|
|
573
|
+
yield data if n0 == n
|
574
|
+
}
|
575
|
+
end
|
576
|
+
yielded = false
|
577
|
+
n0 = Name.create(name)
|
578
|
+
msg.each_answer {|n, ttl, data|
|
579
|
+
if n0 == n
|
580
|
+
case data
|
581
|
+
when typeclass
|
582
|
+
yield data
|
583
|
+
yielded = true
|
584
|
+
when Resource::CNAME
|
585
|
+
n0 = data.name
|
586
|
+
end
|
587
|
+
end
|
588
|
+
}
|
589
|
+
return if yielded
|
590
|
+
msg.each_answer {|n, ttl, data|
|
591
|
+
if n0 == n
|
592
|
+
case data
|
593
|
+
when typeclass
|
594
|
+
yield data
|
595
|
+
end
|
596
|
+
end
|
597
|
+
}
|
598
|
+
end
|
599
|
+
|
600
|
+
if defined? SecureRandom
|
601
|
+
def self.random(arg) # :nodoc:
|
602
|
+
begin
|
603
|
+
SecureRandom.random_number(arg)
|
604
|
+
rescue NotImplementedError
|
605
|
+
rand(arg)
|
606
|
+
end
|
607
|
+
end
|
608
|
+
else
|
609
|
+
def self.random(arg) # :nodoc:
|
610
|
+
rand(arg)
|
611
|
+
end
|
612
|
+
end
|
613
|
+
|
614
|
+
|
615
|
+
def self.rangerand(range) # :nodoc:
|
616
|
+
base = range.begin
|
617
|
+
len = range.end - range.begin
|
618
|
+
if !range.exclude_end?
|
619
|
+
len += 1
|
620
|
+
end
|
621
|
+
base + random(len)
|
622
|
+
end
|
623
|
+
|
624
|
+
RequestID = {} # :nodoc:
|
625
|
+
RequestIDMutex = Mutex.new # :nodoc:
|
626
|
+
|
627
|
+
def self.allocate_request_id(host, port) # :nodoc:
|
628
|
+
id = nil
|
629
|
+
RequestIDMutex.synchronize {
|
630
|
+
h = (RequestID[[host, port]] ||= {})
|
631
|
+
begin
|
632
|
+
id = rangerand(0x0000..0xffff)
|
633
|
+
end while h[id]
|
634
|
+
h[id] = true
|
635
|
+
}
|
636
|
+
id
|
637
|
+
end
|
638
|
+
|
639
|
+
def self.free_request_id(host, port, id) # :nodoc:
|
640
|
+
RequestIDMutex.synchronize {
|
641
|
+
key = [host, port]
|
642
|
+
if h = RequestID[key]
|
643
|
+
h.delete id
|
644
|
+
if h.empty?
|
645
|
+
RequestID.delete key
|
646
|
+
end
|
647
|
+
end
|
648
|
+
}
|
649
|
+
end
|
650
|
+
|
651
|
+
def self.bind_random_port(udpsock, bind_host="0.0.0.0") # :nodoc:
|
652
|
+
begin
|
653
|
+
port = rangerand(1024..65535)
|
654
|
+
udpsock.bind(bind_host, port)
|
655
|
+
rescue Errno::EADDRINUSE, # POSIX
|
656
|
+
Errno::EACCES, # SunOS: See PRIV_SYS_NFS in privileges(5)
|
657
|
+
Errno::EPERM # FreeBSD: security.mac.portacl.port_high is configurable. See mac_portacl(4).
|
658
|
+
retry
|
659
|
+
end
|
660
|
+
end
|
661
|
+
|
662
|
+
class Requester # :nodoc:
|
663
|
+
def initialize
|
664
|
+
@senders = {}
|
665
|
+
@socks = nil
|
666
|
+
end
|
667
|
+
|
668
|
+
def request(sender, tout)
|
669
|
+
start = Time.now
|
670
|
+
timelimit = start + tout
|
671
|
+
begin
|
672
|
+
sender.send
|
673
|
+
rescue Errno::EHOSTUNREACH, # multi-homed IPv6 may generate this
|
674
|
+
Errno::ENETUNREACH
|
675
|
+
raise ResolvTimeout
|
676
|
+
end
|
677
|
+
while true
|
678
|
+
before_select = Time.now
|
679
|
+
timeout = timelimit - before_select
|
680
|
+
if timeout <= 0
|
681
|
+
raise ResolvTimeout
|
682
|
+
end
|
683
|
+
select_result = IO.select(@socks, nil, nil, timeout)
|
684
|
+
if !select_result
|
685
|
+
after_select = Time.now
|
686
|
+
next if after_select < timelimit
|
687
|
+
raise ResolvTimeout
|
688
|
+
end
|
689
|
+
begin
|
690
|
+
reply, from = recv_reply(select_result[0])
|
691
|
+
rescue Errno::ECONNREFUSED, # GNU/Linux, FreeBSD
|
692
|
+
Errno::ECONNRESET # Windows
|
693
|
+
# No name server running on the server?
|
694
|
+
# Don't wait anymore.
|
695
|
+
raise ResolvTimeout
|
696
|
+
end
|
697
|
+
begin
|
698
|
+
msg = Message.decode(reply)
|
699
|
+
rescue DecodeError
|
700
|
+
next # broken DNS message ignored
|
701
|
+
end
|
702
|
+
if s = sender_for(from, msg)
|
703
|
+
break
|
704
|
+
else
|
705
|
+
# unexpected DNS message ignored
|
706
|
+
end
|
707
|
+
end
|
708
|
+
return msg, s.data
|
709
|
+
end
|
710
|
+
|
711
|
+
def sender_for(addr, msg)
|
712
|
+
@senders[[addr,msg.id]]
|
713
|
+
end
|
714
|
+
|
715
|
+
def close
|
716
|
+
socks = @socks
|
717
|
+
@socks = nil
|
718
|
+
if socks
|
719
|
+
socks.each {|sock| sock.close }
|
720
|
+
end
|
721
|
+
end
|
722
|
+
|
723
|
+
class Sender # :nodoc:
|
724
|
+
def initialize(msg, data, sock)
|
725
|
+
@msg = msg
|
726
|
+
@data = data
|
727
|
+
@sock = sock
|
728
|
+
end
|
729
|
+
end
|
730
|
+
|
731
|
+
class UnconnectedUDP < Requester # :nodoc:
|
732
|
+
def initialize(*nameserver_port)
|
733
|
+
super()
|
734
|
+
@nameserver_port = nameserver_port
|
735
|
+
@socks_hash = {}
|
736
|
+
@socks = []
|
737
|
+
nameserver_port.each {|host, port|
|
738
|
+
if host.index(':')
|
739
|
+
bind_host = "::"
|
740
|
+
af = Socket::AF_INET6
|
741
|
+
else
|
742
|
+
bind_host = "0.0.0.0"
|
743
|
+
af = Socket::AF_INET
|
744
|
+
end
|
745
|
+
next if @socks_hash[bind_host]
|
746
|
+
begin
|
747
|
+
sock = UDPSocket.new(af)
|
748
|
+
rescue Errno::EAFNOSUPPORT
|
749
|
+
next # The kernel doesn't support the address family.
|
750
|
+
end
|
751
|
+
sock.do_not_reverse_lookup = true
|
752
|
+
DNS.bind_random_port(sock, bind_host)
|
753
|
+
@socks << sock
|
754
|
+
@socks_hash[bind_host] = sock
|
755
|
+
}
|
756
|
+
end
|
757
|
+
|
758
|
+
def recv_reply(readable_socks)
|
759
|
+
reply, from = readable_socks[0].recvfrom(UDPSize)
|
760
|
+
return reply, [from[3],from[1]]
|
761
|
+
end
|
762
|
+
|
763
|
+
def sender(msg, data, host, port=Port)
|
764
|
+
sock = @socks_hash[host.index(':') ? "::" : "0.0.0.0"]
|
765
|
+
return nil if !sock
|
766
|
+
service = [host, port]
|
767
|
+
id = DNS.allocate_request_id(host, port)
|
768
|
+
request = msg.encode
|
769
|
+
request[0,2] = [id].pack('n')
|
770
|
+
return @senders[[service, id]] =
|
771
|
+
Sender.new(request, data, sock, host, port)
|
772
|
+
end
|
773
|
+
|
774
|
+
def close
|
775
|
+
super
|
776
|
+
@senders.each_key {|service, id|
|
777
|
+
DNS.free_request_id(service[0], service[1], id)
|
778
|
+
}
|
779
|
+
end
|
780
|
+
|
781
|
+
class Sender < Requester::Sender # :nodoc:
|
782
|
+
def initialize(msg, data, sock, host, port)
|
783
|
+
super(msg, data, sock)
|
784
|
+
@host = host
|
785
|
+
@port = port
|
786
|
+
end
|
787
|
+
attr_reader :data
|
788
|
+
|
789
|
+
def send
|
790
|
+
raise "@sock is nil." if @sock.nil?
|
791
|
+
@sock.send(@msg, 0, @host, @port)
|
792
|
+
end
|
793
|
+
end
|
794
|
+
end
|
795
|
+
|
796
|
+
class ConnectedUDP < Requester # :nodoc:
|
797
|
+
def initialize(host, port=Port)
|
798
|
+
super()
|
799
|
+
@host = host
|
800
|
+
@port = port
|
801
|
+
is_ipv6 = host.index(':')
|
802
|
+
sock = UDPSocket.new(is_ipv6 ? Socket::AF_INET6 : Socket::AF_INET)
|
803
|
+
@socks = [sock]
|
804
|
+
sock.do_not_reverse_lookup = true
|
805
|
+
DNS.bind_random_port(sock, is_ipv6 ? "::" : "0.0.0.0")
|
806
|
+
sock.connect(host, port)
|
807
|
+
end
|
808
|
+
|
809
|
+
def recv_reply(readable_socks)
|
810
|
+
reply = readable_socks[0].recv(UDPSize)
|
811
|
+
return reply, nil
|
812
|
+
end
|
813
|
+
|
814
|
+
def sender(msg, data, host=@host, port=@port)
|
815
|
+
unless host == @host && port == @port
|
816
|
+
raise RequestError.new("host/port don't match: #{host}:#{port}")
|
817
|
+
end
|
818
|
+
id = DNS.allocate_request_id(@host, @port)
|
819
|
+
request = msg.encode
|
820
|
+
request[0,2] = [id].pack('n')
|
821
|
+
return @senders[[nil,id]] = Sender.new(request, data, @socks[0])
|
822
|
+
end
|
823
|
+
|
824
|
+
def close
|
825
|
+
super
|
826
|
+
@senders.each_key {|from, id|
|
827
|
+
DNS.free_request_id(@host, @port, id)
|
828
|
+
}
|
829
|
+
end
|
830
|
+
|
831
|
+
class Sender < Requester::Sender # :nodoc:
|
832
|
+
def send
|
833
|
+
raise "@sock is nil." if @sock.nil?
|
834
|
+
@sock.send(@msg, 0)
|
835
|
+
end
|
836
|
+
attr_reader :data
|
837
|
+
end
|
838
|
+
end
|
839
|
+
|
840
|
+
class MDNSOneShot < UnconnectedUDP # :nodoc:
|
841
|
+
def sender(msg, data, host, port=Port)
|
842
|
+
id = DNS.allocate_request_id(host, port)
|
843
|
+
request = msg.encode
|
844
|
+
request[0,2] = [id].pack('n')
|
845
|
+
sock = @socks_hash[host.index(':') ? "::" : "0.0.0.0"]
|
846
|
+
return @senders[id] =
|
847
|
+
UnconnectedUDP::Sender.new(request, data, sock, host, port)
|
848
|
+
end
|
849
|
+
|
850
|
+
def sender_for(addr, msg)
|
851
|
+
@senders[msg.id]
|
852
|
+
end
|
853
|
+
end
|
854
|
+
|
855
|
+
class TCP < Requester # :nodoc:
|
856
|
+
def initialize(host, port=Port)
|
857
|
+
super()
|
858
|
+
@host = host
|
859
|
+
@port = port
|
860
|
+
sock = TCPSocket.new(@host, @port)
|
861
|
+
@socks = [sock]
|
862
|
+
@senders = {}
|
863
|
+
end
|
864
|
+
|
865
|
+
def recv_reply(readable_socks)
|
866
|
+
len = readable_socks[0].read(2).unpack('n')[0]
|
867
|
+
reply = @socks[0].read(len)
|
868
|
+
return reply, nil
|
869
|
+
end
|
870
|
+
|
871
|
+
def sender(msg, data, host=@host, port=@port)
|
872
|
+
unless host == @host && port == @port
|
873
|
+
raise RequestError.new("host/port don't match: #{host}:#{port}")
|
874
|
+
end
|
875
|
+
id = DNS.allocate_request_id(@host, @port)
|
876
|
+
request = msg.encode
|
877
|
+
request[0,2] = [request.length, id].pack('nn')
|
878
|
+
return @senders[[nil,id]] = Sender.new(request, data, @socks[0])
|
879
|
+
end
|
880
|
+
|
881
|
+
class Sender < Requester::Sender # :nodoc:
|
882
|
+
def send
|
883
|
+
@sock.print(@msg)
|
884
|
+
@sock.flush
|
885
|
+
end
|
886
|
+
attr_reader :data
|
887
|
+
end
|
888
|
+
|
889
|
+
def close
|
890
|
+
super
|
891
|
+
@senders.each_key {|from,id|
|
892
|
+
DNS.free_request_id(@host, @port, id)
|
893
|
+
}
|
894
|
+
end
|
895
|
+
end
|
896
|
+
|
897
|
+
##
|
898
|
+
# Indicates a problem with the DNS request.
|
899
|
+
|
900
|
+
class RequestError < StandardError
|
901
|
+
end
|
902
|
+
end
|
903
|
+
|
904
|
+
class Config # :nodoc:
|
905
|
+
def initialize(config_info=nil)
|
906
|
+
@mutex = Mutex.new
|
907
|
+
@config_info = config_info
|
908
|
+
@initialized = nil
|
909
|
+
@timeouts = nil
|
910
|
+
end
|
911
|
+
|
912
|
+
def timeouts=(values)
|
913
|
+
if values
|
914
|
+
values = Array(values)
|
915
|
+
values.each do |t|
|
916
|
+
Numeric === t or raise ArgumentError, "#{t.inspect} is not numeric"
|
917
|
+
t > 0.0 or raise ArgumentError, "timeout=#{t} must be positive"
|
918
|
+
end
|
919
|
+
@timeouts = values
|
920
|
+
else
|
921
|
+
@timeouts = nil
|
922
|
+
end
|
923
|
+
end
|
924
|
+
|
925
|
+
def Config.parse_resolv_conf(filename)
|
926
|
+
nameserver = []
|
927
|
+
search = nil
|
928
|
+
ndots = 1
|
929
|
+
open(filename, 'rb') {|f|
|
930
|
+
f.each {|line|
|
931
|
+
line.sub!(/[#;].*/, '')
|
932
|
+
keyword, *args = line.split(/\s+/)
|
933
|
+
args.each { |arg|
|
934
|
+
arg.untaint
|
935
|
+
}
|
936
|
+
next unless keyword
|
937
|
+
case keyword
|
938
|
+
when 'nameserver'
|
939
|
+
nameserver += args
|
940
|
+
when 'domain'
|
941
|
+
next if args.empty?
|
942
|
+
search = [args[0]]
|
943
|
+
when 'search'
|
944
|
+
next if args.empty?
|
945
|
+
search = args
|
946
|
+
when 'options'
|
947
|
+
args.each {|arg|
|
948
|
+
case arg
|
949
|
+
when /\Andots:(\d+)\z/
|
950
|
+
ndots = $1.to_i
|
951
|
+
end
|
952
|
+
}
|
953
|
+
end
|
954
|
+
}
|
955
|
+
}
|
956
|
+
return { :nameserver => nameserver, :search => search, :ndots => ndots }
|
957
|
+
end
|
958
|
+
|
959
|
+
def Config.default_config_hash(filename="/etc/resolv.conf")
|
960
|
+
if File.exist? filename
|
961
|
+
config_hash = Config.parse_resolv_conf(filename)
|
962
|
+
else
|
963
|
+
if /mswin|cygwin|mingw|bccwin/ =~ RUBY_PLATFORM
|
964
|
+
require 'win32/resolv'
|
965
|
+
search, nameserver = Win32::Resolv.get_resolv_info
|
966
|
+
config_hash = {}
|
967
|
+
config_hash[:nameserver] = nameserver if nameserver
|
968
|
+
config_hash[:search] = [search].flatten if search
|
969
|
+
end
|
970
|
+
end
|
971
|
+
config_hash || {}
|
972
|
+
end
|
973
|
+
|
974
|
+
def lazy_initialize
|
975
|
+
@mutex.synchronize {
|
976
|
+
unless @initialized
|
977
|
+
@nameserver_port = []
|
978
|
+
@search = nil
|
979
|
+
@ndots = 1
|
980
|
+
case @config_info
|
981
|
+
when nil
|
982
|
+
config_hash = Config.default_config_hash
|
983
|
+
when String
|
984
|
+
config_hash = Config.parse_resolv_conf(@config_info)
|
985
|
+
when Hash
|
986
|
+
config_hash = @config_info.dup
|
987
|
+
if String === config_hash[:nameserver]
|
988
|
+
config_hash[:nameserver] = [config_hash[:nameserver]]
|
989
|
+
end
|
990
|
+
if String === config_hash[:search]
|
991
|
+
config_hash[:search] = [config_hash[:search]]
|
992
|
+
end
|
993
|
+
else
|
994
|
+
raise ArgumentError.new("invalid resolv configuration: #{@config_info.inspect}")
|
995
|
+
end
|
996
|
+
if config_hash.include? :nameserver
|
997
|
+
@nameserver_port = config_hash[:nameserver].map {|ns| [ns, Port] }
|
998
|
+
end
|
999
|
+
if config_hash.include? :nameserver_port
|
1000
|
+
@nameserver_port = config_hash[:nameserver_port].map {|ns, port| [ns, (port || Port)] }
|
1001
|
+
end
|
1002
|
+
@search = config_hash[:search] if config_hash.include? :search
|
1003
|
+
@ndots = config_hash[:ndots] if config_hash.include? :ndots
|
1004
|
+
|
1005
|
+
if @nameserver_port.empty?
|
1006
|
+
@nameserver_port << ['0.0.0.0', Port]
|
1007
|
+
end
|
1008
|
+
if @search
|
1009
|
+
@search = @search.map {|arg| Label.split(arg) }
|
1010
|
+
else
|
1011
|
+
hostname = Socket.gethostname
|
1012
|
+
if /\./ =~ hostname
|
1013
|
+
@search = [Label.split($')]
|
1014
|
+
else
|
1015
|
+
@search = [[]]
|
1016
|
+
end
|
1017
|
+
end
|
1018
|
+
|
1019
|
+
if !@nameserver_port.kind_of?(Array) ||
|
1020
|
+
@nameserver_port.any? {|ns_port|
|
1021
|
+
!(Array === ns_port) ||
|
1022
|
+
ns_port.length != 2
|
1023
|
+
!(String === ns_port[0]) ||
|
1024
|
+
!(Integer === ns_port[1])
|
1025
|
+
}
|
1026
|
+
raise ArgumentError.new("invalid nameserver config: #{@nameserver_port.inspect}")
|
1027
|
+
end
|
1028
|
+
|
1029
|
+
if !@search.kind_of?(Array) ||
|
1030
|
+
!@search.all? {|ls| ls.all? {|l| Label::Str === l } }
|
1031
|
+
raise ArgumentError.new("invalid search config: #{@search.inspect}")
|
1032
|
+
end
|
1033
|
+
|
1034
|
+
if !@ndots.kind_of?(Integer)
|
1035
|
+
raise ArgumentError.new("invalid ndots config: #{@ndots.inspect}")
|
1036
|
+
end
|
1037
|
+
|
1038
|
+
@initialized = true
|
1039
|
+
end
|
1040
|
+
}
|
1041
|
+
self
|
1042
|
+
end
|
1043
|
+
|
1044
|
+
def single?
|
1045
|
+
lazy_initialize
|
1046
|
+
if @nameserver_port.length == 1
|
1047
|
+
return @nameserver_port[0]
|
1048
|
+
else
|
1049
|
+
return nil
|
1050
|
+
end
|
1051
|
+
end
|
1052
|
+
|
1053
|
+
def nameserver_port
|
1054
|
+
@nameserver_port
|
1055
|
+
end
|
1056
|
+
|
1057
|
+
def generate_candidates(name)
|
1058
|
+
candidates = nil
|
1059
|
+
name = Name.create(name)
|
1060
|
+
if name.absolute?
|
1061
|
+
candidates = [name]
|
1062
|
+
else
|
1063
|
+
if @ndots <= name.length - 1
|
1064
|
+
candidates = [Name.new(name.to_a)]
|
1065
|
+
else
|
1066
|
+
candidates = []
|
1067
|
+
end
|
1068
|
+
candidates.concat(@search.map {|domain| Name.new(name.to_a + domain)})
|
1069
|
+
fname = Name.create("#{name}.")
|
1070
|
+
if !candidates.include?(fname)
|
1071
|
+
candidates << fname
|
1072
|
+
end
|
1073
|
+
end
|
1074
|
+
return candidates
|
1075
|
+
end
|
1076
|
+
|
1077
|
+
InitialTimeout = 5
|
1078
|
+
|
1079
|
+
def generate_timeouts
|
1080
|
+
ts = [InitialTimeout]
|
1081
|
+
ts << ts[-1] * 2 / @nameserver_port.length
|
1082
|
+
ts << ts[-1] * 2
|
1083
|
+
ts << ts[-1] * 2
|
1084
|
+
return ts
|
1085
|
+
end
|
1086
|
+
|
1087
|
+
def resolv(name)
|
1088
|
+
candidates = generate_candidates(name)
|
1089
|
+
timeouts = @timeouts || generate_timeouts
|
1090
|
+
begin
|
1091
|
+
candidates.each {|candidate|
|
1092
|
+
begin
|
1093
|
+
timeouts.each {|tout|
|
1094
|
+
@nameserver_port.each {|nameserver, port|
|
1095
|
+
begin
|
1096
|
+
yield candidate, tout, nameserver, port
|
1097
|
+
rescue ResolvTimeout
|
1098
|
+
end
|
1099
|
+
}
|
1100
|
+
}
|
1101
|
+
raise ResolvError.new("DNS resolv timeout: #{name}")
|
1102
|
+
rescue NXDomain
|
1103
|
+
end
|
1104
|
+
}
|
1105
|
+
rescue ResolvError
|
1106
|
+
end
|
1107
|
+
end
|
1108
|
+
|
1109
|
+
##
|
1110
|
+
# Indicates no such domain was found.
|
1111
|
+
|
1112
|
+
class NXDomain < ResolvError
|
1113
|
+
end
|
1114
|
+
|
1115
|
+
##
|
1116
|
+
# Indicates some other unhandled resolver error was encountered.
|
1117
|
+
|
1118
|
+
class OtherResolvError < ResolvError
|
1119
|
+
end
|
1120
|
+
end
|
1121
|
+
|
1122
|
+
module OpCode # :nodoc:
|
1123
|
+
Query = 0
|
1124
|
+
IQuery = 1
|
1125
|
+
Status = 2
|
1126
|
+
Notify = 4
|
1127
|
+
Update = 5
|
1128
|
+
end
|
1129
|
+
|
1130
|
+
module RCode # :nodoc:
|
1131
|
+
NoError = 0
|
1132
|
+
FormErr = 1
|
1133
|
+
ServFail = 2
|
1134
|
+
NXDomain = 3
|
1135
|
+
NotImp = 4
|
1136
|
+
Refused = 5
|
1137
|
+
YXDomain = 6
|
1138
|
+
YXRRSet = 7
|
1139
|
+
NXRRSet = 8
|
1140
|
+
NotAuth = 9
|
1141
|
+
NotZone = 10
|
1142
|
+
BADVERS = 16
|
1143
|
+
BADSIG = 16
|
1144
|
+
BADKEY = 17
|
1145
|
+
BADTIME = 18
|
1146
|
+
BADMODE = 19
|
1147
|
+
BADNAME = 20
|
1148
|
+
BADALG = 21
|
1149
|
+
end
|
1150
|
+
|
1151
|
+
##
|
1152
|
+
# Indicates that the DNS response was unable to be decoded.
|
1153
|
+
|
1154
|
+
class DecodeError < StandardError
|
1155
|
+
end
|
1156
|
+
|
1157
|
+
##
|
1158
|
+
# Indicates that the DNS request was unable to be encoded.
|
1159
|
+
|
1160
|
+
class EncodeError < StandardError
|
1161
|
+
end
|
1162
|
+
|
1163
|
+
module Label # :nodoc:
|
1164
|
+
def self.split(arg)
|
1165
|
+
labels = []
|
1166
|
+
arg.scan(/[^\.]+/) {labels << Str.new($&)}
|
1167
|
+
return labels
|
1168
|
+
end
|
1169
|
+
|
1170
|
+
class Str # :nodoc:
|
1171
|
+
def initialize(string)
|
1172
|
+
@string = string
|
1173
|
+
@downcase = string.downcase
|
1174
|
+
end
|
1175
|
+
attr_reader :string, :downcase
|
1176
|
+
|
1177
|
+
def to_s
|
1178
|
+
return @string
|
1179
|
+
end
|
1180
|
+
|
1181
|
+
def inspect
|
1182
|
+
return "#<#{self.class} #{self}>"
|
1183
|
+
end
|
1184
|
+
|
1185
|
+
def ==(other)
|
1186
|
+
return @downcase == other.downcase
|
1187
|
+
end
|
1188
|
+
|
1189
|
+
def eql?(other)
|
1190
|
+
return self == other
|
1191
|
+
end
|
1192
|
+
|
1193
|
+
def hash
|
1194
|
+
return @downcase.hash
|
1195
|
+
end
|
1196
|
+
end
|
1197
|
+
end
|
1198
|
+
|
1199
|
+
##
|
1200
|
+
# A representation of a DNS name.
|
1201
|
+
|
1202
|
+
class Name
|
1203
|
+
|
1204
|
+
##
|
1205
|
+
# Creates a new DNS name from +arg+. +arg+ can be:
|
1206
|
+
#
|
1207
|
+
# Name:: returns +arg+.
|
1208
|
+
# String:: Creates a new Name.
|
1209
|
+
|
1210
|
+
def self.create(arg)
|
1211
|
+
case arg
|
1212
|
+
when Name
|
1213
|
+
return arg
|
1214
|
+
when String
|
1215
|
+
return Name.new(Label.split(arg), /\.\z/ =~ arg ? true : false)
|
1216
|
+
else
|
1217
|
+
raise ArgumentError.new("cannot interpret as DNS name: #{arg.inspect}")
|
1218
|
+
end
|
1219
|
+
end
|
1220
|
+
|
1221
|
+
def initialize(labels, absolute=true) # :nodoc:
|
1222
|
+
@labels = labels
|
1223
|
+
@absolute = absolute
|
1224
|
+
end
|
1225
|
+
|
1226
|
+
def inspect # :nodoc:
|
1227
|
+
"#<#{self.class}: #{self}#{@absolute ? '.' : ''}>"
|
1228
|
+
end
|
1229
|
+
|
1230
|
+
##
|
1231
|
+
# True if this name is absolute.
|
1232
|
+
|
1233
|
+
def absolute?
|
1234
|
+
return @absolute
|
1235
|
+
end
|
1236
|
+
|
1237
|
+
def ==(other) # :nodoc:
|
1238
|
+
return false unless Name === other
|
1239
|
+
return false unless @absolute == other.absolute?
|
1240
|
+
return @labels == other.to_a
|
1241
|
+
end
|
1242
|
+
|
1243
|
+
alias eql? == # :nodoc:
|
1244
|
+
|
1245
|
+
##
|
1246
|
+
# Returns true if +other+ is a subdomain.
|
1247
|
+
#
|
1248
|
+
# Example:
|
1249
|
+
#
|
1250
|
+
# domain = Resolv::DNS::Name.create("y.z")
|
1251
|
+
# p Resolv::DNS::Name.create("w.x.y.z").subdomain_of?(domain) #=> true
|
1252
|
+
# p Resolv::DNS::Name.create("x.y.z").subdomain_of?(domain) #=> true
|
1253
|
+
# p Resolv::DNS::Name.create("y.z").subdomain_of?(domain) #=> false
|
1254
|
+
# p Resolv::DNS::Name.create("z").subdomain_of?(domain) #=> false
|
1255
|
+
# p Resolv::DNS::Name.create("x.y.z.").subdomain_of?(domain) #=> false
|
1256
|
+
# p Resolv::DNS::Name.create("w.z").subdomain_of?(domain) #=> false
|
1257
|
+
#
|
1258
|
+
|
1259
|
+
def subdomain_of?(other)
|
1260
|
+
raise ArgumentError, "not a domain name: #{other.inspect}" unless Name === other
|
1261
|
+
return false if @absolute != other.absolute?
|
1262
|
+
other_len = other.length
|
1263
|
+
return false if @labels.length <= other_len
|
1264
|
+
return @labels[-other_len, other_len] == other.to_a
|
1265
|
+
end
|
1266
|
+
|
1267
|
+
def hash # :nodoc:
|
1268
|
+
return @labels.hash ^ @absolute.hash
|
1269
|
+
end
|
1270
|
+
|
1271
|
+
def to_a # :nodoc:
|
1272
|
+
return @labels
|
1273
|
+
end
|
1274
|
+
|
1275
|
+
def length # :nodoc:
|
1276
|
+
return @labels.length
|
1277
|
+
end
|
1278
|
+
|
1279
|
+
def [](i) # :nodoc:
|
1280
|
+
return @labels[i]
|
1281
|
+
end
|
1282
|
+
|
1283
|
+
##
|
1284
|
+
# returns the domain name as a string.
|
1285
|
+
#
|
1286
|
+
# The domain name doesn't have a trailing dot even if the name object is
|
1287
|
+
# absolute.
|
1288
|
+
#
|
1289
|
+
# Example:
|
1290
|
+
#
|
1291
|
+
# p Resolv::DNS::Name.create("x.y.z.").to_s #=> "x.y.z"
|
1292
|
+
# p Resolv::DNS::Name.create("x.y.z").to_s #=> "x.y.z"
|
1293
|
+
|
1294
|
+
def to_s
|
1295
|
+
return @labels.join('.')
|
1296
|
+
end
|
1297
|
+
end
|
1298
|
+
|
1299
|
+
class Message # :nodoc:
|
1300
|
+
@@identifier = -1
|
1301
|
+
|
1302
|
+
def initialize(id = (@@identifier += 1) & 0xffff)
|
1303
|
+
@id = id
|
1304
|
+
@qr = 0
|
1305
|
+
@opcode = 0
|
1306
|
+
@aa = 0
|
1307
|
+
@tc = 0
|
1308
|
+
@rd = 0 # recursion desired
|
1309
|
+
@ra = 0 # recursion available
|
1310
|
+
@rcode = 0
|
1311
|
+
@question = []
|
1312
|
+
@answer = []
|
1313
|
+
@authority = []
|
1314
|
+
@additional = []
|
1315
|
+
end
|
1316
|
+
|
1317
|
+
attr_accessor :id, :qr, :opcode, :aa, :tc, :rd, :ra, :rcode
|
1318
|
+
attr_reader :question, :answer, :authority, :additional
|
1319
|
+
|
1320
|
+
def ==(other)
|
1321
|
+
return @id == other.id &&
|
1322
|
+
@qr == other.qr &&
|
1323
|
+
@opcode == other.opcode &&
|
1324
|
+
@aa == other.aa &&
|
1325
|
+
@tc == other.tc &&
|
1326
|
+
@rd == other.rd &&
|
1327
|
+
@ra == other.ra &&
|
1328
|
+
@rcode == other.rcode &&
|
1329
|
+
@question == other.question &&
|
1330
|
+
@answer == other.answer &&
|
1331
|
+
@authority == other.authority &&
|
1332
|
+
@additional == other.additional
|
1333
|
+
end
|
1334
|
+
|
1335
|
+
def add_question(name, typeclass)
|
1336
|
+
@question << [Name.create(name), typeclass]
|
1337
|
+
end
|
1338
|
+
|
1339
|
+
def each_question
|
1340
|
+
@question.each {|name, typeclass|
|
1341
|
+
yield name, typeclass
|
1342
|
+
}
|
1343
|
+
end
|
1344
|
+
|
1345
|
+
def add_answer(name, ttl, data)
|
1346
|
+
@answer << [Name.create(name), ttl, data]
|
1347
|
+
end
|
1348
|
+
|
1349
|
+
def each_answer
|
1350
|
+
@answer.each {|name, ttl, data|
|
1351
|
+
yield name, ttl, data
|
1352
|
+
}
|
1353
|
+
end
|
1354
|
+
|
1355
|
+
def add_authority(name, ttl, data)
|
1356
|
+
@authority << [Name.create(name), ttl, data]
|
1357
|
+
end
|
1358
|
+
|
1359
|
+
def each_authority
|
1360
|
+
@authority.each {|name, ttl, data|
|
1361
|
+
yield name, ttl, data
|
1362
|
+
}
|
1363
|
+
end
|
1364
|
+
|
1365
|
+
def add_additional(name, ttl, data)
|
1366
|
+
@additional << [Name.create(name), ttl, data]
|
1367
|
+
end
|
1368
|
+
|
1369
|
+
def each_additional
|
1370
|
+
@additional.each {|name, ttl, data|
|
1371
|
+
yield name, ttl, data
|
1372
|
+
}
|
1373
|
+
end
|
1374
|
+
|
1375
|
+
def each_resource
|
1376
|
+
each_answer {|name, ttl, data| yield name, ttl, data}
|
1377
|
+
each_authority {|name, ttl, data| yield name, ttl, data}
|
1378
|
+
each_additional {|name, ttl, data| yield name, ttl, data}
|
1379
|
+
end
|
1380
|
+
|
1381
|
+
def encode
|
1382
|
+
return MessageEncoder.new {|msg|
|
1383
|
+
msg.put_pack('nnnnnn',
|
1384
|
+
@id,
|
1385
|
+
(@qr & 1) << 15 |
|
1386
|
+
(@opcode & 15) << 11 |
|
1387
|
+
(@aa & 1) << 10 |
|
1388
|
+
(@tc & 1) << 9 |
|
1389
|
+
(@rd & 1) << 8 |
|
1390
|
+
(@ra & 1) << 7 |
|
1391
|
+
(@rcode & 15),
|
1392
|
+
@question.length,
|
1393
|
+
@answer.length,
|
1394
|
+
@authority.length,
|
1395
|
+
@additional.length)
|
1396
|
+
@question.each {|q|
|
1397
|
+
name, typeclass = q
|
1398
|
+
msg.put_name(name)
|
1399
|
+
msg.put_pack('nn', typeclass::TypeValue, typeclass::ClassValue)
|
1400
|
+
}
|
1401
|
+
[@answer, @authority, @additional].each {|rr|
|
1402
|
+
rr.each {|r|
|
1403
|
+
name, ttl, data = r
|
1404
|
+
msg.put_name(name)
|
1405
|
+
msg.put_pack('nnN', data.class::TypeValue, data.class::ClassValue, ttl)
|
1406
|
+
msg.put_length16 {data.encode_rdata(msg)}
|
1407
|
+
}
|
1408
|
+
}
|
1409
|
+
}.to_s
|
1410
|
+
end
|
1411
|
+
|
1412
|
+
class MessageEncoder # :nodoc:
|
1413
|
+
def initialize
|
1414
|
+
@data = ''
|
1415
|
+
@names = {}
|
1416
|
+
yield self
|
1417
|
+
end
|
1418
|
+
|
1419
|
+
def to_s
|
1420
|
+
return @data
|
1421
|
+
end
|
1422
|
+
|
1423
|
+
def put_bytes(d)
|
1424
|
+
@data << d
|
1425
|
+
end
|
1426
|
+
|
1427
|
+
def put_pack(template, *d)
|
1428
|
+
@data << d.pack(template)
|
1429
|
+
end
|
1430
|
+
|
1431
|
+
def put_length16
|
1432
|
+
length_index = @data.length
|
1433
|
+
@data << "\0\0"
|
1434
|
+
data_start = @data.length
|
1435
|
+
yield
|
1436
|
+
data_end = @data.length
|
1437
|
+
@data[length_index, 2] = [data_end - data_start].pack("n")
|
1438
|
+
end
|
1439
|
+
|
1440
|
+
def put_string(d)
|
1441
|
+
self.put_pack("C", d.length)
|
1442
|
+
@data << d
|
1443
|
+
end
|
1444
|
+
|
1445
|
+
def put_string_list(ds)
|
1446
|
+
ds.each {|d|
|
1447
|
+
self.put_string(d)
|
1448
|
+
}
|
1449
|
+
end
|
1450
|
+
|
1451
|
+
def put_name(d)
|
1452
|
+
put_labels(d.to_a)
|
1453
|
+
end
|
1454
|
+
|
1455
|
+
def put_labels(d)
|
1456
|
+
d.each_index {|i|
|
1457
|
+
domain = d[i..-1]
|
1458
|
+
if idx = @names[domain]
|
1459
|
+
self.put_pack("n", 0xc000 | idx)
|
1460
|
+
return
|
1461
|
+
else
|
1462
|
+
@names[domain] = @data.length
|
1463
|
+
self.put_label(d[i])
|
1464
|
+
end
|
1465
|
+
}
|
1466
|
+
@data << "\0"
|
1467
|
+
end
|
1468
|
+
|
1469
|
+
def put_label(d)
|
1470
|
+
self.put_string(d.to_s)
|
1471
|
+
end
|
1472
|
+
end
|
1473
|
+
|
1474
|
+
def Message.decode(m)
|
1475
|
+
o = Message.new(0)
|
1476
|
+
MessageDecoder.new(m) {|msg|
|
1477
|
+
id, flag, qdcount, ancount, nscount, arcount =
|
1478
|
+
msg.get_unpack('nnnnnn')
|
1479
|
+
o.id = id
|
1480
|
+
o.qr = (flag >> 15) & 1
|
1481
|
+
o.opcode = (flag >> 11) & 15
|
1482
|
+
o.aa = (flag >> 10) & 1
|
1483
|
+
o.tc = (flag >> 9) & 1
|
1484
|
+
o.rd = (flag >> 8) & 1
|
1485
|
+
o.ra = (flag >> 7) & 1
|
1486
|
+
o.rcode = flag & 15
|
1487
|
+
(1..qdcount).each {
|
1488
|
+
name, typeclass = msg.get_question
|
1489
|
+
o.add_question(name, typeclass)
|
1490
|
+
}
|
1491
|
+
(1..ancount).each {
|
1492
|
+
name, ttl, data = msg.get_rr
|
1493
|
+
o.add_answer(name, ttl, data)
|
1494
|
+
}
|
1495
|
+
(1..nscount).each {
|
1496
|
+
name, ttl, data = msg.get_rr
|
1497
|
+
o.add_authority(name, ttl, data)
|
1498
|
+
}
|
1499
|
+
(1..arcount).each {
|
1500
|
+
name, ttl, data = msg.get_rr
|
1501
|
+
o.add_additional(name, ttl, data)
|
1502
|
+
}
|
1503
|
+
}
|
1504
|
+
return o
|
1505
|
+
end
|
1506
|
+
|
1507
|
+
class MessageDecoder # :nodoc:
|
1508
|
+
def initialize(data)
|
1509
|
+
@data = data
|
1510
|
+
@index = 0
|
1511
|
+
@limit = data.length
|
1512
|
+
yield self
|
1513
|
+
end
|
1514
|
+
|
1515
|
+
def inspect
|
1516
|
+
"\#<#{self.class}: #{@data[0, @index].inspect} #{@data[@index..-1].inspect}>"
|
1517
|
+
end
|
1518
|
+
|
1519
|
+
def get_length16
|
1520
|
+
len, = self.get_unpack('n')
|
1521
|
+
save_limit = @limit
|
1522
|
+
@limit = @index + len
|
1523
|
+
d = yield(len)
|
1524
|
+
if @index < @limit
|
1525
|
+
raise DecodeError.new("junk exists")
|
1526
|
+
elsif @limit < @index
|
1527
|
+
raise DecodeError.new("limit exceeded")
|
1528
|
+
end
|
1529
|
+
@limit = save_limit
|
1530
|
+
return d
|
1531
|
+
end
|
1532
|
+
|
1533
|
+
def get_bytes(len = @limit - @index)
|
1534
|
+
raise DecodeError.new("limit exceeded") if @limit < @index + len
|
1535
|
+
d = @data[@index, len]
|
1536
|
+
@index += len
|
1537
|
+
return d
|
1538
|
+
end
|
1539
|
+
|
1540
|
+
def get_unpack(template)
|
1541
|
+
len = 0
|
1542
|
+
template.each_byte {|byte|
|
1543
|
+
byte = "%c" % byte
|
1544
|
+
case byte
|
1545
|
+
when ?c, ?C
|
1546
|
+
len += 1
|
1547
|
+
when ?n
|
1548
|
+
len += 2
|
1549
|
+
when ?N
|
1550
|
+
len += 4
|
1551
|
+
else
|
1552
|
+
raise StandardError.new("unsupported template: '#{byte.chr}' in '#{template}'")
|
1553
|
+
end
|
1554
|
+
}
|
1555
|
+
raise DecodeError.new("limit exceeded") if @limit < @index + len
|
1556
|
+
arr = @data.unpack("@#{@index}#{template}")
|
1557
|
+
@index += len
|
1558
|
+
return arr
|
1559
|
+
end
|
1560
|
+
|
1561
|
+
def get_string
|
1562
|
+
raise DecodeError.new("limit exceeded") if @limit <= @index
|
1563
|
+
len = @data[@index].ord
|
1564
|
+
raise DecodeError.new("limit exceeded") if @limit < @index + 1 + len
|
1565
|
+
d = @data[@index + 1, len]
|
1566
|
+
@index += 1 + len
|
1567
|
+
return d
|
1568
|
+
end
|
1569
|
+
|
1570
|
+
def get_string_list
|
1571
|
+
strings = []
|
1572
|
+
while @index < @limit
|
1573
|
+
strings << self.get_string
|
1574
|
+
end
|
1575
|
+
strings
|
1576
|
+
end
|
1577
|
+
|
1578
|
+
def get_name
|
1579
|
+
return Name.new(self.get_labels)
|
1580
|
+
end
|
1581
|
+
|
1582
|
+
def get_labels
|
1583
|
+
prev_index = @index
|
1584
|
+
save_index = nil
|
1585
|
+
d = []
|
1586
|
+
while true
|
1587
|
+
raise DecodeError.new("limit exceeded") if @limit <= @index
|
1588
|
+
case @data[@index].ord
|
1589
|
+
when 0
|
1590
|
+
@index += 1
|
1591
|
+
if save_index
|
1592
|
+
@index = save_index
|
1593
|
+
end
|
1594
|
+
return d
|
1595
|
+
when 192..255
|
1596
|
+
idx = self.get_unpack('n')[0] & 0x3fff
|
1597
|
+
if prev_index <= idx
|
1598
|
+
raise DecodeError.new("non-backward name pointer")
|
1599
|
+
end
|
1600
|
+
prev_index = idx
|
1601
|
+
if !save_index
|
1602
|
+
save_index = @index
|
1603
|
+
end
|
1604
|
+
@index = idx
|
1605
|
+
else
|
1606
|
+
d << self.get_label
|
1607
|
+
end
|
1608
|
+
end
|
1609
|
+
end
|
1610
|
+
|
1611
|
+
def get_label
|
1612
|
+
return Label::Str.new(self.get_string)
|
1613
|
+
end
|
1614
|
+
|
1615
|
+
def get_question
|
1616
|
+
name = self.get_name
|
1617
|
+
type, klass = self.get_unpack("nn")
|
1618
|
+
return name, Resource.get_class(type, klass)
|
1619
|
+
end
|
1620
|
+
|
1621
|
+
def get_rr
|
1622
|
+
name = self.get_name
|
1623
|
+
type, klass, ttl = self.get_unpack('nnN')
|
1624
|
+
typeclass = Resource.get_class(type, klass)
|
1625
|
+
res = self.get_length16 { typeclass.decode_rdata self }
|
1626
|
+
res.instance_variable_set :@ttl, ttl
|
1627
|
+
return name, ttl, res
|
1628
|
+
end
|
1629
|
+
end
|
1630
|
+
end
|
1631
|
+
|
1632
|
+
##
|
1633
|
+
# A DNS query abstract class.
|
1634
|
+
|
1635
|
+
class Query
|
1636
|
+
def encode_rdata(msg) # :nodoc:
|
1637
|
+
raise EncodeError.new("#{self.class} is query.")
|
1638
|
+
end
|
1639
|
+
|
1640
|
+
def self.decode_rdata(msg) # :nodoc:
|
1641
|
+
raise DecodeError.new("#{self.class} is query.")
|
1642
|
+
end
|
1643
|
+
end
|
1644
|
+
|
1645
|
+
##
|
1646
|
+
# A DNS resource abstract class.
|
1647
|
+
|
1648
|
+
class Resource < Query
|
1649
|
+
|
1650
|
+
##
|
1651
|
+
# Remaining Time To Live for this Resource.
|
1652
|
+
|
1653
|
+
attr_reader :ttl
|
1654
|
+
|
1655
|
+
ClassHash = {} # :nodoc:
|
1656
|
+
|
1657
|
+
def encode_rdata(msg) # :nodoc:
|
1658
|
+
raise NotImplementedError.new
|
1659
|
+
end
|
1660
|
+
|
1661
|
+
def self.decode_rdata(msg) # :nodoc:
|
1662
|
+
raise NotImplementedError.new
|
1663
|
+
end
|
1664
|
+
|
1665
|
+
def ==(other) # :nodoc:
|
1666
|
+
return false unless self.class == other.class
|
1667
|
+
s_ivars = self.instance_variables
|
1668
|
+
s_ivars.sort!
|
1669
|
+
s_ivars.delete :@ttl
|
1670
|
+
o_ivars = other.instance_variables
|
1671
|
+
o_ivars.sort!
|
1672
|
+
o_ivars.delete :@ttl
|
1673
|
+
return s_ivars == o_ivars &&
|
1674
|
+
s_ivars.collect {|name| self.instance_variable_get name} ==
|
1675
|
+
o_ivars.collect {|name| other.instance_variable_get name}
|
1676
|
+
end
|
1677
|
+
|
1678
|
+
def eql?(other) # :nodoc:
|
1679
|
+
return self == other
|
1680
|
+
end
|
1681
|
+
|
1682
|
+
def hash # :nodoc:
|
1683
|
+
h = 0
|
1684
|
+
vars = self.instance_variables
|
1685
|
+
vars.delete :@ttl
|
1686
|
+
vars.each {|name|
|
1687
|
+
h ^= self.instance_variable_get(name).hash
|
1688
|
+
}
|
1689
|
+
return h
|
1690
|
+
end
|
1691
|
+
|
1692
|
+
def self.get_class(type_value, class_value) # :nodoc:
|
1693
|
+
return ClassHash[[type_value, class_value]] ||
|
1694
|
+
Generic.create(type_value, class_value)
|
1695
|
+
end
|
1696
|
+
|
1697
|
+
##
|
1698
|
+
# A generic resource abstract class.
|
1699
|
+
|
1700
|
+
class Generic < Resource
|
1701
|
+
|
1702
|
+
##
|
1703
|
+
# Creates a new generic resource.
|
1704
|
+
|
1705
|
+
def initialize(data)
|
1706
|
+
@data = data
|
1707
|
+
end
|
1708
|
+
|
1709
|
+
##
|
1710
|
+
# Data for this generic resource.
|
1711
|
+
|
1712
|
+
attr_reader :data
|
1713
|
+
|
1714
|
+
def encode_rdata(msg) # :nodoc:
|
1715
|
+
msg.put_bytes(data)
|
1716
|
+
end
|
1717
|
+
|
1718
|
+
def self.decode_rdata(msg) # :nodoc:
|
1719
|
+
return self.new(msg.get_bytes)
|
1720
|
+
end
|
1721
|
+
|
1722
|
+
def self.create(type_value, class_value) # :nodoc:
|
1723
|
+
c = Class.new(Generic)
|
1724
|
+
c.const_set(:TypeValue, type_value)
|
1725
|
+
c.const_set(:ClassValue, class_value)
|
1726
|
+
Generic.const_set("Type#{type_value}_Class#{class_value}", c)
|
1727
|
+
ClassHash[[type_value, class_value]] = c
|
1728
|
+
return c
|
1729
|
+
end
|
1730
|
+
end
|
1731
|
+
|
1732
|
+
##
|
1733
|
+
# Domain Name resource abstract class.
|
1734
|
+
|
1735
|
+
class DomainName < Resource
|
1736
|
+
|
1737
|
+
##
|
1738
|
+
# Creates a new DomainName from +name+.
|
1739
|
+
|
1740
|
+
def initialize(name)
|
1741
|
+
@name = name
|
1742
|
+
end
|
1743
|
+
|
1744
|
+
##
|
1745
|
+
# The name of this DomainName.
|
1746
|
+
|
1747
|
+
attr_reader :name
|
1748
|
+
|
1749
|
+
def encode_rdata(msg) # :nodoc:
|
1750
|
+
msg.put_name(@name)
|
1751
|
+
end
|
1752
|
+
|
1753
|
+
def self.decode_rdata(msg) # :nodoc:
|
1754
|
+
return self.new(msg.get_name)
|
1755
|
+
end
|
1756
|
+
end
|
1757
|
+
|
1758
|
+
# Standard (class generic) RRs
|
1759
|
+
|
1760
|
+
ClassValue = nil # :nodoc:
|
1761
|
+
|
1762
|
+
##
|
1763
|
+
# An authoritative name server.
|
1764
|
+
|
1765
|
+
class NS < DomainName
|
1766
|
+
TypeValue = 2 # :nodoc:
|
1767
|
+
end
|
1768
|
+
|
1769
|
+
##
|
1770
|
+
# The canonical name for an alias.
|
1771
|
+
|
1772
|
+
class CNAME < DomainName
|
1773
|
+
TypeValue = 5 # :nodoc:
|
1774
|
+
end
|
1775
|
+
|
1776
|
+
##
|
1777
|
+
# Start Of Authority resource.
|
1778
|
+
|
1779
|
+
class SOA < Resource
|
1780
|
+
|
1781
|
+
TypeValue = 6 # :nodoc:
|
1782
|
+
|
1783
|
+
##
|
1784
|
+
# Creates a new SOA record. See the attr documentation for the
|
1785
|
+
# details of each argument.
|
1786
|
+
|
1787
|
+
def initialize(mname, rname, serial, refresh, retry_, expire, minimum)
|
1788
|
+
@mname = mname
|
1789
|
+
@rname = rname
|
1790
|
+
@serial = serial
|
1791
|
+
@refresh = refresh
|
1792
|
+
@retry = retry_
|
1793
|
+
@expire = expire
|
1794
|
+
@minimum = minimum
|
1795
|
+
end
|
1796
|
+
|
1797
|
+
##
|
1798
|
+
# Name of the host where the master zone file for this zone resides.
|
1799
|
+
|
1800
|
+
attr_reader :mname
|
1801
|
+
|
1802
|
+
##
|
1803
|
+
# The person responsible for this domain name.
|
1804
|
+
|
1805
|
+
attr_reader :rname
|
1806
|
+
|
1807
|
+
##
|
1808
|
+
# The version number of the zone file.
|
1809
|
+
|
1810
|
+
attr_reader :serial
|
1811
|
+
|
1812
|
+
##
|
1813
|
+
# How often, in seconds, a secondary name server is to check for
|
1814
|
+
# updates from the primary name server.
|
1815
|
+
|
1816
|
+
attr_reader :refresh
|
1817
|
+
|
1818
|
+
##
|
1819
|
+
# How often, in seconds, a secondary name server is to retry after a
|
1820
|
+
# failure to check for a refresh.
|
1821
|
+
|
1822
|
+
attr_reader :retry
|
1823
|
+
|
1824
|
+
##
|
1825
|
+
# Time in seconds that a secondary name server is to use the data
|
1826
|
+
# before refreshing from the primary name server.
|
1827
|
+
|
1828
|
+
attr_reader :expire
|
1829
|
+
|
1830
|
+
##
|
1831
|
+
# The minimum number of seconds to be used for TTL values in RRs.
|
1832
|
+
|
1833
|
+
attr_reader :minimum
|
1834
|
+
|
1835
|
+
def encode_rdata(msg) # :nodoc:
|
1836
|
+
msg.put_name(@mname)
|
1837
|
+
msg.put_name(@rname)
|
1838
|
+
msg.put_pack('NNNNN', @serial, @refresh, @retry, @expire, @minimum)
|
1839
|
+
end
|
1840
|
+
|
1841
|
+
def self.decode_rdata(msg) # :nodoc:
|
1842
|
+
mname = msg.get_name
|
1843
|
+
rname = msg.get_name
|
1844
|
+
serial, refresh, retry_, expire, minimum = msg.get_unpack('NNNNN')
|
1845
|
+
return self.new(
|
1846
|
+
mname, rname, serial, refresh, retry_, expire, minimum)
|
1847
|
+
end
|
1848
|
+
end
|
1849
|
+
|
1850
|
+
##
|
1851
|
+
# A Pointer to another DNS name.
|
1852
|
+
|
1853
|
+
class PTR < DomainName
|
1854
|
+
TypeValue = 12 # :nodoc:
|
1855
|
+
end
|
1856
|
+
|
1857
|
+
##
|
1858
|
+
# Host Information resource.
|
1859
|
+
|
1860
|
+
class HINFO < Resource
|
1861
|
+
|
1862
|
+
TypeValue = 13 # :nodoc:
|
1863
|
+
|
1864
|
+
##
|
1865
|
+
# Creates a new HINFO running +os+ on +cpu+.
|
1866
|
+
|
1867
|
+
def initialize(cpu, os)
|
1868
|
+
@cpu = cpu
|
1869
|
+
@os = os
|
1870
|
+
end
|
1871
|
+
|
1872
|
+
##
|
1873
|
+
# CPU architecture for this resource.
|
1874
|
+
|
1875
|
+
attr_reader :cpu
|
1876
|
+
|
1877
|
+
##
|
1878
|
+
# Operating system for this resource.
|
1879
|
+
|
1880
|
+
attr_reader :os
|
1881
|
+
|
1882
|
+
def encode_rdata(msg) # :nodoc:
|
1883
|
+
msg.put_string(@cpu)
|
1884
|
+
msg.put_string(@os)
|
1885
|
+
end
|
1886
|
+
|
1887
|
+
def self.decode_rdata(msg) # :nodoc:
|
1888
|
+
cpu = msg.get_string
|
1889
|
+
os = msg.get_string
|
1890
|
+
return self.new(cpu, os)
|
1891
|
+
end
|
1892
|
+
end
|
1893
|
+
|
1894
|
+
##
|
1895
|
+
# Mailing list or mailbox information.
|
1896
|
+
|
1897
|
+
class MINFO < Resource
|
1898
|
+
|
1899
|
+
TypeValue = 14 # :nodoc:
|
1900
|
+
|
1901
|
+
def initialize(rmailbx, emailbx)
|
1902
|
+
@rmailbx = rmailbx
|
1903
|
+
@emailbx = emailbx
|
1904
|
+
end
|
1905
|
+
|
1906
|
+
##
|
1907
|
+
# Domain name responsible for this mail list or mailbox.
|
1908
|
+
|
1909
|
+
attr_reader :rmailbx
|
1910
|
+
|
1911
|
+
##
|
1912
|
+
# Mailbox to use for error messages related to the mail list or mailbox.
|
1913
|
+
|
1914
|
+
attr_reader :emailbx
|
1915
|
+
|
1916
|
+
def encode_rdata(msg) # :nodoc:
|
1917
|
+
msg.put_name(@rmailbx)
|
1918
|
+
msg.put_name(@emailbx)
|
1919
|
+
end
|
1920
|
+
|
1921
|
+
def self.decode_rdata(msg) # :nodoc:
|
1922
|
+
rmailbx = msg.get_string
|
1923
|
+
emailbx = msg.get_string
|
1924
|
+
return self.new(rmailbx, emailbx)
|
1925
|
+
end
|
1926
|
+
end
|
1927
|
+
|
1928
|
+
##
|
1929
|
+
# Mail Exchanger resource.
|
1930
|
+
|
1931
|
+
class MX < Resource
|
1932
|
+
|
1933
|
+
TypeValue= 15 # :nodoc:
|
1934
|
+
|
1935
|
+
##
|
1936
|
+
# Creates a new MX record with +preference+, accepting mail at
|
1937
|
+
# +exchange+.
|
1938
|
+
|
1939
|
+
def initialize(preference, exchange)
|
1940
|
+
@preference = preference
|
1941
|
+
@exchange = exchange
|
1942
|
+
end
|
1943
|
+
|
1944
|
+
##
|
1945
|
+
# The preference for this MX.
|
1946
|
+
|
1947
|
+
attr_reader :preference
|
1948
|
+
|
1949
|
+
##
|
1950
|
+
# The host of this MX.
|
1951
|
+
|
1952
|
+
attr_reader :exchange
|
1953
|
+
|
1954
|
+
def encode_rdata(msg) # :nodoc:
|
1955
|
+
msg.put_pack('n', @preference)
|
1956
|
+
msg.put_name(@exchange)
|
1957
|
+
end
|
1958
|
+
|
1959
|
+
def self.decode_rdata(msg) # :nodoc:
|
1960
|
+
preference, = msg.get_unpack('n')
|
1961
|
+
exchange = msg.get_name
|
1962
|
+
return self.new(preference, exchange)
|
1963
|
+
end
|
1964
|
+
end
|
1965
|
+
|
1966
|
+
##
|
1967
|
+
# Unstructured text resource.
|
1968
|
+
|
1969
|
+
class TXT < Resource
|
1970
|
+
|
1971
|
+
TypeValue = 16 # :nodoc:
|
1972
|
+
|
1973
|
+
def initialize(first_string, *rest_strings)
|
1974
|
+
@strings = [first_string, *rest_strings]
|
1975
|
+
end
|
1976
|
+
|
1977
|
+
##
|
1978
|
+
# Returns an Array of Strings for this TXT record.
|
1979
|
+
|
1980
|
+
attr_reader :strings
|
1981
|
+
|
1982
|
+
##
|
1983
|
+
# Returns the concatenated string from +strings+.
|
1984
|
+
|
1985
|
+
def data
|
1986
|
+
@strings.join("")
|
1987
|
+
end
|
1988
|
+
|
1989
|
+
def encode_rdata(msg) # :nodoc:
|
1990
|
+
msg.put_string_list(@strings)
|
1991
|
+
end
|
1992
|
+
|
1993
|
+
def self.decode_rdata(msg) # :nodoc:
|
1994
|
+
strings = msg.get_string_list
|
1995
|
+
return self.new(*strings)
|
1996
|
+
end
|
1997
|
+
end
|
1998
|
+
|
1999
|
+
##
|
2000
|
+
# Location resource
|
2001
|
+
|
2002
|
+
class LOC < Resource
|
2003
|
+
|
2004
|
+
TypeValue = 29 # :nodoc:
|
2005
|
+
|
2006
|
+
def initialize(version, ssize, hprecision, vprecision, latitude, longitude, altitude)
|
2007
|
+
@version = version
|
2008
|
+
@ssize = Resolv::LOC::Size.create(ssize)
|
2009
|
+
@hprecision = Resolv::LOC::Size.create(hprecision)
|
2010
|
+
@vprecision = Resolv::LOC::Size.create(vprecision)
|
2011
|
+
@latitude = Resolv::LOC::Coord.create(latitude)
|
2012
|
+
@longitude = Resolv::LOC::Coord.create(longitude)
|
2013
|
+
@altitude = Resolv::LOC::Alt.create(altitude)
|
2014
|
+
end
|
2015
|
+
|
2016
|
+
##
|
2017
|
+
# Returns the version value for this LOC record which should always be 00
|
2018
|
+
|
2019
|
+
attr_reader :version
|
2020
|
+
|
2021
|
+
##
|
2022
|
+
# The spherical size of this LOC
|
2023
|
+
# in meters using scientific notation as 2 integers of XeY
|
2024
|
+
|
2025
|
+
attr_reader :ssize
|
2026
|
+
|
2027
|
+
##
|
2028
|
+
# The horizontal precision using ssize type values
|
2029
|
+
# in meters using scientific notation as 2 integers of XeY
|
2030
|
+
# for precision use value/2 e.g. 2m = +/-1m
|
2031
|
+
|
2032
|
+
attr_reader :hprecision
|
2033
|
+
|
2034
|
+
##
|
2035
|
+
# The vertical precision using ssize type values
|
2036
|
+
# in meters using scientific notation as 2 integers of XeY
|
2037
|
+
# for precision use value/2 e.g. 2m = +/-1m
|
2038
|
+
|
2039
|
+
attr_reader :vprecision
|
2040
|
+
|
2041
|
+
##
|
2042
|
+
# The latitude for this LOC where 2**31 is the equator
|
2043
|
+
# in thousandths of an arc second as an unsigned 32bit integer
|
2044
|
+
|
2045
|
+
attr_reader :latitude
|
2046
|
+
|
2047
|
+
##
|
2048
|
+
# The longitude for this LOC where 2**31 is the prime meridian
|
2049
|
+
# in thousandths of an arc second as an unsigned 32bit integer
|
2050
|
+
|
2051
|
+
attr_reader :longitude
|
2052
|
+
|
2053
|
+
##
|
2054
|
+
# The altitude of the LOC above a reference sphere whose surface sits 100km below the WGS84 spheroid
|
2055
|
+
# in centimeters as an unsigned 32bit integer
|
2056
|
+
|
2057
|
+
attr_reader :altitude
|
2058
|
+
|
2059
|
+
|
2060
|
+
def encode_rdata(msg) # :nodoc:
|
2061
|
+
msg.put_bytes(@version)
|
2062
|
+
msg.put_bytes(@ssize.scalar)
|
2063
|
+
msg.put_bytes(@hprecision.scalar)
|
2064
|
+
msg.put_bytes(@vprecision.scalar)
|
2065
|
+
msg.put_bytes(@latitude.coordinates)
|
2066
|
+
msg.put_bytes(@longitude.coordinates)
|
2067
|
+
msg.put_bytes(@altitude.altitude)
|
2068
|
+
end
|
2069
|
+
|
2070
|
+
def self.decode_rdata(msg) # :nodoc:
|
2071
|
+
version = msg.get_bytes(1)
|
2072
|
+
ssize = msg.get_bytes(1)
|
2073
|
+
hprecision = msg.get_bytes(1)
|
2074
|
+
vprecision = msg.get_bytes(1)
|
2075
|
+
latitude = msg.get_bytes(4)
|
2076
|
+
longitude = msg.get_bytes(4)
|
2077
|
+
altitude = msg.get_bytes(4)
|
2078
|
+
return self.new(
|
2079
|
+
version,
|
2080
|
+
Resolv::LOC::Size.new(ssize),
|
2081
|
+
Resolv::LOC::Size.new(hprecision),
|
2082
|
+
Resolv::LOC::Size.new(vprecision),
|
2083
|
+
Resolv::LOC::Coord.new(latitude,"lat"),
|
2084
|
+
Resolv::LOC::Coord.new(longitude,"lon"),
|
2085
|
+
Resolv::LOC::Alt.new(altitude)
|
2086
|
+
)
|
2087
|
+
end
|
2088
|
+
end
|
2089
|
+
|
2090
|
+
##
|
2091
|
+
# A Query type requesting any RR.
|
2092
|
+
|
2093
|
+
class ANY < Query
|
2094
|
+
TypeValue = 255 # :nodoc:
|
2095
|
+
end
|
2096
|
+
|
2097
|
+
ClassInsensitiveTypes = [ # :nodoc:
|
2098
|
+
NS, CNAME, SOA, PTR, HINFO, MINFO, MX, TXT, LOC, ANY
|
2099
|
+
]
|
2100
|
+
|
2101
|
+
##
|
2102
|
+
# module IN contains ARPA Internet specific RRs.
|
2103
|
+
|
2104
|
+
module IN
|
2105
|
+
|
2106
|
+
ClassValue = 1 # :nodoc:
|
2107
|
+
|
2108
|
+
ClassInsensitiveTypes.each {|s|
|
2109
|
+
c = Class.new(s)
|
2110
|
+
c.const_set(:TypeValue, s::TypeValue)
|
2111
|
+
c.const_set(:ClassValue, ClassValue)
|
2112
|
+
ClassHash[[s::TypeValue, ClassValue]] = c
|
2113
|
+
self.const_set(s.name.sub(/.*::/, ''), c)
|
2114
|
+
}
|
2115
|
+
|
2116
|
+
##
|
2117
|
+
# IPv4 Address resource
|
2118
|
+
|
2119
|
+
class A < Resource
|
2120
|
+
TypeValue = 1
|
2121
|
+
ClassValue = IN::ClassValue
|
2122
|
+
ClassHash[[TypeValue, ClassValue]] = self # :nodoc:
|
2123
|
+
|
2124
|
+
##
|
2125
|
+
# Creates a new A for +address+.
|
2126
|
+
|
2127
|
+
def initialize(address)
|
2128
|
+
@address = IPv4.create(address)
|
2129
|
+
end
|
2130
|
+
|
2131
|
+
##
|
2132
|
+
# The Resolv::IPv4 address for this A.
|
2133
|
+
|
2134
|
+
attr_reader :address
|
2135
|
+
|
2136
|
+
def encode_rdata(msg) # :nodoc:
|
2137
|
+
msg.put_bytes(@address.address)
|
2138
|
+
end
|
2139
|
+
|
2140
|
+
def self.decode_rdata(msg) # :nodoc:
|
2141
|
+
return self.new(IPv4.new(msg.get_bytes(4)))
|
2142
|
+
end
|
2143
|
+
end
|
2144
|
+
|
2145
|
+
##
|
2146
|
+
# Well Known Service resource.
|
2147
|
+
|
2148
|
+
class WKS < Resource
|
2149
|
+
TypeValue = 11
|
2150
|
+
ClassValue = IN::ClassValue
|
2151
|
+
ClassHash[[TypeValue, ClassValue]] = self # :nodoc:
|
2152
|
+
|
2153
|
+
def initialize(address, protocol, bitmap)
|
2154
|
+
@address = IPv4.create(address)
|
2155
|
+
@protocol = protocol
|
2156
|
+
@bitmap = bitmap
|
2157
|
+
end
|
2158
|
+
|
2159
|
+
##
|
2160
|
+
# The host these services run on.
|
2161
|
+
|
2162
|
+
attr_reader :address
|
2163
|
+
|
2164
|
+
##
|
2165
|
+
# IP protocol number for these services.
|
2166
|
+
|
2167
|
+
attr_reader :protocol
|
2168
|
+
|
2169
|
+
##
|
2170
|
+
# A bit map of enabled services on this host.
|
2171
|
+
#
|
2172
|
+
# If protocol is 6 (TCP) then the 26th bit corresponds to the SMTP
|
2173
|
+
# service (port 25). If this bit is set, then an SMTP server should
|
2174
|
+
# be listening on TCP port 25; if zero, SMTP service is not
|
2175
|
+
# supported.
|
2176
|
+
|
2177
|
+
attr_reader :bitmap
|
2178
|
+
|
2179
|
+
def encode_rdata(msg) # :nodoc:
|
2180
|
+
msg.put_bytes(@address.address)
|
2181
|
+
msg.put_pack("n", @protocol)
|
2182
|
+
msg.put_bytes(@bitmap)
|
2183
|
+
end
|
2184
|
+
|
2185
|
+
def self.decode_rdata(msg) # :nodoc:
|
2186
|
+
address = IPv4.new(msg.get_bytes(4))
|
2187
|
+
protocol, = msg.get_unpack("n")
|
2188
|
+
bitmap = msg.get_bytes
|
2189
|
+
return self.new(address, protocol, bitmap)
|
2190
|
+
end
|
2191
|
+
end
|
2192
|
+
|
2193
|
+
##
|
2194
|
+
# An IPv6 address record.
|
2195
|
+
|
2196
|
+
class AAAA < Resource
|
2197
|
+
TypeValue = 28
|
2198
|
+
ClassValue = IN::ClassValue
|
2199
|
+
ClassHash[[TypeValue, ClassValue]] = self # :nodoc:
|
2200
|
+
|
2201
|
+
##
|
2202
|
+
# Creates a new AAAA for +address+.
|
2203
|
+
|
2204
|
+
def initialize(address)
|
2205
|
+
@address = IPv6.create(address)
|
2206
|
+
end
|
2207
|
+
|
2208
|
+
##
|
2209
|
+
# The Resolv::IPv6 address for this AAAA.
|
2210
|
+
|
2211
|
+
attr_reader :address
|
2212
|
+
|
2213
|
+
def encode_rdata(msg) # :nodoc:
|
2214
|
+
msg.put_bytes(@address.address)
|
2215
|
+
end
|
2216
|
+
|
2217
|
+
def self.decode_rdata(msg) # :nodoc:
|
2218
|
+
return self.new(IPv6.new(msg.get_bytes(16)))
|
2219
|
+
end
|
2220
|
+
end
|
2221
|
+
|
2222
|
+
##
|
2223
|
+
# SRV resource record defined in RFC 2782
|
2224
|
+
#
|
2225
|
+
# These records identify the hostname and port that a service is
|
2226
|
+
# available at.
|
2227
|
+
|
2228
|
+
class SRV < Resource
|
2229
|
+
TypeValue = 33
|
2230
|
+
ClassValue = IN::ClassValue
|
2231
|
+
ClassHash[[TypeValue, ClassValue]] = self # :nodoc:
|
2232
|
+
|
2233
|
+
# Create a SRV resource record.
|
2234
|
+
#
|
2235
|
+
# See the documentation for #priority, #weight, #port and #target
|
2236
|
+
# for +priority+, +weight+, +port and +target+ respectively.
|
2237
|
+
|
2238
|
+
def initialize(priority, weight, port, target)
|
2239
|
+
@priority = priority.to_int
|
2240
|
+
@weight = weight.to_int
|
2241
|
+
@port = port.to_int
|
2242
|
+
@target = Name.create(target)
|
2243
|
+
end
|
2244
|
+
|
2245
|
+
# The priority of this target host.
|
2246
|
+
#
|
2247
|
+
# A client MUST attempt to contact the target host with the
|
2248
|
+
# lowest-numbered priority it can reach; target hosts with the same
|
2249
|
+
# priority SHOULD be tried in an order defined by the weight field.
|
2250
|
+
# The range is 0-65535. Note that it is not widely implemented and
|
2251
|
+
# should be set to zero.
|
2252
|
+
|
2253
|
+
attr_reader :priority
|
2254
|
+
|
2255
|
+
# A server selection mechanism.
|
2256
|
+
#
|
2257
|
+
# The weight field specifies a relative weight for entries with the
|
2258
|
+
# same priority. Larger weights SHOULD be given a proportionately
|
2259
|
+
# higher probability of being selected. The range of this number is
|
2260
|
+
# 0-65535. Domain administrators SHOULD use Weight 0 when there
|
2261
|
+
# isn't any server selection to do, to make the RR easier to read
|
2262
|
+
# for humans (less noisy). Note that it is not widely implemented
|
2263
|
+
# and should be set to zero.
|
2264
|
+
|
2265
|
+
attr_reader :weight
|
2266
|
+
|
2267
|
+
# The port on this target host of this service.
|
2268
|
+
#
|
2269
|
+
# The range is 0-65535.
|
2270
|
+
|
2271
|
+
attr_reader :port
|
2272
|
+
|
2273
|
+
# The domain name of the target host.
|
2274
|
+
#
|
2275
|
+
# A target of "." means that the service is decidedly not available
|
2276
|
+
# at this domain.
|
2277
|
+
|
2278
|
+
attr_reader :target
|
2279
|
+
|
2280
|
+
def encode_rdata(msg) # :nodoc:
|
2281
|
+
msg.put_pack("n", @priority)
|
2282
|
+
msg.put_pack("n", @weight)
|
2283
|
+
msg.put_pack("n", @port)
|
2284
|
+
msg.put_name(@target)
|
2285
|
+
end
|
2286
|
+
|
2287
|
+
def self.decode_rdata(msg) # :nodoc:
|
2288
|
+
priority, = msg.get_unpack("n")
|
2289
|
+
weight, = msg.get_unpack("n")
|
2290
|
+
port, = msg.get_unpack("n")
|
2291
|
+
target = msg.get_name
|
2292
|
+
return self.new(priority, weight, port, target)
|
2293
|
+
end
|
2294
|
+
end
|
2295
|
+
end
|
2296
|
+
end
|
2297
|
+
end
|
2298
|
+
|
2299
|
+
##
|
2300
|
+
# A Resolv::DNS IPv4 address.
|
2301
|
+
|
2302
|
+
class IPv4
|
2303
|
+
|
2304
|
+
##
|
2305
|
+
# Regular expression IPv4 addresses must match.
|
2306
|
+
|
2307
|
+
Regex256 = /0
|
2308
|
+
|1(?:[0-9][0-9]?)?
|
2309
|
+
|2(?:[0-4][0-9]?|5[0-5]?|[6-9])?
|
2310
|
+
|[3-9][0-9]?/x
|
2311
|
+
Regex = /\A(#{Regex256})\.(#{Regex256})\.(#{Regex256})\.(#{Regex256})\z/
|
2312
|
+
|
2313
|
+
def self.create(arg)
|
2314
|
+
case arg
|
2315
|
+
when IPv4
|
2316
|
+
return arg
|
2317
|
+
when Regex
|
2318
|
+
if (0..255) === (a = $1.to_i) &&
|
2319
|
+
(0..255) === (b = $2.to_i) &&
|
2320
|
+
(0..255) === (c = $3.to_i) &&
|
2321
|
+
(0..255) === (d = $4.to_i)
|
2322
|
+
return self.new([a, b, c, d].pack("CCCC"))
|
2323
|
+
else
|
2324
|
+
raise ArgumentError.new("IPv4 address with invalid value: " + arg)
|
2325
|
+
end
|
2326
|
+
else
|
2327
|
+
raise ArgumentError.new("cannot interpret as IPv4 address: #{arg.inspect}")
|
2328
|
+
end
|
2329
|
+
end
|
2330
|
+
|
2331
|
+
def initialize(address) # :nodoc:
|
2332
|
+
unless address.kind_of?(String)
|
2333
|
+
raise ArgumentError, 'IPv4 address must be a string'
|
2334
|
+
end
|
2335
|
+
unless address.length == 4
|
2336
|
+
raise ArgumentError, "IPv4 address expects 4 bytes but #{address.length} bytes"
|
2337
|
+
end
|
2338
|
+
@address = address
|
2339
|
+
end
|
2340
|
+
|
2341
|
+
##
|
2342
|
+
# A String representation of this IPv4 address.
|
2343
|
+
|
2344
|
+
##
|
2345
|
+
# The raw IPv4 address as a String.
|
2346
|
+
|
2347
|
+
attr_reader :address
|
2348
|
+
|
2349
|
+
def to_s # :nodoc:
|
2350
|
+
return sprintf("%d.%d.%d.%d", *@address.unpack("CCCC"))
|
2351
|
+
end
|
2352
|
+
|
2353
|
+
def inspect # :nodoc:
|
2354
|
+
return "#<#{self.class} #{self}>"
|
2355
|
+
end
|
2356
|
+
|
2357
|
+
##
|
2358
|
+
# Turns this IPv4 address into a Resolv::DNS::Name.
|
2359
|
+
|
2360
|
+
def to_name
|
2361
|
+
return DNS::Name.create(
|
2362
|
+
'%d.%d.%d.%d.in-addr.arpa.' % @address.unpack('CCCC').reverse)
|
2363
|
+
end
|
2364
|
+
|
2365
|
+
def ==(other) # :nodoc:
|
2366
|
+
return @address == other.address
|
2367
|
+
end
|
2368
|
+
|
2369
|
+
def eql?(other) # :nodoc:
|
2370
|
+
return self == other
|
2371
|
+
end
|
2372
|
+
|
2373
|
+
def hash # :nodoc:
|
2374
|
+
return @address.hash
|
2375
|
+
end
|
2376
|
+
end
|
2377
|
+
|
2378
|
+
##
|
2379
|
+
# A Resolv::DNS IPv6 address.
|
2380
|
+
|
2381
|
+
class IPv6
|
2382
|
+
|
2383
|
+
##
|
2384
|
+
# IPv6 address format a:b:c:d:e:f:g:h
|
2385
|
+
Regex_8Hex = /\A
|
2386
|
+
(?:[0-9A-Fa-f]{1,4}:){7}
|
2387
|
+
[0-9A-Fa-f]{1,4}
|
2388
|
+
\z/x
|
2389
|
+
|
2390
|
+
##
|
2391
|
+
# Compressed IPv6 address format a::b
|
2392
|
+
|
2393
|
+
Regex_CompressedHex = /\A
|
2394
|
+
((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?) ::
|
2395
|
+
((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?)
|
2396
|
+
\z/x
|
2397
|
+
|
2398
|
+
##
|
2399
|
+
# IPv4 mapped IPv6 address format a:b:c:d:e:f:w.x.y.z
|
2400
|
+
|
2401
|
+
Regex_6Hex4Dec = /\A
|
2402
|
+
((?:[0-9A-Fa-f]{1,4}:){6,6})
|
2403
|
+
(\d+)\.(\d+)\.(\d+)\.(\d+)
|
2404
|
+
\z/x
|
2405
|
+
|
2406
|
+
##
|
2407
|
+
# Compressed IPv4 mapped IPv6 address format a::b:w.x.y.z
|
2408
|
+
|
2409
|
+
Regex_CompressedHex4Dec = /\A
|
2410
|
+
((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?) ::
|
2411
|
+
((?:[0-9A-Fa-f]{1,4}:)*)
|
2412
|
+
(\d+)\.(\d+)\.(\d+)\.(\d+)
|
2413
|
+
\z/x
|
2414
|
+
|
2415
|
+
##
|
2416
|
+
# A composite IPv6 address Regexp.
|
2417
|
+
|
2418
|
+
Regex = /
|
2419
|
+
(?:#{Regex_8Hex}) |
|
2420
|
+
(?:#{Regex_CompressedHex}) |
|
2421
|
+
(?:#{Regex_6Hex4Dec}) |
|
2422
|
+
(?:#{Regex_CompressedHex4Dec})/x
|
2423
|
+
|
2424
|
+
##
|
2425
|
+
# Creates a new IPv6 address from +arg+ which may be:
|
2426
|
+
#
|
2427
|
+
# IPv6:: returns +arg+.
|
2428
|
+
# String:: +arg+ must match one of the IPv6::Regex* constants
|
2429
|
+
|
2430
|
+
def self.create(arg)
|
2431
|
+
case arg
|
2432
|
+
when IPv6
|
2433
|
+
return arg
|
2434
|
+
when String
|
2435
|
+
address = ''
|
2436
|
+
if Regex_8Hex =~ arg
|
2437
|
+
arg.scan(/[0-9A-Fa-f]+/) {|hex| address << [hex.hex].pack('n')}
|
2438
|
+
elsif Regex_CompressedHex =~ arg
|
2439
|
+
prefix = $1
|
2440
|
+
suffix = $2
|
2441
|
+
a1 = ''
|
2442
|
+
a2 = ''
|
2443
|
+
prefix.scan(/[0-9A-Fa-f]+/) {|hex| a1 << [hex.hex].pack('n')}
|
2444
|
+
suffix.scan(/[0-9A-Fa-f]+/) {|hex| a2 << [hex.hex].pack('n')}
|
2445
|
+
omitlen = 16 - a1.length - a2.length
|
2446
|
+
address << a1 << "\0" * omitlen << a2
|
2447
|
+
elsif Regex_6Hex4Dec =~ arg
|
2448
|
+
prefix, a, b, c, d = $1, $2.to_i, $3.to_i, $4.to_i, $5.to_i
|
2449
|
+
if (0..255) === a && (0..255) === b && (0..255) === c && (0..255) === d
|
2450
|
+
prefix.scan(/[0-9A-Fa-f]+/) {|hex| address << [hex.hex].pack('n')}
|
2451
|
+
address << [a, b, c, d].pack('CCCC')
|
2452
|
+
else
|
2453
|
+
raise ArgumentError.new("not numeric IPv6 address: " + arg)
|
2454
|
+
end
|
2455
|
+
elsif Regex_CompressedHex4Dec =~ arg
|
2456
|
+
prefix, suffix, a, b, c, d = $1, $2, $3.to_i, $4.to_i, $5.to_i, $6.to_i
|
2457
|
+
if (0..255) === a && (0..255) === b && (0..255) === c && (0..255) === d
|
2458
|
+
a1 = ''
|
2459
|
+
a2 = ''
|
2460
|
+
prefix.scan(/[0-9A-Fa-f]+/) {|hex| a1 << [hex.hex].pack('n')}
|
2461
|
+
suffix.scan(/[0-9A-Fa-f]+/) {|hex| a2 << [hex.hex].pack('n')}
|
2462
|
+
omitlen = 12 - a1.length - a2.length
|
2463
|
+
address << a1 << "\0" * omitlen << a2 << [a, b, c, d].pack('CCCC')
|
2464
|
+
else
|
2465
|
+
raise ArgumentError.new("not numeric IPv6 address: " + arg)
|
2466
|
+
end
|
2467
|
+
else
|
2468
|
+
raise ArgumentError.new("not numeric IPv6 address: " + arg)
|
2469
|
+
end
|
2470
|
+
return IPv6.new(address)
|
2471
|
+
else
|
2472
|
+
raise ArgumentError.new("cannot interpret as IPv6 address: #{arg.inspect}")
|
2473
|
+
end
|
2474
|
+
end
|
2475
|
+
|
2476
|
+
def initialize(address) # :nodoc:
|
2477
|
+
unless address.kind_of?(String) && address.length == 16
|
2478
|
+
raise ArgumentError.new('IPv6 address must be 16 bytes')
|
2479
|
+
end
|
2480
|
+
@address = address
|
2481
|
+
end
|
2482
|
+
|
2483
|
+
##
|
2484
|
+
# The raw IPv6 address as a String.
|
2485
|
+
|
2486
|
+
attr_reader :address
|
2487
|
+
|
2488
|
+
def to_s # :nodoc:
|
2489
|
+
address = sprintf("%X:%X:%X:%X:%X:%X:%X:%X", *@address.unpack("nnnnnnnn"))
|
2490
|
+
unless address.sub!(/(^|:)0(:0)+(:|$)/, '::')
|
2491
|
+
address.sub!(/(^|:)0(:|$)/, '::')
|
2492
|
+
end
|
2493
|
+
return address
|
2494
|
+
end
|
2495
|
+
|
2496
|
+
def inspect # :nodoc:
|
2497
|
+
return "#<#{self.class} #{self}>"
|
2498
|
+
end
|
2499
|
+
|
2500
|
+
##
|
2501
|
+
# Turns this IPv6 address into a Resolv::DNS::Name.
|
2502
|
+
#--
|
2503
|
+
# ip6.arpa should be searched too. [RFC3152]
|
2504
|
+
|
2505
|
+
def to_name
|
2506
|
+
return DNS::Name.new(
|
2507
|
+
@address.unpack("H32")[0].split(//).reverse + ['ip6', 'arpa'])
|
2508
|
+
end
|
2509
|
+
|
2510
|
+
def ==(other) # :nodoc:
|
2511
|
+
return @address == other.address
|
2512
|
+
end
|
2513
|
+
|
2514
|
+
def eql?(other) # :nodoc:
|
2515
|
+
return self == other
|
2516
|
+
end
|
2517
|
+
|
2518
|
+
def hash # :nodoc:
|
2519
|
+
return @address.hash
|
2520
|
+
end
|
2521
|
+
end
|
2522
|
+
|
2523
|
+
##
|
2524
|
+
# Resolv::MDNS is a one-shot Multicast DNS (mDNS) resolver. It blindly
|
2525
|
+
# makes queries to the mDNS addresses without understanding anything about
|
2526
|
+
# multicast ports.
|
2527
|
+
#
|
2528
|
+
# Information taken form the following places:
|
2529
|
+
#
|
2530
|
+
# * RFC 6762
|
2531
|
+
|
2532
|
+
class MDNS < DNS
|
2533
|
+
|
2534
|
+
##
|
2535
|
+
# Default mDNS Port
|
2536
|
+
|
2537
|
+
Port = 5353
|
2538
|
+
|
2539
|
+
##
|
2540
|
+
# Default IPv4 mDNS address
|
2541
|
+
|
2542
|
+
AddressV4 = '224.0.0.251'
|
2543
|
+
|
2544
|
+
##
|
2545
|
+
# Default IPv6 mDNS address
|
2546
|
+
|
2547
|
+
AddressV6 = 'ff02::fb'
|
2548
|
+
|
2549
|
+
##
|
2550
|
+
# Default mDNS addresses
|
2551
|
+
|
2552
|
+
Addresses = [
|
2553
|
+
[AddressV4, Port],
|
2554
|
+
[AddressV6, Port],
|
2555
|
+
]
|
2556
|
+
|
2557
|
+
##
|
2558
|
+
# Creates a new one-shot Multicast DNS (mDNS) resolver.
|
2559
|
+
#
|
2560
|
+
# +config_info+ can be:
|
2561
|
+
#
|
2562
|
+
# nil::
|
2563
|
+
# Uses the default mDNS addresses
|
2564
|
+
#
|
2565
|
+
# Hash::
|
2566
|
+
# Must contain :nameserver or :nameserver_port like
|
2567
|
+
# Resolv::DNS#initialize.
|
2568
|
+
|
2569
|
+
def initialize(config_info=nil)
|
2570
|
+
if config_info then
|
2571
|
+
super({ nameserver_port: Addresses }.merge(config_info))
|
2572
|
+
else
|
2573
|
+
super(nameserver_port: Addresses)
|
2574
|
+
end
|
2575
|
+
end
|
2576
|
+
|
2577
|
+
##
|
2578
|
+
# Iterates over all IP addresses for +name+ retrieved from the mDNS
|
2579
|
+
# resolver, provided name ends with "local". If the name does not end in
|
2580
|
+
# "local" no records will be returned.
|
2581
|
+
#
|
2582
|
+
# +name+ can be a Resolv::DNS::Name or a String. Retrieved addresses will
|
2583
|
+
# be a Resolv::IPv4 or Resolv::IPv6
|
2584
|
+
|
2585
|
+
def each_address(name)
|
2586
|
+
name = Resolv::DNS::Name.create(name)
|
2587
|
+
|
2588
|
+
return unless name.to_a.last == 'local'
|
2589
|
+
|
2590
|
+
super(name)
|
2591
|
+
end
|
2592
|
+
|
2593
|
+
def make_udp_requester # :nodoc:
|
2594
|
+
nameserver_port = @config.nameserver_port
|
2595
|
+
Requester::MDNSOneShot.new(*nameserver_port)
|
2596
|
+
end
|
2597
|
+
|
2598
|
+
end
|
2599
|
+
|
2600
|
+
module LOC
|
2601
|
+
|
2602
|
+
##
|
2603
|
+
# A Resolv::LOC::Size
|
2604
|
+
|
2605
|
+
class Size
|
2606
|
+
|
2607
|
+
Regex = /^(\d+\.*\d*)[m]$/
|
2608
|
+
|
2609
|
+
##
|
2610
|
+
# Creates a new LOC::Size from +arg+ which may be:
|
2611
|
+
#
|
2612
|
+
# LOC::Size:: returns +arg+.
|
2613
|
+
# String:: +arg+ must match the LOC::Size::Regex constant
|
2614
|
+
|
2615
|
+
def self.create(arg)
|
2616
|
+
case arg
|
2617
|
+
when Size
|
2618
|
+
return arg
|
2619
|
+
when String
|
2620
|
+
scalar = ''
|
2621
|
+
if Regex =~ arg
|
2622
|
+
scalar = [(($1.to_f*(1e2)).to_i.to_s[0].to_i*(2**4)+(($1.to_f*(1e2)).to_i.to_s.length-1))].pack("C")
|
2623
|
+
else
|
2624
|
+
raise ArgumentError.new("not a properly formed Size string: " + arg)
|
2625
|
+
end
|
2626
|
+
return Size.new(scalar)
|
2627
|
+
else
|
2628
|
+
raise ArgumentError.new("cannot interpret as Size: #{arg.inspect}")
|
2629
|
+
end
|
2630
|
+
end
|
2631
|
+
|
2632
|
+
def initialize(scalar)
|
2633
|
+
@scalar = scalar
|
2634
|
+
end
|
2635
|
+
|
2636
|
+
##
|
2637
|
+
# The raw size
|
2638
|
+
|
2639
|
+
attr_reader :scalar
|
2640
|
+
|
2641
|
+
def to_s # :nodoc:
|
2642
|
+
s = @scalar.unpack("H2").join.to_s
|
2643
|
+
return ((s[0].to_i)*(10**(s[1].to_i-2))).to_s << "m"
|
2644
|
+
end
|
2645
|
+
|
2646
|
+
def inspect # :nodoc:
|
2647
|
+
return "#<#{self.class} #{self}>"
|
2648
|
+
end
|
2649
|
+
|
2650
|
+
def ==(other) # :nodoc:
|
2651
|
+
return @scalar == other.scalar
|
2652
|
+
end
|
2653
|
+
|
2654
|
+
def eql?(other) # :nodoc:
|
2655
|
+
return self == other
|
2656
|
+
end
|
2657
|
+
|
2658
|
+
def hash # :nodoc:
|
2659
|
+
return @scalar.hash
|
2660
|
+
end
|
2661
|
+
|
2662
|
+
end
|
2663
|
+
|
2664
|
+
##
|
2665
|
+
# A Resolv::LOC::Coord
|
2666
|
+
|
2667
|
+
class Coord
|
2668
|
+
|
2669
|
+
Regex = /^(\d+)\s(\d+)\s(\d+\.\d+)\s([NESW])$/
|
2670
|
+
|
2671
|
+
##
|
2672
|
+
# Creates a new LOC::Coord from +arg+ which may be:
|
2673
|
+
#
|
2674
|
+
# LOC::Coord:: returns +arg+.
|
2675
|
+
# String:: +arg+ must match the LOC::Coord::Regex constant
|
2676
|
+
|
2677
|
+
def self.create(arg)
|
2678
|
+
case arg
|
2679
|
+
when Coord
|
2680
|
+
return arg
|
2681
|
+
when String
|
2682
|
+
coordinates = ''
|
2683
|
+
if Regex =~ arg && $1<180
|
2684
|
+
hemi = ($4[/([NE])/,1]) || ($4[/([SW])/,1]) ? 1 : -1
|
2685
|
+
coordinates = [(($1.to_i*(36e5))+($2.to_i*(6e4))+($3.to_f*(1e3)))*hemi+(2**31)].pack("N")
|
2686
|
+
(orientation ||= '') << $4[[/NS/],1] ? 'lat' : 'lon'
|
2687
|
+
else
|
2688
|
+
raise ArgumentError.new("not a properly formed Coord string: " + arg)
|
2689
|
+
end
|
2690
|
+
return Coord.new(coordinates,orientation)
|
2691
|
+
else
|
2692
|
+
raise ArgumentError.new("cannot interpret as Coord: #{arg.inspect}")
|
2693
|
+
end
|
2694
|
+
end
|
2695
|
+
|
2696
|
+
def initialize(coordinates,orientation)
|
2697
|
+
unless coordinates.kind_of?(String)
|
2698
|
+
raise ArgumentError.new("Coord must be a 32bit unsigned integer in hex format: #{coordinates.inspect}")
|
2699
|
+
end
|
2700
|
+
unless orientation.kind_of?(String) && orientation[/^lon$|^lat$/]
|
2701
|
+
raise ArgumentError.new('Coord expects orientation to be a String argument of "lat" or "lon"')
|
2702
|
+
end
|
2703
|
+
@coordinates = coordinates
|
2704
|
+
@orientation = orientation
|
2705
|
+
end
|
2706
|
+
|
2707
|
+
##
|
2708
|
+
# The raw coordinates
|
2709
|
+
|
2710
|
+
attr_reader :coordinates
|
2711
|
+
|
2712
|
+
## The orientation of the hemisphere as 'lat' or 'lon'
|
2713
|
+
|
2714
|
+
attr_reader :orientation
|
2715
|
+
|
2716
|
+
def to_s # :nodoc:
|
2717
|
+
c = @coordinates.unpack("N").join.to_i
|
2718
|
+
val = (c - (2**31)).abs
|
2719
|
+
fracsecs = (val % 1e3).to_i.to_s
|
2720
|
+
val = val / 1e3
|
2721
|
+
secs = (val % 60).to_i.to_s
|
2722
|
+
val = val / 60
|
2723
|
+
mins = (val % 60).to_i.to_s
|
2724
|
+
degs = (val / 60).to_i.to_s
|
2725
|
+
posi = (c >= 2**31)
|
2726
|
+
case posi
|
2727
|
+
when true
|
2728
|
+
hemi = @orientation[/^lat$/] ? "N" : "E"
|
2729
|
+
else
|
2730
|
+
hemi = @orientation[/^lon$/] ? "W" : "S"
|
2731
|
+
end
|
2732
|
+
return degs << " " << mins << " " << secs << "." << fracsecs << " " << hemi
|
2733
|
+
end
|
2734
|
+
|
2735
|
+
def inspect # :nodoc:
|
2736
|
+
return "#<#{self.class} #{self}>"
|
2737
|
+
end
|
2738
|
+
|
2739
|
+
def ==(other) # :nodoc:
|
2740
|
+
return @coordinates == other.coordinates
|
2741
|
+
end
|
2742
|
+
|
2743
|
+
def eql?(other) # :nodoc:
|
2744
|
+
return self == other
|
2745
|
+
end
|
2746
|
+
|
2747
|
+
def hash # :nodoc:
|
2748
|
+
return @coordinates.hash
|
2749
|
+
end
|
2750
|
+
|
2751
|
+
end
|
2752
|
+
|
2753
|
+
##
|
2754
|
+
# A Resolv::LOC::Alt
|
2755
|
+
|
2756
|
+
class Alt
|
2757
|
+
|
2758
|
+
Regex = /^([+-]*\d+\.*\d*)[m]$/
|
2759
|
+
|
2760
|
+
##
|
2761
|
+
# Creates a new LOC::Alt from +arg+ which may be:
|
2762
|
+
#
|
2763
|
+
# LOC::Alt:: returns +arg+.
|
2764
|
+
# String:: +arg+ must match the LOC::Alt::Regex constant
|
2765
|
+
|
2766
|
+
def self.create(arg)
|
2767
|
+
case arg
|
2768
|
+
when Alt
|
2769
|
+
return arg
|
2770
|
+
when String
|
2771
|
+
altitude = ''
|
2772
|
+
if Regex =~ arg
|
2773
|
+
altitude = [($1.to_f*(1e2))+(1e7)].pack("N")
|
2774
|
+
else
|
2775
|
+
raise ArgumentError.new("not a properly formed Alt string: " + arg)
|
2776
|
+
end
|
2777
|
+
return Alt.new(altitude)
|
2778
|
+
else
|
2779
|
+
raise ArgumentError.new("cannot interpret as Alt: #{arg.inspect}")
|
2780
|
+
end
|
2781
|
+
end
|
2782
|
+
|
2783
|
+
def initialize(altitude)
|
2784
|
+
@altitude = altitude
|
2785
|
+
end
|
2786
|
+
|
2787
|
+
##
|
2788
|
+
# The raw altitude
|
2789
|
+
|
2790
|
+
attr_reader :altitude
|
2791
|
+
|
2792
|
+
def to_s # :nodoc:
|
2793
|
+
a = @altitude.unpack("N").join.to_i
|
2794
|
+
return ((a.to_f/1e2)-1e5).to_s + "m"
|
2795
|
+
end
|
2796
|
+
|
2797
|
+
def inspect # :nodoc:
|
2798
|
+
return "#<#{self.class} #{self}>"
|
2799
|
+
end
|
2800
|
+
|
2801
|
+
def ==(other) # :nodoc:
|
2802
|
+
return @altitude == other.altitude
|
2803
|
+
end
|
2804
|
+
|
2805
|
+
def eql?(other) # :nodoc:
|
2806
|
+
return self == other
|
2807
|
+
end
|
2808
|
+
|
2809
|
+
def hash # :nodoc:
|
2810
|
+
return @altitude.hash
|
2811
|
+
end
|
2812
|
+
|
2813
|
+
end
|
2814
|
+
|
2815
|
+
end
|
2816
|
+
|
2817
|
+
##
|
2818
|
+
# Default resolver to use for Resolv class methods.
|
2819
|
+
|
2820
|
+
DefaultResolver = self.new
|
2821
|
+
|
2822
|
+
##
|
2823
|
+
# Replaces the resolvers in the default resolver with +new_resolvers+. This
|
2824
|
+
# allows resolvers to be changed for resolv-replace.
|
2825
|
+
|
2826
|
+
def DefaultResolver.replace_resolvers new_resolvers
|
2827
|
+
@resolvers = new_resolvers
|
2828
|
+
end
|
2829
|
+
|
2830
|
+
##
|
2831
|
+
# Address Regexp to use for matching IP addresses.
|
2832
|
+
|
2833
|
+
AddressRegex = /(?:#{IPv4::Regex})|(?:#{IPv6::Regex})/
|
2834
|
+
|
2835
|
+
end
|
2836
|
+
|