ライブラリ
- ビルトイン (147)
-
cgi
/ core (3) -
cgi
/ html (28) - csv (17)
- digest (1)
- drb (1)
-
drb
/ extservm (1) - e2mmap (1)
- erb (5)
- etc (5)
- fiddle (1)
-
fiddle
/ import (2) - getoptlong (2)
-
irb
/ cmd / help (1) -
irb
/ cmd / load (3) -
irb
/ context (4) -
irb
/ input-method (1) - json (15)
-
json
/ add / struct (1) - logger (22)
- mkmf (4)
-
net
/ ftp (25) -
net
/ http (8) -
net
/ imap (9) - openssl (42)
- optparse (16)
- ostruct (5)
- pathname (102)
- pp (1)
- pstore (5)
- rake (31)
-
rake
/ loaders / makefile (1) -
rake
/ packagetask (5) -
rake
/ rdoctask (3) -
rake
/ testtask (2) -
rdoc
/ code _ object (2) -
rdoc
/ context (7) -
rdoc
/ markdown (2) -
rdoc
/ markup (3) -
rdoc
/ markup / formatter (1) -
rdoc
/ top _ level (8) - resolv (31)
-
rexml
/ document (48) -
rexml
/ sax2listener (4) -
rexml
/ streamlistener (5) - ripper (1)
-
ripper
/ filter (1) - rss (8)
- rubygems (3)
-
rubygems
/ command (6) -
rubygems
/ command _ manager (5) -
rubygems
/ commands / build _ command (2) -
rubygems
/ commands / dependency _ command (1) -
rubygems
/ commands / lock _ command (1) -
rubygems
/ commands / unpack _ command (1) -
rubygems
/ commands / update _ command (1) -
rubygems
/ commands / which _ command (1) -
rubygems
/ config _ file (2) -
rubygems
/ dependency (4) -
rubygems
/ dependency _ installer (2) -
rubygems
/ dependency _ list (3) -
rubygems
/ indexer (2) -
rubygems
/ installer (5) -
rubygems
/ package / f _ sync _ dir (1) -
rubygems
/ package / tar _ header (4) -
rubygems
/ package / tar _ reader / entry (1) -
rubygems
/ package / tar _ writer (5) -
rubygems
/ source _ index (6) -
rubygems
/ specification (7) - shell (15)
-
shell
/ command-processor (15) -
shell
/ filter (15) -
shell
/ system-command (2) - socket (9)
-
syslog
/ logger (3) - time (3)
- un (1)
- uri (4)
-
webrick
/ httprequest (4) -
webrick
/ httpresponse (2) -
webrick
/ httpservlet / filehandler (1) -
webrick
/ httputils (4) -
win32
/ registry (27) - win32ole (34)
- zlib (2)
クラス
-
ARGF
. class (2) - Addrinfo (2)
- BasicObject (8)
- BasicSocket (5)
- Binding (1)
-
CGI
:: Cookie (2) - CSV (11)
-
CSV
:: Row (2) -
CSV
:: Table (4) -
DRb
:: DRbUnknown (1) -
DRb
:: ExtServManager (1) - ERB (5)
- Encoding (4)
-
Encoding
:: InvalidByteSequenceError (2) -
Encoding
:: UndefinedConversionError (2) -
Etc
:: Group (2) -
Etc
:: Passwd (2) -
Fiddle
:: Function (1) -
Gem
:: Command (6) -
Gem
:: CommandManager (5) -
Gem
:: Commands :: BuildCommand (2) -
Gem
:: Commands :: DependencyCommand (1) -
Gem
:: Commands :: LockCommand (1) -
Gem
:: Commands :: UnpackCommand (1) -
Gem
:: Commands :: UpdateCommand (1) -
Gem
:: Commands :: WhichCommand (1) -
Gem
:: ConfigFile (2) -
Gem
:: Dependency (4) -
Gem
:: DependencyInstaller (2) -
Gem
:: DependencyList (3) -
Gem
:: Indexer (2) -
Gem
:: Installer (5) -
Gem
:: LoadError (2) -
Gem
:: Package :: TarHeader (4) -
Gem
:: Package :: TarReader :: Entry (1) -
Gem
:: Package :: TarWriter (5) -
Gem
:: SourceIndex (6) -
Gem
:: Specification (7) - GetoptLong (2)
- IO (1)
-
IRB
:: Context (4) -
IRB
:: ExtendCommand :: Help (1) -
IRB
:: ExtendCommand :: Load (1) -
IRB
:: ExtendCommand :: Require (1) -
IRB
:: ExtendCommand :: Source (1) -
IRB
:: InputMethod (1) -
JSON
:: Parser (2) -
JSON
:: State (8) - Logger (20)
-
Logger
:: Formatter (1) -
Logger
:: LogDevice (1) - MatchData (8)
- Method (2)
- Module (44)
- NameError (4)
-
Net
:: FTP (23) -
Net
:: FTP :: MLSxEntry (2) -
Net
:: HTTP (1) -
Net
:: IMAP (4) -
Net
:: IMAP :: Address (1) -
Net
:: IMAP :: MailboxList (1) -
Net
:: IMAP :: ResponseCode (1) -
Net
:: IMAP :: TaggedResponse (1) -
Net
:: IMAP :: UntaggedResponse (1) - NoMethodError (1)
- Object (13)
-
OpenSSL
:: ASN1 :: ObjectId (4) -
OpenSSL
:: Cipher (1) -
OpenSSL
:: Config (5) -
OpenSSL
:: Digest (1) -
OpenSSL
:: Engine (4) -
OpenSSL
:: PKCS7 :: RecipientInfo (1) -
OpenSSL
:: PKCS7 :: SignerInfo (2) -
OpenSSL
:: PKey :: EC :: Group (1) -
OpenSSL
:: SSL :: SSLContext (2) -
OpenSSL
:: SSL :: SSLSocket (3) -
OpenSSL
:: X509 :: CRL (2) -
OpenSSL
:: X509 :: Certificate (4) -
OpenSSL
:: X509 :: ExtensionFactory (1) -
OpenSSL
:: X509 :: Name (7) -
OpenSSL
:: X509 :: Request (2) - OpenStruct (5)
- OptionParser (16)
- PP (1)
- PStore (5)
- Pathname (101)
-
RDoc
:: CodeObject (2) -
RDoc
:: Context (7) -
RDoc
:: Markdown (2) -
RDoc
:: Markup (3) -
RDoc
:: Markup :: Formatter (1) -
RDoc
:: Options (3) -
RDoc
:: TopLevel (8) -
REXML
:: AttlistDecl (2) -
REXML
:: Attribute (3) -
REXML
:: Attributes (10) -
REXML
:: DocType (7) -
REXML
:: Document (2) -
REXML
:: Element (12) -
REXML
:: Elements (1) -
REXML
:: Entity (2) -
REXML
:: NotationDecl (1) -
RSS
:: Element (2) -
RSS
:: Maker :: TextinputBase (2) -
RSS
:: RDF :: Textinput (2) -
RSS
:: Rss :: Channel :: TextInput (2) -
Rake
:: Application (2) -
Rake
:: DefaultLoader (1) -
Rake
:: FileList (3) -
Rake
:: InvocationChain (2) -
Rake
:: InvocationChain :: EmptyInvocationChain (2) -
Rake
:: MakefileLoader (1) -
Rake
:: NameSpace (2) -
Rake
:: PackageTask (5) -
Rake
:: RDocTask (3) -
Rake
:: Task (3) -
Rake
:: TaskArguments (6) -
Rake
:: TestTask (2) - Regexp (2)
- Resolv (6)
-
Resolv
:: DNS (9) -
Resolv
:: DNS :: Name (3) -
Resolv
:: DNS :: Resource :: DomainName (1) -
Resolv
:: DNS :: Resource :: IN :: SRV (1) -
Resolv
:: DNS :: Resource :: MX (1) -
Resolv
:: DNS :: Resource :: SOA (2) -
Resolv
:: Hosts (6) -
Resolv
:: IPv4 (1) -
Resolv
:: IPv6 (1) - Ripper (1)
-
Ripper
:: Filter (1) - Shell (15)
-
Shell
:: CommandProcessor (15) -
Shell
:: Filter (15) -
Shell
:: SystemCommand (2) -
Socket
:: Ifaddr (1) -
Socket
:: Option (1) - String (22)
- Struct (14)
- Symbol (2)
-
Syslog
:: Logger (2) -
Syslog
:: Logger :: Formatter (1) - Thread (5)
- Time (3)
- TracePoint (2)
-
URI
:: Generic (2) -
URI
:: LDAP (2) - UnboundMethod (2)
-
WEBrick
:: Cookie (1) -
WEBrick
:: HTTPRequest (4) -
WEBrick
:: HTTPResponse (2) -
WEBrick
:: HTTPServlet :: DefaultFileHandler (1) -
WEBrick
:: HTTPUtils :: FormData (4) - WIN32OLE (7)
-
WIN32OLE
_ METHOD (2) -
WIN32OLE
_ PARAM (6) -
WIN32OLE
_ TYPE (9) -
WIN32OLE
_ TYPELIB (5) -
WIN32OLE
_ VARIABLE (5) -
Win32
:: Registry (27) -
Zlib
:: GzipFile (1) -
Zlib
:: GzipWriter (1)
モジュール
-
CGI
:: HtmlExtension (28) -
CGI
:: QueryExtension (3) - Enumerable (8)
- Exception2MessageMapper (1)
-
Fiddle
:: Importer (2) -
Gem
:: Package :: FSyncDir (1) -
JSON
:: Generator :: GeneratorMethods :: Hash (1) -
JSON
:: Generator :: GeneratorMethods :: Object (1) - Kernel (14)
-
Net
:: HTTPHeader (7) -
OpenSSL
:: SSL :: SocketForwarder (2) -
REXML
:: Namespace (8) -
REXML
:: SAX2Listener (4) -
REXML
:: StreamListener (5) -
Rake
:: TaskManager (7)
キーワード
- % (1)
- + (1)
-
/ (1) - << (2)
- <=> (4)
- == (3)
- === (1)
- =~ (1)
- Digest (1)
- JSON (1)
- Pathname (1)
- [] (23)
- []= (14)
-
_ _ send _ _ (2) - absolute? (2)
- add (4)
-
add
_ attributes (1) -
add
_ class (1) -
add
_ class _ or _ module (2) -
add
_ entry (1) -
add
_ file (2) -
add
_ file _ simple (2) -
add
_ html (1) -
add
_ module (1) -
add
_ namespace (2) -
add
_ row (1) -
add
_ special (1) -
add
_ tag (1) -
add
_ value (1) -
add
_ word _ pair (1) -
ap
_ name (1) -
ap
_ name= (1) - append (2)
-
arg
_ names (1) - args (1)
- ascend (2)
- atime (4)
- attlistdecl (1)
- attr (3)
-
attr
_ accessor (1) -
attr
_ reader (1) -
attr
_ writer (1) - attribute (1)
-
attributes
_ of (1) - autoload (1)
- autoload? (1)
- basename (4)
- binread (1)
- binwrite (1)
- birthtime (1)
- blockdev? (1)
- call (2)
-
callee
_ id (1) -
canonical
_ each (1) - canonname (1)
- chardev? (1)
- charset (1)
- chdir (1)
-
check
_ signedness (2) - checkbox (2)
-
checkbox
_ group (2) - children (1)
- chmod (4)
- chown (4)
- cipher (1)
-
class
_ eval (1) -
class
_ variable _ defined? (1) -
class
_ variable _ get (1) -
class
_ variable _ set (1) - cleanpath (1)
- clone (1)
- cmp (1)
-
col
_ sep (1) - command (1)
-
command
_ names (1) - compress (1)
-
config
_ file _ name (1) -
const
_ defined? (1) -
const
_ get (1) -
const
_ missing (1) -
const
_ set (1) - convert (3)
-
convertible
_ int (2) - ctime (4)
-
curve
_ name (1) - debug (2)
-
def
_ class (1) -
def
_ exception (1) -
def
_ method (1) -
def
_ module (1) - default (1)
-
default
_ event _ sources (1) -
default
_ ole _ types (1) -
define
_ method (2) -
define
_ singleton _ method (2) - delete (7)
-
delete
_ all (1) -
delete
_ field (1) -
delete
_ if (2) -
delete
_ key (1) -
delete
_ namespace (1) -
delete
_ value (1) -
deprecate
_ constant (1) - descend (2)
-
descriptor
_ length (1) -
destination
_ encoding _ name (2) - dig (1)
- digest (1)
- directory? (1)
- dirname (4)
- dn (1)
- dn= (1)
- doctype (2)
- each (13)
-
each
_ address (3) -
each
_ attribute (1) -
each
_ capitalized (1) -
each
_ capitalized _ name (1) -
each
_ child (2) -
each
_ element _ with _ attribute (1) -
each
_ element _ with _ text (1) -
each
_ entry (1) -
each
_ filename (1) -
each
_ header (1) -
each
_ key (1) -
each
_ line (2) -
each
_ name (4) -
each
_ option (1) -
each
_ resource (1) -
each
_ value (1) - egrep (1)
-
element
_ name (1) -
end
_ element (1) -
enhance
_ with _ matching _ rule (1) - entity (1)
- entries (1)
- eql? (2)
- error (2)
- eval (1)
- exchange (1)
-
excluded
_ from _ list? (1) - executable? (1)
-
executable
_ real? (1) - execute (4)
- exist? (1)
- extension (1)
- extension? (1)
-
external
_ id (1) - extname (1)
- fatal (2)
- fetch (1)
- file? (1)
-
file
_ absolute _ name (1) -
file
_ absolute _ name= (1) -
file
_ field (2) -
file
_ name (2) -
file
_ relative _ name (1) -
file
_ relative _ name= (1) - filename (7)
- filename= (3)
- find (2)
-
find
_ command (1) -
find
_ command _ possibilities (1) -
find
_ enclosing _ module _ named (1) -
find
_ gems (1) -
find
_ local _ symbol (1) -
find
_ module _ named (2) -
find
_ name (2) -
find
_ paths (1) -
find
_ spec _ by _ name _ and _ version (1) - fnmatch (1)
- fnmatch? (1)
-
formatted
_ program _ filename (1) - formatter (1)
- formatter= (2)
-
fsync
_ dir (1) - ftype (4)
-
full
_ name (4) - gem (1)
-
gem
_ signature (1) -
generate
_ bin _ script (1) -
generate
_ bin _ symlink (1) -
generate
_ windows _ script (1) - get (2)
-
get
_ all _ gem _ names (1) -
get
_ attribute (1) -
get
_ attribute _ ns (1) -
get
_ one _ gem _ name (1) -
get
_ path (1) -
get
_ value (1) - getaddress (3)
- getaddresses (3)
- getbinaryfile (2)
- getname (3)
- getnameinfo (1)
- getnames (3)
- getpeername (1)
- getresource (1)
- getresources (1)
- getsockname (1)
- getsockopt (2)
- gettextfile (2)
- gname (1)
- grpowned? (1)
- gzip (1)
-
has
_ name? (1) - hash (2)
-
hash
_ old (1) - header? (1)
-
header
_ convert (3) - hidden (2)
- hostname (2)
- hostname= (2)
- httpdate (1)
- id (1)
- id2name (1)
-
implemented
_ ole _ types (1) - import (1)
-
import
_ symbol (1) -
in
_ namespace (1) - include (1)
- include? (1)
- info (3)
- init (2)
- initialize (1)
- inspect (2)
- install (1)
-
instance
_ eval (1) -
instance
_ method (1) - instruction (1)
- intern (2)
- invoke (1)
-
irb
_ name (1) -
irb
_ name= (1) - issuer (4)
- issuer= (2)
- j (1)
- jj (1)
- join (1)
- key? (1)
- keyname (1)
- lchmod (1)
- lchown (1)
- length (1)
-
library
_ name (1) - linkname (1)
- list (1)
- ln (2)
- load (3)
-
load
_ file (1) -
load
_ gemspecs (1) -
local
_ name (1) -
local
_ variables (1) - log (2)
-
long
_ name (1) - lookup (2)
- lstat (4)
- lsub (1)
- main= (1)
-
make
_ link (1) -
make
_ partial _ content (1) -
make
_ symlink (1) - max (4)
-
max
_ key _ length (1) -
max
_ value _ length (1) -
max
_ value _ name _ length (1) - mdtm (1)
- member? (2)
- method (1)
-
method
_ added (1) -
method
_ defined? (1) -
method
_ id (1) -
method
_ missing (1) -
method
_ removed (1) -
method
_ undefined (1) - min (4)
- mkdir (3)
- mkpath (1)
- mlsd (2)
- mlst (1)
- mname (1)
-
module
_ eval (1) -
module
_ function (1) - mountpoint? (1)
- mtime (5)
- name= (15)
-
named
_ captures (2) - names (4)
- namespace (3)
- namespaces (3)
- ndata (1)
-
new
_ ostruct _ member (1) -
new
_ scope (1) - notation (1)
- notationdecl (1)
-
num
_ keys (1) -
num
_ values (1) -
object
_ group (1) -
object
_ nl (1) -
object
_ nl= (1) - offset (2)
-
ok
_ to _ remove? (1) -
ole
_ classes (1) -
ole
_ func _ methods (1) -
ole
_ get _ methods (1) -
ole
_ methods (1) -
ole
_ respond _ to? (1) -
ole
_ type (1) -
ole
_ type _ detail (1) -
ole
_ typelib (2) -
ole
_ types (1) - on (12)
-
op
_ name (1) - open (2)
- opendir (2)
- optional? (1)
- optname (1)
-
orig
_ name (1) -
orig
_ name= (1) -
original
_ name (3) - output? (1)
- owned? (1)
-
package
_ dir= (1) -
package
_ name (1) -
page
_ dir (1) - parent (1)
-
parent
_ file _ name (1) -
parent
_ name (1) - parse (1)
-
password
_ field (2) - path (1)
- pathconf (1)
- pathname (1)
- pipe? (1)
-
post
_ connection _ check (1) - prefix (1)
- prefix= (1)
- private (1)
-
private
_ class _ method (1) -
private
_ constant (1) -
private
_ method _ defined? (1) - progname (1)
- progname= (1)
-
program
_ name (2) -
program
_ name= (2) - protected (1)
-
protected
_ method _ defined? (1) - public (1)
-
public
_ class _ method (1) -
public
_ constant (1) -
public
_ instance _ method (1) -
public
_ method (1) -
public
_ method _ defined? (1) -
public
_ send (2) - put (2)
- putbinaryfile (2)
- puts (1)
- puttextfile (2)
-
radio
_ group (2) - read (2)
-
read
_ bin (1) -
read
_ i (1) -
read
_ s (1) - readable? (1)
-
readable
_ real? (1) - readlines (1)
- readlink (1)
- realdirpath (1)
- realpath (2)
- receiver (1)
-
register
_ command (1) - relative? (1)
-
relative
_ path _ from (1) -
remove
_ by _ name (1) -
remove
_ class _ variable (1) -
remove
_ const (1) -
remove
_ instance _ variable (1) -
remove
_ method (1) -
remove
_ option (1) -
remove
_ spec (1) - rename (6)
- replicate (1)
- reset (2)
-
resolve
_ args (1) -
respond
_ to? (1) -
respond
_ to _ missing? (1) - retval? (1)
- rfc2822 (1)
- rfc822 (1)
- rm (3)
- rmdir (2)
- rmtree (1)
- rname (1)
- root (2)
- root? (2)
-
root
_ node (1) - rule (1)
-
script
_ name (2) -
script
_ name= (1) -
scrolling
_ list (2) - send (2)
-
send
_ request (1) -
server
_ name (2) -
servername
_ cb (1) -
servername
_ cb= (1) - service (1)
-
set
_ arg _ names (1) - setgid? (1)
- setproperty (2)
- setsockopt (3)
- setuid? (1)
- shebang (1)
-
short
_ name (1) -
show
_ lookup _ failure (1) -
singleton
_ method (1) -
singleton
_ method _ added (1) -
singleton
_ method _ removed (1) -
singleton
_ method _ undefined (1) - size (3)
- size? (1)
- slice (6)
- sn (1)
- socket? (1)
- source (1)
-
source
_ encoding _ name (2) -
source
_ ole _ types (1) - space (1)
- space= (1)
-
space
_ before (1) -
space
_ before= (1) -
spec
_ path (1) - specification (1)
- split (4)
-
start
_ element (1) - stat (4)
- sticky? (1)
- sub (2)
-
sub
_ ext (1) -
subdomain
_ of? (1) - subject (2)
- subject= (2)
-
subject
_ certificate= (1) - submit (2)
- symlink? (1)
-
synthesize
_ file _ task (1) - sysopen (1)
-
tag
_ end (1) -
tag
_ name (1) -
tag
_ start (1) - target (1)
- tasks (1)
-
text
_ field (2) - textarea (2)
-
to
_ a (2) -
to
_ der (1) -
to
_ h (1) -
to
_ hash (1) -
to
_ json (3) -
to
_ name (2) -
to
_ path (1) -
to
_ s (14) -
to
_ string (1) -
to
_ sym (1) - truncate (1)
- uname (1)
-
undef
_ method (1) -
unescape
_ filename? (1) - unknown (2)
- unlink (1)
- utime (4)
- value (3)
- values (1)
- variables (1)
- ver (1)
- warn (2)
-
which
_ to _ update (1) - whitespace (1)
-
with
_ defaults (1) -
world
_ readable? (1) -
world
_ writable? (1) - writable? (1)
-
writable
_ real? (1) - write (3)
-
write
_ bin (1) -
write
_ i (1) -
write
_ s (1) - wtime (1)
- xlist (1)
- yaml? (1)
- zero? (1)
検索結果
先頭5件
-
Win32
:: Registry # keyname (18304.0) -
@todo
@todo
Win32::Registry.open または Win32::Registry.create に指定された
subkey の値を返します。 -
Net
:: HTTPHeader # each _ name {|name| . . . } -> () (9667.0) -
保持しているヘッダ名をブロックに渡して呼びだします。
保持しているヘッダ名をブロックに渡して呼びだします。
ヘッダ名は小文字で統一されます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.each_name { |name| puts name }
# => accept-encoding
# => accept
# => user-agent
//} -
Pathname
# each _ child(with _ directory = true) {|pathname| . . . } -> [Pathname] (9604.0) -
self.children(with_directory).each と同じです。
self.children(with_directory).each と同じです。
@param with_directory 偽を指定するとファイル名のみ返します。デフォルトは真です。
//emlist[例][ruby]{
require "pathname"
Pathname("/usr/local").each_child {|f| p f }
# => #<Pathname:/usr/local/bin>
# => #<Pathname:/usr/local/etc>
# => #<Pathname:/usr/local/include>
# => #<Pathname:/us... -
OpenSSL
:: ASN1 :: ObjectId # long _ name -> String | nil (9373.0) -
オブジェクト識別子に対応する long name を返します。
オブジェクト識別子に対応する long name を返します。
例:
require "openssl"
oid = OpenSSL::ASN1::ObjectId.new("subjectAltName")
p oid.ln #=> "X509v3 Subject Alternative Name"
@see OpenSSL::ASN1::ObjectId#sn -
Rake
:: NameSpace # [](name) -> Rake :: Task (9325.0) -
与えられた名前のタスクを返します。
与えられた名前のタスクを返します。
@param name タスクの名前を指定します。
//emlist[][ruby]{
# Rakefile での記載例とする
namespace :ns do |ns|
task :ts1 do
end
task :ts2 do
end
ns[:ts1] # => <Rake::Task ns:ts1 => []>
ns[:ts2] # => <Rake::Task ns:ts2 => []>
end
//} -
Win32
:: Registry # max _ value _ name _ length (9307.0) -
@todo
@todo
キー情報の個々の値を返します。 -
Pathname
# +(other) -> Pathname (9304.0) -
パス名を連結します。つまり、other を self からの相対パスとした新しい Pathname オブジェクトを生成して返します。
パス名を連結します。つまり、other を self からの相対パスとした新しい
Pathname オブジェクトを生成して返します。
other が絶対パスなら単に other と同じ内容の Pathname オブジェクトが返さ
れます。
//emlist[例][ruby]{
require 'pathname'
Pathname("foo/bar")+"baz" # => #<Pathname:foo/bar/baz>
Pathname("foo/bar/")+"baz" # => #<Pathname:foo/bar/baz>
Pathname("foo/bar")+"/baz" ... -
Pathname
# / (other) -> Pathname (9304.0) -
パス名を連結します。つまり、other を self からの相対パスとした新しい Pathname オブジェクトを生成して返します。
パス名を連結します。つまり、other を self からの相対パスとした新しい
Pathname オブジェクトを生成して返します。
other が絶対パスなら単に other と同じ内容の Pathname オブジェクトが返さ
れます。
//emlist[例][ruby]{
require 'pathname'
Pathname("foo/bar")+"baz" # => #<Pathname:foo/bar/baz>
Pathname("foo/bar/")+"baz" # => #<Pathname:foo/bar/baz>
Pathname("foo/bar")+"/baz" ... -
Pathname
# ascend {|pathname| . . . } -> nil (9304.0) -
self のパス名から親方向に辿っていったときの各パス名を新しい Pathname オ ブジェクトとして生成し、ブロックへの引数として渡して実行します。 ブロックを省略した場合は Enumerator を返します。
self のパス名から親方向に辿っていったときの各パス名を新しい Pathname オ
ブジェクトとして生成し、ブロックへの引数として渡して実行します。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
require 'pathname'
Pathname.new('/path/to/some/file.rb').ascend {|v| p v}
# => #<Pathname:/path/to/some/file.rb>
# #<Pathname:/path/to/some>
# #<Pathname:/path/to>
... -
Pathname
# children(with _ directory = true) -> [Pathname] (9304.0) -
self 配下にあるパス名(Pathnameオブジェクト)の配列を返します。
self 配下にあるパス名(Pathnameオブジェクト)の配列を返します。
ただし、 ".", ".." は要素に含まれません。
@param with_directory 偽を指定するとファイル名のみ返します。デフォルトは真です。
@raise Errno::EXXX self が存在しないパスであったりディレクトリでなければ例外が発生します。
//emlist[例][ruby]{
require 'pathname'
Pathname.new("/tmp").children # => [#<Pathname:.X11-unix>, #<Pathname:.iroha_unix>... -
Pathname
# cleanpath(consider _ symlink = false) -> Pathname (9304.0) -
余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。
余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。
cleanpath は、実際にファイルシステムを参照することなく、文字列操作
だけで処理を行います。
@param consider_symlink 真ならパス要素にシンボリックリンクがあった場合
にも問題ないように .. を残します。
//emlist[例][ruby]{
require "pathname"
path = Pathname.new("//.././../")
path # => #<Pa... -
Pathname
# descend {|pathname| . . . } -> nil (9304.0) -
self のパス名の親から子供へと辿っていったときの各パス名を新しい Pathname オブジェクトとして生成し、ブロックへの引数として渡して実行しま す。 ブロックを省略した場合は Enumerator を返します。
self のパス名の親から子供へと辿っていったときの各パス名を新しい
Pathname オブジェクトとして生成し、ブロックへの引数として渡して実行しま
す。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
require 'pathname'
Pathname.new('/path/to/some/file.rb').descend {|v| p v}
# => #<Pathname:/>
# #<Pathname:/path>
# #<Pathname:/path/to>
# #<Pathname:/path/to/s... -
Pathname
# each _ entry {|pathname| . . . } -> nil (9304.0) -
Dir.foreach(self.to_s) {|f| yield Pathname.new(f) } と同じです。
Dir.foreach(self.to_s) {|f| yield Pathname.new(f) } と同じです。
//emlist[例][ruby]{
require "pathname"
Pathname("/usr/local").each_entry {|f| p f }
# => #<Pathname:.>
# => #<Pathname:..>
# => #<Pathname:bin>
# => #<Pathname:etc>
# => #<Pathname:include>
# => #<Pathname:lib>
# => #<Pathname:opt>
//}
@... -
Pathname
# entries -> [Pathname] (9304.0) -
self に含まれるファイルエントリ名を元にした Pathname オブジェクトの配列を返します。
self に含まれるファイルエントリ名を元にした Pathname オブジェクトの配列を返します。
@raise Errno::EXXX self が存在しないパスであったりディレクトリでなければ例外が発生します。
//emlist[例][ruby]{
require 'pathname'
require 'pp'
pp Pathname('/usr/local').entries
# => [#<Pathname:.>,
# #<Pathname:..>,
# #<Pathname:bin>,
# #<Pathname:etc>,
# #<Pathnam... -
Pathname
# expand _ path(default _ dir = & # 39; . & # 39;) -> Pathname (9304.0) -
Pathname.new(File.expand_path(self.to_s, *args)) と同じです。
Pathname.new(File.expand_path(self.to_s, *args)) と同じです。
@param default_dir self が相対パスであれば default_dir を基準に展開されます。
//emlist[例][ruby]{
require "pathname"
path = Pathname("testfile")
Pathname.pwd # => #<Pathname:/path/to>
path.expand_path # => #<Pathname:/path/to/testfile>
path.e... -
Pathname
# find(ignore _ error: true) {|pathname| . . . } -> nil (9304.0) -
self 配下のすべてのファイルやディレクトリを 一つずつ引数 pathname に渡してブロックを実行します。
self 配下のすべてのファイルやディレクトリを
一つずつ引数 pathname に渡してブロックを実行します。
require 'find'
Find.find(self.to_s) {|f| yield Pathname.new(f)}
と同じです。
ブロックを省略した場合は Enumerator を返します。
@param ignore_error 探索中に発生した例外を無視するかどうかを指定します。
@see Find.#find -
Pathname
# join(*args) -> Pathname (9304.0) -
与えられたパス名を連結します。
与えられたパス名を連結します。
@param args 連結したいディレクトリ名やファイル名を文字列で与えます。
//emlist[例][ruby]{
require "pathname"
path0 = Pathname("/usr") # Pathname:/usr
path0 = path0.join("bin/ruby") # Pathname:/usr/bin/ruby
# 上記の path0 の処理は下記の path1 と同様のパスになります
path1 = Pathname("/usr") + "bin/ruby" ... -
Pathname
# parent -> Pathname (9304.0) -
self の親ディレクトリを指す新しい Pathname オブジェクトを返します。
self の親ディレクトリを指す新しい Pathname オブジェクトを返します。
//emlist[例 絶対パス][ruby]{
require "pathname"
path = Pathname("/usr")
path # => #<Pathname:/usr>
path.parent # => #<Pathname:/>
//}
//emlist[例 相対パス][ruby]{
require "pathname"
path = Pathname("foo/bar")
path.parent # => #<Pathname:foo>
p... -
Pathname
# readlink -> Pathname (9304.0) -
Pathname.new(File.readlink(self.to_s)) と同じです。
Pathname.new(File.readlink(self.to_s)) と同じです。
@see File.readlink -
Pathname
# realdirpath(basedir = nil) -> Pathname (9304.0) -
Pathname#realpath とほぼ同じで、最後のコンポーネントは実際に 存在しなくてもエラーになりません。
Pathname#realpath とほぼ同じで、最後のコンポーネントは実際に
存在しなくてもエラーになりません。
@param basedir ベースディレクトリを指定します。省略するとカレントディレクトリになります。
//emlist[例][ruby]{
require "pathname"
path = Pathname("/not_exist")
path.realdirpath # => #<Pathname:/not_exist>
path.realpath # => Errno::ENOENT
# 最後ではないコンポーネント(/not_exist_1)も存在し... -
Pathname
# realpath -> Pathname (9304.0) -
余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。
余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。
また、ファイルシステムをアクセスし、実際に存在するパスを返します。
シンボリックリンクも解決されます。
self が指すパスが存在しない場合は例外 Errno::ENOENT が発生します。
@param basedir ベースディレクトリを指定します。省略するとカレントディレクトリになります。
//emlist[例][ruby]{
require 'pathname'
Dir.rmdir("/tmp/foo") rescue nil
File.unlink("/tmp/b... -
Pathname
# realpath(basedir = nil) -> Pathname (9304.0) -
余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。
余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。
また、ファイルシステムをアクセスし、実際に存在するパスを返します。
シンボリックリンクも解決されます。
self が指すパスが存在しない場合は例外 Errno::ENOENT が発生します。
@param basedir ベースディレクトリを指定します。省略するとカレントディレクトリになります。
//emlist[例][ruby]{
require 'pathname'
Dir.rmdir("/tmp/foo") rescue nil
File.unlink("/tmp/b... -
Pathname
# relative _ path _ from(base _ directory) -> Pathname (9304.0) -
base_directory から self への相対パスを求め、その内容の新しい Pathname オブジェクトを生成して返します。
base_directory から self への相対パスを求め、その内容の新しい Pathname
オブジェクトを生成して返します。
パス名の解決は文字列操作によって行われ、ファイルシステムをアクセス
しません。
self が相対パスなら base_directory も相対パス、self が絶対パスなら
base_directory も絶対パスでなければなりません。
@param base_directory ベースディレクトリを表す Pathname オブジェクトを指定します。
@raise ArgumentError Windows上でドライブが違うなど、base_direct... -
Pathname
# sub(pattern) {|matched| . . . } -> Pathname (9304.0) -
self を表現するパス文字列に対して sub メソッドを呼び出し、その結果を内 容とする新しい Pathname オブジェクトを生成し、返します。
self を表現するパス文字列に対して sub メソッドを呼び出し、その結果を内
容とする新しい Pathname オブジェクトを生成し、返します。
@param pattern 置き換える文字列のパターンを指定します。
@param replace pattern で指定した文字列と置き換える文字列を指定します。
//emlist[例][ruby]{
require 'pathname'
path1 = Pathname('/usr/bin/perl')
path1.sub('perl', 'ruby') #=> #<Pathname:/usr/bin/ruby>
//}
@se... -
Pathname
# sub(pattern , replace) -> Pathname (9304.0) -
self を表現するパス文字列に対して sub メソッドを呼び出し、その結果を内 容とする新しい Pathname オブジェクトを生成し、返します。
self を表現するパス文字列に対して sub メソッドを呼び出し、その結果を内
容とする新しい Pathname オブジェクトを生成し、返します。
@param pattern 置き換える文字列のパターンを指定します。
@param replace pattern で指定した文字列と置き換える文字列を指定します。
//emlist[例][ruby]{
require 'pathname'
path1 = Pathname('/usr/bin/perl')
path1.sub('perl', 'ruby') #=> #<Pathname:/usr/bin/ruby>
//}
@se... -
Pathname
# sub _ ext(replace) -> Pathname (9304.0) -
拡張子を与えられた文字列で置き換えた Pathname オブジェクトを返します。
拡張子を与えられた文字列で置き換えた Pathname オブジェクトを返します。
自身が拡張子を持たない場合は、与えられた文字列を拡張子として付加します。
@param replace 拡張子を文字列で指定します。
//emlist[例][ruby]{
require "pathname"
Pathname('/usr/bin/shutdown').sub_ext('.rb') # => #<Pathname:/usr/bin/shutdown.rb>
Pathname('/home/user/test.txt').sub_ext('.pdf') # => #<Path... -
OpenSSL
:: X509 :: Name # to _ s(flags=nil) -> String (9166.0) -
DNの文字列表現を返します。
DNの文字列表現を返します。
flags には通常は以下のいずれかを渡します。
* nil
* OpenSSL::X509::Name::COMPAT
* OpenSSL::X509::Name::RFC2253
* OpenSSL::X509::Name::ONELINE
* OpenSSL::X509::Name::MULTILINE
*
例:
require 'openssl'
n = OpenSSL::X509::Name.parse('/C=JP/ST=Kanagawa/L=Yokohama/O=Example Company/OU=Lab3/CN... -
Resolv
:: DNS :: Name # subdomain _ of?(other) -> bool (9130.0) -
other が self のサブドメインであるかどうかを返します。
other が self のサブドメインであるかどうかを返します。
//emlist[][ruby]{
require "resolv"
domain = Resolv::DNS::Name.create("y.z")
p Resolv::DNS::Name.create("w.x.y.z").subdomain_of?(domain) #=> true
p Resolv::DNS::Name.create("x.y.z").subdomain_of?(domain) #=> true
p Resolv::DNS::Name.create("y.z").subdomain_of?(domai... -
OpenSSL
:: ASN1 :: ObjectId # sn -> String | nil (9055.0) -
オブジェクト識別子に対応する short name を返します。
オブジェクト識別子に対応する short name を返します。
例:
require "openssl"
oid = OpenSSL::ASN1::ObjectId.new("subjectAltName")
p oid.sn #=> "subjectAltName"
@see OpenSSL::ASN1::ObjectId#ln -
OpenSSL
:: X509 :: Name # <=>(other) -> -1 | 0 | 1 (9052.0) -
他の OpenSSL::X509::Name オブジェクトと比較します。
他の OpenSSL::X509::Name オブジェクトと比較します。
自身が other と一致する場合は 0、otherより大きい場合は1、
小さい場合は -1 を返します。
@param other 比較するオブジェクト -
OpenSSL
:: X509 :: Name # cmp(other) -> -1 | 0 | 1 (9052.0) -
他の OpenSSL::X509::Name オブジェクトと比較します。
他の OpenSSL::X509::Name オブジェクトと比較します。
自身が other と一致する場合は 0、otherより大きい場合は1、
小さい場合は -1 を返します。
@param other 比較するオブジェクト -
Symbol
# to _ s -> String (9043.0) -
シンボルに対応する文字列を返します。
シンボルに対応する文字列を返します。
逆に、文字列に対応するシンボルを得るには
String#intern を使います。
p :foo.id2name # => "foo"
p :foo.id2name.intern == :foo # => true
@see String#intern -
Encoding
# to _ s -> String (9025.0) -
エンコーディングの名前を返します。
エンコーディングの名前を返します。
//emlist[例][ruby]{
Encoding::UTF_8.name #=> "UTF-8"
//} -
WIN32OLE
_ METHOD # to _ s -> String (9025.0) -
メソッド名を取得します。
メソッド名を取得します。
@return メソッド名を文字列で返します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Workbook')
method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
puts method.name # => SaveAs -
WIN32OLE
_ PARAM # to _ s -> String (9025.0) -
パラメータ名を取得します。
パラメータ名を取得します。
@return パラメータ名を返します。名前付き引数形式でメソッドを呼び出すときに指定します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
param1 = method.params[0]
puts param1.name # => Filename -
WIN32OLE
_ TYPE # to _ s -> String (9025.0) -
selfの型名を取得します。
selfの型名を取得します。
@return selfの型名を文字列で返します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Application')
p tobj.name # => "Application" -
WIN32OLE
_ TYPELIB # to _ s -> String (9025.0) -
TypeLibのドキュメント文字列を取得します。
TypeLibのドキュメント文字列を取得します。
ドキュメント文字列は、コンテキストヘルプなどに利用可能なTypeLibの簡単な
説明文で、通常バージョン番号を含みます。
@return TypeLibのドキュメント文字列を返します。
tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 14.0 Object Library')
puts tlib.name # => 'Microsoft Excel 14.0 Object Library' -
WIN32OLE
_ VARIABLE # to _ s -> String (9025.0) -
変数名を取得します。
変数名を取得します。
@return 変数名を文字列で返します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'XlSheetType')
variables = tobj.variables
variables.each do |variable|
puts "#{variable.name}" # => xlChart, xlDialogSheet, ...
end -
OpenSSL
:: X509 :: Name # add _ entry(oid , value , type = nil) (9022.0) -
新しい属性を追加します。
新しい属性を追加します。
@param oid 属性型文字列
@param value 属性値文字列
@param type 属性値の(ASN.1の)型、省略時は OpenSSL::X509::Name::OBJECT_TYPE_TEMPLATE と oid から型が決まる
@raise OpenSSL::X509::NameError 属性の追加に失敗した場合に発生します -
OpenSSL
:: X509 :: Name # hash _ old -> Integer (9022.0) -
OpenSSL 0.9.8 と互換な古い方式のハッシュ関数の ハッシュ値を返します。
OpenSSL 0.9.8 と互換な古い方式のハッシュ関数の
ハッシュ値を返します。
内部では OpenSSL の X509_NAME_hash_old を呼び出します。 -
OpenSSL
:: X509 :: Name # to _ a -> [[String , String , Integer]] (9022.0) -
内容を配列にして返します。
内容を配列にして返します。
配列の各要素は、[属性型文字列、属性値文字列、属性値の型を表す整数(OpenSSL::ASN1以下の各定数で定義されているASN1の型)] という3要素の配列です。
例:
require 'openssl'
n = OpenSSL::X509::Name.parse('/C=JP/ST=Kanagawa/L=Yokohama/O=Example Company/OU=Lab3/CN=foobar/emailAddress=foobar@lab3.example.co.jp')
n.to_a
# => [["C", "JP", 19], ["ST... -
Win32
:: Registry # to _ s (9007.0) -
@todo
@todo
キーのフルパスを 'HKEY_CURRENT_USER\SOFTWARE\foo\bar'
のような形で返します。 -
ARGF
. class # path -> String (9004.0) -
現在開いている処理対象のファイル名を返します。
現在開いている処理対象のファイル名を返します。
標準入力に対しては - を返します。
組み込み変数 $FILENAME と同じです。
$ echo "foo" > foo
$ echo "bar" > bar
$ echo "glark" > glark
$ ruby argf.rb foo bar glark
ARGF.filename # => "foo"
ARGF.read(5) # => "foo\nb"
ARGF.filename # => "bar"
ARGF.skip
ARGF.filename # => "glark" -
NameError
# local _ variables -> [Symbol] (9004.0) -
self が発生した時に定義されていたローカル変数名の一覧を返します。
self が発生した時に定義されていたローカル変数名の一覧を返します。
内部での使用に限ります。
例:
def foo
begin
b = "bar"
c = 123
d
rescue NameError => err
p err.local_variables #=> [:b, :c, :err]
end
end
a = "buz"
foo -
NameError
# receiver -> object (9004.0) -
self が発生した時のレシーバオブジェクトを返します。
self が発生した時のレシーバオブジェクトを返します。
例:
class Sample
def foo
return "foo"
end
end
bar = Sample.new
begin
bar.bar
rescue NameError => err
p err.receiver # => #<Sample:0x007fd4d89b3110>
p err.receiver.foo # => "foo"
end -
NameError
# to _ s -> String (9004.0) -
例外オブジェクトを文字列に変換して返します。
例外オブジェクトを文字列に変換して返します。
例:
begin
foobar
rescue NameError => err
p err # => #<NameError: undefined local variable or method `foobar' for main:Object>
p err.to_s # => "undefined local variable or method `foobar' for main:Object"
end -
OpenSSL
:: X509 :: Name # to _ der -> String (9004.0) -
DER 形式のバイト列を返します。
DER 形式のバイト列を返します。 -
Pathname
# <=>(other) -> -1 | 0 | 1 | nil (9004.0) -
パス名を比較します。other と同じなら 0 を、ASCII順で self が大きい場合 は正、other が大きい場合は負を返します。大文字小文字は区別されます。 other は Pathname オブジェクトでなければなりません。
パス名を比較します。other と同じなら 0 を、ASCII順で self が大きい場合
は正、other が大きい場合は負を返します。大文字小文字は区別されます。
other は Pathname オブジェクトでなければなりません。
パス名の比較は単純にパス文字列の比較によって行われるので、論理的に
同じパスでもパス文字列が違えば異なると判断されます。
@param other 比較対象の Pathname オブジェクトを指定します。
//emlist[例][ruby]{
require 'pathname'
p Pathname.new("foo/bar") <=> Pathn... -
Pathname
# ==(other) -> bool (9004.0) -
パス名を比較し、 other と同じなら真を返します。大文字小文字は区別されます。 other は Pathname オブジェクトでなければなりません。
パス名を比較し、 other と同じなら真を返します。大文字小文字は区別されます。
other は Pathname オブジェクトでなければなりません。
パス名の比較は単純にパス文字列の比較によって行われるので、論理的に
同じパスでもパス文字列が違えば異なると判断されます。
@param other 比較対象の Pathname オブジェクトを指定します。
//emlist[例][ruby]{
require 'pathname'
p Pathname.new("foo/bar") == Pathname.new("foo/bar")
p Pathname.new("foo/bar"... -
Pathname
# ===(other) -> bool (9004.0) -
パス名を比較し、 other と同じなら真を返します。大文字小文字は区別されます。 other は Pathname オブジェクトでなければなりません。
パス名を比較し、 other と同じなら真を返します。大文字小文字は区別されます。
other は Pathname オブジェクトでなければなりません。
パス名の比較は単純にパス文字列の比較によって行われるので、論理的に
同じパスでもパス文字列が違えば異なると判断されます。
@param other 比較対象の Pathname オブジェクトを指定します。
//emlist[例][ruby]{
require 'pathname'
p Pathname.new("foo/bar") == Pathname.new("foo/bar")
p Pathname.new("foo/bar"... -
Pathname
# absolute? -> bool (9004.0) -
self が絶対パス指定であれば真を返します。
self が絶対パス指定であれば真を返します。
//emlist[例][ruby]{
require "pathname"
pathname = Pathname("/path/to/example.rb")
pathname.absolute? # => true
pathname = Pathname("../")
pathname.absolute? # => false
//} -
Pathname
# ascend -> Enumerator (9004.0) -
self のパス名から親方向に辿っていったときの各パス名を新しい Pathname オ ブジェクトとして生成し、ブロックへの引数として渡して実行します。 ブロックを省略した場合は Enumerator を返します。
self のパス名から親方向に辿っていったときの各パス名を新しい Pathname オ
ブジェクトとして生成し、ブロックへの引数として渡して実行します。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
require 'pathname'
Pathname.new('/path/to/some/file.rb').ascend {|v| p v}
# => #<Pathname:/path/to/some/file.rb>
# #<Pathname:/path/to/some>
# #<Pathname:/path/to>
... -
Pathname
# atime -> Time (9004.0) -
File.atime(self.to_s) を渡したものと同じです。
File.atime(self.to_s) を渡したものと同じです。
//emlist[例][ruby]{
require "pathname"
pathname = Pathname("testfile")
pathname.atime # => 2018-12-18 20:58:13 +0900
//}
@see File.atime -
Pathname
# binread(*args) -> String | nil (9004.0) -
IO.binread(self.to_s, *args)と同じです。
IO.binread(self.to_s, *args)と同じです。
//emlist[例][ruby]{
require "pathname"
pathname = Pathname("testfile")
pathname.binread # => "This is line one\nThis is line two\nThis is line three\nAnd so on...\n"
pathname.binread(20) # => "This is line one\nThi"
pathname.binread(20, 10) # => ... -
Pathname
# binwrite(string , offset=nil) -> Integer (9004.0) -
IO.binwrite(self.to_s, *args)と同じです。
IO.binwrite(self.to_s, *args)と同じです。
@see IO.binwrite -
Pathname
# birthtime -> Time (9004.0) -
File.birthtime(self.to_s) を渡したものと同じです。
File.birthtime(self.to_s) を渡したものと同じです。
@raise NotImplementedError Windows のような birthtime のない環境で発生します。
@see File.birthtime -
Pathname
# blockdev? -> bool (9004.0) -
FileTest.blockdev?(self.to_s) と同じです。
FileTest.blockdev?(self.to_s) と同じです。
@see FileTest.#blockdev? -
Pathname
# chardev? -> bool (9004.0) -
FileTest.chardev?(self.to_s) と同じです。
FileTest.chardev?(self.to_s) と同じです。
@see FileTest.#chardev? -
Pathname
# chmod(mode) -> Integer (9004.0) -
File.chmod(mode, self.to_s) と同じです。
File.chmod(mode, self.to_s) と同じです。
@param mode ファイルのアクセス権限を整数で指定します。
@see File.chmod -
Pathname
# chown(owner , group) -> Integer (9004.0) -
File.chown(owner, group, self.to_s) と同じです。
File.chown(owner, group, self.to_s) と同じです。
@param owner オーナーを指定します。
@param group グループを指定します。
//emlist[例][ruby]{
require 'pathname'
Pathname('testfile').stat.uid # => 501
Pathname('testfile').chown(502, 12)
Pathname('testfile').stat.uid # => 502
//}
@see File.chown, File#chown -
Pathname
# ctime -> Time (9004.0) -
File.ctime(self.to_s) を渡したものと同じです。
File.ctime(self.to_s) を渡したものと同じです。
//emlist[例][ruby]{
require 'pathname'
IO.write("testfile", "test")
pathname = Pathname("testfile")
pathname.ctime # => 2019-01-14 00:39:51 +0900
sleep 1
pathname.chmod(0755)
pathname.ctime # => 2019-01-14 00:39:52 +0900
//}
@see File.ctime -
Pathname
# delete -> Integer (9004.0) -
self が指すディレクトリあるいはファイルを削除します。
self が指すディレクトリあるいはファイルを削除します。
//emlist[例][ruby]{
require "pathname"
pathname = Pathname("/path/to/sample")
pathname.exist? # => true
pathname.unlink # => 1
pathname.exist? # => false
//} -
Pathname
# descend -> Enumerator (9004.0) -
self のパス名の親から子供へと辿っていったときの各パス名を新しい Pathname オブジェクトとして生成し、ブロックへの引数として渡して実行しま す。 ブロックを省略した場合は Enumerator を返します。
self のパス名の親から子供へと辿っていったときの各パス名を新しい
Pathname オブジェクトとして生成し、ブロックへの引数として渡して実行しま
す。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
require 'pathname'
Pathname.new('/path/to/some/file.rb').descend {|v| p v}
# => #<Pathname:/>
# #<Pathname:/path>
# #<Pathname:/path/to>
# #<Pathname:/path/to/s... -
Pathname
# directory? -> bool (9004.0) -
FileTest.directory?(self.to_s) と同じです。
FileTest.directory?(self.to_s) と同じです。
@see FileTest.#directory? -
Pathname
# each _ child(with _ directory = true) -> Enumerator (9004.0) -
self.children(with_directory).each と同じです。
self.children(with_directory).each と同じです。
@param with_directory 偽を指定するとファイル名のみ返します。デフォルトは真です。
//emlist[例][ruby]{
require "pathname"
Pathname("/usr/local").each_child {|f| p f }
# => #<Pathname:/usr/local/bin>
# => #<Pathname:/usr/local/etc>
# => #<Pathname:/usr/local/include>
# => #<Pathname:/us... -
Pathname
# each _ line(*args) -> Enumerator (9004.0) -
IO.foreach(self.to_s, *args, &block) と同じです。
IO.foreach(self.to_s, *args, &block) と同じです。
//emlist[例][ruby]{
require "pathname"
IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line
# => #<Enumerator: IO:foreach("testfile")>
//}
//emlist[例 ブロックを指定][ruby]{
require "pathname"
IO.write("testfile", "line1\nline2,\nline3\... -
Pathname
# each _ line(*args) {|line| . . . } -> nil (9004.0) -
IO.foreach(self.to_s, *args, &block) と同じです。
IO.foreach(self.to_s, *args, &block) と同じです。
//emlist[例][ruby]{
require "pathname"
IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line
# => #<Enumerator: IO:foreach("testfile")>
//}
//emlist[例 ブロックを指定][ruby]{
require "pathname"
IO.write("testfile", "line1\nline2,\nline3\... -
Pathname
# eql?(other) -> bool (9004.0) -
パス名を比較し、 other と同じなら真を返します。大文字小文字は区別されます。 other は Pathname オブジェクトでなければなりません。
パス名を比較し、 other と同じなら真を返します。大文字小文字は区別されます。
other は Pathname オブジェクトでなければなりません。
パス名の比較は単純にパス文字列の比較によって行われるので、論理的に
同じパスでもパス文字列が違えば異なると判断されます。
@param other 比較対象の Pathname オブジェクトを指定します。
//emlist[例][ruby]{
require 'pathname'
p Pathname.new("foo/bar") == Pathname.new("foo/bar")
p Pathname.new("foo/bar"... -
Pathname
# executable? -> bool (9004.0) -
FileTest.executable?(self.to_s) と同じです。
FileTest.executable?(self.to_s) と同じです。
@see FileTest.#executable? -
Pathname
# executable _ real? -> bool (9004.0) -
FileTest.executable_real?(self.to_s) と同じです。
FileTest.executable_real?(self.to_s) と同じです。
@see FileTest.#executable_real? -
Pathname
# exist? -> bool (9004.0) -
FileTest.exist?(self.to_s) と同じです。
FileTest.exist?(self.to_s) と同じです。
@see FileTest.#exist? -
Pathname
# file? -> bool (9004.0) -
FileTest.file?(self.to_s) と同じです。
FileTest.file?(self.to_s) と同じです。
@see FileTest.#file? -
Pathname
# find(ignore _ error: true) -> Enumerator (9004.0) -
self 配下のすべてのファイルやディレクトリを 一つずつ引数 pathname に渡してブロックを実行します。
self 配下のすべてのファイルやディレクトリを
一つずつ引数 pathname に渡してブロックを実行します。
require 'find'
Find.find(self.to_s) {|f| yield Pathname.new(f)}
と同じです。
ブロックを省略した場合は Enumerator を返します。
@param ignore_error 探索中に発生した例外を無視するかどうかを指定します。
@see Find.#find -
Pathname
# fnmatch(pattern , *args) -> bool (9004.0) -
File.fnmatch(pattern, self.to_s, *args) と同じです。
File.fnmatch(pattern, self.to_s, *args) と同じです。
@param pattern パターンを文字列で指定します。ワイルドカードとして `*', `?', `[]' が使用できま
す。Dir.glob とは違って `{}' や `**/' は使用できません。
@param args File.fnmatch を参照してください。
//emlist[例][ruby]{
require "pathname"
path = Pathname("testfile")
path.fnmatch("test*") ... -
Pathname
# fnmatch?(pattern , *args) -> bool (9004.0) -
File.fnmatch?(pattern, self.to_s, *args) と同じです。
File.fnmatch?(pattern, self.to_s, *args) と同じです。
@param pattern パターンを文字列で指定します。ワイルドカードとして `*', `?', `[]' が使用できま
す。Dir.glob とは違って `{}' や `**/' は使用できません。
@param args File.fnmatch を参照してください。
@see File.fnmatch? -
Pathname
# ftype -> String (9004.0) -
File.ftype(self.to_s) と同じです。
File.ftype(self.to_s) と同じです。
@see File.ftype -
Pathname
# grpowned? -> bool (9004.0) -
FileTest.grpowned?(self.to_s) と同じです。
FileTest.grpowned?(self.to_s) と同じです。
@see FileTest.#grpowned? -
Pathname
# hash -> Integer (9004.0) -
ハッシュ値を返します。
ハッシュ値を返します。 -
Pathname
# lchmod(mode) -> Integer (9004.0) -
File.lchmod(mode, self.to_s) と同じです。
File.lchmod(mode, self.to_s) と同じです。
@param mode ファイルのアクセス権限を整数で指定します。
@see File.lchmod -
Pathname
# lchown(owner , group) -> Integer (9004.0) -
File.lchown(owner, group, self.to_s) と同じです。
File.lchown(owner, group, self.to_s) と同じです。
@param owner オーナーを指定します。
@param group グループを指定します。
@see File.lchown -
Pathname
# lstat -> File :: Stat (9004.0) -
File.lstat(self.to_s) と同じです。
File.lstat(self.to_s) と同じです。
@see File.lstat -
Pathname
# make _ link(old) -> 0 (9004.0) -
File.link(old, self.to_s) と同じです。
File.link(old, self.to_s) と同じです。
@see File.link -
Pathname
# make _ symlink(old) -> 0 (9004.0) -
File.symlink(old, self.to_s) と同じです。
File.symlink(old, self.to_s) と同じです。
@see File.symlink -
Pathname
# mkdir(*args) -> 0 (9004.0) -
Dir.mkdir(self.to_s, *args) と同じです。
Dir.mkdir(self.to_s, *args) と同じです。
@see Dir.mkdir -
Pathname
# mkpath -> nil (9004.0) -
FileUtils.mkpath(self.to_s) と同じです。
FileUtils.mkpath(self.to_s) と同じです。
@see FileUtils.#mkpath -
Pathname
# mountpoint? -> bool (9004.0) -
self がマウントポイントであれば真を返します。
self がマウントポイントであれば真を返します。
//emlist[例][ruby]{
require "pathname"
path = Pathname("/")
path.mountpoint? # => true
path = Pathname("/usr")
path.mountpoint? # => false
//} -
Pathname
# mtime -> Time (9004.0) -
File.mtime(self.to_s) を渡したものと同じです。
File.mtime(self.to_s) を渡したものと同じです。
@see File.mtime -
Pathname
# open(mode = & # 39;r& # 39; , perm = 0666) -> File (9004.0) -
File.open(self.to_s, *args, &block) と同じです。
File.open(self.to_s, *args, &block) と同じです。
@see File.open -
Pathname
# open(mode = & # 39;r& # 39; , perm = 0666) {|file| . . . } -> object (9004.0) -
File.open(self.to_s, *args, &block) と同じです。
File.open(self.to_s, *args, &block) と同じです。
@see File.open -
Pathname
# opendir -> Dir (9004.0) -
Dir.open(self.to_s, &block) と同じです。
Dir.open(self.to_s, &block) と同じです。
@see Dir.open -
Pathname
# opendir {|dir| . . . } -> nil (9004.0) -
Dir.open(self.to_s, &block) と同じです。
Dir.open(self.to_s, &block) と同じです。
@see Dir.open -
Pathname
# owned? -> bool (9004.0) -
FileTest.owned?(self.to_s) と同じです。
FileTest.owned?(self.to_s) と同じです。
@see FileTest.#owned? -
Pathname
# pipe? -> bool (9004.0) -
FileTest.pipe?(self.to_s) と同じです。
FileTest.pipe?(self.to_s) と同じです。
@see FileTest.#pipe? -
Pathname
# read(*args) -> String | nil (9004.0) -
IO.read(self.to_s, *args)と同じです。
IO.read(self.to_s, *args)と同じです。
@see IO.read -
Pathname
# readable? -> bool (9004.0) -
FileTest.readable?(self.to_s) と同じです。
FileTest.readable?(self.to_s) と同じです。
@see FileTest.#readable? -
Pathname
# readable _ real? -> bool (9004.0) -
FileTest.readable_real?(self.to_s) と同じです。
FileTest.readable_real?(self.to_s) と同じです。
@see FileTest.#readable_real? -
Pathname
# readlines(*args) -> [String] (9004.0) -
IO.readlines(self.to_s, *args)と同じです。
IO.readlines(self.to_s, *args)と同じです。
@see IO.readlines -
Pathname
# relative? -> bool (9004.0) -
self が相対パス指定であれば真を返します。
self が相対パス指定であれば真を返します。
//emlist[例][ruby]{
require 'pathname'
p = Pathname.new('/im/sure')
p.relative? #=> false
p = Pathname.new('not/so/sure')
p.relative? #=> true
//} -
Pathname
# rmdir -> 0 (9004.0) -
Dir.rmdir(self.to_s) と同じです。
Dir.rmdir(self.to_s) と同じです。
@see Dir.rmdir -
Pathname
# rmtree -> nil (9004.0) -
FileUtils.rm_r(self.to_s) と同じです。
FileUtils.rm_r(self.to_s) と同じです。
@see FileUtils.#rm_r