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,2341 @@
|
|
1
|
+
# encoding: US-ASCII
|
2
|
+
# = csv.rb -- CSV Reading and Writing
|
3
|
+
#
|
4
|
+
# Created by James Edward Gray II on 2005-10-31.
|
5
|
+
# Copyright 2005 James Edward Gray II. You can redistribute or modify this code
|
6
|
+
# under the terms of Ruby's license.
|
7
|
+
#
|
8
|
+
# See CSV for documentation.
|
9
|
+
#
|
10
|
+
# == Description
|
11
|
+
#
|
12
|
+
# Welcome to the new and improved CSV.
|
13
|
+
#
|
14
|
+
# This version of the CSV library began its life as FasterCSV. FasterCSV was
|
15
|
+
# intended as a replacement to Ruby's then standard CSV library. It was
|
16
|
+
# designed to address concerns users of that library had and it had three
|
17
|
+
# primary goals:
|
18
|
+
#
|
19
|
+
# 1. Be significantly faster than CSV while remaining a pure Ruby library.
|
20
|
+
# 2. Use a smaller and easier to maintain code base. (FasterCSV eventually
|
21
|
+
# grew larger, was also but considerably richer in features. The parsing
|
22
|
+
# core remains quite small.)
|
23
|
+
# 3. Improve on the CSV interface.
|
24
|
+
#
|
25
|
+
# Obviously, the last one is subjective. I did try to defer to the original
|
26
|
+
# interface whenever I didn't have a compelling reason to change it though, so
|
27
|
+
# hopefully this won't be too radically different.
|
28
|
+
#
|
29
|
+
# We must have met our goals because FasterCSV was renamed to CSV and replaced
|
30
|
+
# the original library as of Ruby 1.9. If you are migrating code from 1.8 or
|
31
|
+
# earlier, you may have to change your code to comply with the new interface.
|
32
|
+
#
|
33
|
+
# == What's Different From the Old CSV?
|
34
|
+
#
|
35
|
+
# I'm sure I'll miss something, but I'll try to mention most of the major
|
36
|
+
# differences I am aware of, to help others quickly get up to speed:
|
37
|
+
#
|
38
|
+
# === CSV Parsing
|
39
|
+
#
|
40
|
+
# * This parser is m17n aware. See CSV for full details.
|
41
|
+
# * This library has a stricter parser and will throw MalformedCSVErrors on
|
42
|
+
# problematic data.
|
43
|
+
# * This library has a less liberal idea of a line ending than CSV. What you
|
44
|
+
# set as the <tt>:row_sep</tt> is law. It can auto-detect your line endings
|
45
|
+
# though.
|
46
|
+
# * The old library returned empty lines as <tt>[nil]</tt>. This library calls
|
47
|
+
# them <tt>[]</tt>.
|
48
|
+
# * This library has a much faster parser.
|
49
|
+
#
|
50
|
+
# === Interface
|
51
|
+
#
|
52
|
+
# * CSV now uses Hash-style parameters to set options.
|
53
|
+
# * CSV no longer has generate_row() or parse_row().
|
54
|
+
# * The old CSV's Reader and Writer classes have been dropped.
|
55
|
+
# * CSV::open() is now more like Ruby's open().
|
56
|
+
# * CSV objects now support most standard IO methods.
|
57
|
+
# * CSV now has a new() method used to wrap objects like String and IO for
|
58
|
+
# reading and writing.
|
59
|
+
# * CSV::generate() is different from the old method.
|
60
|
+
# * CSV no longer supports partial reads. It works line-by-line.
|
61
|
+
# * CSV no longer allows the instance methods to override the separators for
|
62
|
+
# performance reasons. They must be set in the constructor.
|
63
|
+
#
|
64
|
+
# If you use this library and find yourself missing any functionality I have
|
65
|
+
# trimmed, please {let me know}[mailto:james@grayproductions.net].
|
66
|
+
#
|
67
|
+
# == Documentation
|
68
|
+
#
|
69
|
+
# See CSV for documentation.
|
70
|
+
#
|
71
|
+
# == What is CSV, really?
|
72
|
+
#
|
73
|
+
# CSV maintains a pretty strict definition of CSV taken directly from
|
74
|
+
# {the RFC}[http://www.ietf.org/rfc/rfc4180.txt]. I relax the rules in only one
|
75
|
+
# place and that is to make using this library easier. CSV will parse all valid
|
76
|
+
# CSV.
|
77
|
+
#
|
78
|
+
# What you don't want to do is feed CSV invalid data. Because of the way the
|
79
|
+
# CSV format works, it's common for a parser to need to read until the end of
|
80
|
+
# the file to be sure a field is invalid. This eats a lot of time and memory.
|
81
|
+
#
|
82
|
+
# Luckily, when working with invalid CSV, Ruby's built-in methods will almost
|
83
|
+
# always be superior in every way. For example, parsing non-quoted fields is as
|
84
|
+
# easy as:
|
85
|
+
#
|
86
|
+
# data.split(",")
|
87
|
+
#
|
88
|
+
# == Questions and/or Comments
|
89
|
+
#
|
90
|
+
# Feel free to email {James Edward Gray II}[mailto:james@grayproductions.net]
|
91
|
+
# with any questions.
|
92
|
+
|
93
|
+
require "forwardable"
|
94
|
+
require "English"
|
95
|
+
require "date"
|
96
|
+
require "stringio"
|
97
|
+
|
98
|
+
#
|
99
|
+
# This class provides a complete interface to CSV files and data. It offers
|
100
|
+
# tools to enable you to read and write to and from Strings or IO objects, as
|
101
|
+
# needed.
|
102
|
+
#
|
103
|
+
# == Reading
|
104
|
+
#
|
105
|
+
# === From a File
|
106
|
+
#
|
107
|
+
# ==== A Line at a Time
|
108
|
+
#
|
109
|
+
# CSV.foreach("path/to/file.csv") do |row|
|
110
|
+
# # use row here...
|
111
|
+
# end
|
112
|
+
#
|
113
|
+
# ==== All at Once
|
114
|
+
#
|
115
|
+
# arr_of_arrs = CSV.read("path/to/file.csv")
|
116
|
+
#
|
117
|
+
# === From a String
|
118
|
+
#
|
119
|
+
# ==== A Line at a Time
|
120
|
+
#
|
121
|
+
# CSV.parse("CSV,data,String") do |row|
|
122
|
+
# # use row here...
|
123
|
+
# end
|
124
|
+
#
|
125
|
+
# ==== All at Once
|
126
|
+
#
|
127
|
+
# arr_of_arrs = CSV.parse("CSV,data,String")
|
128
|
+
#
|
129
|
+
# == Writing
|
130
|
+
#
|
131
|
+
# === To a File
|
132
|
+
#
|
133
|
+
# CSV.open("path/to/file.csv", "wb") do |csv|
|
134
|
+
# csv << ["row", "of", "CSV", "data"]
|
135
|
+
# csv << ["another", "row"]
|
136
|
+
# # ...
|
137
|
+
# end
|
138
|
+
#
|
139
|
+
# === To a String
|
140
|
+
#
|
141
|
+
# csv_string = CSV.generate do |csv|
|
142
|
+
# csv << ["row", "of", "CSV", "data"]
|
143
|
+
# csv << ["another", "row"]
|
144
|
+
# # ...
|
145
|
+
# end
|
146
|
+
#
|
147
|
+
# == Convert a Single Line
|
148
|
+
#
|
149
|
+
# csv_string = ["CSV", "data"].to_csv # to CSV
|
150
|
+
# csv_array = "CSV,String".parse_csv # from CSV
|
151
|
+
#
|
152
|
+
# == Shortcut Interface
|
153
|
+
#
|
154
|
+
# CSV { |csv_out| csv_out << %w{my data here} } # to $stdout
|
155
|
+
# CSV(csv = "") { |csv_str| csv_str << %w{my data here} } # to a String
|
156
|
+
# CSV($stderr) { |csv_err| csv_err << %w{my data here} } # to $stderr
|
157
|
+
# CSV($stdin) { |csv_in| csv_in.each { |row| p row } } # from $stdin
|
158
|
+
#
|
159
|
+
# == Advanced Usage
|
160
|
+
#
|
161
|
+
# === Wrap an IO Object
|
162
|
+
#
|
163
|
+
# csv = CSV.new(io, options)
|
164
|
+
# # ... read (with gets() or each()) from and write (with <<) to csv here ...
|
165
|
+
#
|
166
|
+
# == CSV and Character Encodings (M17n or Multilingualization)
|
167
|
+
#
|
168
|
+
# This new CSV parser is m17n savvy. The parser works in the Encoding of the IO
|
169
|
+
# or String object being read from or written to. Your data is never transcoded
|
170
|
+
# (unless you ask Ruby to transcode it for you) and will literally be parsed in
|
171
|
+
# the Encoding it is in. Thus CSV will return Arrays or Rows of Strings in the
|
172
|
+
# Encoding of your data. This is accomplished by transcoding the parser itself
|
173
|
+
# into your Encoding.
|
174
|
+
#
|
175
|
+
# Some transcoding must take place, of course, to accomplish this multiencoding
|
176
|
+
# support. For example, <tt>:col_sep</tt>, <tt>:row_sep</tt>, and
|
177
|
+
# <tt>:quote_char</tt> must be transcoded to match your data. Hopefully this
|
178
|
+
# makes the entire process feel transparent, since CSV's defaults should just
|
179
|
+
# magically work for you data. However, you can set these values manually in
|
180
|
+
# the target Encoding to avoid the translation.
|
181
|
+
#
|
182
|
+
# It's also important to note that while all of CSV's core parser is now
|
183
|
+
# Encoding agnostic, some features are not. For example, the built-in
|
184
|
+
# converters will try to transcode data to UTF-8 before making conversions.
|
185
|
+
# Again, you can provide custom converters that are aware of your Encodings to
|
186
|
+
# avoid this translation. It's just too hard for me to support native
|
187
|
+
# conversions in all of Ruby's Encodings.
|
188
|
+
#
|
189
|
+
# Anyway, the practical side of this is simple: make sure IO and String objects
|
190
|
+
# passed into CSV have the proper Encoding set and everything should just work.
|
191
|
+
# CSV methods that allow you to open IO objects (CSV::foreach(), CSV::open(),
|
192
|
+
# CSV::read(), and CSV::readlines()) do allow you to specify the Encoding.
|
193
|
+
#
|
194
|
+
# One minor exception comes when generating CSV into a String with an Encoding
|
195
|
+
# that is not ASCII compatible. There's no existing data for CSV to use to
|
196
|
+
# prepare itself and thus you will probably need to manually specify the desired
|
197
|
+
# Encoding for most of those cases. It will try to guess using the fields in a
|
198
|
+
# row of output though, when using CSV::generate_line() or Array#to_csv().
|
199
|
+
#
|
200
|
+
# I try to point out any other Encoding issues in the documentation of methods
|
201
|
+
# as they come up.
|
202
|
+
#
|
203
|
+
# This has been tested to the best of my ability with all non-"dummy" Encodings
|
204
|
+
# Ruby ships with. However, it is brave new code and may have some bugs.
|
205
|
+
# Please feel free to {report}[mailto:james@grayproductions.net] any issues you
|
206
|
+
# find with it.
|
207
|
+
#
|
208
|
+
class CSV
|
209
|
+
# The version of the installed library.
|
210
|
+
VERSION = "2.4.8".freeze
|
211
|
+
|
212
|
+
#
|
213
|
+
# A CSV::Row is part Array and part Hash. It retains an order for the fields
|
214
|
+
# and allows duplicates just as an Array would, but also allows you to access
|
215
|
+
# fields by name just as you could if they were in a Hash.
|
216
|
+
#
|
217
|
+
# All rows returned by CSV will be constructed from this class, if header row
|
218
|
+
# processing is activated.
|
219
|
+
#
|
220
|
+
class Row
|
221
|
+
#
|
222
|
+
# Construct a new CSV::Row from +headers+ and +fields+, which are expected
|
223
|
+
# to be Arrays. If one Array is shorter than the other, it will be padded
|
224
|
+
# with +nil+ objects.
|
225
|
+
#
|
226
|
+
# The optional +header_row+ parameter can be set to +true+ to indicate, via
|
227
|
+
# CSV::Row.header_row?() and CSV::Row.field_row?(), that this is a header
|
228
|
+
# row. Otherwise, the row is assumes to be a field row.
|
229
|
+
#
|
230
|
+
# A CSV::Row object supports the following Array methods through delegation:
|
231
|
+
#
|
232
|
+
# * empty?()
|
233
|
+
# * length()
|
234
|
+
# * size()
|
235
|
+
#
|
236
|
+
def initialize(headers, fields, header_row = false)
|
237
|
+
@header_row = header_row
|
238
|
+
headers.each { |h| h.freeze if h.is_a? String }
|
239
|
+
|
240
|
+
# handle extra headers or fields
|
241
|
+
@row = if headers.size >= fields.size
|
242
|
+
headers.zip(fields)
|
243
|
+
else
|
244
|
+
fields.zip(headers).map { |pair| pair.reverse! }
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
248
|
+
# Internal data format used to compare equality.
|
249
|
+
attr_reader :row
|
250
|
+
protected :row
|
251
|
+
|
252
|
+
### Array Delegation ###
|
253
|
+
|
254
|
+
extend Forwardable
|
255
|
+
def_delegators :@row, :empty?, :length, :size
|
256
|
+
|
257
|
+
# Returns +true+ if this is a header row.
|
258
|
+
def header_row?
|
259
|
+
@header_row
|
260
|
+
end
|
261
|
+
|
262
|
+
# Returns +true+ if this is a field row.
|
263
|
+
def field_row?
|
264
|
+
not header_row?
|
265
|
+
end
|
266
|
+
|
267
|
+
# Returns the headers of this row.
|
268
|
+
def headers
|
269
|
+
@row.map { |pair| pair.first }
|
270
|
+
end
|
271
|
+
|
272
|
+
#
|
273
|
+
# :call-seq:
|
274
|
+
# field( header )
|
275
|
+
# field( header, offset )
|
276
|
+
# field( index )
|
277
|
+
#
|
278
|
+
# This method will return the field value by +header+ or +index+. If a field
|
279
|
+
# is not found, +nil+ is returned.
|
280
|
+
#
|
281
|
+
# When provided, +offset+ ensures that a header match occurs on or later
|
282
|
+
# than the +offset+ index. You can use this to find duplicate headers,
|
283
|
+
# without resorting to hard-coding exact indices.
|
284
|
+
#
|
285
|
+
def field(header_or_index, minimum_index = 0)
|
286
|
+
# locate the pair
|
287
|
+
finder = header_or_index.is_a?(Integer) ? :[] : :assoc
|
288
|
+
pair = @row[minimum_index..-1].send(finder, header_or_index)
|
289
|
+
|
290
|
+
# return the field if we have a pair
|
291
|
+
pair.nil? ? nil : pair.last
|
292
|
+
end
|
293
|
+
alias_method :[], :field
|
294
|
+
|
295
|
+
#
|
296
|
+
# :call-seq:
|
297
|
+
# fetch( header )
|
298
|
+
# fetch( header ) { |row| ... }
|
299
|
+
# fetch( header, default )
|
300
|
+
#
|
301
|
+
# This method will fetch the field value by +header+. It has the same
|
302
|
+
# behavior as Hash#fetch: if there is a field with the given +header+, its
|
303
|
+
# value is returned. Otherwise, if a block is given, it is yielded the
|
304
|
+
# +header+ and its result is returned; if a +default+ is given as the
|
305
|
+
# second argument, it is returned; otherwise a KeyError is raised.
|
306
|
+
#
|
307
|
+
def fetch(header, *varargs)
|
308
|
+
raise ArgumentError, "Too many arguments" if varargs.length > 1
|
309
|
+
pair = @row.assoc(header)
|
310
|
+
if pair
|
311
|
+
pair.last
|
312
|
+
else
|
313
|
+
if block_given?
|
314
|
+
yield header
|
315
|
+
elsif varargs.empty?
|
316
|
+
raise KeyError, "key not found: #{header}"
|
317
|
+
else
|
318
|
+
varargs.first
|
319
|
+
end
|
320
|
+
end
|
321
|
+
end
|
322
|
+
|
323
|
+
# Returns +true+ if there is a field with the given +header+.
|
324
|
+
def has_key?(header)
|
325
|
+
!!@row.assoc(header)
|
326
|
+
end
|
327
|
+
alias_method :include?, :has_key?
|
328
|
+
alias_method :key?, :has_key?
|
329
|
+
alias_method :member?, :has_key?
|
330
|
+
|
331
|
+
#
|
332
|
+
# :call-seq:
|
333
|
+
# []=( header, value )
|
334
|
+
# []=( header, offset, value )
|
335
|
+
# []=( index, value )
|
336
|
+
#
|
337
|
+
# Looks up the field by the semantics described in CSV::Row.field() and
|
338
|
+
# assigns the +value+.
|
339
|
+
#
|
340
|
+
# Assigning past the end of the row with an index will set all pairs between
|
341
|
+
# to <tt>[nil, nil]</tt>. Assigning to an unused header appends the new
|
342
|
+
# pair.
|
343
|
+
#
|
344
|
+
def []=(*args)
|
345
|
+
value = args.pop
|
346
|
+
|
347
|
+
if args.first.is_a? Integer
|
348
|
+
if @row[args.first].nil? # extending past the end with index
|
349
|
+
@row[args.first] = [nil, value]
|
350
|
+
@row.map! { |pair| pair.nil? ? [nil, nil] : pair }
|
351
|
+
else # normal index assignment
|
352
|
+
@row[args.first][1] = value
|
353
|
+
end
|
354
|
+
else
|
355
|
+
index = index(*args)
|
356
|
+
if index.nil? # appending a field
|
357
|
+
self << [args.first, value]
|
358
|
+
else # normal header assignment
|
359
|
+
@row[index][1] = value
|
360
|
+
end
|
361
|
+
end
|
362
|
+
end
|
363
|
+
|
364
|
+
#
|
365
|
+
# :call-seq:
|
366
|
+
# <<( field )
|
367
|
+
# <<( header_and_field_array )
|
368
|
+
# <<( header_and_field_hash )
|
369
|
+
#
|
370
|
+
# If a two-element Array is provided, it is assumed to be a header and field
|
371
|
+
# and the pair is appended. A Hash works the same way with the key being
|
372
|
+
# the header and the value being the field. Anything else is assumed to be
|
373
|
+
# a lone field which is appended with a +nil+ header.
|
374
|
+
#
|
375
|
+
# This method returns the row for chaining.
|
376
|
+
#
|
377
|
+
def <<(arg)
|
378
|
+
if arg.is_a?(Array) and arg.size == 2 # appending a header and name
|
379
|
+
@row << arg
|
380
|
+
elsif arg.is_a?(Hash) # append header and name pairs
|
381
|
+
arg.each { |pair| @row << pair }
|
382
|
+
else # append field value
|
383
|
+
@row << [nil, arg]
|
384
|
+
end
|
385
|
+
|
386
|
+
self # for chaining
|
387
|
+
end
|
388
|
+
|
389
|
+
#
|
390
|
+
# A shortcut for appending multiple fields. Equivalent to:
|
391
|
+
#
|
392
|
+
# args.each { |arg| csv_row << arg }
|
393
|
+
#
|
394
|
+
# This method returns the row for chaining.
|
395
|
+
#
|
396
|
+
def push(*args)
|
397
|
+
args.each { |arg| self << arg }
|
398
|
+
|
399
|
+
self # for chaining
|
400
|
+
end
|
401
|
+
|
402
|
+
#
|
403
|
+
# :call-seq:
|
404
|
+
# delete( header )
|
405
|
+
# delete( header, offset )
|
406
|
+
# delete( index )
|
407
|
+
#
|
408
|
+
# Used to remove a pair from the row by +header+ or +index+. The pair is
|
409
|
+
# located as described in CSV::Row.field(). The deleted pair is returned,
|
410
|
+
# or +nil+ if a pair could not be found.
|
411
|
+
#
|
412
|
+
def delete(header_or_index, minimum_index = 0)
|
413
|
+
if header_or_index.is_a? Integer # by index
|
414
|
+
@row.delete_at(header_or_index)
|
415
|
+
elsif i = index(header_or_index, minimum_index) # by header
|
416
|
+
@row.delete_at(i)
|
417
|
+
else
|
418
|
+
[ ]
|
419
|
+
end
|
420
|
+
end
|
421
|
+
|
422
|
+
#
|
423
|
+
# The provided +block+ is passed a header and field for each pair in the row
|
424
|
+
# and expected to return +true+ or +false+, depending on whether the pair
|
425
|
+
# should be deleted.
|
426
|
+
#
|
427
|
+
# This method returns the row for chaining.
|
428
|
+
#
|
429
|
+
def delete_if(&block)
|
430
|
+
@row.delete_if(&block)
|
431
|
+
|
432
|
+
self # for chaining
|
433
|
+
end
|
434
|
+
|
435
|
+
#
|
436
|
+
# This method accepts any number of arguments which can be headers, indices,
|
437
|
+
# Ranges of either, or two-element Arrays containing a header and offset.
|
438
|
+
# Each argument will be replaced with a field lookup as described in
|
439
|
+
# CSV::Row.field().
|
440
|
+
#
|
441
|
+
# If called with no arguments, all fields are returned.
|
442
|
+
#
|
443
|
+
def fields(*headers_and_or_indices)
|
444
|
+
if headers_and_or_indices.empty? # return all fields--no arguments
|
445
|
+
@row.map { |pair| pair.last }
|
446
|
+
else # or work like values_at()
|
447
|
+
headers_and_or_indices.inject(Array.new) do |all, h_or_i|
|
448
|
+
all + if h_or_i.is_a? Range
|
449
|
+
index_begin = h_or_i.begin.is_a?(Integer) ? h_or_i.begin :
|
450
|
+
index(h_or_i.begin)
|
451
|
+
index_end = h_or_i.end.is_a?(Integer) ? h_or_i.end :
|
452
|
+
index(h_or_i.end)
|
453
|
+
new_range = h_or_i.exclude_end? ? (index_begin...index_end) :
|
454
|
+
(index_begin..index_end)
|
455
|
+
fields.values_at(new_range)
|
456
|
+
else
|
457
|
+
[field(*Array(h_or_i))]
|
458
|
+
end
|
459
|
+
end
|
460
|
+
end
|
461
|
+
end
|
462
|
+
alias_method :values_at, :fields
|
463
|
+
|
464
|
+
#
|
465
|
+
# :call-seq:
|
466
|
+
# index( header )
|
467
|
+
# index( header, offset )
|
468
|
+
#
|
469
|
+
# This method will return the index of a field with the provided +header+.
|
470
|
+
# The +offset+ can be used to locate duplicate header names, as described in
|
471
|
+
# CSV::Row.field().
|
472
|
+
#
|
473
|
+
def index(header, minimum_index = 0)
|
474
|
+
# find the pair
|
475
|
+
index = headers[minimum_index..-1].index(header)
|
476
|
+
# return the index at the right offset, if we found one
|
477
|
+
index.nil? ? nil : index + minimum_index
|
478
|
+
end
|
479
|
+
|
480
|
+
# Returns +true+ if +name+ is a header for this row, and +false+ otherwise.
|
481
|
+
def header?(name)
|
482
|
+
headers.include? name
|
483
|
+
end
|
484
|
+
alias_method :include?, :header?
|
485
|
+
|
486
|
+
#
|
487
|
+
# Returns +true+ if +data+ matches a field in this row, and +false+
|
488
|
+
# otherwise.
|
489
|
+
#
|
490
|
+
def field?(data)
|
491
|
+
fields.include? data
|
492
|
+
end
|
493
|
+
|
494
|
+
include Enumerable
|
495
|
+
|
496
|
+
#
|
497
|
+
# Yields each pair of the row as header and field tuples (much like
|
498
|
+
# iterating over a Hash).
|
499
|
+
#
|
500
|
+
# Support for Enumerable.
|
501
|
+
#
|
502
|
+
# This method returns the row for chaining.
|
503
|
+
#
|
504
|
+
def each(&block)
|
505
|
+
@row.each(&block)
|
506
|
+
|
507
|
+
self # for chaining
|
508
|
+
end
|
509
|
+
|
510
|
+
#
|
511
|
+
# Returns +true+ if this row contains the same headers and fields in the
|
512
|
+
# same order as +other+.
|
513
|
+
#
|
514
|
+
def ==(other)
|
515
|
+
return @row == other.row if other.is_a? CSV::Row
|
516
|
+
@row == other
|
517
|
+
end
|
518
|
+
|
519
|
+
#
|
520
|
+
# Collapses the row into a simple Hash. Be warning that this discards field
|
521
|
+
# order and clobbers duplicate fields.
|
522
|
+
#
|
523
|
+
def to_hash
|
524
|
+
# flatten just one level of the internal Array
|
525
|
+
Hash[*@row.inject(Array.new) { |ary, pair| ary.push(*pair) }]
|
526
|
+
end
|
527
|
+
|
528
|
+
#
|
529
|
+
# Returns the row as a CSV String. Headers are not used. Equivalent to:
|
530
|
+
#
|
531
|
+
# csv_row.fields.to_csv( options )
|
532
|
+
#
|
533
|
+
def to_csv(options = Hash.new)
|
534
|
+
fields.to_csv(options)
|
535
|
+
end
|
536
|
+
alias_method :to_s, :to_csv
|
537
|
+
|
538
|
+
# A summary of fields, by header, in an ASCII compatible String.
|
539
|
+
def inspect
|
540
|
+
str = ["#<", self.class.to_s]
|
541
|
+
each do |header, field|
|
542
|
+
str << " " << (header.is_a?(Symbol) ? header.to_s : header.inspect) <<
|
543
|
+
":" << field.inspect
|
544
|
+
end
|
545
|
+
str << ">"
|
546
|
+
begin
|
547
|
+
str.join('')
|
548
|
+
rescue # any encoding error
|
549
|
+
str.map do |s|
|
550
|
+
e = Encoding::Converter.asciicompat_encoding(s.encoding)
|
551
|
+
e ? s.encode(e) : s.force_encoding("ASCII-8BIT")
|
552
|
+
end.join('')
|
553
|
+
end
|
554
|
+
end
|
555
|
+
end
|
556
|
+
|
557
|
+
#
|
558
|
+
# A CSV::Table is a two-dimensional data structure for representing CSV
|
559
|
+
# documents. Tables allow you to work with the data by row or column,
|
560
|
+
# manipulate the data, and even convert the results back to CSV, if needed.
|
561
|
+
#
|
562
|
+
# All tables returned by CSV will be constructed from this class, if header
|
563
|
+
# row processing is activated.
|
564
|
+
#
|
565
|
+
class Table
|
566
|
+
#
|
567
|
+
# Construct a new CSV::Table from +array_of_rows+, which are expected
|
568
|
+
# to be CSV::Row objects. All rows are assumed to have the same headers.
|
569
|
+
#
|
570
|
+
# A CSV::Table object supports the following Array methods through
|
571
|
+
# delegation:
|
572
|
+
#
|
573
|
+
# * empty?()
|
574
|
+
# * length()
|
575
|
+
# * size()
|
576
|
+
#
|
577
|
+
def initialize(array_of_rows)
|
578
|
+
@table = array_of_rows
|
579
|
+
@mode = :col_or_row
|
580
|
+
end
|
581
|
+
|
582
|
+
# The current access mode for indexing and iteration.
|
583
|
+
attr_reader :mode
|
584
|
+
|
585
|
+
# Internal data format used to compare equality.
|
586
|
+
attr_reader :table
|
587
|
+
protected :table
|
588
|
+
|
589
|
+
### Array Delegation ###
|
590
|
+
|
591
|
+
extend Forwardable
|
592
|
+
def_delegators :@table, :empty?, :length, :size
|
593
|
+
|
594
|
+
#
|
595
|
+
# Returns a duplicate table object, in column mode. This is handy for
|
596
|
+
# chaining in a single call without changing the table mode, but be aware
|
597
|
+
# that this method can consume a fair amount of memory for bigger data sets.
|
598
|
+
#
|
599
|
+
# This method returns the duplicate table for chaining. Don't chain
|
600
|
+
# destructive methods (like []=()) this way though, since you are working
|
601
|
+
# with a duplicate.
|
602
|
+
#
|
603
|
+
def by_col
|
604
|
+
self.class.new(@table.dup).by_col!
|
605
|
+
end
|
606
|
+
|
607
|
+
#
|
608
|
+
# Switches the mode of this table to column mode. All calls to indexing and
|
609
|
+
# iteration methods will work with columns until the mode is changed again.
|
610
|
+
#
|
611
|
+
# This method returns the table and is safe to chain.
|
612
|
+
#
|
613
|
+
def by_col!
|
614
|
+
@mode = :col
|
615
|
+
|
616
|
+
self
|
617
|
+
end
|
618
|
+
|
619
|
+
#
|
620
|
+
# Returns a duplicate table object, in mixed mode. This is handy for
|
621
|
+
# chaining in a single call without changing the table mode, but be aware
|
622
|
+
# that this method can consume a fair amount of memory for bigger data sets.
|
623
|
+
#
|
624
|
+
# This method returns the duplicate table for chaining. Don't chain
|
625
|
+
# destructive methods (like []=()) this way though, since you are working
|
626
|
+
# with a duplicate.
|
627
|
+
#
|
628
|
+
def by_col_or_row
|
629
|
+
self.class.new(@table.dup).by_col_or_row!
|
630
|
+
end
|
631
|
+
|
632
|
+
#
|
633
|
+
# Switches the mode of this table to mixed mode. All calls to indexing and
|
634
|
+
# iteration methods will use the default intelligent indexing system until
|
635
|
+
# the mode is changed again. In mixed mode an index is assumed to be a row
|
636
|
+
# reference while anything else is assumed to be column access by headers.
|
637
|
+
#
|
638
|
+
# This method returns the table and is safe to chain.
|
639
|
+
#
|
640
|
+
def by_col_or_row!
|
641
|
+
@mode = :col_or_row
|
642
|
+
|
643
|
+
self
|
644
|
+
end
|
645
|
+
|
646
|
+
#
|
647
|
+
# Returns a duplicate table object, in row mode. This is handy for chaining
|
648
|
+
# in a single call without changing the table mode, but be aware that this
|
649
|
+
# method can consume a fair amount of memory for bigger data sets.
|
650
|
+
#
|
651
|
+
# This method returns the duplicate table for chaining. Don't chain
|
652
|
+
# destructive methods (like []=()) this way though, since you are working
|
653
|
+
# with a duplicate.
|
654
|
+
#
|
655
|
+
def by_row
|
656
|
+
self.class.new(@table.dup).by_row!
|
657
|
+
end
|
658
|
+
|
659
|
+
#
|
660
|
+
# Switches the mode of this table to row mode. All calls to indexing and
|
661
|
+
# iteration methods will work with rows until the mode is changed again.
|
662
|
+
#
|
663
|
+
# This method returns the table and is safe to chain.
|
664
|
+
#
|
665
|
+
def by_row!
|
666
|
+
@mode = :row
|
667
|
+
|
668
|
+
self
|
669
|
+
end
|
670
|
+
|
671
|
+
#
|
672
|
+
# Returns the headers for the first row of this table (assumed to match all
|
673
|
+
# other rows). An empty Array is returned for empty tables.
|
674
|
+
#
|
675
|
+
def headers
|
676
|
+
if @table.empty?
|
677
|
+
Array.new
|
678
|
+
else
|
679
|
+
@table.first.headers
|
680
|
+
end
|
681
|
+
end
|
682
|
+
|
683
|
+
#
|
684
|
+
# In the default mixed mode, this method returns rows for index access and
|
685
|
+
# columns for header access. You can force the index association by first
|
686
|
+
# calling by_col!() or by_row!().
|
687
|
+
#
|
688
|
+
# Columns are returned as an Array of values. Altering that Array has no
|
689
|
+
# effect on the table.
|
690
|
+
#
|
691
|
+
def [](index_or_header)
|
692
|
+
if @mode == :row or # by index
|
693
|
+
(@mode == :col_or_row and index_or_header.is_a? Integer)
|
694
|
+
@table[index_or_header]
|
695
|
+
else # by header
|
696
|
+
@table.map { |row| row[index_or_header] }
|
697
|
+
end
|
698
|
+
end
|
699
|
+
|
700
|
+
#
|
701
|
+
# In the default mixed mode, this method assigns rows for index access and
|
702
|
+
# columns for header access. You can force the index association by first
|
703
|
+
# calling by_col!() or by_row!().
|
704
|
+
#
|
705
|
+
# Rows may be set to an Array of values (which will inherit the table's
|
706
|
+
# headers()) or a CSV::Row.
|
707
|
+
#
|
708
|
+
# Columns may be set to a single value, which is copied to each row of the
|
709
|
+
# column, or an Array of values. Arrays of values are assigned to rows top
|
710
|
+
# to bottom in row major order. Excess values are ignored and if the Array
|
711
|
+
# does not have a value for each row the extra rows will receive a +nil+.
|
712
|
+
#
|
713
|
+
# Assigning to an existing column or row clobbers the data. Assigning to
|
714
|
+
# new columns creates them at the right end of the table.
|
715
|
+
#
|
716
|
+
def []=(index_or_header, value)
|
717
|
+
if @mode == :row or # by index
|
718
|
+
(@mode == :col_or_row and index_or_header.is_a? Integer)
|
719
|
+
if value.is_a? Array
|
720
|
+
@table[index_or_header] = Row.new(headers, value)
|
721
|
+
else
|
722
|
+
@table[index_or_header] = value
|
723
|
+
end
|
724
|
+
else # set column
|
725
|
+
if value.is_a? Array # multiple values
|
726
|
+
@table.each_with_index do |row, i|
|
727
|
+
if row.header_row?
|
728
|
+
row[index_or_header] = index_or_header
|
729
|
+
else
|
730
|
+
row[index_or_header] = value[i]
|
731
|
+
end
|
732
|
+
end
|
733
|
+
else # repeated value
|
734
|
+
@table.each do |row|
|
735
|
+
if row.header_row?
|
736
|
+
row[index_or_header] = index_or_header
|
737
|
+
else
|
738
|
+
row[index_or_header] = value
|
739
|
+
end
|
740
|
+
end
|
741
|
+
end
|
742
|
+
end
|
743
|
+
end
|
744
|
+
|
745
|
+
#
|
746
|
+
# The mixed mode default is to treat a list of indices as row access,
|
747
|
+
# returning the rows indicated. Anything else is considered columnar
|
748
|
+
# access. For columnar access, the return set has an Array for each row
|
749
|
+
# with the values indicated by the headers in each Array. You can force
|
750
|
+
# column or row mode using by_col!() or by_row!().
|
751
|
+
#
|
752
|
+
# You cannot mix column and row access.
|
753
|
+
#
|
754
|
+
def values_at(*indices_or_headers)
|
755
|
+
if @mode == :row or # by indices
|
756
|
+
( @mode == :col_or_row and indices_or_headers.all? do |index|
|
757
|
+
index.is_a?(Integer) or
|
758
|
+
( index.is_a?(Range) and
|
759
|
+
index.first.is_a?(Integer) and
|
760
|
+
index.last.is_a?(Integer) )
|
761
|
+
end )
|
762
|
+
@table.values_at(*indices_or_headers)
|
763
|
+
else # by headers
|
764
|
+
@table.map { |row| row.values_at(*indices_or_headers) }
|
765
|
+
end
|
766
|
+
end
|
767
|
+
|
768
|
+
#
|
769
|
+
# Adds a new row to the bottom end of this table. You can provide an Array,
|
770
|
+
# which will be converted to a CSV::Row (inheriting the table's headers()),
|
771
|
+
# or a CSV::Row.
|
772
|
+
#
|
773
|
+
# This method returns the table for chaining.
|
774
|
+
#
|
775
|
+
def <<(row_or_array)
|
776
|
+
if row_or_array.is_a? Array # append Array
|
777
|
+
@table << Row.new(headers, row_or_array)
|
778
|
+
else # append Row
|
779
|
+
@table << row_or_array
|
780
|
+
end
|
781
|
+
|
782
|
+
self # for chaining
|
783
|
+
end
|
784
|
+
|
785
|
+
#
|
786
|
+
# A shortcut for appending multiple rows. Equivalent to:
|
787
|
+
#
|
788
|
+
# rows.each { |row| self << row }
|
789
|
+
#
|
790
|
+
# This method returns the table for chaining.
|
791
|
+
#
|
792
|
+
def push(*rows)
|
793
|
+
rows.each { |row| self << row }
|
794
|
+
|
795
|
+
self # for chaining
|
796
|
+
end
|
797
|
+
|
798
|
+
#
|
799
|
+
# Removes and returns the indicated column or row. In the default mixed
|
800
|
+
# mode indices refer to rows and everything else is assumed to be a column
|
801
|
+
# header. Use by_col!() or by_row!() to force the lookup.
|
802
|
+
#
|
803
|
+
def delete(index_or_header)
|
804
|
+
if @mode == :row or # by index
|
805
|
+
(@mode == :col_or_row and index_or_header.is_a? Integer)
|
806
|
+
@table.delete_at(index_or_header)
|
807
|
+
else # by header
|
808
|
+
@table.map { |row| row.delete(index_or_header).last }
|
809
|
+
end
|
810
|
+
end
|
811
|
+
|
812
|
+
#
|
813
|
+
# Removes any column or row for which the block returns +true+. In the
|
814
|
+
# default mixed mode or row mode, iteration is the standard row major
|
815
|
+
# walking of rows. In column mode, iteration will +yield+ two element
|
816
|
+
# tuples containing the column name and an Array of values for that column.
|
817
|
+
#
|
818
|
+
# This method returns the table for chaining.
|
819
|
+
#
|
820
|
+
def delete_if(&block)
|
821
|
+
if @mode == :row or @mode == :col_or_row # by index
|
822
|
+
@table.delete_if(&block)
|
823
|
+
else # by header
|
824
|
+
to_delete = Array.new
|
825
|
+
headers.each_with_index do |header, i|
|
826
|
+
to_delete << header if block[[header, self[header]]]
|
827
|
+
end
|
828
|
+
to_delete.map { |header| delete(header) }
|
829
|
+
end
|
830
|
+
|
831
|
+
self # for chaining
|
832
|
+
end
|
833
|
+
|
834
|
+
include Enumerable
|
835
|
+
|
836
|
+
#
|
837
|
+
# In the default mixed mode or row mode, iteration is the standard row major
|
838
|
+
# walking of rows. In column mode, iteration will +yield+ two element
|
839
|
+
# tuples containing the column name and an Array of values for that column.
|
840
|
+
#
|
841
|
+
# This method returns the table for chaining.
|
842
|
+
#
|
843
|
+
def each(&block)
|
844
|
+
if @mode == :col
|
845
|
+
headers.each { |header| block[[header, self[header]]] }
|
846
|
+
else
|
847
|
+
@table.each(&block)
|
848
|
+
end
|
849
|
+
|
850
|
+
self # for chaining
|
851
|
+
end
|
852
|
+
|
853
|
+
# Returns +true+ if all rows of this table ==() +other+'s rows.
|
854
|
+
def ==(other)
|
855
|
+
@table == other.table
|
856
|
+
end
|
857
|
+
|
858
|
+
#
|
859
|
+
# Returns the table as an Array of Arrays. Headers will be the first row,
|
860
|
+
# then all of the field rows will follow.
|
861
|
+
#
|
862
|
+
def to_a
|
863
|
+
@table.inject([headers]) do |array, row|
|
864
|
+
if row.header_row?
|
865
|
+
array
|
866
|
+
else
|
867
|
+
array + [row.fields]
|
868
|
+
end
|
869
|
+
end
|
870
|
+
end
|
871
|
+
|
872
|
+
#
|
873
|
+
# Returns the table as a complete CSV String. Headers will be listed first,
|
874
|
+
# then all of the field rows.
|
875
|
+
#
|
876
|
+
# This method assumes you want the Table.headers(), unless you explicitly
|
877
|
+
# pass <tt>:write_headers => false</tt>.
|
878
|
+
#
|
879
|
+
def to_csv(options = Hash.new)
|
880
|
+
wh = options.fetch(:write_headers, true)
|
881
|
+
@table.inject(wh ? [headers.to_csv(options)] : [ ]) do |rows, row|
|
882
|
+
if row.header_row?
|
883
|
+
rows
|
884
|
+
else
|
885
|
+
rows + [row.fields.to_csv(options)]
|
886
|
+
end
|
887
|
+
end.join('')
|
888
|
+
end
|
889
|
+
alias_method :to_s, :to_csv
|
890
|
+
|
891
|
+
# Shows the mode and size of this table in a US-ASCII String.
|
892
|
+
def inspect
|
893
|
+
"#<#{self.class} mode:#{@mode} row_count:#{to_a.size}>".encode("US-ASCII")
|
894
|
+
end
|
895
|
+
end
|
896
|
+
|
897
|
+
# The error thrown when the parser encounters illegal CSV formatting.
|
898
|
+
class MalformedCSVError < RuntimeError; end
|
899
|
+
|
900
|
+
#
|
901
|
+
# A FieldInfo Struct contains details about a field's position in the data
|
902
|
+
# source it was read from. CSV will pass this Struct to some blocks that make
|
903
|
+
# decisions based on field structure. See CSV.convert_fields() for an
|
904
|
+
# example.
|
905
|
+
#
|
906
|
+
# <b><tt>index</tt></b>:: The zero-based index of the field in its row.
|
907
|
+
# <b><tt>line</tt></b>:: The line of the data source this row is from.
|
908
|
+
# <b><tt>header</tt></b>:: The header for the column, when available.
|
909
|
+
#
|
910
|
+
FieldInfo = Struct.new(:index, :line, :header)
|
911
|
+
|
912
|
+
# A Regexp used to find and convert some common Date formats.
|
913
|
+
DateMatcher = / \A(?: (\w+,?\s+)?\w+\s+\d{1,2},?\s+\d{2,4} |
|
914
|
+
\d{4}-\d{2}-\d{2} )\z /x
|
915
|
+
# A Regexp used to find and convert some common DateTime formats.
|
916
|
+
DateTimeMatcher =
|
917
|
+
/ \A(?: (\w+,?\s+)?\w+\s+\d{1,2}\s+\d{1,2}:\d{1,2}:\d{1,2},?\s+\d{2,4} |
|
918
|
+
\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2} )\z /x
|
919
|
+
|
920
|
+
# The encoding used by all converters.
|
921
|
+
ConverterEncoding = Encoding.find("UTF-8")
|
922
|
+
|
923
|
+
#
|
924
|
+
# This Hash holds the built-in converters of CSV that can be accessed by name.
|
925
|
+
# You can select Converters with CSV.convert() or through the +options+ Hash
|
926
|
+
# passed to CSV::new().
|
927
|
+
#
|
928
|
+
# <b><tt>:integer</tt></b>:: Converts any field Integer() accepts.
|
929
|
+
# <b><tt>:float</tt></b>:: Converts any field Float() accepts.
|
930
|
+
# <b><tt>:numeric</tt></b>:: A combination of <tt>:integer</tt>
|
931
|
+
# and <tt>:float</tt>.
|
932
|
+
# <b><tt>:date</tt></b>:: Converts any field Date::parse() accepts.
|
933
|
+
# <b><tt>:date_time</tt></b>:: Converts any field DateTime::parse() accepts.
|
934
|
+
# <b><tt>:all</tt></b>:: All built-in converters. A combination of
|
935
|
+
# <tt>:date_time</tt> and <tt>:numeric</tt>.
|
936
|
+
#
|
937
|
+
# All built-in converters transcode field data to UTF-8 before attempting a
|
938
|
+
# conversion. If your data cannot be transcoded to UTF-8 the conversion will
|
939
|
+
# fail and the field will remain unchanged.
|
940
|
+
#
|
941
|
+
# This Hash is intentionally left unfrozen and users should feel free to add
|
942
|
+
# values to it that can be accessed by all CSV objects.
|
943
|
+
#
|
944
|
+
# To add a combo field, the value should be an Array of names. Combo fields
|
945
|
+
# can be nested with other combo fields.
|
946
|
+
#
|
947
|
+
Converters = { integer: lambda { |f|
|
948
|
+
Integer(f.encode(ConverterEncoding)) rescue f
|
949
|
+
},
|
950
|
+
float: lambda { |f|
|
951
|
+
Float(f.encode(ConverterEncoding)) rescue f
|
952
|
+
},
|
953
|
+
numeric: [:integer, :float],
|
954
|
+
date: lambda { |f|
|
955
|
+
begin
|
956
|
+
e = f.encode(ConverterEncoding)
|
957
|
+
e =~ DateMatcher ? Date.parse(e) : f
|
958
|
+
rescue # encoding conversion or date parse errors
|
959
|
+
f
|
960
|
+
end
|
961
|
+
},
|
962
|
+
date_time: lambda { |f|
|
963
|
+
begin
|
964
|
+
e = f.encode(ConverterEncoding)
|
965
|
+
e =~ DateTimeMatcher ? DateTime.parse(e) : f
|
966
|
+
rescue # encoding conversion or date parse errors
|
967
|
+
f
|
968
|
+
end
|
969
|
+
},
|
970
|
+
all: [:date_time, :numeric] }
|
971
|
+
|
972
|
+
#
|
973
|
+
# This Hash holds the built-in header converters of CSV that can be accessed
|
974
|
+
# by name. You can select HeaderConverters with CSV.header_convert() or
|
975
|
+
# through the +options+ Hash passed to CSV::new().
|
976
|
+
#
|
977
|
+
# <b><tt>:downcase</tt></b>:: Calls downcase() on the header String.
|
978
|
+
# <b><tt>:symbol</tt></b>:: The header String is downcased, spaces are
|
979
|
+
# replaced with underscores, non-word characters
|
980
|
+
# are dropped, and finally to_sym() is called.
|
981
|
+
#
|
982
|
+
# All built-in header converters transcode header data to UTF-8 before
|
983
|
+
# attempting a conversion. If your data cannot be transcoded to UTF-8 the
|
984
|
+
# conversion will fail and the header will remain unchanged.
|
985
|
+
#
|
986
|
+
# This Hash is intentionally left unfrozen and users should feel free to add
|
987
|
+
# values to it that can be accessed by all CSV objects.
|
988
|
+
#
|
989
|
+
# To add a combo field, the value should be an Array of names. Combo fields
|
990
|
+
# can be nested with other combo fields.
|
991
|
+
#
|
992
|
+
HeaderConverters = {
|
993
|
+
downcase: lambda { |h| h.encode(ConverterEncoding).downcase },
|
994
|
+
symbol: lambda { |h|
|
995
|
+
h.encode(ConverterEncoding).downcase.strip.gsub(/\s+/, "_").
|
996
|
+
gsub(/\W+/, "").to_sym
|
997
|
+
}
|
998
|
+
}
|
999
|
+
|
1000
|
+
#
|
1001
|
+
# The options used when no overrides are given by calling code. They are:
|
1002
|
+
#
|
1003
|
+
# <b><tt>:col_sep</tt></b>:: <tt>","</tt>
|
1004
|
+
# <b><tt>:row_sep</tt></b>:: <tt>:auto</tt>
|
1005
|
+
# <b><tt>:quote_char</tt></b>:: <tt>'"'</tt>
|
1006
|
+
# <b><tt>:field_size_limit</tt></b>:: +nil+
|
1007
|
+
# <b><tt>:converters</tt></b>:: +nil+
|
1008
|
+
# <b><tt>:unconverted_fields</tt></b>:: +nil+
|
1009
|
+
# <b><tt>:headers</tt></b>:: +false+
|
1010
|
+
# <b><tt>:return_headers</tt></b>:: +false+
|
1011
|
+
# <b><tt>:header_converters</tt></b>:: +nil+
|
1012
|
+
# <b><tt>:skip_blanks</tt></b>:: +false+
|
1013
|
+
# <b><tt>:force_quotes</tt></b>:: +false+
|
1014
|
+
# <b><tt>:skip_lines</tt></b>:: +nil+
|
1015
|
+
#
|
1016
|
+
DEFAULT_OPTIONS = { col_sep: ",",
|
1017
|
+
row_sep: :auto,
|
1018
|
+
quote_char: '"',
|
1019
|
+
field_size_limit: nil,
|
1020
|
+
converters: nil,
|
1021
|
+
unconverted_fields: nil,
|
1022
|
+
headers: false,
|
1023
|
+
return_headers: false,
|
1024
|
+
header_converters: nil,
|
1025
|
+
skip_blanks: false,
|
1026
|
+
force_quotes: false,
|
1027
|
+
skip_lines: nil }.freeze
|
1028
|
+
|
1029
|
+
#
|
1030
|
+
# This method will return a CSV instance, just like CSV::new(), but the
|
1031
|
+
# instance will be cached and returned for all future calls to this method for
|
1032
|
+
# the same +data+ object (tested by Object#object_id()) with the same
|
1033
|
+
# +options+.
|
1034
|
+
#
|
1035
|
+
# If a block is given, the instance is passed to the block and the return
|
1036
|
+
# value becomes the return value of the block.
|
1037
|
+
#
|
1038
|
+
def self.instance(data = $stdout, options = Hash.new)
|
1039
|
+
# create a _signature_ for this method call, data object and options
|
1040
|
+
sig = [data.object_id] +
|
1041
|
+
options.values_at(*DEFAULT_OPTIONS.keys.sort_by { |sym| sym.to_s })
|
1042
|
+
|
1043
|
+
# fetch or create the instance for this signature
|
1044
|
+
@@instances ||= Hash.new
|
1045
|
+
instance = (@@instances[sig] ||= new(data, options))
|
1046
|
+
|
1047
|
+
if block_given?
|
1048
|
+
yield instance # run block, if given, returning result
|
1049
|
+
else
|
1050
|
+
instance # or return the instance
|
1051
|
+
end
|
1052
|
+
end
|
1053
|
+
|
1054
|
+
#
|
1055
|
+
# :call-seq:
|
1056
|
+
# filter( options = Hash.new ) { |row| ... }
|
1057
|
+
# filter( input, options = Hash.new ) { |row| ... }
|
1058
|
+
# filter( input, output, options = Hash.new ) { |row| ... }
|
1059
|
+
#
|
1060
|
+
# This method is a convenience for building Unix-like filters for CSV data.
|
1061
|
+
# Each row is yielded to the provided block which can alter it as needed.
|
1062
|
+
# After the block returns, the row is appended to +output+ altered or not.
|
1063
|
+
#
|
1064
|
+
# The +input+ and +output+ arguments can be anything CSV::new() accepts
|
1065
|
+
# (generally String or IO objects). If not given, they default to
|
1066
|
+
# <tt>ARGF</tt> and <tt>$stdout</tt>.
|
1067
|
+
#
|
1068
|
+
# The +options+ parameter is also filtered down to CSV::new() after some
|
1069
|
+
# clever key parsing. Any key beginning with <tt>:in_</tt> or
|
1070
|
+
# <tt>:input_</tt> will have that leading identifier stripped and will only
|
1071
|
+
# be used in the +options+ Hash for the +input+ object. Keys starting with
|
1072
|
+
# <tt>:out_</tt> or <tt>:output_</tt> affect only +output+. All other keys
|
1073
|
+
# are assigned to both objects.
|
1074
|
+
#
|
1075
|
+
# The <tt>:output_row_sep</tt> +option+ defaults to
|
1076
|
+
# <tt>$INPUT_RECORD_SEPARATOR</tt> (<tt>$/</tt>).
|
1077
|
+
#
|
1078
|
+
def self.filter(*args)
|
1079
|
+
# parse options for input, output, or both
|
1080
|
+
in_options, out_options = Hash.new, {row_sep: $INPUT_RECORD_SEPARATOR}
|
1081
|
+
if args.last.is_a? Hash
|
1082
|
+
args.pop.each do |key, value|
|
1083
|
+
case key.to_s
|
1084
|
+
when /\Ain(?:put)?_(.+)\Z/
|
1085
|
+
in_options[$1.to_sym] = value
|
1086
|
+
when /\Aout(?:put)?_(.+)\Z/
|
1087
|
+
out_options[$1.to_sym] = value
|
1088
|
+
else
|
1089
|
+
in_options[key] = value
|
1090
|
+
out_options[key] = value
|
1091
|
+
end
|
1092
|
+
end
|
1093
|
+
end
|
1094
|
+
# build input and output wrappers
|
1095
|
+
input = new(args.shift || ARGF, in_options)
|
1096
|
+
output = new(args.shift || $stdout, out_options)
|
1097
|
+
|
1098
|
+
# read, yield, write
|
1099
|
+
input.each do |row|
|
1100
|
+
yield row
|
1101
|
+
output << row
|
1102
|
+
end
|
1103
|
+
end
|
1104
|
+
|
1105
|
+
#
|
1106
|
+
# This method is intended as the primary interface for reading CSV files. You
|
1107
|
+
# pass a +path+ and any +options+ you wish to set for the read. Each row of
|
1108
|
+
# file will be passed to the provided +block+ in turn.
|
1109
|
+
#
|
1110
|
+
# The +options+ parameter can be anything CSV::new() understands. This method
|
1111
|
+
# also understands an additional <tt>:encoding</tt> parameter that you can use
|
1112
|
+
# to specify the Encoding of the data in the file to be read. You must provide
|
1113
|
+
# this unless your data is in Encoding::default_external(). CSV will use this
|
1114
|
+
# to determine how to parse the data. You may provide a second Encoding to
|
1115
|
+
# have the data transcoded as it is read. For example,
|
1116
|
+
# <tt>encoding: "UTF-32BE:UTF-8"</tt> would read UTF-32BE data from the file
|
1117
|
+
# but transcode it to UTF-8 before CSV parses it.
|
1118
|
+
#
|
1119
|
+
def self.foreach(path, options = Hash.new, &block)
|
1120
|
+
return to_enum(__method__, path, options) unless block
|
1121
|
+
open(path, options) do |csv|
|
1122
|
+
csv.each(&block)
|
1123
|
+
end
|
1124
|
+
end
|
1125
|
+
|
1126
|
+
#
|
1127
|
+
# :call-seq:
|
1128
|
+
# generate( str, options = Hash.new ) { |csv| ... }
|
1129
|
+
# generate( options = Hash.new ) { |csv| ... }
|
1130
|
+
#
|
1131
|
+
# This method wraps a String you provide, or an empty default String, in a
|
1132
|
+
# CSV object which is passed to the provided block. You can use the block to
|
1133
|
+
# append CSV rows to the String and when the block exits, the final String
|
1134
|
+
# will be returned.
|
1135
|
+
#
|
1136
|
+
# Note that a passed String *is* modified by this method. Call dup() before
|
1137
|
+
# passing if you need a new String.
|
1138
|
+
#
|
1139
|
+
# The +options+ parameter can be anything CSV::new() understands. This method
|
1140
|
+
# understands an additional <tt>:encoding</tt> parameter when not passed a
|
1141
|
+
# String to set the base Encoding for the output. CSV needs this hint if you
|
1142
|
+
# plan to output non-ASCII compatible data.
|
1143
|
+
#
|
1144
|
+
def self.generate(*args)
|
1145
|
+
# add a default empty String, if none was given
|
1146
|
+
if args.first.is_a? String
|
1147
|
+
io = StringIO.new(args.shift)
|
1148
|
+
io.seek(0, IO::SEEK_END)
|
1149
|
+
args.unshift(io)
|
1150
|
+
else
|
1151
|
+
encoding = args[-1][:encoding] if args.last.is_a?(Hash)
|
1152
|
+
str = ""
|
1153
|
+
str.force_encoding(encoding) if encoding
|
1154
|
+
args.unshift(str)
|
1155
|
+
end
|
1156
|
+
csv = new(*args) # wrap
|
1157
|
+
yield csv # yield for appending
|
1158
|
+
csv.string # return final String
|
1159
|
+
end
|
1160
|
+
|
1161
|
+
#
|
1162
|
+
# This method is a shortcut for converting a single row (Array) into a CSV
|
1163
|
+
# String.
|
1164
|
+
#
|
1165
|
+
# The +options+ parameter can be anything CSV::new() understands. This method
|
1166
|
+
# understands an additional <tt>:encoding</tt> parameter to set the base
|
1167
|
+
# Encoding for the output. This method will try to guess your Encoding from
|
1168
|
+
# the first non-+nil+ field in +row+, if possible, but you may need to use
|
1169
|
+
# this parameter as a backup plan.
|
1170
|
+
#
|
1171
|
+
# The <tt>:row_sep</tt> +option+ defaults to <tt>$INPUT_RECORD_SEPARATOR</tt>
|
1172
|
+
# (<tt>$/</tt>) when calling this method.
|
1173
|
+
#
|
1174
|
+
def self.generate_line(row, options = Hash.new)
|
1175
|
+
options = {row_sep: $INPUT_RECORD_SEPARATOR}.merge(options)
|
1176
|
+
encoding = options.delete(:encoding)
|
1177
|
+
str = ""
|
1178
|
+
if encoding
|
1179
|
+
str.force_encoding(encoding)
|
1180
|
+
elsif field = row.find { |f| not f.nil? }
|
1181
|
+
str.force_encoding(String(field).encoding)
|
1182
|
+
end
|
1183
|
+
(new(str, options) << row).string
|
1184
|
+
end
|
1185
|
+
|
1186
|
+
#
|
1187
|
+
# :call-seq:
|
1188
|
+
# open( filename, mode = "rb", options = Hash.new ) { |faster_csv| ... }
|
1189
|
+
# open( filename, options = Hash.new ) { |faster_csv| ... }
|
1190
|
+
# open( filename, mode = "rb", options = Hash.new )
|
1191
|
+
# open( filename, options = Hash.new )
|
1192
|
+
#
|
1193
|
+
# This method opens an IO object, and wraps that with CSV. This is intended
|
1194
|
+
# as the primary interface for writing a CSV file.
|
1195
|
+
#
|
1196
|
+
# You must pass a +filename+ and may optionally add a +mode+ for Ruby's
|
1197
|
+
# open(). You may also pass an optional Hash containing any +options+
|
1198
|
+
# CSV::new() understands as the final argument.
|
1199
|
+
#
|
1200
|
+
# This method works like Ruby's open() call, in that it will pass a CSV object
|
1201
|
+
# to a provided block and close it when the block terminates, or it will
|
1202
|
+
# return the CSV object when no block is provided. (*Note*: This is different
|
1203
|
+
# from the Ruby 1.8 CSV library which passed rows to the block. Use
|
1204
|
+
# CSV::foreach() for that behavior.)
|
1205
|
+
#
|
1206
|
+
# You must provide a +mode+ with an embedded Encoding designator unless your
|
1207
|
+
# data is in Encoding::default_external(). CSV will check the Encoding of the
|
1208
|
+
# underlying IO object (set by the +mode+ you pass) to determine how to parse
|
1209
|
+
# the data. You may provide a second Encoding to have the data transcoded as
|
1210
|
+
# it is read just as you can with a normal call to IO::open(). For example,
|
1211
|
+
# <tt>"rb:UTF-32BE:UTF-8"</tt> would read UTF-32BE data from the file but
|
1212
|
+
# transcode it to UTF-8 before CSV parses it.
|
1213
|
+
#
|
1214
|
+
# An opened CSV object will delegate to many IO methods for convenience. You
|
1215
|
+
# may call:
|
1216
|
+
#
|
1217
|
+
# * binmode()
|
1218
|
+
# * binmode?()
|
1219
|
+
# * close()
|
1220
|
+
# * close_read()
|
1221
|
+
# * close_write()
|
1222
|
+
# * closed?()
|
1223
|
+
# * eof()
|
1224
|
+
# * eof?()
|
1225
|
+
# * external_encoding()
|
1226
|
+
# * fcntl()
|
1227
|
+
# * fileno()
|
1228
|
+
# * flock()
|
1229
|
+
# * flush()
|
1230
|
+
# * fsync()
|
1231
|
+
# * internal_encoding()
|
1232
|
+
# * ioctl()
|
1233
|
+
# * isatty()
|
1234
|
+
# * path()
|
1235
|
+
# * pid()
|
1236
|
+
# * pos()
|
1237
|
+
# * pos=()
|
1238
|
+
# * reopen()
|
1239
|
+
# * seek()
|
1240
|
+
# * stat()
|
1241
|
+
# * sync()
|
1242
|
+
# * sync=()
|
1243
|
+
# * tell()
|
1244
|
+
# * to_i()
|
1245
|
+
# * to_io()
|
1246
|
+
# * truncate()
|
1247
|
+
# * tty?()
|
1248
|
+
#
|
1249
|
+
def self.open(*args)
|
1250
|
+
# find the +options+ Hash
|
1251
|
+
options = if args.last.is_a? Hash then args.pop else Hash.new end
|
1252
|
+
# wrap a File opened with the remaining +args+ with no newline
|
1253
|
+
# decorator
|
1254
|
+
file_opts = {universal_newline: false}.merge(options)
|
1255
|
+
begin
|
1256
|
+
f = File.open(*args, file_opts)
|
1257
|
+
rescue ArgumentError => e
|
1258
|
+
raise unless /needs binmode/ =~ e.message and args.size == 1
|
1259
|
+
args << "rb"
|
1260
|
+
file_opts = {encoding: Encoding.default_external}.merge(file_opts)
|
1261
|
+
retry
|
1262
|
+
end
|
1263
|
+
begin
|
1264
|
+
csv = new(f, options)
|
1265
|
+
rescue Exception
|
1266
|
+
f.close
|
1267
|
+
raise
|
1268
|
+
end
|
1269
|
+
|
1270
|
+
# handle blocks like Ruby's open(), not like the CSV library
|
1271
|
+
if block_given?
|
1272
|
+
begin
|
1273
|
+
yield csv
|
1274
|
+
ensure
|
1275
|
+
csv.close
|
1276
|
+
end
|
1277
|
+
else
|
1278
|
+
csv
|
1279
|
+
end
|
1280
|
+
end
|
1281
|
+
|
1282
|
+
#
|
1283
|
+
# :call-seq:
|
1284
|
+
# parse( str, options = Hash.new ) { |row| ... }
|
1285
|
+
# parse( str, options = Hash.new )
|
1286
|
+
#
|
1287
|
+
# This method can be used to easily parse CSV out of a String. You may either
|
1288
|
+
# provide a +block+ which will be called with each row of the String in turn,
|
1289
|
+
# or just use the returned Array of Arrays (when no +block+ is given).
|
1290
|
+
#
|
1291
|
+
# You pass your +str+ to read from, and an optional +options+ Hash containing
|
1292
|
+
# anything CSV::new() understands.
|
1293
|
+
#
|
1294
|
+
def self.parse(*args, &block)
|
1295
|
+
csv = new(*args)
|
1296
|
+
if block.nil? # slurp contents, if no block is given
|
1297
|
+
begin
|
1298
|
+
csv.read
|
1299
|
+
ensure
|
1300
|
+
csv.close
|
1301
|
+
end
|
1302
|
+
else # or pass each row to a provided block
|
1303
|
+
csv.each(&block)
|
1304
|
+
end
|
1305
|
+
end
|
1306
|
+
|
1307
|
+
#
|
1308
|
+
# This method is a shortcut for converting a single line of a CSV String into
|
1309
|
+
# an Array. Note that if +line+ contains multiple rows, anything beyond the
|
1310
|
+
# first row is ignored.
|
1311
|
+
#
|
1312
|
+
# The +options+ parameter can be anything CSV::new() understands.
|
1313
|
+
#
|
1314
|
+
def self.parse_line(line, options = Hash.new)
|
1315
|
+
new(line, options).shift
|
1316
|
+
end
|
1317
|
+
|
1318
|
+
#
|
1319
|
+
# Use to slurp a CSV file into an Array of Arrays. Pass the +path+ to the
|
1320
|
+
# file and any +options+ CSV::new() understands. This method also understands
|
1321
|
+
# an additional <tt>:encoding</tt> parameter that you can use to specify the
|
1322
|
+
# Encoding of the data in the file to be read. You must provide this unless
|
1323
|
+
# your data is in Encoding::default_external(). CSV will use this to determine
|
1324
|
+
# how to parse the data. You may provide a second Encoding to have the data
|
1325
|
+
# transcoded as it is read. For example,
|
1326
|
+
# <tt>encoding: "UTF-32BE:UTF-8"</tt> would read UTF-32BE data from the file
|
1327
|
+
# but transcode it to UTF-8 before CSV parses it.
|
1328
|
+
#
|
1329
|
+
def self.read(path, *options)
|
1330
|
+
open(path, *options) { |csv| csv.read }
|
1331
|
+
end
|
1332
|
+
|
1333
|
+
# Alias for CSV::read().
|
1334
|
+
def self.readlines(*args)
|
1335
|
+
read(*args)
|
1336
|
+
end
|
1337
|
+
|
1338
|
+
#
|
1339
|
+
# A shortcut for:
|
1340
|
+
#
|
1341
|
+
# CSV.read( path, { headers: true,
|
1342
|
+
# converters: :numeric,
|
1343
|
+
# header_converters: :symbol }.merge(options) )
|
1344
|
+
#
|
1345
|
+
def self.table(path, options = Hash.new)
|
1346
|
+
read( path, { headers: true,
|
1347
|
+
converters: :numeric,
|
1348
|
+
header_converters: :symbol }.merge(options) )
|
1349
|
+
end
|
1350
|
+
|
1351
|
+
#
|
1352
|
+
# This constructor will wrap either a String or IO object passed in +data+ for
|
1353
|
+
# reading and/or writing. In addition to the CSV instance methods, several IO
|
1354
|
+
# methods are delegated. (See CSV::open() for a complete list.) If you pass
|
1355
|
+
# a String for +data+, you can later retrieve it (after writing to it, for
|
1356
|
+
# example) with CSV.string().
|
1357
|
+
#
|
1358
|
+
# Note that a wrapped String will be positioned at at the beginning (for
|
1359
|
+
# reading). If you want it at the end (for writing), use CSV::generate().
|
1360
|
+
# If you want any other positioning, pass a preset StringIO object instead.
|
1361
|
+
#
|
1362
|
+
# You may set any reading and/or writing preferences in the +options+ Hash.
|
1363
|
+
# Available options are:
|
1364
|
+
#
|
1365
|
+
# <b><tt>:col_sep</tt></b>:: The String placed between each field.
|
1366
|
+
# This String will be transcoded into
|
1367
|
+
# the data's Encoding before parsing.
|
1368
|
+
# <b><tt>:row_sep</tt></b>:: The String appended to the end of each
|
1369
|
+
# row. This can be set to the special
|
1370
|
+
# <tt>:auto</tt> setting, which requests
|
1371
|
+
# that CSV automatically discover this
|
1372
|
+
# from the data. Auto-discovery reads
|
1373
|
+
# ahead in the data looking for the next
|
1374
|
+
# <tt>"\r\n"</tt>, <tt>"\n"</tt>, or
|
1375
|
+
# <tt>"\r"</tt> sequence. A sequence
|
1376
|
+
# will be selected even if it occurs in
|
1377
|
+
# a quoted field, assuming that you
|
1378
|
+
# would have the same line endings
|
1379
|
+
# there. If none of those sequences is
|
1380
|
+
# found, +data+ is <tt>ARGF</tt>,
|
1381
|
+
# <tt>STDIN</tt>, <tt>STDOUT</tt>, or
|
1382
|
+
# <tt>STDERR</tt>, or the stream is only
|
1383
|
+
# available for output, the default
|
1384
|
+
# <tt>$INPUT_RECORD_SEPARATOR</tt>
|
1385
|
+
# (<tt>$/</tt>) is used. Obviously,
|
1386
|
+
# discovery takes a little time. Set
|
1387
|
+
# manually if speed is important. Also
|
1388
|
+
# note that IO objects should be opened
|
1389
|
+
# in binary mode on Windows if this
|
1390
|
+
# feature will be used as the
|
1391
|
+
# line-ending translation can cause
|
1392
|
+
# problems with resetting the document
|
1393
|
+
# position to where it was before the
|
1394
|
+
# read ahead. This String will be
|
1395
|
+
# transcoded into the data's Encoding
|
1396
|
+
# before parsing.
|
1397
|
+
# <b><tt>:quote_char</tt></b>:: The character used to quote fields.
|
1398
|
+
# This has to be a single character
|
1399
|
+
# String. This is useful for
|
1400
|
+
# application that incorrectly use
|
1401
|
+
# <tt>'</tt> as the quote character
|
1402
|
+
# instead of the correct <tt>"</tt>.
|
1403
|
+
# CSV will always consider a double
|
1404
|
+
# sequence of this character to be an
|
1405
|
+
# escaped quote. This String will be
|
1406
|
+
# transcoded into the data's Encoding
|
1407
|
+
# before parsing.
|
1408
|
+
# <b><tt>:field_size_limit</tt></b>:: This is a maximum size CSV will read
|
1409
|
+
# ahead looking for the closing quote
|
1410
|
+
# for a field. (In truth, it reads to
|
1411
|
+
# the first line ending beyond this
|
1412
|
+
# size.) If a quote cannot be found
|
1413
|
+
# within the limit CSV will raise a
|
1414
|
+
# MalformedCSVError, assuming the data
|
1415
|
+
# is faulty. You can use this limit to
|
1416
|
+
# prevent what are effectively DoS
|
1417
|
+
# attacks on the parser. However, this
|
1418
|
+
# limit can cause a legitimate parse to
|
1419
|
+
# fail and thus is set to +nil+, or off,
|
1420
|
+
# by default.
|
1421
|
+
# <b><tt>:converters</tt></b>:: An Array of names from the Converters
|
1422
|
+
# Hash and/or lambdas that handle custom
|
1423
|
+
# conversion. A single converter
|
1424
|
+
# doesn't have to be in an Array. All
|
1425
|
+
# built-in converters try to transcode
|
1426
|
+
# fields to UTF-8 before converting.
|
1427
|
+
# The conversion will fail if the data
|
1428
|
+
# cannot be transcoded, leaving the
|
1429
|
+
# field unchanged.
|
1430
|
+
# <b><tt>:unconverted_fields</tt></b>:: If set to +true+, an
|
1431
|
+
# unconverted_fields() method will be
|
1432
|
+
# added to all returned rows (Array or
|
1433
|
+
# CSV::Row) that will return the fields
|
1434
|
+
# as they were before conversion. Note
|
1435
|
+
# that <tt>:headers</tt> supplied by
|
1436
|
+
# Array or String were not fields of the
|
1437
|
+
# document and thus will have an empty
|
1438
|
+
# Array attached.
|
1439
|
+
# <b><tt>:headers</tt></b>:: If set to <tt>:first_row</tt> or
|
1440
|
+
# +true+, the initial row of the CSV
|
1441
|
+
# file will be treated as a row of
|
1442
|
+
# headers. If set to an Array, the
|
1443
|
+
# contents will be used as the headers.
|
1444
|
+
# If set to a String, the String is run
|
1445
|
+
# through a call of CSV::parse_line()
|
1446
|
+
# with the same <tt>:col_sep</tt>,
|
1447
|
+
# <tt>:row_sep</tt>, and
|
1448
|
+
# <tt>:quote_char</tt> as this instance
|
1449
|
+
# to produce an Array of headers. This
|
1450
|
+
# setting causes CSV#shift() to return
|
1451
|
+
# rows as CSV::Row objects instead of
|
1452
|
+
# Arrays and CSV#read() to return
|
1453
|
+
# CSV::Table objects instead of an Array
|
1454
|
+
# of Arrays.
|
1455
|
+
# <b><tt>:return_headers</tt></b>:: When +false+, header rows are silently
|
1456
|
+
# swallowed. If set to +true+, header
|
1457
|
+
# rows are returned in a CSV::Row object
|
1458
|
+
# with identical headers and
|
1459
|
+
# fields (save that the fields do not go
|
1460
|
+
# through the converters).
|
1461
|
+
# <b><tt>:write_headers</tt></b>:: When +true+ and <tt>:headers</tt> is
|
1462
|
+
# set, a header row will be added to the
|
1463
|
+
# output.
|
1464
|
+
# <b><tt>:header_converters</tt></b>:: Identical in functionality to
|
1465
|
+
# <tt>:converters</tt> save that the
|
1466
|
+
# conversions are only made to header
|
1467
|
+
# rows. All built-in converters try to
|
1468
|
+
# transcode headers to UTF-8 before
|
1469
|
+
# converting. The conversion will fail
|
1470
|
+
# if the data cannot be transcoded,
|
1471
|
+
# leaving the header unchanged.
|
1472
|
+
# <b><tt>:skip_blanks</tt></b>:: When set to a +true+ value, CSV will
|
1473
|
+
# skip over any empty rows. Note that
|
1474
|
+
# this setting will not skip rows that
|
1475
|
+
# contain column separators, even if
|
1476
|
+
# the rows contain no actual data. If
|
1477
|
+
# you want to skip rows that contain
|
1478
|
+
# separators but no content, consider
|
1479
|
+
# using <tt>:skip_lines</tt>, or
|
1480
|
+
# inspecting fields.compact.empty? on
|
1481
|
+
# each row.
|
1482
|
+
# <b><tt>:force_quotes</tt></b>:: When set to a +true+ value, CSV will
|
1483
|
+
# quote all CSV fields it creates.
|
1484
|
+
# <b><tt>:skip_lines</tt></b>:: When set to an object responding to
|
1485
|
+
# <tt>match</tt>, every line matching
|
1486
|
+
# it is considered a comment and ignored
|
1487
|
+
# during parsing. When set to a String,
|
1488
|
+
# it is first converted to a Regexp.
|
1489
|
+
# When set to +nil+ no line is considered
|
1490
|
+
# a comment. If the passed object does
|
1491
|
+
# not respond to <tt>match</tt>,
|
1492
|
+
# <tt>ArgumentError</tt> is thrown.
|
1493
|
+
#
|
1494
|
+
# See CSV::DEFAULT_OPTIONS for the default settings.
|
1495
|
+
#
|
1496
|
+
# Options cannot be overridden in the instance methods for performance reasons,
|
1497
|
+
# so be sure to set what you want here.
|
1498
|
+
#
|
1499
|
+
def initialize(data, options = Hash.new)
|
1500
|
+
if data.nil?
|
1501
|
+
raise ArgumentError.new("Cannot parse nil as CSV")
|
1502
|
+
end
|
1503
|
+
|
1504
|
+
# build the options for this read/write
|
1505
|
+
options = DEFAULT_OPTIONS.merge(options)
|
1506
|
+
|
1507
|
+
# create the IO object we will read from
|
1508
|
+
@io = data.is_a?(String) ? StringIO.new(data) : data
|
1509
|
+
# honor the IO encoding if we can, otherwise default to ASCII-8BIT
|
1510
|
+
@encoding = raw_encoding(nil) ||
|
1511
|
+
( if encoding = options.delete(:internal_encoding)
|
1512
|
+
case encoding
|
1513
|
+
when Encoding; encoding
|
1514
|
+
else Encoding.find(encoding)
|
1515
|
+
end
|
1516
|
+
end ) ||
|
1517
|
+
( case encoding = options.delete(:encoding)
|
1518
|
+
when Encoding; encoding
|
1519
|
+
when /\A[^:]+/; Encoding.find($&)
|
1520
|
+
end ) ||
|
1521
|
+
Encoding.default_internal || Encoding.default_external
|
1522
|
+
#
|
1523
|
+
# prepare for building safe regular expressions in the target encoding,
|
1524
|
+
# if we can transcode the needed characters
|
1525
|
+
#
|
1526
|
+
@re_esc = "\\".encode(@encoding) rescue ""
|
1527
|
+
@re_chars = /#{%"[-\\]\\[\\.^$?*+{}()|# \r\n\t\f\v]".encode(@encoding)}/
|
1528
|
+
|
1529
|
+
init_separators(options)
|
1530
|
+
init_parsers(options)
|
1531
|
+
init_converters(options)
|
1532
|
+
init_headers(options)
|
1533
|
+
init_comments(options)
|
1534
|
+
|
1535
|
+
@force_encoding = !!(encoding || options.delete(:encoding))
|
1536
|
+
options.delete(:internal_encoding)
|
1537
|
+
options.delete(:external_encoding)
|
1538
|
+
unless options.empty?
|
1539
|
+
raise ArgumentError, "Unknown options: #{options.keys.join(', ')}."
|
1540
|
+
end
|
1541
|
+
|
1542
|
+
# track our own lineno since IO gets confused about line-ends is CSV fields
|
1543
|
+
@lineno = 0
|
1544
|
+
end
|
1545
|
+
|
1546
|
+
#
|
1547
|
+
# The encoded <tt>:col_sep</tt> used in parsing and writing. See CSV::new
|
1548
|
+
# for details.
|
1549
|
+
#
|
1550
|
+
attr_reader :col_sep
|
1551
|
+
#
|
1552
|
+
# The encoded <tt>:row_sep</tt> used in parsing and writing. See CSV::new
|
1553
|
+
# for details.
|
1554
|
+
#
|
1555
|
+
attr_reader :row_sep
|
1556
|
+
#
|
1557
|
+
# The encoded <tt>:quote_char</tt> used in parsing and writing. See CSV::new
|
1558
|
+
# for details.
|
1559
|
+
#
|
1560
|
+
attr_reader :quote_char
|
1561
|
+
# The limit for field size, if any. See CSV::new for details.
|
1562
|
+
attr_reader :field_size_limit
|
1563
|
+
|
1564
|
+
# The regex marking a line as a comment. See CSV::new for details
|
1565
|
+
attr_reader :skip_lines
|
1566
|
+
|
1567
|
+
#
|
1568
|
+
# Returns the current list of converters in effect. See CSV::new for details.
|
1569
|
+
# Built-in converters will be returned by name, while others will be returned
|
1570
|
+
# as is.
|
1571
|
+
#
|
1572
|
+
def converters
|
1573
|
+
@converters.map do |converter|
|
1574
|
+
name = Converters.rassoc(converter)
|
1575
|
+
name ? name.first : converter
|
1576
|
+
end
|
1577
|
+
end
|
1578
|
+
#
|
1579
|
+
# Returns +true+ if unconverted_fields() to parsed results. See CSV::new
|
1580
|
+
# for details.
|
1581
|
+
#
|
1582
|
+
def unconverted_fields?() @unconverted_fields end
|
1583
|
+
#
|
1584
|
+
# Returns +nil+ if headers will not be used, +true+ if they will but have not
|
1585
|
+
# yet been read, or the actual headers after they have been read. See
|
1586
|
+
# CSV::new for details.
|
1587
|
+
#
|
1588
|
+
def headers
|
1589
|
+
@headers || true if @use_headers
|
1590
|
+
end
|
1591
|
+
#
|
1592
|
+
# Returns +true+ if headers will be returned as a row of results.
|
1593
|
+
# See CSV::new for details.
|
1594
|
+
#
|
1595
|
+
def return_headers?() @return_headers end
|
1596
|
+
# Returns +true+ if headers are written in output. See CSV::new for details.
|
1597
|
+
def write_headers?() @write_headers end
|
1598
|
+
#
|
1599
|
+
# Returns the current list of converters in effect for headers. See CSV::new
|
1600
|
+
# for details. Built-in converters will be returned by name, while others
|
1601
|
+
# will be returned as is.
|
1602
|
+
#
|
1603
|
+
def header_converters
|
1604
|
+
@header_converters.map do |converter|
|
1605
|
+
name = HeaderConverters.rassoc(converter)
|
1606
|
+
name ? name.first : converter
|
1607
|
+
end
|
1608
|
+
end
|
1609
|
+
#
|
1610
|
+
# Returns +true+ blank lines are skipped by the parser. See CSV::new
|
1611
|
+
# for details.
|
1612
|
+
#
|
1613
|
+
def skip_blanks?() @skip_blanks end
|
1614
|
+
# Returns +true+ if all output fields are quoted. See CSV::new for details.
|
1615
|
+
def force_quotes?() @force_quotes end
|
1616
|
+
|
1617
|
+
#
|
1618
|
+
# The Encoding CSV is parsing or writing in. This will be the Encoding you
|
1619
|
+
# receive parsed data in and/or the Encoding data will be written in.
|
1620
|
+
#
|
1621
|
+
attr_reader :encoding
|
1622
|
+
|
1623
|
+
#
|
1624
|
+
# The line number of the last row read from this file. Fields with nested
|
1625
|
+
# line-end characters will not affect this count.
|
1626
|
+
#
|
1627
|
+
attr_reader :lineno
|
1628
|
+
|
1629
|
+
### IO and StringIO Delegation ###
|
1630
|
+
|
1631
|
+
extend Forwardable
|
1632
|
+
def_delegators :@io, :binmode, :binmode?, :close, :close_read, :close_write,
|
1633
|
+
:closed?, :eof, :eof?, :external_encoding, :fcntl,
|
1634
|
+
:fileno, :flock, :flush, :fsync, :internal_encoding,
|
1635
|
+
:ioctl, :isatty, :path, :pid, :pos, :pos=, :reopen,
|
1636
|
+
:seek, :stat, :string, :sync, :sync=, :tell, :to_i,
|
1637
|
+
:to_io, :truncate, :tty?
|
1638
|
+
|
1639
|
+
# Rewinds the underlying IO object and resets CSV's lineno() counter.
|
1640
|
+
def rewind
|
1641
|
+
@headers = nil
|
1642
|
+
@lineno = 0
|
1643
|
+
|
1644
|
+
@io.rewind
|
1645
|
+
end
|
1646
|
+
|
1647
|
+
### End Delegation ###
|
1648
|
+
|
1649
|
+
#
|
1650
|
+
# The primary write method for wrapped Strings and IOs, +row+ (an Array or
|
1651
|
+
# CSV::Row) is converted to CSV and appended to the data source. When a
|
1652
|
+
# CSV::Row is passed, only the row's fields() are appended to the output.
|
1653
|
+
#
|
1654
|
+
# The data source must be open for writing.
|
1655
|
+
#
|
1656
|
+
def <<(row)
|
1657
|
+
# make sure headers have been assigned
|
1658
|
+
if header_row? and [Array, String].include? @use_headers.class
|
1659
|
+
parse_headers # won't read data for Array or String
|
1660
|
+
self << @headers if @write_headers
|
1661
|
+
end
|
1662
|
+
|
1663
|
+
# handle CSV::Row objects and Hashes
|
1664
|
+
row = case row
|
1665
|
+
when self.class::Row then row.fields
|
1666
|
+
when Hash then @headers.map { |header| row[header] }
|
1667
|
+
else row
|
1668
|
+
end
|
1669
|
+
|
1670
|
+
@headers = row if header_row?
|
1671
|
+
@lineno += 1
|
1672
|
+
|
1673
|
+
output = row.map(&@quote).join(@col_sep) + @row_sep # quote and separate
|
1674
|
+
if @io.is_a?(StringIO) and
|
1675
|
+
output.encoding != (encoding = raw_encoding)
|
1676
|
+
if @force_encoding
|
1677
|
+
output = output.encode(encoding)
|
1678
|
+
elsif (compatible_encoding = Encoding.compatible?(@io.string, output))
|
1679
|
+
@io.set_encoding(compatible_encoding)
|
1680
|
+
@io.seek(0, IO::SEEK_END)
|
1681
|
+
end
|
1682
|
+
end
|
1683
|
+
@io << output
|
1684
|
+
|
1685
|
+
self # for chaining
|
1686
|
+
end
|
1687
|
+
alias_method :add_row, :<<
|
1688
|
+
alias_method :puts, :<<
|
1689
|
+
|
1690
|
+
#
|
1691
|
+
# :call-seq:
|
1692
|
+
# convert( name )
|
1693
|
+
# convert { |field| ... }
|
1694
|
+
# convert { |field, field_info| ... }
|
1695
|
+
#
|
1696
|
+
# You can use this method to install a CSV::Converters built-in, or provide a
|
1697
|
+
# block that handles a custom conversion.
|
1698
|
+
#
|
1699
|
+
# If you provide a block that takes one argument, it will be passed the field
|
1700
|
+
# and is expected to return the converted value or the field itself. If your
|
1701
|
+
# block takes two arguments, it will also be passed a CSV::FieldInfo Struct,
|
1702
|
+
# containing details about the field. Again, the block should return a
|
1703
|
+
# converted field or the field itself.
|
1704
|
+
#
|
1705
|
+
def convert(name = nil, &converter)
|
1706
|
+
add_converter(:converters, self.class::Converters, name, &converter)
|
1707
|
+
end
|
1708
|
+
|
1709
|
+
#
|
1710
|
+
# :call-seq:
|
1711
|
+
# header_convert( name )
|
1712
|
+
# header_convert { |field| ... }
|
1713
|
+
# header_convert { |field, field_info| ... }
|
1714
|
+
#
|
1715
|
+
# Identical to CSV#convert(), but for header rows.
|
1716
|
+
#
|
1717
|
+
# Note that this method must be called before header rows are read to have any
|
1718
|
+
# effect.
|
1719
|
+
#
|
1720
|
+
def header_convert(name = nil, &converter)
|
1721
|
+
add_converter( :header_converters,
|
1722
|
+
self.class::HeaderConverters,
|
1723
|
+
name,
|
1724
|
+
&converter )
|
1725
|
+
end
|
1726
|
+
|
1727
|
+
include Enumerable
|
1728
|
+
|
1729
|
+
#
|
1730
|
+
# Yields each row of the data source in turn.
|
1731
|
+
#
|
1732
|
+
# Support for Enumerable.
|
1733
|
+
#
|
1734
|
+
# The data source must be open for reading.
|
1735
|
+
#
|
1736
|
+
def each
|
1737
|
+
if block_given?
|
1738
|
+
while row = shift
|
1739
|
+
yield row
|
1740
|
+
end
|
1741
|
+
else
|
1742
|
+
to_enum
|
1743
|
+
end
|
1744
|
+
end
|
1745
|
+
|
1746
|
+
#
|
1747
|
+
# Slurps the remaining rows and returns an Array of Arrays.
|
1748
|
+
#
|
1749
|
+
# The data source must be open for reading.
|
1750
|
+
#
|
1751
|
+
def read
|
1752
|
+
rows = to_a
|
1753
|
+
if @use_headers
|
1754
|
+
Table.new(rows)
|
1755
|
+
else
|
1756
|
+
rows
|
1757
|
+
end
|
1758
|
+
end
|
1759
|
+
alias_method :readlines, :read
|
1760
|
+
|
1761
|
+
# Returns +true+ if the next row read will be a header row.
|
1762
|
+
def header_row?
|
1763
|
+
@use_headers and @headers.nil?
|
1764
|
+
end
|
1765
|
+
|
1766
|
+
#
|
1767
|
+
# The primary read method for wrapped Strings and IOs, a single row is pulled
|
1768
|
+
# from the data source, parsed and returned as an Array of fields (if header
|
1769
|
+
# rows are not used) or a CSV::Row (when header rows are used).
|
1770
|
+
#
|
1771
|
+
# The data source must be open for reading.
|
1772
|
+
#
|
1773
|
+
def shift
|
1774
|
+
#########################################################################
|
1775
|
+
### This method is purposefully kept a bit long as simple conditional ###
|
1776
|
+
### checks are faster than numerous (expensive) method calls. ###
|
1777
|
+
#########################################################################
|
1778
|
+
|
1779
|
+
# handle headers not based on document content
|
1780
|
+
if header_row? and @return_headers and
|
1781
|
+
[Array, String].include? @use_headers.class
|
1782
|
+
if @unconverted_fields
|
1783
|
+
return add_unconverted_fields(parse_headers, Array.new)
|
1784
|
+
else
|
1785
|
+
return parse_headers
|
1786
|
+
end
|
1787
|
+
end
|
1788
|
+
|
1789
|
+
#
|
1790
|
+
# it can take multiple calls to <tt>@io.gets()</tt> to get a full line,
|
1791
|
+
# because of \r and/or \n characters embedded in quoted fields
|
1792
|
+
#
|
1793
|
+
in_extended_col = false
|
1794
|
+
csv = Array.new
|
1795
|
+
|
1796
|
+
loop do
|
1797
|
+
# add another read to the line
|
1798
|
+
unless parse = @io.gets(@row_sep)
|
1799
|
+
return nil
|
1800
|
+
end
|
1801
|
+
|
1802
|
+
parse.sub!(@parsers[:line_end], "")
|
1803
|
+
|
1804
|
+
if csv.empty?
|
1805
|
+
#
|
1806
|
+
# I believe a blank line should be an <tt>Array.new</tt>, not Ruby 1.8
|
1807
|
+
# CSV's <tt>[nil]</tt>
|
1808
|
+
#
|
1809
|
+
if parse.empty?
|
1810
|
+
@lineno += 1
|
1811
|
+
if @skip_blanks
|
1812
|
+
next
|
1813
|
+
elsif @unconverted_fields
|
1814
|
+
return add_unconverted_fields(Array.new, Array.new)
|
1815
|
+
elsif @use_headers
|
1816
|
+
return self.class::Row.new(Array.new, Array.new)
|
1817
|
+
else
|
1818
|
+
return Array.new
|
1819
|
+
end
|
1820
|
+
end
|
1821
|
+
end
|
1822
|
+
|
1823
|
+
next if @skip_lines and @skip_lines.match parse
|
1824
|
+
|
1825
|
+
parts = parse.split(@col_sep, -1)
|
1826
|
+
if parts.empty?
|
1827
|
+
if in_extended_col
|
1828
|
+
csv[-1] << @col_sep # will be replaced with a @row_sep after the parts.each loop
|
1829
|
+
else
|
1830
|
+
csv << nil
|
1831
|
+
end
|
1832
|
+
end
|
1833
|
+
|
1834
|
+
# This loop is the hot path of csv parsing. Some things may be non-dry
|
1835
|
+
# for a reason. Make sure to benchmark when refactoring.
|
1836
|
+
parts.each do |part|
|
1837
|
+
if in_extended_col
|
1838
|
+
# If we are continuing a previous column
|
1839
|
+
if part[-1] == @quote_char && part.count(@quote_char) % 2 != 0
|
1840
|
+
# extended column ends
|
1841
|
+
csv.last << part[0..-2]
|
1842
|
+
if csv.last =~ @parsers[:stray_quote]
|
1843
|
+
raise MalformedCSVError,
|
1844
|
+
"Missing or stray quote in line #{lineno + 1}"
|
1845
|
+
end
|
1846
|
+
csv.last.gsub!(@quote_char * 2, @quote_char)
|
1847
|
+
in_extended_col = false
|
1848
|
+
else
|
1849
|
+
csv.last << part
|
1850
|
+
csv.last << @col_sep
|
1851
|
+
end
|
1852
|
+
elsif part[0] == @quote_char
|
1853
|
+
# If we are staring a new quoted column
|
1854
|
+
if part[-1] != @quote_char || part.count(@quote_char) % 2 != 0
|
1855
|
+
# start an extended column
|
1856
|
+
csv << part[1..-1]
|
1857
|
+
csv.last << @col_sep
|
1858
|
+
in_extended_col = true
|
1859
|
+
else
|
1860
|
+
# regular quoted column
|
1861
|
+
csv << part[1..-2]
|
1862
|
+
if csv.last =~ @parsers[:stray_quote]
|
1863
|
+
raise MalformedCSVError,
|
1864
|
+
"Missing or stray quote in line #{lineno + 1}"
|
1865
|
+
end
|
1866
|
+
csv.last.gsub!(@quote_char * 2, @quote_char)
|
1867
|
+
end
|
1868
|
+
elsif part =~ @parsers[:quote_or_nl]
|
1869
|
+
# Unquoted field with bad characters.
|
1870
|
+
if part =~ @parsers[:nl_or_lf]
|
1871
|
+
raise MalformedCSVError, "Unquoted fields do not allow " +
|
1872
|
+
"\\r or \\n (line #{lineno + 1})."
|
1873
|
+
else
|
1874
|
+
raise MalformedCSVError, "Illegal quoting in line #{lineno + 1}."
|
1875
|
+
end
|
1876
|
+
else
|
1877
|
+
# Regular ole unquoted field.
|
1878
|
+
csv << (part.empty? ? nil : part)
|
1879
|
+
end
|
1880
|
+
end
|
1881
|
+
|
1882
|
+
# Replace tacked on @col_sep with @row_sep if we are still in an extended
|
1883
|
+
# column.
|
1884
|
+
csv[-1][-1] = @row_sep if in_extended_col
|
1885
|
+
|
1886
|
+
if in_extended_col
|
1887
|
+
# if we're at eof?(), a quoted field wasn't closed...
|
1888
|
+
if @io.eof?
|
1889
|
+
raise MalformedCSVError,
|
1890
|
+
"Unclosed quoted field on line #{lineno + 1}."
|
1891
|
+
elsif @field_size_limit and csv.last.size >= @field_size_limit
|
1892
|
+
raise MalformedCSVError, "Field size exceeded on line #{lineno + 1}."
|
1893
|
+
end
|
1894
|
+
# otherwise, we need to loop and pull some more data to complete the row
|
1895
|
+
else
|
1896
|
+
@lineno += 1
|
1897
|
+
|
1898
|
+
# save fields unconverted fields, if needed...
|
1899
|
+
unconverted = csv.dup if @unconverted_fields
|
1900
|
+
|
1901
|
+
# convert fields, if needed...
|
1902
|
+
csv = convert_fields(csv) unless @use_headers or @converters.empty?
|
1903
|
+
# parse out header rows and handle CSV::Row conversions...
|
1904
|
+
csv = parse_headers(csv) if @use_headers
|
1905
|
+
|
1906
|
+
# inject unconverted fields and accessor, if requested...
|
1907
|
+
if @unconverted_fields and not csv.respond_to? :unconverted_fields
|
1908
|
+
add_unconverted_fields(csv, unconverted)
|
1909
|
+
end
|
1910
|
+
|
1911
|
+
# return the results
|
1912
|
+
break csv
|
1913
|
+
end
|
1914
|
+
end
|
1915
|
+
end
|
1916
|
+
alias_method :gets, :shift
|
1917
|
+
alias_method :readline, :shift
|
1918
|
+
|
1919
|
+
#
|
1920
|
+
# Returns a simplified description of the key CSV attributes in an
|
1921
|
+
# ASCII compatible String.
|
1922
|
+
#
|
1923
|
+
def inspect
|
1924
|
+
str = ["<#", self.class.to_s, " io_type:"]
|
1925
|
+
# show type of wrapped IO
|
1926
|
+
if @io == $stdout then str << "$stdout"
|
1927
|
+
elsif @io == $stdin then str << "$stdin"
|
1928
|
+
elsif @io == $stderr then str << "$stderr"
|
1929
|
+
else str << @io.class.to_s
|
1930
|
+
end
|
1931
|
+
# show IO.path(), if available
|
1932
|
+
if @io.respond_to?(:path) and (p = @io.path)
|
1933
|
+
str << " io_path:" << p.inspect
|
1934
|
+
end
|
1935
|
+
# show encoding
|
1936
|
+
str << " encoding:" << @encoding.name
|
1937
|
+
# show other attributes
|
1938
|
+
%w[ lineno col_sep row_sep
|
1939
|
+
quote_char skip_blanks ].each do |attr_name|
|
1940
|
+
if a = instance_variable_get("@#{attr_name}")
|
1941
|
+
str << " " << attr_name << ":" << a.inspect
|
1942
|
+
end
|
1943
|
+
end
|
1944
|
+
if @use_headers
|
1945
|
+
str << " headers:" << headers.inspect
|
1946
|
+
end
|
1947
|
+
str << ">"
|
1948
|
+
begin
|
1949
|
+
str.join('')
|
1950
|
+
rescue # any encoding error
|
1951
|
+
str.map do |s|
|
1952
|
+
e = Encoding::Converter.asciicompat_encoding(s.encoding)
|
1953
|
+
e ? s.encode(e) : s.force_encoding("ASCII-8BIT")
|
1954
|
+
end.join('')
|
1955
|
+
end
|
1956
|
+
end
|
1957
|
+
|
1958
|
+
private
|
1959
|
+
|
1960
|
+
#
|
1961
|
+
# Stores the indicated separators for later use.
|
1962
|
+
#
|
1963
|
+
# If auto-discovery was requested for <tt>@row_sep</tt>, this method will read
|
1964
|
+
# ahead in the <tt>@io</tt> and try to find one. +ARGF+, +STDIN+, +STDOUT+,
|
1965
|
+
# +STDERR+ and any stream open for output only with a default
|
1966
|
+
# <tt>@row_sep</tt> of <tt>$INPUT_RECORD_SEPARATOR</tt> (<tt>$/</tt>).
|
1967
|
+
#
|
1968
|
+
# This method also establishes the quoting rules used for CSV output.
|
1969
|
+
#
|
1970
|
+
def init_separators(options)
|
1971
|
+
# store the selected separators
|
1972
|
+
@col_sep = options.delete(:col_sep).to_s.encode(@encoding)
|
1973
|
+
@row_sep = options.delete(:row_sep) # encode after resolving :auto
|
1974
|
+
@quote_char = options.delete(:quote_char).to_s.encode(@encoding)
|
1975
|
+
|
1976
|
+
if @quote_char.length != 1
|
1977
|
+
raise ArgumentError, ":quote_char has to be a single character String"
|
1978
|
+
end
|
1979
|
+
|
1980
|
+
#
|
1981
|
+
# automatically discover row separator when requested
|
1982
|
+
# (not fully encoding safe)
|
1983
|
+
#
|
1984
|
+
if @row_sep == :auto
|
1985
|
+
if [ARGF, STDIN, STDOUT, STDERR].include?(@io) or
|
1986
|
+
(defined?(Zlib) and @io.class == Zlib::GzipWriter)
|
1987
|
+
@row_sep = $INPUT_RECORD_SEPARATOR
|
1988
|
+
else
|
1989
|
+
begin
|
1990
|
+
#
|
1991
|
+
# remember where we were (pos() will raise an exception if @io is pipe
|
1992
|
+
# or not opened for reading)
|
1993
|
+
#
|
1994
|
+
saved_pos = @io.pos
|
1995
|
+
while @row_sep == :auto
|
1996
|
+
#
|
1997
|
+
# if we run out of data, it's probably a single line
|
1998
|
+
# (ensure will set default value)
|
1999
|
+
#
|
2000
|
+
break unless sample = @io.gets(nil, 1024)
|
2001
|
+
# extend sample if we're unsure of the line ending
|
2002
|
+
if sample.end_with? encode_str("\r")
|
2003
|
+
sample << (@io.gets(nil, 1) || "")
|
2004
|
+
end
|
2005
|
+
|
2006
|
+
# try to find a standard separator
|
2007
|
+
if sample =~ encode_re("\r\n?|\n")
|
2008
|
+
@row_sep = $&
|
2009
|
+
break
|
2010
|
+
end
|
2011
|
+
end
|
2012
|
+
|
2013
|
+
# tricky seek() clone to work around GzipReader's lack of seek()
|
2014
|
+
@io.rewind
|
2015
|
+
# reset back to the remembered position
|
2016
|
+
while saved_pos > 1024 # avoid loading a lot of data into memory
|
2017
|
+
@io.read(1024)
|
2018
|
+
saved_pos -= 1024
|
2019
|
+
end
|
2020
|
+
@io.read(saved_pos) if saved_pos.nonzero?
|
2021
|
+
rescue IOError # not opened for reading
|
2022
|
+
# do nothing: ensure will set default
|
2023
|
+
rescue NoMethodError # Zlib::GzipWriter doesn't have some IO methods
|
2024
|
+
# do nothing: ensure will set default
|
2025
|
+
rescue SystemCallError # pipe
|
2026
|
+
# do nothing: ensure will set default
|
2027
|
+
ensure
|
2028
|
+
#
|
2029
|
+
# set default if we failed to detect
|
2030
|
+
# (stream not opened for reading, a pipe, or a single line of data)
|
2031
|
+
#
|
2032
|
+
@row_sep = $INPUT_RECORD_SEPARATOR if @row_sep == :auto
|
2033
|
+
end
|
2034
|
+
end
|
2035
|
+
end
|
2036
|
+
@row_sep = @row_sep.to_s.encode(@encoding)
|
2037
|
+
|
2038
|
+
# establish quoting rules
|
2039
|
+
@force_quotes = options.delete(:force_quotes)
|
2040
|
+
do_quote = lambda do |field|
|
2041
|
+
field = String(field)
|
2042
|
+
encoded_quote = @quote_char.encode(field.encoding)
|
2043
|
+
encoded_quote +
|
2044
|
+
field.gsub(encoded_quote, encoded_quote * 2) +
|
2045
|
+
encoded_quote
|
2046
|
+
end
|
2047
|
+
quotable_chars = encode_str("\r\n", @col_sep, @quote_char)
|
2048
|
+
@quote = if @force_quotes
|
2049
|
+
do_quote
|
2050
|
+
else
|
2051
|
+
lambda do |field|
|
2052
|
+
if field.nil? # represent +nil+ fields as empty unquoted fields
|
2053
|
+
""
|
2054
|
+
else
|
2055
|
+
field = String(field) # Stringify fields
|
2056
|
+
# represent empty fields as empty quoted fields
|
2057
|
+
if field.empty? or
|
2058
|
+
field.count(quotable_chars).nonzero?
|
2059
|
+
do_quote.call(field)
|
2060
|
+
else
|
2061
|
+
field # unquoted field
|
2062
|
+
end
|
2063
|
+
end
|
2064
|
+
end
|
2065
|
+
end
|
2066
|
+
end
|
2067
|
+
|
2068
|
+
# Pre-compiles parsers and stores them by name for access during reads.
|
2069
|
+
def init_parsers(options)
|
2070
|
+
# store the parser behaviors
|
2071
|
+
@skip_blanks = options.delete(:skip_blanks)
|
2072
|
+
@field_size_limit = options.delete(:field_size_limit)
|
2073
|
+
|
2074
|
+
# prebuild Regexps for faster parsing
|
2075
|
+
esc_row_sep = escape_re(@row_sep)
|
2076
|
+
esc_quote = escape_re(@quote_char)
|
2077
|
+
@parsers = {
|
2078
|
+
# for detecting parse errors
|
2079
|
+
quote_or_nl: encode_re("[", esc_quote, "\r\n]"),
|
2080
|
+
nl_or_lf: encode_re("[\r\n]"),
|
2081
|
+
stray_quote: encode_re( "[^", esc_quote, "]", esc_quote,
|
2082
|
+
"[^", esc_quote, "]" ),
|
2083
|
+
# safer than chomp!()
|
2084
|
+
line_end: encode_re(esc_row_sep, "\\z"),
|
2085
|
+
# illegal unquoted characters
|
2086
|
+
return_newline: encode_str("\r\n")
|
2087
|
+
}
|
2088
|
+
end
|
2089
|
+
|
2090
|
+
#
|
2091
|
+
# Loads any converters requested during construction.
|
2092
|
+
#
|
2093
|
+
# If +field_name+ is set <tt>:converters</tt> (the default) field converters
|
2094
|
+
# are set. When +field_name+ is <tt>:header_converters</tt> header converters
|
2095
|
+
# are added instead.
|
2096
|
+
#
|
2097
|
+
# The <tt>:unconverted_fields</tt> option is also actived for
|
2098
|
+
# <tt>:converters</tt> calls, if requested.
|
2099
|
+
#
|
2100
|
+
def init_converters(options, field_name = :converters)
|
2101
|
+
if field_name == :converters
|
2102
|
+
@unconverted_fields = options.delete(:unconverted_fields)
|
2103
|
+
end
|
2104
|
+
|
2105
|
+
instance_variable_set("@#{field_name}", Array.new)
|
2106
|
+
|
2107
|
+
# find the correct method to add the converters
|
2108
|
+
convert = method(field_name.to_s.sub(/ers\Z/, ""))
|
2109
|
+
|
2110
|
+
# load converters
|
2111
|
+
unless options[field_name].nil?
|
2112
|
+
# allow a single converter not wrapped in an Array
|
2113
|
+
unless options[field_name].is_a? Array
|
2114
|
+
options[field_name] = [options[field_name]]
|
2115
|
+
end
|
2116
|
+
# load each converter...
|
2117
|
+
options[field_name].each do |converter|
|
2118
|
+
if converter.is_a? Proc # custom code block
|
2119
|
+
convert.call(&converter)
|
2120
|
+
else # by name
|
2121
|
+
convert.call(converter)
|
2122
|
+
end
|
2123
|
+
end
|
2124
|
+
end
|
2125
|
+
|
2126
|
+
options.delete(field_name)
|
2127
|
+
end
|
2128
|
+
|
2129
|
+
# Stores header row settings and loads header converters, if needed.
|
2130
|
+
def init_headers(options)
|
2131
|
+
@use_headers = options.delete(:headers)
|
2132
|
+
@return_headers = options.delete(:return_headers)
|
2133
|
+
@write_headers = options.delete(:write_headers)
|
2134
|
+
|
2135
|
+
# headers must be delayed until shift(), in case they need a row of content
|
2136
|
+
@headers = nil
|
2137
|
+
|
2138
|
+
init_converters(options, :header_converters)
|
2139
|
+
end
|
2140
|
+
|
2141
|
+
# Stores the pattern of comments to skip from the provided options.
|
2142
|
+
#
|
2143
|
+
# The pattern must respond to +.match+, else ArgumentError is raised.
|
2144
|
+
# Strings are converted to a Regexp.
|
2145
|
+
#
|
2146
|
+
# See also CSV.new
|
2147
|
+
def init_comments(options)
|
2148
|
+
@skip_lines = options.delete(:skip_lines)
|
2149
|
+
@skip_lines = Regexp.new(@skip_lines) if @skip_lines.is_a? String
|
2150
|
+
if @skip_lines and not @skip_lines.respond_to?(:match)
|
2151
|
+
raise ArgumentError, ":skip_lines has to respond to matches"
|
2152
|
+
end
|
2153
|
+
end
|
2154
|
+
#
|
2155
|
+
# The actual work method for adding converters, used by both CSV.convert() and
|
2156
|
+
# CSV.header_convert().
|
2157
|
+
#
|
2158
|
+
# This method requires the +var_name+ of the instance variable to place the
|
2159
|
+
# converters in, the +const+ Hash to lookup named converters in, and the
|
2160
|
+
# normal parameters of the CSV.convert() and CSV.header_convert() methods.
|
2161
|
+
#
|
2162
|
+
def add_converter(var_name, const, name = nil, &converter)
|
2163
|
+
if name.nil? # custom converter
|
2164
|
+
instance_variable_get("@#{var_name}") << converter
|
2165
|
+
else # named converter
|
2166
|
+
combo = const[name]
|
2167
|
+
case combo
|
2168
|
+
when Array # combo converter
|
2169
|
+
combo.each do |converter_name|
|
2170
|
+
add_converter(var_name, const, converter_name)
|
2171
|
+
end
|
2172
|
+
else # individual named converter
|
2173
|
+
instance_variable_get("@#{var_name}") << combo
|
2174
|
+
end
|
2175
|
+
end
|
2176
|
+
end
|
2177
|
+
|
2178
|
+
#
|
2179
|
+
# Processes +fields+ with <tt>@converters</tt>, or <tt>@header_converters</tt>
|
2180
|
+
# if +headers+ is passed as +true+, returning the converted field set. Any
|
2181
|
+
# converter that changes the field into something other than a String halts
|
2182
|
+
# the pipeline of conversion for that field. This is primarily an efficiency
|
2183
|
+
# shortcut.
|
2184
|
+
#
|
2185
|
+
def convert_fields(fields, headers = false)
|
2186
|
+
# see if we are converting headers or fields
|
2187
|
+
converters = headers ? @header_converters : @converters
|
2188
|
+
|
2189
|
+
fields.map.with_index do |field, index|
|
2190
|
+
converters.each do |converter|
|
2191
|
+
break if field.nil?
|
2192
|
+
field = if converter.arity == 1 # straight field converter
|
2193
|
+
converter[field]
|
2194
|
+
else # FieldInfo converter
|
2195
|
+
header = @use_headers && !headers ? @headers[index] : nil
|
2196
|
+
converter[field, FieldInfo.new(index, lineno, header)]
|
2197
|
+
end
|
2198
|
+
break unless field.is_a? String # short-circuit pipeline for speed
|
2199
|
+
end
|
2200
|
+
field # final state of each field, converted or original
|
2201
|
+
end
|
2202
|
+
end
|
2203
|
+
|
2204
|
+
#
|
2205
|
+
# This method is used to turn a finished +row+ into a CSV::Row. Header rows
|
2206
|
+
# are also dealt with here, either by returning a CSV::Row with identical
|
2207
|
+
# headers and fields (save that the fields do not go through the converters)
|
2208
|
+
# or by reading past them to return a field row. Headers are also saved in
|
2209
|
+
# <tt>@headers</tt> for use in future rows.
|
2210
|
+
#
|
2211
|
+
# When +nil+, +row+ is assumed to be a header row not based on an actual row
|
2212
|
+
# of the stream.
|
2213
|
+
#
|
2214
|
+
def parse_headers(row = nil)
|
2215
|
+
if @headers.nil? # header row
|
2216
|
+
@headers = case @use_headers # save headers
|
2217
|
+
# Array of headers
|
2218
|
+
when Array then @use_headers
|
2219
|
+
# CSV header String
|
2220
|
+
when String
|
2221
|
+
self.class.parse_line( @use_headers,
|
2222
|
+
col_sep: @col_sep,
|
2223
|
+
row_sep: @row_sep,
|
2224
|
+
quote_char: @quote_char )
|
2225
|
+
# first row is headers
|
2226
|
+
else row
|
2227
|
+
end
|
2228
|
+
|
2229
|
+
# prepare converted and unconverted copies
|
2230
|
+
row = @headers if row.nil?
|
2231
|
+
@headers = convert_fields(@headers, true)
|
2232
|
+
@headers.each { |h| h.freeze if h.is_a? String }
|
2233
|
+
|
2234
|
+
if @return_headers # return headers
|
2235
|
+
return self.class::Row.new(@headers, row, true)
|
2236
|
+
elsif not [Array, String].include? @use_headers.class # skip to field row
|
2237
|
+
return shift
|
2238
|
+
end
|
2239
|
+
end
|
2240
|
+
|
2241
|
+
self.class::Row.new(@headers, convert_fields(row)) # field row
|
2242
|
+
end
|
2243
|
+
|
2244
|
+
#
|
2245
|
+
# This method injects an instance variable <tt>unconverted_fields</tt> into
|
2246
|
+
# +row+ and an accessor method for +row+ called unconverted_fields(). The
|
2247
|
+
# variable is set to the contents of +fields+.
|
2248
|
+
#
|
2249
|
+
def add_unconverted_fields(row, fields)
|
2250
|
+
class << row
|
2251
|
+
attr_reader :unconverted_fields
|
2252
|
+
end
|
2253
|
+
row.instance_eval { @unconverted_fields = fields }
|
2254
|
+
row
|
2255
|
+
end
|
2256
|
+
|
2257
|
+
#
|
2258
|
+
# This method is an encoding safe version of Regexp::escape(). It will escape
|
2259
|
+
# any characters that would change the meaning of a regular expression in the
|
2260
|
+
# encoding of +str+. Regular expression characters that cannot be transcoded
|
2261
|
+
# to the target encoding will be skipped and no escaping will be performed if
|
2262
|
+
# a backslash cannot be transcoded.
|
2263
|
+
#
|
2264
|
+
def escape_re(str)
|
2265
|
+
str.gsub(@re_chars) {|c| @re_esc + c}
|
2266
|
+
end
|
2267
|
+
|
2268
|
+
#
|
2269
|
+
# Builds a regular expression in <tt>@encoding</tt>. All +chunks+ will be
|
2270
|
+
# transcoded to that encoding.
|
2271
|
+
#
|
2272
|
+
def encode_re(*chunks)
|
2273
|
+
Regexp.new(encode_str(*chunks))
|
2274
|
+
end
|
2275
|
+
|
2276
|
+
#
|
2277
|
+
# Builds a String in <tt>@encoding</tt>. All +chunks+ will be transcoded to
|
2278
|
+
# that encoding.
|
2279
|
+
#
|
2280
|
+
def encode_str(*chunks)
|
2281
|
+
chunks.map { |chunk| chunk.encode(@encoding.name) }.join('')
|
2282
|
+
end
|
2283
|
+
|
2284
|
+
private
|
2285
|
+
|
2286
|
+
#
|
2287
|
+
# Returns the encoding of the internal IO object or the +default+ if the
|
2288
|
+
# encoding cannot be determined.
|
2289
|
+
#
|
2290
|
+
def raw_encoding(default = Encoding::ASCII_8BIT)
|
2291
|
+
if @io.respond_to? :internal_encoding
|
2292
|
+
@io.internal_encoding || @io.external_encoding
|
2293
|
+
elsif @io.is_a? StringIO
|
2294
|
+
@io.string.encoding
|
2295
|
+
elsif @io.respond_to? :encoding
|
2296
|
+
@io.encoding
|
2297
|
+
else
|
2298
|
+
default
|
2299
|
+
end
|
2300
|
+
end
|
2301
|
+
end
|
2302
|
+
|
2303
|
+
# Passes +args+ to CSV::instance.
|
2304
|
+
#
|
2305
|
+
# CSV("CSV,data").read
|
2306
|
+
# #=> [["CSV", "data"]]
|
2307
|
+
#
|
2308
|
+
# If a block is given, the instance is passed the block and the return value
|
2309
|
+
# becomes the return value of the block.
|
2310
|
+
#
|
2311
|
+
# CSV("CSV,data") { |c|
|
2312
|
+
# c.read.any? { |a| a.include?("data") }
|
2313
|
+
# } #=> true
|
2314
|
+
#
|
2315
|
+
# CSV("CSV,data") { |c|
|
2316
|
+
# c.read.any? { |a| a.include?("zombies") }
|
2317
|
+
# } #=> false
|
2318
|
+
#
|
2319
|
+
def CSV(*args, &block)
|
2320
|
+
CSV.instance(*args, &block)
|
2321
|
+
end
|
2322
|
+
|
2323
|
+
class Array # :nodoc:
|
2324
|
+
# Equivalent to CSV::generate_line(self, options)
|
2325
|
+
#
|
2326
|
+
# ["CSV", "data"].to_csv
|
2327
|
+
# #=> "CSV,data\n"
|
2328
|
+
def to_csv(options = Hash.new)
|
2329
|
+
CSV.generate_line(self, options)
|
2330
|
+
end
|
2331
|
+
end
|
2332
|
+
|
2333
|
+
class String # :nodoc:
|
2334
|
+
# Equivalent to CSV::parse_line(self, options)
|
2335
|
+
#
|
2336
|
+
# "CSV,data".parse_csv
|
2337
|
+
# #=> ["CSV", "data"]
|
2338
|
+
def parse_csv(options = Hash.new)
|
2339
|
+
CSV.parse_line(self, options)
|
2340
|
+
end
|
2341
|
+
end
|