This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BUNDLE_BIN: .bundle/bin | |
BUNDLE_SHEBANG: ruby-local-exec | |
BUNDLE_DISABLE_SHARED_GEMS: '1' | |
BUNDLE_PATH: vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a code example for the Ruby HTTP library Typhoeus | |
# here's an example for twitter search | |
# Including Typhoeus adds http methods like get, put, post, and delete. | |
# What's more interesting though is the stuff to build up what I call | |
# remote_methods. | |
class Twitter | |
include Typhoeus | |
remote_defaults :on_success => lambda {|response| JSON.parse(response.body)}, | |
:on_failure => lambda {|response| puts "error code: #{response.code}"}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# An unintrusive, temporary DSL strategy. | |
# | |
# Why discusses Ruby DSLs and instance_eval vs. block arguments: | |
# http://hackety.org/2008/10/06/mixingOurWayOutOfInstanceEval.html | |
# | |
# This takes advantage of some Ruby 1.9 features to implement a DSL mixin that | |
# is temporary and doesn't override locally defined methods. | |
class DslInstance | |
attr_accessor :script | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ::Cli | |
def start | |
::Api.new(self) | |
end | |
end | |
class ::Api | |
end | |
describe ::Cli do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Happy Birthday to you. | |
Happy Birthday to you. | |
Happy Birthday dear TAQTIQA. | |
Happy Birthday to you! |
NewerOlder