Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added some methods to the class Encoding

  • Loading branch information...
commit 1cb6d4320d2de8acfa017ad88c40d44d61f77654 1 parent dfbd6d8
@BloodyD BloodyD authored
View
68 bin/rdoc
@@ -1,67 +1,19 @@
#!/usr/bin/env maglev-ruby
#
-# RDoc: Documentation tool for source code
-# (see lib/rdoc/rdoc.rb for more information)
+# This file was generated by RubyGems.
#
-# Copyright (c) 2003 Dave Thomas
-# Released under the same terms as Ruby
+# The application 'rdoc' is installed as part of a gem, and
+# this file is here to facilitate running it.
#
-# $Revision: 11708 $
-## Transitional Hack ####
-#
-# RDoc was initially distributed independently, and installed
-# itself into <prefix>/lib/ruby/site_ruby/<ver>/rdoc...
-#
-# Now that RDoc is part of the distribution, it's installed into
-# <prefix>/lib/ruby/<ver>, which unfortunately appears later in the
-# search path. This means that if you have previously installed RDoc,
-# and then install from ruby-lang, you'll pick up the old one by
-# default. This hack checks for the condition, and readjusts the
-# search path if necessary.
-
-def adjust_for_existing_rdoc(path)
-
- $stderr.puts %{
- It seems as if you have a previously-installed RDoc in
- the directory #{path}.
-
- Because this is now out-of-date, you might want to consider
- removing the directories:
-
- #{File.join(path, "rdoc")}
-
- and
+require 'rubygems'
- #{File.join(path, "markup")}
+version = ">= 0"
- }
-
- # Move all the site_ruby directories to the end
- p $:
- $:.replace($:.partition {|path| /site_ruby/ !~ path}.flatten)
- p $:
-end
-
-$:.each do |path|
- if /site_ruby/ =~ path
- rdoc_path = File.join(path, 'rdoc', 'rdoc.rb')
- if File.exists?(rdoc_path)
- adjust_for_existing_rdoc(path)
- break
- end
- end
+if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
+ version = $1
+ ARGV.shift
end
-## End of Transitional Hack ##
-
-
-require 'rdoc/rdoc'
-
-begin
- r = RDoc::RDoc.new
- r.document(ARGV)
-rescue RDoc::RDocError => e
- $stderr.puts e.message
- exit(1)
-end
+gem 'rdoc', version
+load Gem.bin_path('rdoc', 'rdoc', version)
View
53 bin/ri
@@ -1,50 +1,19 @@
#!/usr/bin/env maglev-ruby
-# -*- ruby -*-
-# usage:
#
-# ri name...
+# This file was generated by RubyGems.
#
-# where name can be
+# The application 'rdoc' is installed as part of a gem, and
+# this file is here to facilitate running it.
#
-# Class | Class::method | Class#method | Class.method | method
-#
-# All names may be abbreviated to their minimum unbiguous form. If a name
-# _is_ ambiguous, all valid options will be listed.
-#
-# The form '.' method matches either class or instance methods, while
-# #method matches only instance and ::method matches only class methods.
-#
-#
-# == Installing Documentation
-#
-# 'ri' uses a database of documentation built by the RDoc utility.
-#
-# So, how do you install this documentation on your system?
-# It depends on how you installed Ruby.
-#
-# <em>If you installed Ruby from source files</em> (that is, if it some point
-# you typed 'make' during the process :), you can install the RDoc
-# documentation yourself. Just go back to the place where you have
-# your Ruby source and type
-#
-# make install-doc
-#
-# You'll probably need to do this as a superuser, as the documentation
-# is installed in the Ruby target tree (normally somewhere under
-# <tt>/usr/local</tt>.
-#
-# <em>If you installed Ruby from a binary distribution</em> (perhaps
-# using a one-click installer, or using some other packaging system),
-# then the team that produced the package probably forgot to package
-# the documentation as well. Contact them, and see if they can add
-# it to the next release.
-#
-
-require 'rdoc/ri/ri_driver'
+require 'rubygems'
-######################################################################
+version = ">= 0"
-ri = RiDriver.new
-ri.process_args
+if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
+ version = $1
+ ARGV.shift
+end
+gem 'rdoc', version
+load Gem.bin_path('rdoc', 'ri', version)
View
3  lib/ruby/1.8/zlib.rb
@@ -122,7 +122,8 @@ def orig_name
class GzipReader < GzipFile # {
- def initialize(io)
+ def initialize(io, *args)
+ # TODO: update it to ruby 1.9
@io = io
@zstream = ZStream.open_read(io, Error) # Error resolves to GzipFile::Error
super()
View
10 src/kernel/bootstrap/String.rb
@@ -2037,4 +2037,14 @@ def between?(min, max)
(min <= self) && (self <= max)
end
+ def encode(*args)
+ # TODO
+ self.dup
+ end
+
+ def encode!(*args)
+ # TODO
+ self
+ end
+
end
View
1  src/kernel/bootstrap/String3.rb
@@ -19,4 +19,5 @@ def __extract_base(base)
[ base, $1, $3 ] # result is [ baseFixnum , signString, magnitudeString ]
end
+
end
View
80 src/kernel/common/Encoding.rb
@@ -1,3 +1,79 @@
+class EncodingError < StandardError
+end
+
class Encoding
- UTF_8 = nil
-end
+ class UndefinedConversionError < EncodingError
+ end
+
+ class ConverterNotFoundError < EncodingError
+ end
+
+ class CompatibilityError < EncodingError
+ end
+
+ def initialize
+
+ end
+
+ def self.list
+ []
+ end
+ def self.find(name)
+ end
+
+ def self.aliases
+ end
+
+ def compatible?(obj1, obj2)
+ end
+
+ def self.default_external
+ end
+
+ def self.default_external=(enc)
+ end
+
+ def self.default_internal
+ end
+
+ def self.default_internal=(enc)
+ end
+
+ def self.locale_charmap
+
+ end
+
+ def self.name_list
+
+ end
+
+ def ascii_compatible?
+
+ end
+
+ def dummy?
+
+ end
+
+ def inspect
+ end
+
+ def name
+ end
+
+ def names
+
+ end
+
+
+ def replicate(name)
+
+ end
+
+ def to_s
+
+ end
+
+end
+
+Encoding::UTF_8 = Encoding.new
Please sign in to comment.
Something went wrong with that request. Please try again.