my month with ruby
Post on 19-Jul-2015
80 Views
Preview:
TRANSCRIPT
Who is this guy?
- Alex Tomovski
- Backend Developer (primarily)
- Scala, Java, Groovy
- Recently crossed to the dark side… JS
How did I end up coding Ruby?
- Joined Wix in the summer.
- No project was waiting for me.
- Finally after two weeks I got a call…
What was I supposed to build?
- Thin Rest Wrapper
- But why?- Make developers life easier.
- Annoying request signing logic
- Document and provide examples for the APIs
Where do you start???
- Book: The Ruby Programming language
- IRB
- Setup the project
- Look at other examples/tools- www.ruby-toolbox.com
Setting up the project
- Bundler and Rake
- Love at first sight (especially for bundler)
I want less of this: and more of this:
Testing a dynamic language
- Paranoia!- What happens if someone
passes the wrong type?
- Guard statements
everywhere?
- Wait do I care?
Integration (e2e) Tests
- Easier refactoring
- Faster bug discovery
- VCR- https://github.com/vcr/vcr
- Records HTTP Interactions
- Fast re-execution
- Helps with debugging
Introducing Hashie
- Best of two worlds- https://github.com/intridea/hashie
Too much magic
- It was all great until this:
/hashie/dash.rb:41:in `block in property': wrong number of arguments (1 for 0)
(ArgumentError)
from /hashie-3.2.0/lib/hashie/hash.rb:48:in `flexibly_convert_to_hash'
from /hashie-3.2.0/lib/hashie/hash.rb:34:in `block in to_hash'
from /hashie-3.2.0/lib/hashie/hash.rb:20:in `each'
from /hashie-3.2.0/lib/hashie/hash.rb:20:in `to_hash'
from /hashie-3.2.0/lib/hashie/hash.rb:42:in `to_json'
Thank you!
Questions, Comments?
Repo: https://github.com/wix/wix-hive-ruby
top related