Ruby

書式
配列名..each.with_index(0) do |num, index|
使用例

#!/usr/bin/ruby#クラスSampleの定義class Sample #文字列を出力 def testFu ...

Ruby

1.sublimeをダウンロード
URL:

2.sublimeのnodejsプラグインをダウンロード

3.zipファイルを解凍し、フォルダーを”Nodejs”にリネーム

Ruby

1.システムのインストールに必要なパッケージ
Xcodeのインストール

Homebrewのインストール
( ruby -e “$(curl -fsSL

2.RVMをインスト

Ruby

操作手順:

1.gem
gem ‘activeadmin’,github: ‘activeadmin’
gem ‘devise’

Ruby

書式
配列名.push(値)
使用例

#!/usr/bin/ruby# -*- coding: UTF-8 -*-cftArr=, ] cftArr.push()puts "result1\n"p cftArrp ...

Ruby

1.システムの必要なパッケージをインストール
sudo apt-get install -y build-essential openssl curl libcurl3-dev libreadline6 libreadline ...

Ruby

python2.x:
wget -O – | sudo python

python3.x
wget -O – | sudo python3.4

参考サイト  ...

Ruby

書式
文字列.length()
文字列.length
使用例

p "長さ:"p "arkgame".length()p "()を省略 長さ:"p "arkgame".lengthp "小文字2:" p " ...

Ruby

書式
配列名 +=「値」
配列名 <<「値」
使用例

#!/usr/bin/ruby# -*- coding: UTF-8 -*-cftA= cftA += puts "+演算子 result ...

Ruby

書式
return 値
使用例

#!/usr/bin/ruby# -*- coding: UTF-8 -*-#戻り値メソッドAdef testA(nn) return nn + 2end#戻り値メソッドBdef ...

Ruby

使用例

#!/usr/bin/ruby# -*- coding: UTF-8 -*-users = puts usersp usersemps = puts empsp emps

実行結果
>ruby test ...

Ruby

書式
def 関数名?(引数名)
some code
end
使用例

#!/usr/bin/ruby# -*- coding: UTF-8 -*-def testFuncA?(nn) return ...

Ruby

書式
class クラス名
メンバ変数
end
インスタンス変数名 = クラス名.new
使用例

#!/usr/bin/ruby# -*- coding: UTF-8 -*-class U ...

Ruby

書式
配列名.grep(/条件式/)
使用例

#!/usr/bin/ruby# -*- coding: UTF-8 -*-target = p "正規表現grepで値を抽出結果" p target.grep(/m ...

Ruby

#奇数ビット列の文字列対称を判断 例 “aba”
def method str
p str == str.reverse ? “Yes” : “No̶ ...

Ruby

書式
match(/\d+/)
使用例

strA = "Study 111 Ruby 222 Skill in arkgame"strB = "Study Ruby 444 Skill in arkgame"st ...

Ruby

rubyコード:
require ‘zlib’

deflated = Zlib::Deflate.deflate(“これはテストプログラム.”)
puts d ...

Ruby

rubyコード:
require ‘tk’
top = TkRoot.new {title “TKListboxサンプル”}

list1 = TkListbo ...