別のキーワード
ライブラリ
クラス
- Module (36)
-
Net
:: HTTP (144) -
Net
:: POP3 (12) - Proc (14)
- Refinement (4)
-
Shell
:: ProcessController (6) - Socket (36)
モジュール
- Kernel (75)
-
Socket
:: Constants (36)
オブジェクト
- main (12)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - CSV (12)
-
IFF
_ CANTCONFIG (24) -
MSG
_ DONTROUTE (24) -
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 1 . 0 (12) -
NEWS for Ruby 2
. 7 . 0 (6) -
NEWS for Ruby 3
. 0 . 0 (5) - Ruby用語集 (12)
-
SO
_ DONTROUTE (24) -
USING
_ AT _ EXIT _ WHEN _ PROCESS _ EXIT (6) -
auth
_ only (12) - bigdecimal (12)
-
check
_ signedness (24) -
convertible
_ int (24) - get (24)
- get2 (24)
-
import
_ methods (4) - lambda (13)
-
net
/ smtp (12) - new (14)
- post (24)
- post2 (24)
- proc (14)
- refine (12)
-
request
_ get (24) -
request
_ post (24) -
rubygems
/ security (12) - shell (6)
-
used
_ modules (12)
検索結果
先頭5件
- Net
:: HTTP # request _ get(path , header = nil) -> Net :: HTTPResponse - Net
:: HTTP # request _ get(path , header = nil) {|response| . . . . } -> Net :: HTTPResponse - Net
:: HTTP # request _ post(path , data , header = nil) -> Net :: HTTPResponse - Net
:: HTTP # request _ post(path , data , header = nil) {|response| . . . . } -> Net :: HTTPResponse - Net
:: POP3 . auth _ only(address , port = nil , account , password , isapop=false)
-
Net
:: HTTP # request _ get(path , header = nil) -> Net :: HTTPResponse (6.0) -
サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。
...t[例][ruby]{
# example
response = http.request_get('/index.html')
p response['content-type']
puts response.body # body is already read
# using block
http.request_get('/index.html') {|response|
p response['content-type']
response.read_body do |str| # read body now
print str
end... -
Net
:: HTTP # request _ get(path , header = nil) {|response| . . . . } -> Net :: HTTPResponse (6.0) -
サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。
...t[例][ruby]{
# example
response = http.request_get('/index.html')
p response['content-type']
puts response.body # body is already read
# using block
http.request_get('/index.html') {|response|
p response['content-type']
response.read_body do |str| # read body now
print str
end... -
Net
:: HTTP # request _ post(path , data , header = nil) -> Net :: HTTPResponse (6.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。 返り値は Net::HTTPResponse のインスタンスです。
...[ruby]{
response = http.request_post('/cgi-bin/nice.rb', 'datadatadata...')
p response.status
puts response.body # body is already read
# using block
http.request_post('/cgi-bin/nice.rb', 'datadatadata...') {|response|
p response.status
p response['content-type']
response.read_body d... -
Net
:: HTTP # request _ post(path , data , header = nil) {|response| . . . . } -> Net :: HTTPResponse (6.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。 返り値は Net::HTTPResponse のインスタンスです。
...[ruby]{
response = http.request_post('/cgi-bin/nice.rb', 'datadatadata...')
p response.status
puts response.body # body is already read
# using block
http.request_post('/cgi-bin/nice.rb', 'datadatadata...') {|response|
p response.status
p response['content-type']
response.read_body d... -
Net
:: POP3 . auth _ only(address , port = nil , account , password , isapop=false) (6.0) -
POP セッションを開き、認証だけを行って接続を切ります。
...に POP before SMTP のために用意されています。
使用例:
require 'net/pop'
Net::POP3.auth_only('pop.example.com', nil, # using default port (110)
'YourAccount', 'YourPassword')
@param address POP3サーバのホスト名文字列
@param port 接続す... -
Proc
. new -> Proc (6.0) -
ブロックをコンテキストとともにオブジェクト化して返します。
...ブロックを指定しない場合、Ruby 2.7 では
$VERBOSE = true のときには警告メッセージ
「warning: Capturing the given block using Proc.new is deprecated; use `&block` instead」
が出力され、Ruby 3.0 では
ArgumentError (tried to create Proc object without a block)
が... -
Proc
. new { . . . } -> Proc (6.0) -
ブロックをコンテキストとともにオブジェクト化して返します。
...ブロックを指定しない場合、Ruby 2.7 では
$VERBOSE = true のときには警告メッセージ
「warning: Capturing the given block using Proc.new is deprecated; use `&block` instead」
が出力され、Ruby 3.0 では
ArgumentError (tried to create Proc object without a block)
が... -
Refinement
# import _ methods(*modules) -> self (6.0) -
モジュールからメソッドをインポートします。
...st[][ruby]{
module StrUtils
def indent(level)
' ' * level + self
end
end
module M
refine String do
import_methods StrUtils
end
end
using M
p "foo".indent(3) # => " foo"
module M
refine String do
import_methods Enumerable
# Can't import method which is not defined with... -
bigdecimal (6.0)
-
bigdecimal は浮動小数点数演算ライブラリです。 任意の精度で 10 進表現された浮動小数点数を扱えます。
...{
#!/usr/local/bin/ruby
require "bigdecimal"
#
# Calculates 3.1415.... (the number of times that a circle's diameter
# will fit around the circle) using J. Machin's formula.
#
def big_pi(sig) # sig: Number of significant figures
exp = -sig
pi = BigDecimal("0")
two = BigDecimal("2")... -
shell (6.0)
-
Ruby 上で sh/csh のようにコマンドの実行及びフィルタリングを手軽に行うためのライブラリです。
...f = open("tmpFile", "w")
f.print "TEST\n"
f.close
end
print pwd
end
end
end
==== Example 3: Using Pipe
require 'shell'
sh = Shell.new
sh.cat("/etc/printcap") | sh.tee("tee1") > "tee2"
(sh.cat < "/etc/printcap") | sh.tee("tee11") > "tee...