shoesgem 0.1424.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +30 -0
- data/README.rdoc +31 -0
- data/lib/shoes.rb +4 -0
- data/shoes/CHANGELOG.txt +21 -0
- data/shoes/COPYING.txt +30 -0
- data/shoes/README.txt +117 -0
- data/shoes/VERSION.txt +1 -0
- data/shoes/fonts/Coolvetica.ttf +0 -0
- data/shoes/fonts/Lacuna.ttf +0 -0
- data/shoes/freetype6.dll +0 -0
- data/shoes/lib/shoes/cache.rb +54 -0
- data/shoes/lib/shoes/data.rb +39 -0
- data/shoes/lib/shoes/help.rb +421 -0
- data/shoes/lib/shoes/image.rb +25 -0
- data/shoes/lib/shoes/inspect.rb +128 -0
- data/shoes/lib/shoes/log.rb +48 -0
- data/shoes/lib/shoes/minitar.rb +986 -0
- data/shoes/lib/shoes/override.rb +38 -0
- data/shoes/lib/shoes/pack.rb +503 -0
- data/shoes/lib/shoes/search.rb +46 -0
- data/shoes/lib/shoes/setup.rb +329 -0
- data/shoes/lib/shoes/shy.rb +131 -0
- data/shoes/lib/shoes/shybuilder.rb +44 -0
- data/shoes/lib/shoes.rb +522 -0
- data/shoes/libcairo-2.dll +0 -0
- data/shoes/libeay32.dll +0 -0
- data/shoes/libexpat-1.dll +0 -0
- data/shoes/libfontconfig-1.dll +0 -0
- data/shoes/libgio-2.0-0.dll +0 -0
- data/shoes/libglib-2.0-0.dll +0 -0
- data/shoes/libgmodule-2.0-0.dll +0 -0
- data/shoes/libgobject-2.0-0.dll +0 -0
- data/shoes/libgthread-2.0-0.dll +0 -0
- data/shoes/libiconv2.dll +0 -0
- data/shoes/libjpeg-8.dll +0 -0
- data/shoes/libpango-1.0-0.dll +0 -0
- data/shoes/libpangocairo-1.0-0.dll +0 -0
- data/shoes/libpangoft2-1.0-0.dll +0 -0
- data/shoes/libpangowin32-1.0-0.dll +0 -0
- data/shoes/libpng14-14.dll +0 -0
- data/shoes/libportaudio-2.dll +0 -0
- data/shoes/libshoes.dll +0 -0
- data/shoes/libssl32.dll +0 -0
- data/shoes/libungif4.dll +0 -0
- data/shoes/msvcrt-ruby191.dll +0 -0
- data/shoes/readline5.dll +0 -0
- data/shoes/ruby/gems/1.9.1/gems/hpricot-0.8.1/lib/fast_xs.so +0 -0
- data/shoes/ruby/gems/1.9.1/gems/hpricot-0.8.1/lib/hpricot/blankslate.rb +63 -0
- data/shoes/ruby/gems/1.9.1/gems/hpricot-0.8.1/lib/hpricot/builder.rb +216 -0
- data/shoes/ruby/gems/1.9.1/gems/hpricot-0.8.1/lib/hpricot/elements.rb +510 -0
- data/shoes/ruby/gems/1.9.1/gems/hpricot-0.8.1/lib/hpricot/htmlinfo.rb +691 -0
- data/shoes/ruby/gems/1.9.1/gems/hpricot-0.8.1/lib/hpricot/inspect.rb +103 -0
- data/shoes/ruby/gems/1.9.1/gems/hpricot-0.8.1/lib/hpricot/modules.rb +40 -0
- data/shoes/ruby/gems/1.9.1/gems/hpricot-0.8.1/lib/hpricot/parse.rb +38 -0
- data/shoes/ruby/gems/1.9.1/gems/hpricot-0.8.1/lib/hpricot/tag.rb +202 -0
- data/shoes/ruby/gems/1.9.1/gems/hpricot-0.8.1/lib/hpricot/tags.rb +164 -0
- data/shoes/ruby/gems/1.9.1/gems/hpricot-0.8.1/lib/hpricot/traverse.rb +838 -0
- data/shoes/ruby/gems/1.9.1/gems/hpricot-0.8.1/lib/hpricot/xchar.rb +94 -0
- data/shoes/ruby/gems/1.9.1/gems/hpricot-0.8.1/lib/hpricot.rb +26 -0
- data/shoes/ruby/gems/1.9.1/gems/hpricot-0.8.1/lib/hpricot_scan.so +0 -0
- data/shoes/ruby/gems/1.9.1/gems/json-shoes-1.1.3/lib/json/add/core.rb +135 -0
- data/shoes/ruby/gems/1.9.1/gems/json-shoes-1.1.3/lib/json/add/rails.rb +58 -0
- data/shoes/ruby/gems/1.9.1/gems/json-shoes-1.1.3/lib/json/common.rb +354 -0
- data/shoes/ruby/gems/1.9.1/gems/json-shoes-1.1.3/lib/json/ext/generator.so +0 -0
- data/shoes/ruby/gems/1.9.1/gems/json-shoes-1.1.3/lib/json/ext/parser.so +0 -0
- data/shoes/ruby/gems/1.9.1/gems/json-shoes-1.1.3/lib/json/ext.rb +13 -0
- data/shoes/ruby/gems/1.9.1/gems/json-shoes-1.1.3/lib/json/version.rb +9 -0
- data/shoes/ruby/gems/1.9.1/gems/json-shoes-1.1.3/lib/json.rb +8 -0
- data/shoes/ruby/gems/1.9.1/gems/sqlite3-ruby-1.2.5-x86-mswin32/lib/sqlite3/constants.rb +49 -0
- data/shoes/ruby/gems/1.9.1/gems/sqlite3-ruby-1.2.5-x86-mswin32/lib/sqlite3/database.rb +721 -0
- data/shoes/ruby/gems/1.9.1/gems/sqlite3-ruby-1.2.5-x86-mswin32/lib/sqlite3/driver/dl/api.rb +152 -0
- data/shoes/ruby/gems/1.9.1/gems/sqlite3-ruby-1.2.5-x86-mswin32/lib/sqlite3/driver/dl/driver.rb +307 -0
- data/shoes/ruby/gems/1.9.1/gems/sqlite3-ruby-1.2.5-x86-mswin32/lib/sqlite3/driver/native/driver.rb +219 -0
- data/shoes/ruby/gems/1.9.1/gems/sqlite3-ruby-1.2.5-x86-mswin32/lib/sqlite3/errors.rb +68 -0
- data/shoes/ruby/gems/1.9.1/gems/sqlite3-ruby-1.2.5-x86-mswin32/lib/sqlite3/pragmas.rb +271 -0
- data/shoes/ruby/gems/1.9.1/gems/sqlite3-ruby-1.2.5-x86-mswin32/lib/sqlite3/resultset.rb +180 -0
- data/shoes/ruby/gems/1.9.1/gems/sqlite3-ruby-1.2.5-x86-mswin32/lib/sqlite3/statement.rb +231 -0
- data/shoes/ruby/gems/1.9.1/gems/sqlite3-ruby-1.2.5-x86-mswin32/lib/sqlite3/translator.rb +109 -0
- data/shoes/ruby/gems/1.9.1/gems/sqlite3-ruby-1.2.5-x86-mswin32/lib/sqlite3/value.rb +57 -0
- data/shoes/ruby/gems/1.9.1/gems/sqlite3-ruby-1.2.5-x86-mswin32/lib/sqlite3/version.rb +16 -0
- data/shoes/ruby/gems/1.9.1/gems/sqlite3-ruby-1.2.5-x86-mswin32/lib/sqlite3.rb +1 -0
- data/shoes/ruby/gems/1.9.1/gems/sqlite3-ruby-1.2.5-x86-mswin32/lib/sqlite3_api.so +0 -0
- data/shoes/ruby/gems/1.9.1/specifications/hpricot-0.8.1.gemspec +32 -0
- data/shoes/ruby/gems/1.9.1/specifications/json-shoes-1.1.3.gemspec +34 -0
- data/shoes/ruby/gems/1.9.1/specifications/sqlite3-ruby-1.2.5-x86-mswin32.gemspec +46 -0
- data/shoes/ruby/lib/English.rb +155 -0
- data/shoes/ruby/lib/Win32API.rb +28 -0
- data/shoes/ruby/lib/abbrev.rb +103 -0
- data/shoes/ruby/lib/base64.rb +91 -0
- data/shoes/ruby/lib/benchmark.rb +573 -0
- data/shoes/ruby/lib/bigdecimal/jacobian.rb +85 -0
- data/shoes/ruby/lib/bigdecimal/ludcmp.rb +86 -0
- data/shoes/ruby/lib/bigdecimal/math.rb +237 -0
- data/shoes/ruby/lib/bigdecimal/newton.rb +77 -0
- data/shoes/ruby/lib/bigdecimal/util.rb +53 -0
- data/shoes/ruby/lib/cgi/cookie.rb +144 -0
- data/shoes/ruby/lib/cgi/core.rb +786 -0
- data/shoes/ruby/lib/cgi/html.rb +1021 -0
- data/shoes/ruby/lib/cgi/session/pstore.rb +111 -0
- data/shoes/ruby/lib/cgi/session.rb +537 -0
- data/shoes/ruby/lib/cgi/util.rb +181 -0
- data/shoes/ruby/lib/cgi.rb +274 -0
- data/shoes/ruby/lib/cmath.rb +233 -0
- data/shoes/ruby/lib/complex.rb +24 -0
- data/shoes/ruby/lib/csv.rb +2320 -0
- data/shoes/ruby/lib/date/format.rb +1313 -0
- data/shoes/ruby/lib/date.rb +1834 -0
- data/shoes/ruby/lib/debug.rb +907 -0
- data/shoes/ruby/lib/delegate.rb +311 -0
- data/shoes/ruby/lib/digest/hmac.rb +274 -0
- data/shoes/ruby/lib/digest/sha2.rb +74 -0
- data/shoes/ruby/lib/digest.rb +50 -0
- data/shoes/ruby/lib/dl/callback.rb +69 -0
- data/shoes/ruby/lib/dl/cparser.rb +109 -0
- data/shoes/ruby/lib/dl/func.rb +153 -0
- data/shoes/ruby/lib/dl/import.rb +215 -0
- data/shoes/ruby/lib/dl/pack.rb +173 -0
- data/shoes/ruby/lib/dl/stack.rb +146 -0
- data/shoes/ruby/lib/dl/struct.rb +213 -0
- data/shoes/ruby/lib/dl/types.rb +40 -0
- data/shoes/ruby/lib/dl/value.rb +112 -0
- data/shoes/ruby/lib/drb/acl.rb +146 -0
- data/shoes/ruby/lib/drb/drb.rb +1778 -0
- data/shoes/ruby/lib/drb/eq.rb +16 -0
- data/shoes/ruby/lib/drb/extserv.rb +71 -0
- data/shoes/ruby/lib/drb/extservm.rb +85 -0
- data/shoes/ruby/lib/drb/gw.rb +122 -0
- data/shoes/ruby/lib/drb/invokemethod.rb +34 -0
- data/shoes/ruby/lib/drb/observer.rb +22 -0
- data/shoes/ruby/lib/drb/ssl.rb +190 -0
- data/shoes/ruby/lib/drb/timeridconv.rb +91 -0
- data/shoes/ruby/lib/drb/unix.rb +108 -0
- data/shoes/ruby/lib/drb.rb +2 -0
- data/shoes/ruby/lib/e2mmap.rb +172 -0
- data/shoes/ruby/lib/erb.rb +902 -0
- data/shoes/ruby/lib/fileutils.rb +1592 -0
- data/shoes/ruby/lib/find.rb +81 -0
- data/shoes/ruby/lib/forwardable.rb +270 -0
- data/shoes/ruby/lib/ftsearch/analysis/analyzer.rb +16 -0
- data/shoes/ruby/lib/ftsearch/analysis/simple_identifier_analyzer.rb +23 -0
- data/shoes/ruby/lib/ftsearch/analysis/whitespace_analyzer.rb +22 -0
- data/shoes/ruby/lib/ftsearch/document_map_reader.rb +106 -0
- data/shoes/ruby/lib/ftsearch/document_map_writer.rb +46 -0
- data/shoes/ruby/lib/ftsearch/field_infos.rb +46 -0
- data/shoes/ruby/lib/ftsearch/fragment_writer.rb +114 -0
- data/shoes/ruby/lib/ftsearch/fulltext_reader.rb +52 -0
- data/shoes/ruby/lib/ftsearch/fulltext_writer.rb +75 -0
- data/shoes/ruby/lib/ftsearch/suffix_array_reader.rb +275 -0
- data/shoes/ruby/lib/ftsearch/suffix_array_writer.rb +99 -0
- data/shoes/ruby/lib/ftsearch/util.rb +21 -0
- data/shoes/ruby/lib/getoptlong.rb +610 -0
- data/shoes/ruby/lib/gserver.rb +253 -0
- data/shoes/ruby/lib/i386-mingw32/bigdecimal.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/binject.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/bloops.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/continuation.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/coverage.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/curses.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/digest/bubblebabble.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/digest/md5.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/digest/rmd160.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/digest/sha1.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/digest/sha2.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/digest.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/dl.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/big5.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/cp949.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/emacs_mule.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/encdb.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/euc_jp.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/euc_kr.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/euc_tw.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/gb18030.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/gb2312.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/gbk.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/iso_8859_1.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/iso_8859_10.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/iso_8859_11.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/iso_8859_13.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/iso_8859_14.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/iso_8859_15.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/iso_8859_16.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/iso_8859_2.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/iso_8859_3.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/iso_8859_4.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/iso_8859_5.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/iso_8859_6.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/iso_8859_7.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/iso_8859_8.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/iso_8859_9.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/koi8_r.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/koi8_u.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/shift_jis.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/trans/big5.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/trans/chinese.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/trans/escape.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/trans/gb18030.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/trans/gbk.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/trans/iso2022.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/trans/japanese.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/trans/japanese_euc.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/trans/japanese_sjis.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/trans/korean.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/trans/single_byte.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/trans/transdb.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/trans/utf_16_32.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/utf_16be.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/utf_16le.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/utf_32be.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/utf_32le.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/enc/windows_1251.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/etc.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/fcntl.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/fiber.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/ftsearchrt.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/gdbm.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/iconv.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/io/wait.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/json/ext/generator.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/json/ext/parser.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/mathn/complex.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/mathn/rational.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/nkf.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/openssl.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/racc/cparse.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/rbconfig.rb +196 -0
- data/shoes/ruby/lib/i386-mingw32/readline.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/ripper.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/sdbm.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/socket.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/stringio.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/strscan.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/syck.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/win32ole.so +0 -0
- data/shoes/ruby/lib/i386-mingw32/zlib.so +0 -0
- data/shoes/ruby/lib/io/nonblock.rb +23 -0
- data/shoes/ruby/lib/ipaddr.rb +813 -0
- data/shoes/ruby/lib/irb/cmd/chws.rb +32 -0
- data/shoes/ruby/lib/irb/cmd/fork.rb +38 -0
- data/shoes/ruby/lib/irb/cmd/help.rb +36 -0
- data/shoes/ruby/lib/irb/cmd/load.rb +66 -0
- data/shoes/ruby/lib/irb/cmd/nop.rb +38 -0
- data/shoes/ruby/lib/irb/cmd/pushws.rb +38 -0
- data/shoes/ruby/lib/irb/cmd/subirb.rb +42 -0
- data/shoes/ruby/lib/irb/completion.rb +207 -0
- data/shoes/ruby/lib/irb/context.rb +255 -0
- data/shoes/ruby/lib/irb/ext/change-ws.rb +61 -0
- data/shoes/ruby/lib/irb/ext/history.rb +109 -0
- data/shoes/ruby/lib/irb/ext/loader.rb +119 -0
- data/shoes/ruby/lib/irb/ext/math-mode.rb +36 -0
- data/shoes/ruby/lib/irb/ext/multi-irb.rb +240 -0
- data/shoes/ruby/lib/irb/ext/save-history.rb +100 -0
- data/shoes/ruby/lib/irb/ext/tracer.rb +60 -0
- data/shoes/ruby/lib/irb/ext/use-loader.rb +64 -0
- data/shoes/ruby/lib/irb/ext/workspaces.rb +55 -0
- data/shoes/ruby/lib/irb/extend-command.rb +272 -0
- data/shoes/ruby/lib/irb/frame.rb +66 -0
- data/shoes/ruby/lib/irb/help.rb +35 -0
- data/shoes/ruby/lib/irb/init.rb +288 -0
- data/shoes/ruby/lib/irb/input-method.rb +142 -0
- data/shoes/ruby/lib/irb/lc/error.rb +29 -0
- data/shoes/ruby/lib/irb/lc/help-message +38 -0
- data/shoes/ruby/lib/irb/lc/ja/encoding_aliases.rb +8 -0
- data/shoes/ruby/lib/irb/lc/ja/error.rb +27 -0
- data/shoes/ruby/lib/irb/lc/ja/help-message +39 -0
- data/shoes/ruby/lib/irb/locale.rb +195 -0
- data/shoes/ruby/lib/irb/magic-file.rb +36 -0
- data/shoes/ruby/lib/irb/notifier.rb +144 -0
- data/shoes/ruby/lib/irb/output-method.rb +69 -0
- data/shoes/ruby/lib/irb/ruby-lex.rb +1188 -0
- data/shoes/ruby/lib/irb/ruby-token.rb +270 -0
- data/shoes/ruby/lib/irb/slex.rb +282 -0
- data/shoes/ruby/lib/irb/src_encoding.rb +4 -0
- data/shoes/ruby/lib/irb/version.rb +15 -0
- data/shoes/ruby/lib/irb/workspace.rb +108 -0
- data/shoes/ruby/lib/irb/ws-for-case-2.rb +14 -0
- data/shoes/ruby/lib/irb/xmp.rb +97 -0
- data/shoes/ruby/lib/irb.rb +354 -0
- data/shoes/ruby/lib/json/add/core.rb +135 -0
- data/shoes/ruby/lib/json/add/rails.rb +58 -0
- data/shoes/ruby/lib/json/common.rb +354 -0
- data/shoes/ruby/lib/json/editor.rb +1371 -0
- data/shoes/ruby/lib/json/ext.rb +15 -0
- data/shoes/ruby/lib/json/version.rb +9 -0
- data/shoes/ruby/lib/json.rb +297 -0
- data/shoes/ruby/lib/kconv.rb +282 -0
- data/shoes/ruby/lib/logger.rb +732 -0
- data/shoes/ruby/lib/mathn.rb +206 -0
- data/shoes/ruby/lib/matrix.rb +1381 -0
- data/shoes/ruby/lib/minitest/autorun.rb +9 -0
- data/shoes/ruby/lib/minitest/mock.rb +37 -0
- data/shoes/ruby/lib/minitest/spec.rb +89 -0
- data/shoes/ruby/lib/minitest/unit.rb +497 -0
- data/shoes/ruby/lib/mkmf.rb +1958 -0
- data/shoes/ruby/lib/monitor.rb +265 -0
- data/shoes/ruby/lib/mutex_m.rb +91 -0
- data/shoes/ruby/lib/net/ftp.rb +981 -0
- data/shoes/ruby/lib/net/http.rb +2399 -0
- data/shoes/ruby/lib/net/https.rb +136 -0
- data/shoes/ruby/lib/net/imap.rb +3500 -0
- data/shoes/ruby/lib/net/pop.rb +1000 -0
- data/shoes/ruby/lib/net/protocol.rb +382 -0
- data/shoes/ruby/lib/net/smtp.rb +1014 -0
- data/shoes/ruby/lib/net/telnet.rb +759 -0
- data/shoes/ruby/lib/observer.rb +193 -0
- data/shoes/ruby/lib/open-uri.rb +832 -0
- data/shoes/ruby/lib/open3.rb +98 -0
- data/shoes/ruby/lib/openssl/bn.rb +35 -0
- data/shoes/ruby/lib/openssl/buffering.rb +242 -0
- data/shoes/ruby/lib/openssl/cipher.rb +65 -0
- data/shoes/ruby/lib/openssl/digest.rb +61 -0
- data/shoes/ruby/lib/openssl/ssl.rb +178 -0
- data/shoes/ruby/lib/openssl/x509.rb +155 -0
- data/shoes/ruby/lib/openssl.rb +24 -0
- data/shoes/ruby/lib/optparse/date.rb +17 -0
- data/shoes/ruby/lib/optparse/shellwords.rb +6 -0
- data/shoes/ruby/lib/optparse/time.rb +10 -0
- data/shoes/ruby/lib/optparse/uri.rb +6 -0
- data/shoes/ruby/lib/optparse/version.rb +70 -0
- data/shoes/ruby/lib/optparse.rb +1810 -0
- data/shoes/ruby/lib/ostruct.rb +145 -0
- data/shoes/ruby/lib/pathname.rb +1099 -0
- data/shoes/ruby/lib/pp.rb +532 -0
- data/shoes/ruby/lib/prettyprint.rb +896 -0
- data/shoes/ruby/lib/prime.rb +471 -0
- data/shoes/ruby/lib/profile.rb +10 -0
- data/shoes/ruby/lib/profiler.rb +59 -0
- data/shoes/ruby/lib/pstore.rb +543 -0
- data/shoes/ruby/lib/racc/parser.rb +441 -0
- data/shoes/ruby/lib/rake/classic_namespace.rb +8 -0
- data/shoes/ruby/lib/rake/clean.rb +33 -0
- data/shoes/ruby/lib/rake/gempackagetask.rb +97 -0
- data/shoes/ruby/lib/rake/loaders/makefile.rb +35 -0
- data/shoes/ruby/lib/rake/packagetask.rb +185 -0
- data/shoes/ruby/lib/rake/rake_test_loader.rb +5 -0
- data/shoes/ruby/lib/rake/rdoctask.rb +147 -0
- data/shoes/ruby/lib/rake/runtest.rb +23 -0
- data/shoes/ruby/lib/rake/tasklib.rb +23 -0
- data/shoes/ruby/lib/rake/testtask.rb +161 -0
- data/shoes/ruby/lib/rake/win32.rb +34 -0
- data/shoes/ruby/lib/rake.rb +2465 -0
- data/shoes/ruby/lib/rational.rb +19 -0
- data/shoes/ruby/lib/rbconfig/datadir.rb +24 -0
- data/shoes/ruby/lib/rdoc/code_objects.rb +1061 -0
- data/shoes/ruby/lib/rdoc/diagram.rb +340 -0
- data/shoes/ruby/lib/rdoc/dot.rb +249 -0
- data/shoes/ruby/lib/rdoc/generator/chm/chm.rb +100 -0
- data/shoes/ruby/lib/rdoc/generator/chm.rb +113 -0
- data/shoes/ruby/lib/rdoc/generator/html/common.rb +24 -0
- data/shoes/ruby/lib/rdoc/generator/html/frameless.rb +92 -0
- data/shoes/ruby/lib/rdoc/generator/html/hefss.rb +150 -0
- data/shoes/ruby/lib/rdoc/generator/html/html.rb +769 -0
- data/shoes/ruby/lib/rdoc/generator/html/kilmer.rb +151 -0
- data/shoes/ruby/lib/rdoc/generator/html/kilmerfactory.rb +427 -0
- data/shoes/ruby/lib/rdoc/generator/html/one_page_html.rb +122 -0
- data/shoes/ruby/lib/rdoc/generator/html.rb +445 -0
- data/shoes/ruby/lib/rdoc/generator/ri.rb +226 -0
- data/shoes/ruby/lib/rdoc/generator/texinfo/class.texinfo.erb +44 -0
- data/shoes/ruby/lib/rdoc/generator/texinfo/file.texinfo.erb +6 -0
- data/shoes/ruby/lib/rdoc/generator/texinfo/method.texinfo.erb +6 -0
- data/shoes/ruby/lib/rdoc/generator/texinfo/texinfo.erb +28 -0
- data/shoes/ruby/lib/rdoc/generator/texinfo.rb +81 -0
- data/shoes/ruby/lib/rdoc/generator/xml/rdf.rb +113 -0
- data/shoes/ruby/lib/rdoc/generator/xml/xml.rb +123 -0
- data/shoes/ruby/lib/rdoc/generator/xml.rb +117 -0
- data/shoes/ruby/lib/rdoc/generator.rb +1082 -0
- data/shoes/ruby/lib/rdoc/known_classes.rb +68 -0
- data/shoes/ruby/lib/rdoc/markup/attribute_manager.rb +265 -0
- data/shoes/ruby/lib/rdoc/markup/formatter.rb +14 -0
- data/shoes/ruby/lib/rdoc/markup/fragments.rb +337 -0
- data/shoes/ruby/lib/rdoc/markup/inline.rb +101 -0
- data/shoes/ruby/lib/rdoc/markup/lines.rb +152 -0
- data/shoes/ruby/lib/rdoc/markup/preprocess.rb +75 -0
- data/shoes/ruby/lib/rdoc/markup/to_flow.rb +185 -0
- data/shoes/ruby/lib/rdoc/markup/to_html.rb +403 -0
- data/shoes/ruby/lib/rdoc/markup/to_html_crossref.rb +148 -0
- data/shoes/ruby/lib/rdoc/markup/to_latex.rb +328 -0
- data/shoes/ruby/lib/rdoc/markup/to_test.rb +50 -0
- data/shoes/ruby/lib/rdoc/markup/to_texinfo.rb +69 -0
- data/shoes/ruby/lib/rdoc/markup.rb +378 -0
- data/shoes/ruby/lib/rdoc/options.rb +638 -0
- data/shoes/ruby/lib/rdoc/parser/c.rb +661 -0
- data/shoes/ruby/lib/rdoc/parser/f95.rb +1835 -0
- data/shoes/ruby/lib/rdoc/parser/perl.rb +165 -0
- data/shoes/ruby/lib/rdoc/parser/ruby.rb +2829 -0
- data/shoes/ruby/lib/rdoc/parser/simple.rb +38 -0
- data/shoes/ruby/lib/rdoc/parser.rb +142 -0
- data/shoes/ruby/lib/rdoc/rdoc.rb +293 -0
- data/shoes/ruby/lib/rdoc/ri/cache.rb +187 -0
- data/shoes/ruby/lib/rdoc/ri/descriptions.rb +156 -0
- data/shoes/ruby/lib/rdoc/ri/display.rb +392 -0
- data/shoes/ruby/lib/rdoc/ri/driver.rb +669 -0
- data/shoes/ruby/lib/rdoc/ri/formatter.rb +616 -0
- data/shoes/ruby/lib/rdoc/ri/paths.rb +99 -0
- data/shoes/ruby/lib/rdoc/ri/reader.rb +106 -0
- data/shoes/ruby/lib/rdoc/ri/util.rb +79 -0
- data/shoes/ruby/lib/rdoc/ri/writer.rb +68 -0
- data/shoes/ruby/lib/rdoc/ri.rb +8 -0
- data/shoes/ruby/lib/rdoc/stats.rb +115 -0
- data/shoes/ruby/lib/rdoc/template.rb +64 -0
- data/shoes/ruby/lib/rdoc/tokenstream.rb +33 -0
- data/shoes/ruby/lib/rdoc.rb +395 -0
- data/shoes/ruby/lib/resolv-replace.rb +63 -0
- data/shoes/ruby/lib/resolv.rb +2262 -0
- data/shoes/ruby/lib/rexml/attlistdecl.rb +62 -0
- data/shoes/ruby/lib/rexml/attribute.rb +188 -0
- data/shoes/ruby/lib/rexml/cdata.rb +67 -0
- data/shoes/ruby/lib/rexml/child.rb +96 -0
- data/shoes/ruby/lib/rexml/comment.rb +80 -0
- data/shoes/ruby/lib/rexml/doctype.rb +270 -0
- data/shoes/ruby/lib/rexml/document.rb +231 -0
- data/shoes/ruby/lib/rexml/dtd/attlistdecl.rb +10 -0
- data/shoes/ruby/lib/rexml/dtd/dtd.rb +51 -0
- data/shoes/ruby/lib/rexml/dtd/elementdecl.rb +17 -0
- data/shoes/ruby/lib/rexml/dtd/entitydecl.rb +56 -0
- data/shoes/ruby/lib/rexml/dtd/notationdecl.rb +39 -0
- data/shoes/ruby/lib/rexml/element.rb +1246 -0
- data/shoes/ruby/lib/rexml/encoding.rb +71 -0
- data/shoes/ruby/lib/rexml/encodings/CP-1252.rb +103 -0
- data/shoes/ruby/lib/rexml/encodings/EUC-JP.rb +35 -0
- data/shoes/ruby/lib/rexml/encodings/ICONV.rb +22 -0
- data/shoes/ruby/lib/rexml/encodings/ISO-8859-1.rb +7 -0
- data/shoes/ruby/lib/rexml/encodings/ISO-8859-15.rb +72 -0
- data/shoes/ruby/lib/rexml/encodings/SHIFT-JIS.rb +37 -0
- data/shoes/ruby/lib/rexml/encodings/SHIFT_JIS.rb +1 -0
- data/shoes/ruby/lib/rexml/encodings/UNILE.rb +34 -0
- data/shoes/ruby/lib/rexml/encodings/US-ASCII.rb +30 -0
- data/shoes/ruby/lib/rexml/encodings/UTF-16.rb +35 -0
- data/shoes/ruby/lib/rexml/encodings/UTF-8.rb +18 -0
- data/shoes/ruby/lib/rexml/entity.rb +166 -0
- data/shoes/ruby/lib/rexml/formatters/default.rb +109 -0
- data/shoes/ruby/lib/rexml/formatters/pretty.rb +139 -0
- data/shoes/ruby/lib/rexml/formatters/transitive.rb +58 -0
- data/shoes/ruby/lib/rexml/functions.rb +388 -0
- data/shoes/ruby/lib/rexml/instruction.rb +70 -0
- data/shoes/ruby/lib/rexml/light/node.rb +196 -0
- data/shoes/ruby/lib/rexml/namespace.rb +47 -0
- data/shoes/ruby/lib/rexml/node.rb +75 -0
- data/shoes/ruby/lib/rexml/output.rb +24 -0
- data/shoes/ruby/lib/rexml/parent.rb +166 -0
- data/shoes/ruby/lib/rexml/parseexception.rb +51 -0
- data/shoes/ruby/lib/rexml/parsers/baseparser.rb +530 -0
- data/shoes/ruby/lib/rexml/parsers/lightparser.rb +58 -0
- data/shoes/ruby/lib/rexml/parsers/pullparser.rb +196 -0
- data/shoes/ruby/lib/rexml/parsers/sax2parser.rb +247 -0
- data/shoes/ruby/lib/rexml/parsers/streamparser.rb +46 -0
- data/shoes/ruby/lib/rexml/parsers/treeparser.rb +100 -0
- data/shoes/ruby/lib/rexml/parsers/ultralightparser.rb +56 -0
- data/shoes/ruby/lib/rexml/parsers/xpathparser.rb +698 -0
- data/shoes/ruby/lib/rexml/quickpath.rb +263 -0
- data/shoes/ruby/lib/rexml/rexml.rb +31 -0
- data/shoes/ruby/lib/rexml/sax2listener.rb +97 -0
- data/shoes/ruby/lib/rexml/source.rb +258 -0
- data/shoes/ruby/lib/rexml/streamlistener.rb +92 -0
- data/shoes/ruby/lib/rexml/syncenumerator.rb +32 -0
- data/shoes/ruby/lib/rexml/text.rb +404 -0
- data/shoes/ruby/lib/rexml/undefinednamespaceexception.rb +8 -0
- data/shoes/ruby/lib/rexml/validation/relaxng.rb +559 -0
- data/shoes/ruby/lib/rexml/validation/validation.rb +155 -0
- data/shoes/ruby/lib/rexml/validation/validationexception.rb +9 -0
- data/shoes/ruby/lib/rexml/xmldecl.rb +119 -0
- data/shoes/ruby/lib/rexml/xmltokens.rb +18 -0
- data/shoes/ruby/lib/rexml/xpath.rb +77 -0
- data/shoes/ruby/lib/rexml/xpath_parser.rb +792 -0
- data/shoes/ruby/lib/rinda/rinda.rb +283 -0
- data/shoes/ruby/lib/rinda/ring.rb +271 -0
- data/shoes/ruby/lib/rinda/tuplespace.rb +642 -0
- data/shoes/ruby/lib/ripper/core.rb +70 -0
- data/shoes/ruby/lib/ripper/filter.rb +70 -0
- data/shoes/ruby/lib/ripper/lexer.rb +179 -0
- data/shoes/ruby/lib/ripper/sexp.rb +99 -0
- data/shoes/ruby/lib/ripper.rb +4 -0
- data/shoes/ruby/lib/rss/0.9.rb +427 -0
- data/shoes/ruby/lib/rss/1.0.rb +452 -0
- data/shoes/ruby/lib/rss/2.0.rb +111 -0
- data/shoes/ruby/lib/rss/atom.rb +748 -0
- data/shoes/ruby/lib/rss/content/1.0.rb +10 -0
- data/shoes/ruby/lib/rss/content/2.0.rb +12 -0
- data/shoes/ruby/lib/rss/content.rb +31 -0
- data/shoes/ruby/lib/rss/converter.rb +170 -0
- data/shoes/ruby/lib/rss/dublincore/1.0.rb +13 -0
- data/shoes/ruby/lib/rss/dublincore/2.0.rb +13 -0
- data/shoes/ruby/lib/rss/dublincore/atom.rb +17 -0
- data/shoes/ruby/lib/rss/dublincore.rb +161 -0
- data/shoes/ruby/lib/rss/image.rb +193 -0
- data/shoes/ruby/lib/rss/itunes.rb +410 -0
- data/shoes/ruby/lib/rss/maker/0.9.rb +467 -0
- data/shoes/ruby/lib/rss/maker/1.0.rb +434 -0
- data/shoes/ruby/lib/rss/maker/2.0.rb +223 -0
- data/shoes/ruby/lib/rss/maker/atom.rb +172 -0
- data/shoes/ruby/lib/rss/maker/base.rb +880 -0
- data/shoes/ruby/lib/rss/maker/content.rb +21 -0
- data/shoes/ruby/lib/rss/maker/dublincore.rb +124 -0
- data/shoes/ruby/lib/rss/maker/entry.rb +163 -0
- data/shoes/ruby/lib/rss/maker/feed.rb +430 -0
- data/shoes/ruby/lib/rss/maker/image.rb +111 -0
- data/shoes/ruby/lib/rss/maker/itunes.rb +242 -0
- data/shoes/ruby/lib/rss/maker/slash.rb +33 -0
- data/shoes/ruby/lib/rss/maker/syndication.rb +18 -0
- data/shoes/ruby/lib/rss/maker/taxonomy.rb +118 -0
- data/shoes/ruby/lib/rss/maker/trackback.rb +61 -0
- data/shoes/ruby/lib/rss/maker.rb +44 -0
- data/shoes/ruby/lib/rss/parser.rb +568 -0
- data/shoes/ruby/lib/rss/rexmlparser.rb +54 -0
- data/shoes/ruby/lib/rss/rss.rb +1313 -0
- data/shoes/ruby/lib/rss/slash.rb +49 -0
- data/shoes/ruby/lib/rss/syndication.rb +67 -0
- data/shoes/ruby/lib/rss/taxonomy.rb +145 -0
- data/shoes/ruby/lib/rss/trackback.rb +288 -0
- data/shoes/ruby/lib/rss/utils.rb +111 -0
- data/shoes/ruby/lib/rss/xml-stylesheet.rb +105 -0
- data/shoes/ruby/lib/rss/xml.rb +71 -0
- data/shoes/ruby/lib/rss/xmlparser.rb +93 -0
- data/shoes/ruby/lib/rss/xmlscanner.rb +121 -0
- data/shoes/ruby/lib/rss.rb +19 -0
- data/shoes/ruby/lib/rubygems/builder.rb +88 -0
- data/shoes/ruby/lib/rubygems/command.rb +406 -0
- data/shoes/ruby/lib/rubygems/command_manager.rb +146 -0
- data/shoes/ruby/lib/rubygems/commands/build_command.rb +53 -0
- data/shoes/ruby/lib/rubygems/commands/cert_command.rb +86 -0
- data/shoes/ruby/lib/rubygems/commands/check_command.rb +75 -0
- data/shoes/ruby/lib/rubygems/commands/cleanup_command.rb +91 -0
- data/shoes/ruby/lib/rubygems/commands/contents_command.rb +74 -0
- data/shoes/ruby/lib/rubygems/commands/dependency_command.rb +188 -0
- data/shoes/ruby/lib/rubygems/commands/environment_command.rb +128 -0
- data/shoes/ruby/lib/rubygems/commands/fetch_command.rb +62 -0
- data/shoes/ruby/lib/rubygems/commands/generate_index_command.rb +57 -0
- data/shoes/ruby/lib/rubygems/commands/help_command.rb +172 -0
- data/shoes/ruby/lib/rubygems/commands/install_command.rb +148 -0
- data/shoes/ruby/lib/rubygems/commands/list_command.rb +35 -0
- data/shoes/ruby/lib/rubygems/commands/lock_command.rb +110 -0
- data/shoes/ruby/lib/rubygems/commands/mirror_command.rb +111 -0
- data/shoes/ruby/lib/rubygems/commands/outdated_command.rb +33 -0
- data/shoes/ruby/lib/rubygems/commands/pristine_command.rb +93 -0
- data/shoes/ruby/lib/rubygems/commands/query_command.rb +233 -0
- data/shoes/ruby/lib/rubygems/commands/rdoc_command.rb +82 -0
- data/shoes/ruby/lib/rubygems/commands/search_command.rb +37 -0
- data/shoes/ruby/lib/rubygems/commands/server_command.rb +48 -0
- data/shoes/ruby/lib/rubygems/commands/sources_command.rb +152 -0
- data/shoes/ruby/lib/rubygems/commands/specification_command.rb +77 -0
- data/shoes/ruby/lib/rubygems/commands/stale_command.rb +27 -0
- data/shoes/ruby/lib/rubygems/commands/uninstall_command.rb +73 -0
- data/shoes/ruby/lib/rubygems/commands/unpack_command.rb +95 -0
- data/shoes/ruby/lib/rubygems/commands/update_command.rb +181 -0
- data/shoes/ruby/lib/rubygems/commands/which_command.rb +87 -0
- data/shoes/ruby/lib/rubygems/config_file.rb +266 -0
- data/shoes/ruby/lib/rubygems/custom_require.rb +46 -0
- data/shoes/ruby/lib/rubygems/defaults.rb +89 -0
- data/shoes/ruby/lib/rubygems/dependency.rb +119 -0
- data/shoes/ruby/lib/rubygems/dependency_installer.rb +258 -0
- data/shoes/ruby/lib/rubygems/dependency_list.rb +165 -0
- data/shoes/ruby/lib/rubygems/digest/digest_adapter.rb +40 -0
- data/shoes/ruby/lib/rubygems/digest/md5.rb +23 -0
- data/shoes/ruby/lib/rubygems/digest/sha1.rb +17 -0
- data/shoes/ruby/lib/rubygems/digest/sha2.rb +17 -0
- data/shoes/ruby/lib/rubygems/doc_manager.rb +214 -0
- data/shoes/ruby/lib/rubygems/exceptions.rb +84 -0
- data/shoes/ruby/lib/rubygems/ext/builder.rb +56 -0
- data/shoes/ruby/lib/rubygems/ext/configure_builder.rb +24 -0
- data/shoes/ruby/lib/rubygems/ext/ext_conf_builder.rb +23 -0
- data/shoes/ruby/lib/rubygems/ext/rake_builder.rb +27 -0
- data/shoes/ruby/lib/rubygems/ext.rb +18 -0
- data/shoes/ruby/lib/rubygems/format.rb +87 -0
- data/shoes/ruby/lib/rubygems/gem_openssl.rb +83 -0
- data/shoes/ruby/lib/rubygems/gem_path_searcher.rb +100 -0
- data/shoes/ruby/lib/rubygems/gem_runner.rb +58 -0
- data/shoes/ruby/lib/rubygems/indexer/abstract_index_builder.rb +88 -0
- data/shoes/ruby/lib/rubygems/indexer/latest_index_builder.rb +35 -0
- data/shoes/ruby/lib/rubygems/indexer/marshal_index_builder.rb +17 -0
- data/shoes/ruby/lib/rubygems/indexer/master_index_builder.rb +54 -0
- data/shoes/ruby/lib/rubygems/indexer/quick_index_builder.rb +50 -0
- data/shoes/ruby/lib/rubygems/indexer.rb +370 -0
- data/shoes/ruby/lib/rubygems/install_update_options.rb +113 -0
- data/shoes/ruby/lib/rubygems/installer.rb +578 -0
- data/shoes/ruby/lib/rubygems/local_remote_options.rb +134 -0
- data/shoes/ruby/lib/rubygems/old_format.rb +148 -0
- data/shoes/ruby/lib/rubygems/package/f_sync_dir.rb +24 -0
- data/shoes/ruby/lib/rubygems/package/tar_header.rb +245 -0
- data/shoes/ruby/lib/rubygems/package/tar_input.rb +219 -0
- data/shoes/ruby/lib/rubygems/package/tar_output.rb +143 -0
- data/shoes/ruby/lib/rubygems/package/tar_reader/entry.rb +99 -0
- data/shoes/ruby/lib/rubygems/package/tar_reader.rb +86 -0
- data/shoes/ruby/lib/rubygems/package/tar_writer.rb +180 -0
- data/shoes/ruby/lib/rubygems/package.rb +95 -0
- data/shoes/ruby/lib/rubygems/platform.rb +178 -0
- data/shoes/ruby/lib/rubygems/remote_fetcher.rb +344 -0
- data/shoes/ruby/lib/rubygems/require_paths_builder.rb +15 -0
- data/shoes/ruby/lib/rubygems/requirement.rb +163 -0
- data/shoes/ruby/lib/rubygems/rubygems_version.rb +6 -0
- data/shoes/ruby/lib/rubygems/security.rb +786 -0
- data/shoes/ruby/lib/rubygems/server.rb +629 -0
- data/shoes/ruby/lib/rubygems/source_index.rb +559 -0
- data/shoes/ruby/lib/rubygems/source_info_cache.rb +393 -0
- data/shoes/ruby/lib/rubygems/source_info_cache_entry.rb +56 -0
- data/shoes/ruby/lib/rubygems/spec_fetcher.rb +249 -0
- data/shoes/ruby/lib/rubygems/specification.rb +1262 -0
- data/shoes/ruby/lib/rubygems/test_utilities.rb +131 -0
- data/shoes/ruby/lib/rubygems/timer.rb +25 -0
- data/shoes/ruby/lib/rubygems/uninstaller.rb +242 -0
- data/shoes/ruby/lib/rubygems/user_interaction.rb +360 -0
- data/shoes/ruby/lib/rubygems/validator.rb +208 -0
- data/shoes/ruby/lib/rubygems/version.rb +167 -0
- data/shoes/ruby/lib/rubygems/version_option.rb +48 -0
- data/shoes/ruby/lib/rubygems.rb +888 -0
- data/shoes/ruby/lib/scanf.rb +703 -0
- data/shoes/ruby/lib/securerandom.rb +182 -0
- data/shoes/ruby/lib/set.rb +1274 -0
- data/shoes/ruby/lib/shell/builtin-command.rb +160 -0
- data/shoes/ruby/lib/shell/command-processor.rb +593 -0
- data/shoes/ruby/lib/shell/error.rb +25 -0
- data/shoes/ruby/lib/shell/filter.rb +109 -0
- data/shoes/ruby/lib/shell/process-controller.rb +319 -0
- data/shoes/ruby/lib/shell/system-command.rb +159 -0
- data/shoes/ruby/lib/shell/version.rb +15 -0
- data/shoes/ruby/lib/shell.rb +300 -0
- data/shoes/ruby/lib/shellwords.rb +156 -0
- data/shoes/ruby/lib/singleton.rb +313 -0
- data/shoes/ruby/lib/sync.rb +307 -0
- data/shoes/ruby/lib/tempfile.rb +218 -0
- data/shoes/ruby/lib/test/unit/assertions.rb +122 -0
- data/shoes/ruby/lib/test/unit/testcase.rb +12 -0
- data/shoes/ruby/lib/test/unit.rb +66 -0
- data/shoes/ruby/lib/thread.rb +367 -0
- data/shoes/ruby/lib/thwait.rb +168 -0
- data/shoes/ruby/lib/time.rb +869 -0
- data/shoes/ruby/lib/timeout.rb +108 -0
- data/shoes/ruby/lib/tmpdir.rb +138 -0
- data/shoes/ruby/lib/tracer.rb +166 -0
- data/shoes/ruby/lib/tsort.rb +290 -0
- data/shoes/ruby/lib/ubygems.rb +10 -0
- data/shoes/ruby/lib/un.rb +304 -0
- data/shoes/ruby/lib/uri/common.rb +727 -0
- data/shoes/ruby/lib/uri/ftp.rb +198 -0
- data/shoes/ruby/lib/uri/generic.rb +1128 -0
- data/shoes/ruby/lib/uri/http.rb +100 -0
- data/shoes/ruby/lib/uri/https.rb +20 -0
- data/shoes/ruby/lib/uri/ldap.rb +190 -0
- data/shoes/ruby/lib/uri/ldaps.rb +12 -0
- data/shoes/ruby/lib/uri/mailto.rb +266 -0
- data/shoes/ruby/lib/uri.rb +29 -0
- data/shoes/ruby/lib/weakref.rb +80 -0
- data/shoes/ruby/lib/webrick/accesslog.rb +75 -0
- data/shoes/ruby/lib/webrick/cgi.rb +260 -0
- data/shoes/ruby/lib/webrick/compat.rb +15 -0
- data/shoes/ruby/lib/webrick/config.rb +100 -0
- data/shoes/ruby/lib/webrick/cookie.rb +110 -0
- data/shoes/ruby/lib/webrick/htmlutils.rb +25 -0
- data/shoes/ruby/lib/webrick/httpauth/authenticator.rb +79 -0
- data/shoes/ruby/lib/webrick/httpauth/basicauth.rb +65 -0
- data/shoes/ruby/lib/webrick/httpauth/digestauth.rb +344 -0
- data/shoes/ruby/lib/webrick/httpauth/htdigest.rb +91 -0
- data/shoes/ruby/lib/webrick/httpauth/htgroup.rb +61 -0
- data/shoes/ruby/lib/webrick/httpauth/htpasswd.rb +83 -0
- data/shoes/ruby/lib/webrick/httpauth/userdb.rb +29 -0
- data/shoes/ruby/lib/webrick/httpauth.rb +45 -0
- data/shoes/ruby/lib/webrick/httpproxy.rb +288 -0
- data/shoes/ruby/lib/webrick/httprequest.rb +402 -0
- data/shoes/ruby/lib/webrick/httpresponse.rb +326 -0
- data/shoes/ruby/lib/webrick/https.rb +63 -0
- data/shoes/ruby/lib/webrick/httpserver.rb +217 -0
- data/shoes/ruby/lib/webrick/httpservlet/abstract.rb +70 -0
- data/shoes/ruby/lib/webrick/httpservlet/cgi_runner.rb +47 -0
- data/shoes/ruby/lib/webrick/httpservlet/cgihandler.rb +110 -0
- data/shoes/ruby/lib/webrick/httpservlet/erbhandler.rb +54 -0
- data/shoes/ruby/lib/webrick/httpservlet/filehandler.rb +435 -0
- data/shoes/ruby/lib/webrick/httpservlet/prochandler.rb +33 -0
- data/shoes/ruby/lib/webrick/httpservlet.rb +22 -0
- data/shoes/ruby/lib/webrick/httpstatus.rb +132 -0
- data/shoes/ruby/lib/webrick/httputils.rb +392 -0
- data/shoes/ruby/lib/webrick/httpversion.rb +49 -0
- data/shoes/ruby/lib/webrick/log.rb +88 -0
- data/shoes/ruby/lib/webrick/server.rb +210 -0
- data/shoes/ruby/lib/webrick/ssl.rb +126 -0
- data/shoes/ruby/lib/webrick/utils.rb +175 -0
- data/shoes/ruby/lib/webrick/version.rb +13 -0
- data/shoes/ruby/lib/webrick.rb +29 -0
- data/shoes/ruby/lib/win32/registry.rb +832 -0
- data/shoes/ruby/lib/win32/resolv.rb +370 -0
- data/shoes/ruby/lib/win32/sspi.rb +330 -0
- data/shoes/ruby/lib/win32ole/property.rb +16 -0
- data/shoes/ruby/lib/xmlrpc/base64.rb +81 -0
- data/shoes/ruby/lib/xmlrpc/client.rb +625 -0
- data/shoes/ruby/lib/xmlrpc/config.rb +40 -0
- data/shoes/ruby/lib/xmlrpc/create.rb +290 -0
- data/shoes/ruby/lib/xmlrpc/datetime.rb +142 -0
- data/shoes/ruby/lib/xmlrpc/httpserver.rb +178 -0
- data/shoes/ruby/lib/xmlrpc/marshal.rb +76 -0
- data/shoes/ruby/lib/xmlrpc/parser.rb +813 -0
- data/shoes/ruby/lib/xmlrpc/server.rb +778 -0
- data/shoes/ruby/lib/xmlrpc/utils.rb +165 -0
- data/shoes/ruby/lib/yaml/baseemitter.rb +242 -0
- data/shoes/ruby/lib/yaml/basenode.rb +216 -0
- data/shoes/ruby/lib/yaml/constants.rb +45 -0
- data/shoes/ruby/lib/yaml/dbm.rb +111 -0
- data/shoes/ruby/lib/yaml/encoding.rb +33 -0
- data/shoes/ruby/lib/yaml/error.rb +34 -0
- data/shoes/ruby/lib/yaml/loader.rb +14 -0
- data/shoes/ruby/lib/yaml/rubytypes.rb +446 -0
- data/shoes/ruby/lib/yaml/store.rb +43 -0
- data/shoes/ruby/lib/yaml/stream.rb +40 -0
- data/shoes/ruby/lib/yaml/stringio.rb +83 -0
- data/shoes/ruby/lib/yaml/syck.rb +19 -0
- data/shoes/ruby/lib/yaml/tag.rb +91 -0
- data/shoes/ruby/lib/yaml/types.rb +192 -0
- data/shoes/ruby/lib/yaml/yamlnode.rb +54 -0
- data/shoes/ruby/lib/yaml/ypath.rb +52 -0
- data/shoes/ruby/lib/yaml.rb +440 -0
- data/shoes/samples/class-book.rb +43 -0
- data/shoes/samples/class-book.yaml +387 -0
- data/shoes/samples/expert-definr.rb +23 -0
- data/shoes/samples/expert-funnies.rb +51 -0
- data/shoes/samples/expert-irb.rb +112 -0
- data/shoes/samples/expert-minesweeper.rb +267 -0
- data/shoes/samples/expert-othello.rb +319 -0
- data/shoes/samples/expert-pong.rb +62 -0
- data/shoes/samples/expert-tankspank.rb +385 -0
- data/shoes/samples/good-arc.rb +37 -0
- data/shoes/samples/good-clock.rb +51 -0
- data/shoes/samples/good-follow.rb +26 -0
- data/shoes/samples/good-reminder.rb +174 -0
- data/shoes/samples/good-vjot.rb +56 -0
- data/shoes/samples/simple-accordion.rb +75 -0
- data/shoes/samples/simple-anim-shapes.rb +17 -0
- data/shoes/samples/simple-anim-text.rb +13 -0
- data/shoes/samples/simple-arc.rb +23 -0
- data/shoes/samples/simple-bounce.rb +24 -0
- data/shoes/samples/simple-calc.rb +70 -0
- data/shoes/samples/simple-control-sizes.rb +24 -0
- data/shoes/samples/simple-curve.rb +26 -0
- data/shoes/samples/simple-dialogs.rb +29 -0
- data/shoes/samples/simple-downloader.rb +27 -0
- data/shoes/samples/simple-draw.rb +13 -0
- data/shoes/samples/simple-editor.rb +28 -0
- data/shoes/samples/simple-form.rb +28 -0
- data/shoes/samples/simple-form.shy +0 -0
- data/shoes/samples/simple-mask.rb +21 -0
- data/shoes/samples/simple-menu.rb +31 -0
- data/shoes/samples/simple-menu1.rb +35 -0
- data/shoes/samples/simple-rubygems.rb +29 -0
- data/shoes/samples/simple-slide.rb +45 -0
- data/shoes/samples/simple-sphere.rb +28 -0
- data/shoes/samples/simple-timer.rb +13 -0
- data/shoes/samples/simple-video.rb +13 -0
- data/shoes/shoes +21 -0
- data/shoes/shoes.exe +0 -0
- data/shoes/shoes.exe.manifest +17 -0
- data/shoes/sqlite3.dll +0 -0
- data/shoes/static/Shoes.icns +0 -0
- data/shoes/static/Thumbs.db +0 -0
- data/shoes/static/app-icon.png +0 -0
- data/shoes/static/avatar.png +0 -0
- data/shoes/static/code_highlighter.js +188 -0
- data/shoes/static/code_highlighter_ruby.js +26 -0
- data/shoes/static/icon-debug.png +0 -0
- data/shoes/static/icon-error.png +0 -0
- data/shoes/static/icon-info.png +0 -0
- data/shoes/static/icon-warn.png +0 -0
- data/shoes/static/listbox_button1.png +0 -0
- data/shoes/static/listbox_button2.png +0 -0
- data/shoes/static/man-app.png +0 -0
- data/shoes/static/man-builds.png +0 -0
- data/shoes/static/man-editor-notepad.png +0 -0
- data/shoes/static/man-editor-osx.png +0 -0
- data/shoes/static/man-ele-background.png +0 -0
- data/shoes/static/man-ele-border.png +0 -0
- data/shoes/static/man-ele-button.png +0 -0
- data/shoes/static/man-ele-check.png +0 -0
- data/shoes/static/man-ele-editbox.png +0 -0
- data/shoes/static/man-ele-editline.png +0 -0
- data/shoes/static/man-ele-image.png +0 -0
- data/shoes/static/man-ele-listbox.png +0 -0
- data/shoes/static/man-ele-progress.png +0 -0
- data/shoes/static/man-ele-radio.png +0 -0
- data/shoes/static/man-ele-shape.png +0 -0
- data/shoes/static/man-ele-textblock.png +0 -0
- data/shoes/static/man-ele-video.png +0 -0
- data/shoes/static/man-intro-dmg.png +0 -0
- data/shoes/static/man-intro-exe.png +0 -0
- data/shoes/static/man-look-tiger.png +0 -0
- data/shoes/static/man-look-ubuntu.png +0 -0
- data/shoes/static/man-look-vista.png +0 -0
- data/shoes/static/man-run-osx.png +0 -0
- data/shoes/static/man-run-vista.png +0 -0
- data/shoes/static/man-run-xp.png +0 -0
- data/shoes/static/man-shot1.png +0 -0
- data/shoes/static/manual-en.txt +2783 -0
- data/shoes/static/manual-ja.txt +2780 -0
- data/shoes/static/manual.css +167 -0
- data/shoes/static/menu-corner1.png +0 -0
- data/shoes/static/menu-corner2.png +0 -0
- data/shoes/static/menu-gray.png +0 -0
- data/shoes/static/menu-left.png +0 -0
- data/shoes/static/menu-right.png +0 -0
- data/shoes/static/menu-top.png +0 -0
- data/shoes/static/shoes-dmg.jpg +0 -0
- data/shoes/static/shoes-icon-blue.png +0 -0
- data/shoes/static/shoes-icon.png +0 -0
- data/shoes/static/shoes-manual-apps.gif +0 -0
- data/shoes/static/stripe.png +0 -0
- data/shoes/static/stubs/blank.exe +0 -0
- data/shoes/static/stubs/blank.hfz +0 -0
- data/shoes/static/stubs/blank.run +375 -0
- data/shoes/static/stubs/cocoa-install +0 -0
- data/shoes/static/stubs/sh-install +48 -0
- data/shoes/static/tutor-back.png +0 -0
- data/shoes/zlib.dll +0 -0
- data/shoes/zlib1.dll +0 -0
- metadata +887 -0
@@ -0,0 +1,869 @@
|
|
1
|
+
|
2
|
+
#
|
3
|
+
# == Introduction
|
4
|
+
#
|
5
|
+
# This library extends the Time class:
|
6
|
+
# * conversion between date string and time object.
|
7
|
+
# * date-time defined by RFC 2822
|
8
|
+
# * HTTP-date defined by RFC 2616
|
9
|
+
# * dateTime defined by XML Schema Part 2: Datatypes (ISO 8601)
|
10
|
+
# * various formats handled by Date._parse (string to time only)
|
11
|
+
#
|
12
|
+
# == Design Issues
|
13
|
+
#
|
14
|
+
# === Specialized interface
|
15
|
+
#
|
16
|
+
# This library provides methods dedicated to special purposes:
|
17
|
+
# * RFC 2822, RFC 2616 and XML Schema.
|
18
|
+
# * They makes usual life easier.
|
19
|
+
#
|
20
|
+
# === Doesn't depend on strftime
|
21
|
+
#
|
22
|
+
# This library doesn't use +strftime+. Especially #rfc2822 doesn't depend
|
23
|
+
# on +strftime+ because:
|
24
|
+
#
|
25
|
+
# * %a and %b are locale sensitive
|
26
|
+
#
|
27
|
+
# Since they are locale sensitive, they may be replaced to
|
28
|
+
# invalid weekday/month name in some locales.
|
29
|
+
# Since ruby-1.6 doesn't invoke setlocale by default,
|
30
|
+
# the problem doesn't arise until some external library invokes setlocale.
|
31
|
+
# Ruby/GTK is the example of such library.
|
32
|
+
#
|
33
|
+
# * %z is not portable
|
34
|
+
#
|
35
|
+
# %z is required to generate zone in date-time of RFC 2822
|
36
|
+
# but it is not portable.
|
37
|
+
#
|
38
|
+
# == Revision Information
|
39
|
+
#
|
40
|
+
# $Id$
|
41
|
+
#
|
42
|
+
|
43
|
+
require 'date/format'
|
44
|
+
|
45
|
+
#
|
46
|
+
# Implements the extensions to the Time class that are described in the
|
47
|
+
# documentation for the time.rb library.
|
48
|
+
#
|
49
|
+
class Time
|
50
|
+
class << Time
|
51
|
+
|
52
|
+
ZoneOffset = {
|
53
|
+
'UTC' => 0,
|
54
|
+
# ISO 8601
|
55
|
+
'Z' => 0,
|
56
|
+
# RFC 822
|
57
|
+
'UT' => 0, 'GMT' => 0,
|
58
|
+
'EST' => -5, 'EDT' => -4,
|
59
|
+
'CST' => -6, 'CDT' => -5,
|
60
|
+
'MST' => -7, 'MDT' => -6,
|
61
|
+
'PST' => -8, 'PDT' => -7,
|
62
|
+
# Following definition of military zones is original one.
|
63
|
+
# See RFC 1123 and RFC 2822 for the error in RFC 822.
|
64
|
+
'A' => +1, 'B' => +2, 'C' => +3, 'D' => +4, 'E' => +5, 'F' => +6,
|
65
|
+
'G' => +7, 'H' => +8, 'I' => +9, 'K' => +10, 'L' => +11, 'M' => +12,
|
66
|
+
'N' => -1, 'O' => -2, 'P' => -3, 'Q' => -4, 'R' => -5, 'S' => -6,
|
67
|
+
'T' => -7, 'U' => -8, 'V' => -9, 'W' => -10, 'X' => -11, 'Y' => -12,
|
68
|
+
}
|
69
|
+
def zone_offset(zone, year=self.now.year)
|
70
|
+
off = nil
|
71
|
+
zone = zone.upcase
|
72
|
+
if /\A([+-])(\d\d):?(\d\d)\z/ =~ zone
|
73
|
+
off = ($1 == '-' ? -1 : 1) * ($2.to_i * 60 + $3.to_i) * 60
|
74
|
+
elsif /\A[+-]\d\d\z/ =~ zone
|
75
|
+
off = zone.to_i * 3600
|
76
|
+
elsif ZoneOffset.include?(zone)
|
77
|
+
off = ZoneOffset[zone] * 3600
|
78
|
+
elsif ((t = self.local(year, 1, 1)).zone.upcase == zone rescue false)
|
79
|
+
off = t.utc_offset
|
80
|
+
elsif ((t = self.local(year, 7, 1)).zone.upcase == zone rescue false)
|
81
|
+
off = t.utc_offset
|
82
|
+
end
|
83
|
+
off
|
84
|
+
end
|
85
|
+
|
86
|
+
def zone_utc?(zone)
|
87
|
+
# * +0000
|
88
|
+
# In RFC 2822, +0000 indicate a time zone at Universal Time.
|
89
|
+
# Europe/London is "a time zone at Universal Time" in Winter.
|
90
|
+
# Europe/Lisbon is "a time zone at Universal Time" in Winter.
|
91
|
+
# Atlantic/Reykjavik is "a time zone at Universal Time".
|
92
|
+
# Africa/Dakar is "a time zone at Universal Time".
|
93
|
+
# So +0000 is a local time such as Europe/London, etc.
|
94
|
+
# * GMT
|
95
|
+
# GMT is used as a time zone abbreviation in Europe/London,
|
96
|
+
# Africa/Dakar, etc.
|
97
|
+
# So it is a local time.
|
98
|
+
#
|
99
|
+
# * -0000, -00:00
|
100
|
+
# In RFC 2822, -0000 the date-time contains no information about the
|
101
|
+
# local time zone.
|
102
|
+
# In RFC 3339, -00:00 is used for the time in UTC is known,
|
103
|
+
# but the offset to local time is unknown.
|
104
|
+
# They are not appropriate for specific time zone such as
|
105
|
+
# Europe/London because time zone neutral,
|
106
|
+
# So -00:00 and -0000 are treated as UTC.
|
107
|
+
if /\A(?:-00:00|-0000|-00|UTC|Z|UT)\z/i =~ zone
|
108
|
+
true
|
109
|
+
else
|
110
|
+
false
|
111
|
+
end
|
112
|
+
end
|
113
|
+
private :zone_utc?
|
114
|
+
|
115
|
+
LeapYearMonthDays = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
|
116
|
+
CommonYearMonthDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
|
117
|
+
def month_days(y, m)
|
118
|
+
if ((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0)
|
119
|
+
LeapYearMonthDays[m-1]
|
120
|
+
else
|
121
|
+
CommonYearMonthDays[m-1]
|
122
|
+
end
|
123
|
+
end
|
124
|
+
private :month_days
|
125
|
+
|
126
|
+
def apply_offset(year, mon, day, hour, min, sec, off)
|
127
|
+
if off < 0
|
128
|
+
off = -off
|
129
|
+
off, o = off.divmod(60)
|
130
|
+
if o != 0 then sec += o; o, sec = sec.divmod(60); off += o end
|
131
|
+
off, o = off.divmod(60)
|
132
|
+
if o != 0 then min += o; o, min = min.divmod(60); off += o end
|
133
|
+
off, o = off.divmod(24)
|
134
|
+
if o != 0 then hour += o; o, hour = hour.divmod(24); off += o end
|
135
|
+
if off != 0
|
136
|
+
day += off
|
137
|
+
if month_days(year, mon) < day
|
138
|
+
mon += 1
|
139
|
+
if 12 < mon
|
140
|
+
mon = 1
|
141
|
+
year += 1
|
142
|
+
end
|
143
|
+
day = 1
|
144
|
+
end
|
145
|
+
end
|
146
|
+
elsif 0 < off
|
147
|
+
off, o = off.divmod(60)
|
148
|
+
if o != 0 then sec -= o; o, sec = sec.divmod(60); off -= o end
|
149
|
+
off, o = off.divmod(60)
|
150
|
+
if o != 0 then min -= o; o, min = min.divmod(60); off -= o end
|
151
|
+
off, o = off.divmod(24)
|
152
|
+
if o != 0 then hour -= o; o, hour = hour.divmod(24); off -= o end
|
153
|
+
if off != 0 then
|
154
|
+
day -= off
|
155
|
+
if day < 1
|
156
|
+
mon -= 1
|
157
|
+
if mon < 1
|
158
|
+
year -= 1
|
159
|
+
mon = 12
|
160
|
+
end
|
161
|
+
day = month_days(year, mon)
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
return year, mon, day, hour, min, sec
|
166
|
+
end
|
167
|
+
private :apply_offset
|
168
|
+
|
169
|
+
def make_time(year, mon, day, hour, min, sec, sec_fraction, zone, now)
|
170
|
+
usec = nil
|
171
|
+
usec = sec_fraction * 1000000 if sec_fraction
|
172
|
+
if now
|
173
|
+
begin
|
174
|
+
break if year; year = now.year
|
175
|
+
break if mon; mon = now.mon
|
176
|
+
break if day; day = now.day
|
177
|
+
break if hour; hour = now.hour
|
178
|
+
break if min; min = now.min
|
179
|
+
break if sec; sec = now.sec
|
180
|
+
break if sec_fraction; usec = now.tv_usec
|
181
|
+
end until true
|
182
|
+
end
|
183
|
+
|
184
|
+
year ||= 1970
|
185
|
+
mon ||= 1
|
186
|
+
day ||= 1
|
187
|
+
hour ||= 0
|
188
|
+
min ||= 0
|
189
|
+
sec ||= 0
|
190
|
+
usec ||= 0
|
191
|
+
|
192
|
+
off = nil
|
193
|
+
off = zone_offset(zone, year) if zone
|
194
|
+
|
195
|
+
if off
|
196
|
+
year, mon, day, hour, min, sec =
|
197
|
+
apply_offset(year, mon, day, hour, min, sec, off)
|
198
|
+
t = self.utc(year, mon, day, hour, min, sec, usec)
|
199
|
+
t.localtime if !zone_utc?(zone)
|
200
|
+
t
|
201
|
+
else
|
202
|
+
self.local(year, mon, day, hour, min, sec, usec)
|
203
|
+
end
|
204
|
+
end
|
205
|
+
private :make_time
|
206
|
+
|
207
|
+
#
|
208
|
+
# Parses +date+ using Date._parse and converts it to a Time object.
|
209
|
+
#
|
210
|
+
# If a block is given, the year described in +date+ is converted by the
|
211
|
+
# block. For example:
|
212
|
+
#
|
213
|
+
# Time.parse(...) {|y| y < 100 ? (y >= 69 ? y + 1900 : y + 2000) : y}
|
214
|
+
#
|
215
|
+
# If the upper components of the given time are broken or missing, they are
|
216
|
+
# supplied with those of +now+. For the lower components, the minimum
|
217
|
+
# values (1 or 0) are assumed if broken or missing. For example:
|
218
|
+
#
|
219
|
+
# # Suppose it is "Thu Nov 29 14:33:20 GMT 2001" now and
|
220
|
+
# # your timezone is GMT:
|
221
|
+
# Time.parse("16:30") #=> Thu Nov 29 16:30:00 GMT 2001
|
222
|
+
# Time.parse("7/23") #=> Mon Jul 23 00:00:00 GMT 2001
|
223
|
+
# Time.parse("Aug 31") #=> Fri Aug 31 00:00:00 GMT 2001
|
224
|
+
#
|
225
|
+
# Since there are numerous conflicts among locally defined timezone
|
226
|
+
# abbreviations all over the world, this method is not made to
|
227
|
+
# understand all of them. For example, the abbreviation "CST" is
|
228
|
+
# used variously as:
|
229
|
+
#
|
230
|
+
# -06:00 in America/Chicago,
|
231
|
+
# -05:00 in America/Havana,
|
232
|
+
# +08:00 in Asia/Harbin,
|
233
|
+
# +09:30 in Australia/Darwin,
|
234
|
+
# +10:30 in Australia/Adelaide,
|
235
|
+
# etc.
|
236
|
+
#
|
237
|
+
# Based on the fact, this method only understands the timezone
|
238
|
+
# abbreviations described in RFC 822 and the system timezone, in the
|
239
|
+
# order named. (i.e. a definition in RFC 822 overrides the system
|
240
|
+
# timezone definition.) The system timezone is taken from
|
241
|
+
# <tt>Time.local(year, 1, 1).zone</tt> and
|
242
|
+
# <tt>Time.local(year, 7, 1).zone</tt>.
|
243
|
+
# If the extracted timezone abbreviation does not match any of them,
|
244
|
+
# it is ignored and the given time is regarded as a local time.
|
245
|
+
#
|
246
|
+
# ArgumentError is raised if Date._parse cannot extract information from
|
247
|
+
# +date+ or Time class cannot represent specified date.
|
248
|
+
#
|
249
|
+
# This method can be used as fail-safe for other parsing methods as:
|
250
|
+
#
|
251
|
+
# Time.rfc2822(date) rescue Time.parse(date)
|
252
|
+
# Time.httpdate(date) rescue Time.parse(date)
|
253
|
+
# Time.xmlschema(date) rescue Time.parse(date)
|
254
|
+
#
|
255
|
+
# A failure for Time.parse should be checked, though.
|
256
|
+
#
|
257
|
+
def parse(date, now=self.now)
|
258
|
+
d = Date._parse(date, false)
|
259
|
+
year = d[:year]
|
260
|
+
year = yield(year) if year && block_given?
|
261
|
+
make_time(year, d[:mon], d[:mday], d[:hour], d[:min], d[:sec], d[:sec_fraction], d[:zone], now)
|
262
|
+
end
|
263
|
+
|
264
|
+
#
|
265
|
+
# Parses +date+ using Date._strptime and converts it to a Time object.
|
266
|
+
#
|
267
|
+
# If a block is given, the year described in +date+ is converted by the
|
268
|
+
# block. For example:
|
269
|
+
#
|
270
|
+
# Time.strptime(...) {|y| y < 100 ? (y >= 69 ? y + 1900 : y + 2000) : y}
|
271
|
+
def strptime(date, format, now=self.now)
|
272
|
+
d = Date._strptime(date, format)
|
273
|
+
raise ArgumentError, "invalid strptime format - `#{format}'" unless d
|
274
|
+
year = d[:year]
|
275
|
+
year = yield(year) if year && block_given?
|
276
|
+
make_time(year, d[:mon], d[:mday], d[:hour], d[:min], d[:sec], d[:sec_fraction], d[:zone], now)
|
277
|
+
end
|
278
|
+
|
279
|
+
MonthValue = {
|
280
|
+
'JAN' => 1, 'FEB' => 2, 'MAR' => 3, 'APR' => 4, 'MAY' => 5, 'JUN' => 6,
|
281
|
+
'JUL' => 7, 'AUG' => 8, 'SEP' => 9, 'OCT' =>10, 'NOV' =>11, 'DEC' =>12
|
282
|
+
}
|
283
|
+
|
284
|
+
#
|
285
|
+
# Parses +date+ as date-time defined by RFC 2822 and converts it to a Time
|
286
|
+
# object. The format is identical to the date format defined by RFC 822 and
|
287
|
+
# updated by RFC 1123.
|
288
|
+
#
|
289
|
+
# ArgumentError is raised if +date+ is not compliant with RFC 2822
|
290
|
+
# or Time class cannot represent specified date.
|
291
|
+
#
|
292
|
+
# See #rfc2822 for more information on this format.
|
293
|
+
#
|
294
|
+
def rfc2822(date)
|
295
|
+
if /\A\s*
|
296
|
+
(?:(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)\s*,\s*)?
|
297
|
+
(\d{1,2})\s+
|
298
|
+
(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+
|
299
|
+
(\d{2,})\s+
|
300
|
+
(\d{2})\s*
|
301
|
+
:\s*(\d{2})\s*
|
302
|
+
(?::\s*(\d{2}))?\s+
|
303
|
+
([+-]\d{4}|
|
304
|
+
UT|GMT|EST|EDT|CST|CDT|MST|MDT|PST|PDT|[A-IK-Z])/ix =~ date
|
305
|
+
# Since RFC 2822 permit comments, the regexp has no right anchor.
|
306
|
+
day = $1.to_i
|
307
|
+
mon = MonthValue[$2.upcase]
|
308
|
+
year = $3.to_i
|
309
|
+
hour = $4.to_i
|
310
|
+
min = $5.to_i
|
311
|
+
sec = $6 ? $6.to_i : 0
|
312
|
+
zone = $7
|
313
|
+
|
314
|
+
# following year completion is compliant with RFC 2822.
|
315
|
+
year = if year < 50
|
316
|
+
2000 + year
|
317
|
+
elsif year < 1000
|
318
|
+
1900 + year
|
319
|
+
else
|
320
|
+
year
|
321
|
+
end
|
322
|
+
|
323
|
+
year, mon, day, hour, min, sec =
|
324
|
+
apply_offset(year, mon, day, hour, min, sec, zone_offset(zone))
|
325
|
+
t = self.utc(year, mon, day, hour, min, sec)
|
326
|
+
t.localtime if !zone_utc?(zone)
|
327
|
+
t
|
328
|
+
else
|
329
|
+
raise ArgumentError.new("not RFC 2822 compliant date: #{date.inspect}")
|
330
|
+
end
|
331
|
+
end
|
332
|
+
alias rfc822 rfc2822
|
333
|
+
|
334
|
+
#
|
335
|
+
# Parses +date+ as HTTP-date defined by RFC 2616 and converts it to a Time
|
336
|
+
# object.
|
337
|
+
#
|
338
|
+
# ArgumentError is raised if +date+ is not compliant with RFC 2616 or Time
|
339
|
+
# class cannot represent specified date.
|
340
|
+
#
|
341
|
+
# See #httpdate for more information on this format.
|
342
|
+
#
|
343
|
+
def httpdate(date)
|
344
|
+
if /\A\s*
|
345
|
+
(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun),\x20
|
346
|
+
(\d{2})\x20
|
347
|
+
(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\x20
|
348
|
+
(\d{4})\x20
|
349
|
+
(\d{2}):(\d{2}):(\d{2})\x20
|
350
|
+
GMT
|
351
|
+
\s*\z/ix =~ date
|
352
|
+
self.rfc2822(date)
|
353
|
+
elsif /\A\s*
|
354
|
+
(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday),\x20
|
355
|
+
(\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d)\x20
|
356
|
+
(\d\d):(\d\d):(\d\d)\x20
|
357
|
+
GMT
|
358
|
+
\s*\z/ix =~ date
|
359
|
+
year = $3.to_i
|
360
|
+
if year < 50
|
361
|
+
year += 2000
|
362
|
+
else
|
363
|
+
year += 1900
|
364
|
+
end
|
365
|
+
self.utc(year, $2, $1.to_i, $4.to_i, $5.to_i, $6.to_i)
|
366
|
+
elsif /\A\s*
|
367
|
+
(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)\x20
|
368
|
+
(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\x20
|
369
|
+
(\d\d|\x20\d)\x20
|
370
|
+
(\d\d):(\d\d):(\d\d)\x20
|
371
|
+
(\d{4})
|
372
|
+
\s*\z/ix =~ date
|
373
|
+
self.utc($6.to_i, MonthValue[$1.upcase], $2.to_i,
|
374
|
+
$3.to_i, $4.to_i, $5.to_i)
|
375
|
+
else
|
376
|
+
raise ArgumentError.new("not RFC 2616 compliant date: #{date.inspect}")
|
377
|
+
end
|
378
|
+
end
|
379
|
+
|
380
|
+
#
|
381
|
+
# Parses +date+ as dateTime defined by XML Schema and converts it to a Time
|
382
|
+
# object. The format is restricted version of the format defined by ISO
|
383
|
+
# 8601.
|
384
|
+
#
|
385
|
+
# ArgumentError is raised if +date+ is not compliant with the format or Time
|
386
|
+
# class cannot represent specified date.
|
387
|
+
#
|
388
|
+
# See #xmlschema for more information on this format.
|
389
|
+
#
|
390
|
+
def xmlschema(date)
|
391
|
+
if /\A\s*
|
392
|
+
(-?\d+)-(\d\d)-(\d\d)
|
393
|
+
T
|
394
|
+
(\d\d):(\d\d):(\d\d)
|
395
|
+
(\.\d+)?
|
396
|
+
(Z|[+-]\d\d:\d\d)?
|
397
|
+
\s*\z/ix =~ date
|
398
|
+
year = $1.to_i
|
399
|
+
mon = $2.to_i
|
400
|
+
day = $3.to_i
|
401
|
+
hour = $4.to_i
|
402
|
+
min = $5.to_i
|
403
|
+
sec = $6.to_i
|
404
|
+
usec = 0
|
405
|
+
if $7
|
406
|
+
usec = Rational($7) * 1000000
|
407
|
+
end
|
408
|
+
if $8
|
409
|
+
zone = $8
|
410
|
+
year, mon, day, hour, min, sec =
|
411
|
+
apply_offset(year, mon, day, hour, min, sec, zone_offset(zone))
|
412
|
+
self.utc(year, mon, day, hour, min, sec, usec)
|
413
|
+
else
|
414
|
+
self.local(year, mon, day, hour, min, sec, usec)
|
415
|
+
end
|
416
|
+
else
|
417
|
+
raise ArgumentError.new("invalid date: #{date.inspect}")
|
418
|
+
end
|
419
|
+
end
|
420
|
+
alias iso8601 xmlschema
|
421
|
+
end # class << self
|
422
|
+
|
423
|
+
#
|
424
|
+
# Returns a string which represents the time as date-time defined by RFC 2822:
|
425
|
+
#
|
426
|
+
# day-of-week, DD month-name CCYY hh:mm:ss zone
|
427
|
+
#
|
428
|
+
# where zone is [+-]hhmm.
|
429
|
+
#
|
430
|
+
# If +self+ is a UTC time, -0000 is used as zone.
|
431
|
+
#
|
432
|
+
def rfc2822
|
433
|
+
sprintf('%s, %02d %s %d %02d:%02d:%02d ',
|
434
|
+
RFC2822_DAY_NAME[wday],
|
435
|
+
day, RFC2822_MONTH_NAME[mon-1], year,
|
436
|
+
hour, min, sec) +
|
437
|
+
if utc?
|
438
|
+
'-0000'
|
439
|
+
else
|
440
|
+
off = utc_offset
|
441
|
+
sign = off < 0 ? '-' : '+'
|
442
|
+
sprintf('%s%02d%02d', sign, *(off.abs / 60).divmod(60))
|
443
|
+
end
|
444
|
+
end
|
445
|
+
alias rfc822 rfc2822
|
446
|
+
|
447
|
+
RFC2822_DAY_NAME = [
|
448
|
+
'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'
|
449
|
+
]
|
450
|
+
RFC2822_MONTH_NAME = [
|
451
|
+
'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
|
452
|
+
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
|
453
|
+
]
|
454
|
+
|
455
|
+
#
|
456
|
+
# Returns a string which represents the time as rfc1123-date of HTTP-date
|
457
|
+
# defined by RFC 2616:
|
458
|
+
#
|
459
|
+
# day-of-week, DD month-name CCYY hh:mm:ss GMT
|
460
|
+
#
|
461
|
+
# Note that the result is always UTC (GMT).
|
462
|
+
#
|
463
|
+
def httpdate
|
464
|
+
t = dup.utc
|
465
|
+
sprintf('%s, %02d %s %d %02d:%02d:%02d GMT',
|
466
|
+
RFC2822_DAY_NAME[t.wday],
|
467
|
+
t.day, RFC2822_MONTH_NAME[t.mon-1], t.year,
|
468
|
+
t.hour, t.min, t.sec)
|
469
|
+
end
|
470
|
+
|
471
|
+
#
|
472
|
+
# Returns a string which represents the time as dateTime defined by XML
|
473
|
+
# Schema:
|
474
|
+
#
|
475
|
+
# CCYY-MM-DDThh:mm:ssTZD
|
476
|
+
# CCYY-MM-DDThh:mm:ss.sssTZD
|
477
|
+
#
|
478
|
+
# where TZD is Z or [+-]hh:mm.
|
479
|
+
#
|
480
|
+
# If self is a UTC time, Z is used as TZD. [+-]hh:mm is used otherwise.
|
481
|
+
#
|
482
|
+
# +fractional_seconds+ specifies a number of digits of fractional seconds.
|
483
|
+
# Its default value is 0.
|
484
|
+
#
|
485
|
+
def xmlschema(fraction_digits=0)
|
486
|
+
sprintf('%d-%02d-%02dT%02d:%02d:%02d',
|
487
|
+
year, mon, day, hour, min, sec) +
|
488
|
+
if fraction_digits == 0
|
489
|
+
''
|
490
|
+
elsif fraction_digits <= 9
|
491
|
+
'.' + sprintf('%09d', nsec)[0, fraction_digits]
|
492
|
+
else
|
493
|
+
'.' + sprintf('%09d', nsec) + '0' * (fraction_digits - 9)
|
494
|
+
end +
|
495
|
+
if utc?
|
496
|
+
'Z'
|
497
|
+
else
|
498
|
+
off = utc_offset
|
499
|
+
sign = off < 0 ? '-' : '+'
|
500
|
+
sprintf('%s%02d:%02d', sign, *(off.abs / 60).divmod(60))
|
501
|
+
end
|
502
|
+
end
|
503
|
+
alias iso8601 xmlschema
|
504
|
+
end
|
505
|
+
|
506
|
+
if __FILE__ == $0
|
507
|
+
require 'test/unit'
|
508
|
+
|
509
|
+
class TimeExtentionTest < Test::Unit::TestCase # :nodoc:
|
510
|
+
def test_rfc822
|
511
|
+
assert_equal(Time.utc(1976, 8, 26, 14, 30) + 4 * 3600,
|
512
|
+
Time.rfc2822("26 Aug 76 14:30 EDT"))
|
513
|
+
assert_equal(Time.utc(1976, 8, 27, 9, 32) + 7 * 3600,
|
514
|
+
Time.rfc2822("27 Aug 76 09:32 PDT"))
|
515
|
+
end
|
516
|
+
|
517
|
+
def test_rfc2822
|
518
|
+
assert_equal(Time.utc(1997, 11, 21, 9, 55, 6) + 6 * 3600,
|
519
|
+
Time.rfc2822("Fri, 21 Nov 1997 09:55:06 -0600"))
|
520
|
+
assert_equal(Time.utc(2003, 7, 1, 10, 52, 37) - 2 * 3600,
|
521
|
+
Time.rfc2822("Tue, 1 Jul 2003 10:52:37 +0200"))
|
522
|
+
assert_equal(Time.utc(1997, 11, 21, 10, 1, 10) + 6 * 3600,
|
523
|
+
Time.rfc2822("Fri, 21 Nov 1997 10:01:10 -0600"))
|
524
|
+
assert_equal(Time.utc(1997, 11, 21, 11, 0, 0) + 6 * 3600,
|
525
|
+
Time.rfc2822("Fri, 21 Nov 1997 11:00:00 -0600"))
|
526
|
+
assert_equal(Time.utc(1997, 11, 24, 14, 22, 1) + 8 * 3600,
|
527
|
+
Time.rfc2822("Mon, 24 Nov 1997 14:22:01 -0800"))
|
528
|
+
begin
|
529
|
+
Time.at(-1)
|
530
|
+
rescue ArgumentError
|
531
|
+
# ignore
|
532
|
+
else
|
533
|
+
assert_equal(Time.utc(1969, 2, 13, 23, 32, 54) + 3 * 3600 + 30 * 60,
|
534
|
+
Time.rfc2822("Thu, 13 Feb 1969 23:32:54 -0330"))
|
535
|
+
assert_equal(Time.utc(1969, 2, 13, 23, 32, 0) + 3 * 3600 + 30 * 60,
|
536
|
+
Time.rfc2822(" Thu,
|
537
|
+
13
|
538
|
+
Feb
|
539
|
+
1969
|
540
|
+
23:32
|
541
|
+
-0330 (Newfoundland Time)"))
|
542
|
+
end
|
543
|
+
assert_equal(Time.utc(1997, 11, 21, 9, 55, 6),
|
544
|
+
Time.rfc2822("21 Nov 97 09:55:06 GMT"))
|
545
|
+
assert_equal(Time.utc(1997, 11, 21, 9, 55, 6) + 6 * 3600,
|
546
|
+
Time.rfc2822("Fri, 21 Nov 1997 09 : 55 : 06 -0600"))
|
547
|
+
assert_raise(ArgumentError) {
|
548
|
+
# inner comment is not supported.
|
549
|
+
Time.rfc2822("Fri, 21 Nov 1997 09(comment): 55 : 06 -0600")
|
550
|
+
}
|
551
|
+
end
|
552
|
+
|
553
|
+
def test_rfc2616
|
554
|
+
t = Time.utc(1994, 11, 6, 8, 49, 37)
|
555
|
+
assert_equal(t, Time.httpdate("Sun, 06 Nov 1994 08:49:37 GMT"))
|
556
|
+
assert_equal(t, Time.httpdate("Sunday, 06-Nov-94 08:49:37 GMT"))
|
557
|
+
assert_equal(t, Time.httpdate("Sun Nov 6 08:49:37 1994"))
|
558
|
+
assert_equal(Time.utc(1995, 11, 15, 6, 25, 24),
|
559
|
+
Time.httpdate("Wed, 15 Nov 1995 06:25:24 GMT"))
|
560
|
+
assert_equal(Time.utc(1995, 11, 15, 4, 58, 8),
|
561
|
+
Time.httpdate("Wed, 15 Nov 1995 04:58:08 GMT"))
|
562
|
+
assert_equal(Time.utc(1994, 11, 15, 8, 12, 31),
|
563
|
+
Time.httpdate("Tue, 15 Nov 1994 08:12:31 GMT"))
|
564
|
+
assert_equal(Time.utc(1994, 12, 1, 16, 0, 0),
|
565
|
+
Time.httpdate("Thu, 01 Dec 1994 16:00:00 GMT"))
|
566
|
+
assert_equal(Time.utc(1994, 10, 29, 19, 43, 31),
|
567
|
+
Time.httpdate("Sat, 29 Oct 1994 19:43:31 GMT"))
|
568
|
+
assert_equal(Time.utc(1994, 11, 15, 12, 45, 26),
|
569
|
+
Time.httpdate("Tue, 15 Nov 1994 12:45:26 GMT"))
|
570
|
+
assert_equal(Time.utc(1999, 12, 31, 23, 59, 59),
|
571
|
+
Time.httpdate("Fri, 31 Dec 1999 23:59:59 GMT"))
|
572
|
+
|
573
|
+
assert_equal(Time.utc(2007, 12, 23, 11, 22, 33),
|
574
|
+
Time.httpdate('Sunday, 23-Dec-07 11:22:33 GMT'))
|
575
|
+
end
|
576
|
+
|
577
|
+
def test_rfc3339
|
578
|
+
t = Time.utc(1985, 4, 12, 23, 20, 50, 520000)
|
579
|
+
s = "1985-04-12T23:20:50.52Z"
|
580
|
+
assert_equal(t, Time.iso8601(s))
|
581
|
+
assert_equal(s, t.iso8601(2))
|
582
|
+
|
583
|
+
t = Time.utc(1996, 12, 20, 0, 39, 57)
|
584
|
+
s = "1996-12-19T16:39:57-08:00"
|
585
|
+
assert_equal(t, Time.iso8601(s))
|
586
|
+
# There is no way to generate time string with arbitrary timezone.
|
587
|
+
s = "1996-12-20T00:39:57Z"
|
588
|
+
assert_equal(t, Time.iso8601(s))
|
589
|
+
assert_equal(s, t.iso8601)
|
590
|
+
|
591
|
+
t = Time.utc(1990, 12, 31, 23, 59, 60)
|
592
|
+
s = "1990-12-31T23:59:60Z"
|
593
|
+
assert_equal(t, Time.iso8601(s))
|
594
|
+
# leap second is representable only if timezone file has it.
|
595
|
+
s = "1990-12-31T15:59:60-08:00"
|
596
|
+
assert_equal(t, Time.iso8601(s))
|
597
|
+
|
598
|
+
begin
|
599
|
+
Time.at(-1)
|
600
|
+
rescue ArgumentError
|
601
|
+
# ignore
|
602
|
+
else
|
603
|
+
t = Time.utc(1937, 1, 1, 11, 40, 27, 870000)
|
604
|
+
s = "1937-01-01T12:00:27.87+00:20"
|
605
|
+
assert_equal(t, Time.iso8601(s))
|
606
|
+
end
|
607
|
+
end
|
608
|
+
|
609
|
+
# http://www.w3.org/TR/xmlschema-2/
|
610
|
+
def test_xmlschema
|
611
|
+
assert_equal(Time.utc(1999, 5, 31, 13, 20, 0) + 5 * 3600,
|
612
|
+
Time.xmlschema("1999-05-31T13:20:00-05:00"))
|
613
|
+
assert_equal(Time.local(2000, 1, 20, 12, 0, 0),
|
614
|
+
Time.xmlschema("2000-01-20T12:00:00"))
|
615
|
+
assert_equal(Time.utc(2000, 1, 20, 12, 0, 0),
|
616
|
+
Time.xmlschema("2000-01-20T12:00:00Z"))
|
617
|
+
assert_equal(Time.utc(2000, 1, 20, 12, 0, 0) - 12 * 3600,
|
618
|
+
Time.xmlschema("2000-01-20T12:00:00+12:00"))
|
619
|
+
assert_equal(Time.utc(2000, 1, 20, 12, 0, 0) + 13 * 3600,
|
620
|
+
Time.xmlschema("2000-01-20T12:00:00-13:00"))
|
621
|
+
assert_equal(Time.utc(2000, 3, 4, 23, 0, 0) - 3 * 3600,
|
622
|
+
Time.xmlschema("2000-03-04T23:00:00+03:00"))
|
623
|
+
assert_equal(Time.utc(2000, 3, 4, 20, 0, 0),
|
624
|
+
Time.xmlschema("2000-03-04T20:00:00Z"))
|
625
|
+
assert_equal(Time.local(2000, 1, 15, 0, 0, 0),
|
626
|
+
Time.xmlschema("2000-01-15T00:00:00"))
|
627
|
+
assert_equal(Time.local(2000, 2, 15, 0, 0, 0),
|
628
|
+
Time.xmlschema("2000-02-15T00:00:00"))
|
629
|
+
assert_equal(Time.local(2000, 1, 15, 12, 0, 0),
|
630
|
+
Time.xmlschema("2000-01-15T12:00:00"))
|
631
|
+
assert_equal(Time.utc(2000, 1, 16, 12, 0, 0),
|
632
|
+
Time.xmlschema("2000-01-16T12:00:00Z"))
|
633
|
+
assert_equal(Time.local(2000, 1, 1, 12, 0, 0),
|
634
|
+
Time.xmlschema("2000-01-01T12:00:00"))
|
635
|
+
assert_equal(Time.utc(1999, 12, 31, 23, 0, 0),
|
636
|
+
Time.xmlschema("1999-12-31T23:00:00Z"))
|
637
|
+
assert_equal(Time.local(2000, 1, 16, 12, 0, 0),
|
638
|
+
Time.xmlschema("2000-01-16T12:00:00"))
|
639
|
+
assert_equal(Time.local(2000, 1, 16, 0, 0, 0),
|
640
|
+
Time.xmlschema("2000-01-16T00:00:00"))
|
641
|
+
assert_equal(Time.utc(2000, 1, 12, 12, 13, 14),
|
642
|
+
Time.xmlschema("2000-01-12T12:13:14Z"))
|
643
|
+
assert_equal(Time.utc(2001, 4, 17, 19, 23, 17, 300000),
|
644
|
+
Time.xmlschema("2001-04-17T19:23:17.3Z"))
|
645
|
+
assert_raise(ArgumentError) { Time.xmlschema("2000-01-01T00:00:00.+00:00") }
|
646
|
+
end
|
647
|
+
|
648
|
+
def test_encode_xmlschema
|
649
|
+
t = Time.utc(2001, 4, 17, 19, 23, 17, 300000)
|
650
|
+
assert_equal("2001-04-17T19:23:17Z", t.xmlschema)
|
651
|
+
assert_equal("2001-04-17T19:23:17.3Z", t.xmlschema(1))
|
652
|
+
assert_equal("2001-04-17T19:23:17.300000Z", t.xmlschema(6))
|
653
|
+
assert_equal("2001-04-17T19:23:17.3000000Z", t.xmlschema(7))
|
654
|
+
|
655
|
+
t = Time.utc(2001, 4, 17, 19, 23, 17, 123456)
|
656
|
+
assert_equal("2001-04-17T19:23:17.1234560Z", t.xmlschema(7))
|
657
|
+
assert_equal("2001-04-17T19:23:17.123456Z", t.xmlschema(6))
|
658
|
+
assert_equal("2001-04-17T19:23:17.12345Z", t.xmlschema(5))
|
659
|
+
assert_equal("2001-04-17T19:23:17.1Z", t.xmlschema(1))
|
660
|
+
|
661
|
+
begin
|
662
|
+
Time.at(-1)
|
663
|
+
rescue ArgumentError
|
664
|
+
# ignore
|
665
|
+
else
|
666
|
+
t = Time.utc(1960, 12, 31, 23, 0, 0, 123456)
|
667
|
+
assert_equal("1960-12-31T23:00:00.123456Z", t.xmlschema(6))
|
668
|
+
end
|
669
|
+
|
670
|
+
assert_equal(249, Time.xmlschema("2008-06-05T23:49:23.000249+09:00").usec)
|
671
|
+
end
|
672
|
+
|
673
|
+
def test_completion
|
674
|
+
now = Time.local(2001,11,29,21,26,35)
|
675
|
+
assert_equal(Time.local( 2001,11,29,21,12),
|
676
|
+
Time.parse("2001/11/29 21:12", now))
|
677
|
+
assert_equal(Time.local( 2001,11,29),
|
678
|
+
Time.parse("2001/11/29", now))
|
679
|
+
assert_equal(Time.local( 2001,11,29),
|
680
|
+
Time.parse( "11/29", now))
|
681
|
+
#assert_equal(Time.local(2001,11,1), Time.parse("Nov", now))
|
682
|
+
assert_equal(Time.local( 2001,11,29,10,22),
|
683
|
+
Time.parse( "10:22", now))
|
684
|
+
end
|
685
|
+
|
686
|
+
def test_invalid
|
687
|
+
# They were actually used in some web sites.
|
688
|
+
assert_raise(ArgumentError) { Time.httpdate("1 Dec 2001 10:23:57 GMT") }
|
689
|
+
assert_raise(ArgumentError) { Time.httpdate("Sat, 1 Dec 2001 10:25:42 GMT") }
|
690
|
+
assert_raise(ArgumentError) { Time.httpdate("Sat, 1-Dec-2001 10:53:55 GMT") }
|
691
|
+
assert_raise(ArgumentError) { Time.httpdate("Saturday, 01-Dec-2001 10:15:34 GMT") }
|
692
|
+
assert_raise(ArgumentError) { Time.httpdate("Saturday, 01-Dec-101 11:10:07 GMT") }
|
693
|
+
assert_raise(ArgumentError) { Time.httpdate("Fri, 30 Nov 2001 21:30:00 JST") }
|
694
|
+
|
695
|
+
# They were actually used in some mails.
|
696
|
+
assert_raise(ArgumentError) { Time.rfc2822("01-5-20") }
|
697
|
+
assert_raise(ArgumentError) { Time.rfc2822("7/21/00") }
|
698
|
+
assert_raise(ArgumentError) { Time.rfc2822("2001-8-28") }
|
699
|
+
assert_raise(ArgumentError) { Time.rfc2822("00-5-6 1:13:06") }
|
700
|
+
assert_raise(ArgumentError) { Time.rfc2822("2001-9-27 9:36:49") }
|
701
|
+
assert_raise(ArgumentError) { Time.rfc2822("2000-12-13 11:01:11") }
|
702
|
+
assert_raise(ArgumentError) { Time.rfc2822("2001/10/17 04:29:55") }
|
703
|
+
assert_raise(ArgumentError) { Time.rfc2822("9/4/2001 9:23:19 PM") }
|
704
|
+
assert_raise(ArgumentError) { Time.rfc2822("01 Nov 2001 09:04:31") }
|
705
|
+
assert_raise(ArgumentError) { Time.rfc2822("13 Feb 2001 16:4 GMT") }
|
706
|
+
assert_raise(ArgumentError) { Time.rfc2822("01 Oct 00 5:41:19 PM") }
|
707
|
+
assert_raise(ArgumentError) { Time.rfc2822("2 Jul 00 00:51:37 JST") }
|
708
|
+
assert_raise(ArgumentError) { Time.rfc2822("01 11 2001 06:55:57 -0500") }
|
709
|
+
assert_raise(ArgumentError) { Time.rfc2822("18 \343\366\356\341\370 2000") }
|
710
|
+
assert_raise(ArgumentError) { Time.rfc2822("Fri, Oct 2001 18:53:32") }
|
711
|
+
assert_raise(ArgumentError) { Time.rfc2822("Fri, 2 Nov 2001 03:47:54") }
|
712
|
+
assert_raise(ArgumentError) { Time.rfc2822("Fri, 27 Jul 2001 11.14.14 +0200") }
|
713
|
+
assert_raise(ArgumentError) { Time.rfc2822("Thu, 2 Nov 2000 04:13:53 -600") }
|
714
|
+
assert_raise(ArgumentError) { Time.rfc2822("Wed, 5 Apr 2000 22:57:09 JST") }
|
715
|
+
assert_raise(ArgumentError) { Time.rfc2822("Mon, 11 Sep 2000 19:47:33 00000") }
|
716
|
+
assert_raise(ArgumentError) { Time.rfc2822("Fri, 28 Apr 2000 20:40:47 +-900") }
|
717
|
+
assert_raise(ArgumentError) { Time.rfc2822("Fri, 19 Jan 2001 8:15:36 AM -0500") }
|
718
|
+
assert_raise(ArgumentError) { Time.rfc2822("Thursday, Sep 27 2001 7:42:35 AM EST") }
|
719
|
+
assert_raise(ArgumentError) { Time.rfc2822("3/11/2001 1:31:57 PM Pacific Daylight Time") }
|
720
|
+
assert_raise(ArgumentError) { Time.rfc2822("Mi, 28 Mrz 2001 11:51:36") }
|
721
|
+
assert_raise(ArgumentError) { Time.rfc2822("P, 30 sept 2001 23:03:14") }
|
722
|
+
assert_raise(ArgumentError) { Time.rfc2822("fr, 11 aug 2000 18:39:22") }
|
723
|
+
assert_raise(ArgumentError) { Time.rfc2822("Fr, 21 Sep 2001 17:44:03 -1000") }
|
724
|
+
assert_raise(ArgumentError) { Time.rfc2822("Mo, 18 Jun 2001 19:21:40 -1000") }
|
725
|
+
assert_raise(ArgumentError) { Time.rfc2822("l\366, 12 aug 2000 18:53:20") }
|
726
|
+
assert_raise(ArgumentError) { Time.rfc2822("l\366, 26 maj 2001 00:15:58") }
|
727
|
+
assert_raise(ArgumentError) { Time.rfc2822("Dom, 30 Sep 2001 17:36:30") }
|
728
|
+
assert_raise(ArgumentError) { Time.rfc2822("%&, 31 %2/ 2000 15:44:47 -0500") }
|
729
|
+
assert_raise(ArgumentError) { Time.rfc2822("dom, 26 ago 2001 03:57:07 -0300") }
|
730
|
+
assert_raise(ArgumentError) { Time.rfc2822("ter, 04 set 2001 16:27:58 -0300") }
|
731
|
+
assert_raise(ArgumentError) { Time.rfc2822("Wen, 3 oct 2001 23:17:49 -0400") }
|
732
|
+
assert_raise(ArgumentError) { Time.rfc2822("Wen, 3 oct 2001 23:17:49 -0400") }
|
733
|
+
assert_raise(ArgumentError) { Time.rfc2822("ele, 11 h: 2000 12:42:15 -0500") }
|
734
|
+
assert_raise(ArgumentError) { Time.rfc2822("Tue, 14 Aug 2001 3:55:3 +0200") }
|
735
|
+
assert_raise(ArgumentError) { Time.rfc2822("Fri, 25 Aug 2000 9:3:48 +0800") }
|
736
|
+
assert_raise(ArgumentError) { Time.rfc2822("Fri, 1 Dec 2000 0:57:50 EST") }
|
737
|
+
assert_raise(ArgumentError) { Time.rfc2822("Mon, 7 May 2001 9:39:51 +0200") }
|
738
|
+
assert_raise(ArgumentError) { Time.rfc2822("Wed, 1 Aug 2001 16:9:15 +0200") }
|
739
|
+
assert_raise(ArgumentError) { Time.rfc2822("Wed, 23 Aug 2000 9:17:36 +0800") }
|
740
|
+
assert_raise(ArgumentError) { Time.rfc2822("Fri, 11 Aug 2000 10:4:42 +0800") }
|
741
|
+
assert_raise(ArgumentError) { Time.rfc2822("Sat, 15 Sep 2001 13:22:2 +0300") }
|
742
|
+
assert_raise(ArgumentError) { Time.rfc2822("Wed,16 \276\305\324\302 2001 20:06:25 +0800") }
|
743
|
+
assert_raise(ArgumentError) { Time.rfc2822("Wed,7 \312\256\322\273\324\302 2001 23:47:22 +0800") }
|
744
|
+
assert_raise(ArgumentError) { Time.rfc2822("=?iso-8859-1?Q?(=C5=DA),?= 10 2 2001 23:32:26 +0900 (JST)") }
|
745
|
+
assert_raise(ArgumentError) { Time.rfc2822("\307\341\314\343\332\311, 30 \344\346\335\343\310\321 2001 10:01:06") }
|
746
|
+
assert_raise(ArgumentError) { Time.rfc2822("=?iso-8859-1?Q?(=BF=E5),?= 12 =?iso-8859-1?Q?9=B7=EE?= 2001 14:52:41\n+0900 (JST)") }
|
747
|
+
end
|
748
|
+
|
749
|
+
def test_zone_0000
|
750
|
+
assert_equal(true, Time.parse("2000-01-01T00:00:00Z").utc?)
|
751
|
+
assert_equal(true, Time.parse("2000-01-01T00:00:00-00:00").utc?)
|
752
|
+
assert_equal(false, Time.parse("2000-01-01T00:00:00+00:00").utc?)
|
753
|
+
assert_equal(false, Time.parse("Sat, 01 Jan 2000 00:00:00 GMT").utc?)
|
754
|
+
assert_equal(true, Time.parse("Sat, 01 Jan 2000 00:00:00 -0000").utc?)
|
755
|
+
assert_equal(false, Time.parse("Sat, 01 Jan 2000 00:00:00 +0000").utc?)
|
756
|
+
assert_equal(false, Time.rfc2822("Sat, 01 Jan 2000 00:00:00 GMT").utc?)
|
757
|
+
assert_equal(true, Time.rfc2822("Sat, 01 Jan 2000 00:00:00 -0000").utc?)
|
758
|
+
assert_equal(false, Time.rfc2822("Sat, 01 Jan 2000 00:00:00 +0000").utc?)
|
759
|
+
assert_equal(true, Time.rfc2822("Sat, 01 Jan 2000 00:00:00 UTC").utc?)
|
760
|
+
end
|
761
|
+
|
762
|
+
def test_rfc2822_utc_roundtrip_winter
|
763
|
+
t1 = Time.local(2008,12,1)
|
764
|
+
t2 = Time.rfc2822(t1.rfc2822)
|
765
|
+
assert_equal(t1.utc?, t2.utc?, "[ruby-dev:37126]")
|
766
|
+
end
|
767
|
+
|
768
|
+
def test_rfc2822_utc_roundtrip_summer
|
769
|
+
t1 = Time.local(2008,8,1)
|
770
|
+
t2 = Time.rfc2822(t1.rfc2822)
|
771
|
+
assert_equal(t1.utc?, t2.utc?)
|
772
|
+
end
|
773
|
+
|
774
|
+
def test_parse_leap_second
|
775
|
+
t = Time.utc(1998,12,31,23,59,59)
|
776
|
+
assert_equal(t, Time.parse("Thu Dec 31 23:59:59 UTC 1998"))
|
777
|
+
assert_equal(t, Time.parse("Fri Dec 31 23:59:59 -0000 1998"));t.localtime
|
778
|
+
assert_equal(t, Time.parse("Fri Jan 1 08:59:59 +0900 1999"))
|
779
|
+
assert_equal(t, Time.parse("Fri Jan 1 00:59:59 +0100 1999"))
|
780
|
+
assert_equal(t, Time.parse("Fri Dec 31 23:59:59 +0000 1998"))
|
781
|
+
assert_equal(t, Time.parse("Fri Dec 31 22:59:59 -0100 1998"));t.utc
|
782
|
+
t += 1
|
783
|
+
assert_equal(t, Time.parse("Thu Dec 31 23:59:60 UTC 1998"))
|
784
|
+
assert_equal(t, Time.parse("Fri Dec 31 23:59:60 -0000 1998"));t.localtime
|
785
|
+
assert_equal(t, Time.parse("Fri Jan 1 08:59:60 +0900 1999"))
|
786
|
+
assert_equal(t, Time.parse("Fri Jan 1 00:59:60 +0100 1999"))
|
787
|
+
assert_equal(t, Time.parse("Fri Dec 31 23:59:60 +0000 1998"))
|
788
|
+
assert_equal(t, Time.parse("Fri Dec 31 22:59:60 -0100 1998"));t.utc
|
789
|
+
t += 1 if t.sec == 60
|
790
|
+
assert_equal(t, Time.parse("Thu Jan 1 00:00:00 UTC 1999"))
|
791
|
+
assert_equal(t, Time.parse("Fri Jan 1 00:00:00 -0000 1999"));t.localtime
|
792
|
+
assert_equal(t, Time.parse("Fri Jan 1 09:00:00 +0900 1999"))
|
793
|
+
assert_equal(t, Time.parse("Fri Jan 1 01:00:00 +0100 1999"))
|
794
|
+
assert_equal(t, Time.parse("Fri Jan 1 00:00:00 +0000 1999"))
|
795
|
+
assert_equal(t, Time.parse("Fri Dec 31 23:00:00 -0100 1998"))
|
796
|
+
end
|
797
|
+
|
798
|
+
def test_rfc2822_leap_second
|
799
|
+
t = Time.utc(1998,12,31,23,59,59)
|
800
|
+
assert_equal(t, Time.rfc2822("Thu, 31 Dec 1998 23:59:59 UTC"))
|
801
|
+
assert_equal(t, Time.rfc2822("Fri, 31 Dec 1998 23:59:59 -0000"));t.localtime
|
802
|
+
assert_equal(t, Time.rfc2822("Fri, 1 Jan 1999 08:59:59 +0900"))
|
803
|
+
assert_equal(t, Time.rfc2822("Fri, 1 Jan 1999 00:59:59 +0100"))
|
804
|
+
assert_equal(t, Time.rfc2822("Fri, 31 Dec 1998 23:59:59 +0000"))
|
805
|
+
assert_equal(t, Time.rfc2822("Fri, 31 Dec 1998 22:59:59 -0100"));t.utc
|
806
|
+
t += 1
|
807
|
+
assert_equal(t, Time.rfc2822("Thu, 31 Dec 1998 23:59:60 UTC"))
|
808
|
+
assert_equal(t, Time.rfc2822("Fri, 31 Dec 1998 23:59:60 -0000"));t.localtime
|
809
|
+
assert_equal(t, Time.rfc2822("Fri, 1 Jan 1999 08:59:60 +0900"))
|
810
|
+
assert_equal(t, Time.rfc2822("Fri, 1 Jan 1999 00:59:60 +0100"))
|
811
|
+
assert_equal(t, Time.rfc2822("Fri, 31 Dec 1998 23:59:60 +0000"))
|
812
|
+
assert_equal(t, Time.rfc2822("Fri, 31 Dec 1998 22:59:60 -0100"));t.utc
|
813
|
+
t += 1 if t.sec == 60
|
814
|
+
assert_equal(t, Time.rfc2822("Thu, 1 Jan 1999 00:00:00 UTC"))
|
815
|
+
assert_equal(t, Time.rfc2822("Fri, 1 Jan 1999 00:00:00 -0000"));t.localtime
|
816
|
+
assert_equal(t, Time.rfc2822("Fri, 1 Jan 1999 09:00:00 +0900"))
|
817
|
+
assert_equal(t, Time.rfc2822("Fri, 1 Jan 1999 01:00:00 +0100"))
|
818
|
+
assert_equal(t, Time.rfc2822("Fri, 1 Jan 1999 00:00:00 +0000"))
|
819
|
+
assert_equal(t, Time.rfc2822("Fri, 31 Dec 1998 23:00:00 -0100"))
|
820
|
+
end
|
821
|
+
|
822
|
+
def test_xmlschema_leap_second
|
823
|
+
t = Time.utc(1998,12,31,23,59,59)
|
824
|
+
assert_equal(t, Time.xmlschema("1998-12-31T23:59:59Z"))
|
825
|
+
assert_equal(t, Time.xmlschema("1998-12-31T23:59:59-00:00"));t.localtime
|
826
|
+
assert_equal(t, Time.xmlschema("1999-01-01T08:59:59+09:00"))
|
827
|
+
assert_equal(t, Time.xmlschema("1999-01-01T00:59:59+01:00"))
|
828
|
+
assert_equal(t, Time.xmlschema("1998-12-31T23:59:59+00:00"))
|
829
|
+
assert_equal(t, Time.xmlschema("1998-12-31T22:59:59-01:00"));t.utc
|
830
|
+
t += 1
|
831
|
+
assert_equal(t, Time.xmlschema("1998-12-31T23:59:60Z"))
|
832
|
+
assert_equal(t, Time.xmlschema("1998-12-31T23:59:60-00:00"));t.localtime
|
833
|
+
assert_equal(t, Time.xmlschema("1999-01-01T08:59:60+09:00"))
|
834
|
+
assert_equal(t, Time.xmlschema("1999-01-01T00:59:60+01:00"))
|
835
|
+
assert_equal(t, Time.xmlschema("1998-12-31T23:59:60+00:00"))
|
836
|
+
assert_equal(t, Time.xmlschema("1998-12-31T22:59:60-01:00"));t.utc
|
837
|
+
t += 1 if t.sec == 60
|
838
|
+
assert_equal(t, Time.xmlschema("1999-01-01T00:00:00Z"))
|
839
|
+
assert_equal(t, Time.xmlschema("1999-01-01T00:00:00-00:00"));t.localtime
|
840
|
+
assert_equal(t, Time.xmlschema("1999-01-01T09:00:00+09:00"))
|
841
|
+
assert_equal(t, Time.xmlschema("1999-01-01T01:00:00+01:00"))
|
842
|
+
assert_equal(t, Time.xmlschema("1999-01-01T00:00:00+00:00"))
|
843
|
+
assert_equal(t, Time.xmlschema("1998-12-31T23:00:00-01:00"))
|
844
|
+
end
|
845
|
+
|
846
|
+
def test_xmlschema_fraction
|
847
|
+
assert_equal(500000, Time.xmlschema("2000-01-01T00:00:00.5+00:00").tv_usec)
|
848
|
+
end
|
849
|
+
|
850
|
+
def test_ruby_talk_152866
|
851
|
+
t = Time::xmlschema('2005-08-30T22:48:00-07:00')
|
852
|
+
assert_equal(31, t.day)
|
853
|
+
assert_equal(8, t.mon)
|
854
|
+
end
|
855
|
+
|
856
|
+
def test_parse_fraction
|
857
|
+
assert_equal(500000, Time.parse("2000-01-01T00:00:00.5+00:00").tv_usec)
|
858
|
+
end
|
859
|
+
|
860
|
+
def test_strptime
|
861
|
+
assert_equal(Time.utc(2005, 8, 28, 06, 54, 20), Time.strptime("28/Aug/2005:06:54:20 +0000", "%d/%b/%Y:%T %z"))
|
862
|
+
end
|
863
|
+
|
864
|
+
def test_nsec
|
865
|
+
assert_equal(123456789, Time.xmlschema("2000-01-01T00:00:00.123456789+00:00").tv_nsec)
|
866
|
+
assert_equal(123456789, Time.parse("2000-01-01T00:00:00.123456789+00:00").tv_nsec)
|
867
|
+
end
|
868
|
+
end
|
869
|
+
end
|