Results for: "pstore"

Returns the number of online processors.

The result is intended as the number of processes to use all available processors.

This method is implemented using:

Example:

require 'etc'
p Etc.nprocessors #=> 4

The result might be smaller number than physical cpus especially when ruby process is bound to specific cpus. This is intended for getting better parallel processing.

Example: (Linux)

linux$ taskset 0x3 ./ruby -retc -e "p Etc.nprocessors"  #=> 2

Change the size of the memory allocated at the memory location addr to size bytes. Returns the memory address of the reallocated memory, which may be different than the address passed in.

Free the memory at address addr

Convert str to ISO-2022-JP

Convert str to ISO-2022-JP

Convert str to EUC-JP

Convert str to EUC-JP

Convert str to Shift_JIS

Convert str to Shift_JIS

Convert str to UTF-8

Convert str to UTF-8

Convert str to UTF-16

Convert str to UTF-16

Convert str to UTF-32

Convert str to UTF-32

Convert self to locale encoding

Convert self to locale encoding

Converts an object id to a reference to the object. May not be called on an object id passed as a parameter to a finalizer.

s = "I am a string"                    #=> "I am a string"
r = ObjectSpace._id2ref(s.object_id)   #=> "I am a string"
r == s                                 #=> true

Returns a Digest subclass by name

require 'openssl'

OpenSSL::Digest("MD5")
# => OpenSSL::Digest::MD5

Digest("Foo")
# => NameError: wrong constant name Foo

Returns a Digest subclass by name

require 'openssl'

OpenSSL::Digest("MD5")
# => OpenSSL::Digest::MD5

Digest("Foo")
# => NameError: wrong constant name Foo

See any remaining errors held in queue.

Any errors you see here are probably due to a bug in Ruby’s OpenSSL implementation.

Shows the prompt and reads the inputted line with line editing. The inputted line is added to the history if add_hist is true.

Returns nil when the inputted line is empty and user inputs EOF (Presses ^D on UNIX).

Raises IOError exception if one of below conditions are satisfied.

  1. stdin was closed.

  2. stdout was closed.

This method supports thread. Switches the thread context when waits inputting line.

Supports line edit when inputs line. Provides VI and Emacs editing mode. Default is Emacs editing mode.

NOTE: Terminates ruby interpreter and does not return the terminal status after user pressed ‘^C’ when wait inputting line. Give 3 examples that avoid it.

Can make as follows with Readline::HISTORY constant. It does not record to the history if the inputted line is empty or the same it as last one.

require "readline"

while buf = Readline.readline("> ", true)
  # p Readline::HISTORY.to_a
  Readline::HISTORY.pop if /^\s*$/ =~ buf

  begin
    if Readline::HISTORY[Readline::HISTORY.length-2] == buf
      Readline::HISTORY.pop
    end
  rescue IndexError
  end

  # p Readline::HISTORY.to_a
  print "-> ", buf, "\n"
end

Change what’s displayed on the screen to reflect the current contents.

See GNU Readline’s rl_redisplay function.

Raises NotImplementedError if the using readline library does not support.

Closes and then reopens the syslog.

Arguments are the same as for open().

Returns self, for backward compatibility.

Search took: 5ms  ·  Total Results: 3363