ruby -cw xx.rb
ruby检查代码语法 ruby 后面加个 -cw
PS C:\Users\Administrator\RubyCode> more ex11.rb
# missing "
puts "Hello ,world
PS C:\Users\Administrator\RubyCode> ruby -cw ex11.rb
ex11.rb:2: unterminated string meets end of file
ruby xx.rb
ruby运行代码
PS C:\Users\Administrator\RubyCode> more ex11.rb
# no missing "
puts "Hello ,world "
PS C:\Users\Administrator\RubyCode> ruby ex11.rb
Hello ,world
Variable
各种变量的约定写法举例,akarin~( ‘-^ )-☆
Type | Ruby convention |
---|---|
Local | akaza_akarin |
Instance | @akaza_akarin |
Class | @@akaza_akarin |
Global | $akaza_akarin |
Reference
《The Well-Grounded Rubyist, Second Edition》
(https://www.manning.com/books/the-well-grounded-rubyist-second-edition)1.1.2. The variety of Ruby identifiers
1.1.3. Method calls, messages, and Ruby objects
1.1.4. Writing and saving a simple program
1.1.5. Feeding the program to Rubyhttp://www.ioccc.org/2011/akari/akari.c
http://www.csdn.net/article/2012-04-25/2805007
∧_∧
(・_・ =)
_φノ__⊂)__
/ /三/ /|
|| ̄ ̄ ̄ ̄~|| |
|| ̄| ̄∪∪|| |
||/ ||/
http://emoji.vis.ne.jp/benkyo_chu12.htm