ruby 언어를 새로 배우면서 많이 혼란스럽다. 공부하면서 계속 정리 해야 할 것 같다. 

(계속 내용 변경 예정)



reserved word
http://www.tutorialspoint.com/ruby/ruby_quick_guide.htm

equal check
http://stackoverflow.com/questions/7156955/whats-the-difference-between-equal-eql-and

4 variables and scope
http://strugglingwithruby.blogspot.dk/2010/03/variables.html

operator
http://www.tutorialspoint.com/ruby/ruby_operators.htm

loop
http://www.tutorialspoint.com/ruby/ruby_loops.htm

class & module
http://stackoverflow.com/questions/151505/difference-between-a-class-and-a-module
http://www.rootr.net/rubyfaq-8.html

symbol
http://www.rootr.net/rubyfaq-6.html


java 개발에서 ruby 개발할 때 주의 사항
https://www.ruby-lang.org/en/documentation/ruby-from-other-languages/to-ruby-from-java/
(==, equal이 java와 ruby는 반대다...)


일반 operator 설명 
http://en.wikibooks.org/wiki/Ruby_Programming/Syntax/Operators

ruby 파일을 읽는 4가지 방법

https://practicingruby.com/articles/ways-to-load-code

block, proc, lamba 비교
http://www.reactive.io/tips/2008/12/21/understanding-ruby-blocks-procs-and-lambdas/


inspect & to_s

http://stackoverflow.com/questions/2625667/why-do-this-ruby-object-have-two-to-s-and-inspect-methods-that-seems-do-the-same


yield

http://stackoverflow.com/questions/10451060/use-of-yield-and-return-in-ruby

http://stackoverflow.com/questions/764134/rubys-yield-feature-in-relation-to-computer-science/765126#765126



! (bang)

http://stackoverflow.com/questions/612189/why-are-exclamation-marks-used-in-ruby-methods

https://coderwall.com/p/rgvk4g

irb(main):015:0* name = 'knight76'

=> "knight76"

irb(main):016:0> name.sub('k', 'x')

=> "xnight76"

irb(main):017:0> name

=> "knight76"

irb(main):018:0> name.sub!('k', 'x')

=> "xnight76"

irb(main):019:0> name

=> "xnight76"

http://stackoverflow.com/questions/7561572/why-would-you-use-a-operator


named parameter

http://brainspec.com/blog/2012/10/08/keyword-arguments-ruby-2-0/


lazy init

http://patshaughnessy.net/2013/4/3/ruby-2-0-works-hard-so-you-can-be-lazy


동적 클래스 메소드 재정의 (monkeypatching / open class)

http://www.runtime-era.com/2012/12/reopen-and-modify-ruby-classes-monkey.html


array.sample(랜덤으로 값 가지고 오기)

http://www.ruby-doc.org/core-2.1.2/Array.html#method-i-sample



* 테스트쪽


rspec-expect
https://www.relishapp.com/rspec/rspec-expectations/v/3-0/docs/built-in-matchers/equality-matchers

rspec 

http://code.tutsplus.com/tutorials/ruby-for-newbies-testing-with-rspec--net-21297

http://magazine.rubyist.net/?0035-RSpecInPractice

http://magazine.rubyist.net/?0021-Rspec

http://magazine.rubyist.net/?0032-TranslationArticle

http://blog.carbonfive.com/2010/10/21/rspec-best-practices/

(한글) http://betterspecs.org/ko/index.html
(command line) https://www.relishapp.com/rspec/rspec-core/v/2-4/docs/command-line


binding.pry (irb와 비슷)
http://knight76.tistory.com/entry/ruby-%EB%94%94%EB%B2%84%EA%B7%B8debug-%EC%89%BD%EA%B2%8C-%ED%95%98%EA%B8%B0


sinatra (http url mockup)

http://www.sinatrarb.com/intro.html

get '/download/*.*' do |path, ext|
  [path, ext] # => ["path/to/file", "xml"]
end


faraday - http 연결 client

http://mislav.uniqpath.com/2011/07/faraday-advanced-http/


active record - DB 연결

http://rubylearning.com/satishtalim/ruby_activerecord_and_mysql.html



<특이 함수>

- list의 empty string을 없애기
url.reject! { |c| c.empty? }

- string에서 grep을 바로 쓸 수 없어서. enumerable로 변경해서 grep을 사용

link.lines.grep(/aaa/)



Posted by '김용환'
,