This file contains hidden or 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
| context setups | |
| + asserts should only run the setup once | |
| + asserts even with multiple assertions | |
| context setups that are nested | |
| + asserts gets run again | |
| + asserts only once per nesting, even with multiple assertions | |
| 4 passes, 0 failures, 0 errors in 0.000148 seconds |
This file contains hidden or 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
| module Farts | |
| def farts | |
| "pfft" | |
| end | |
| end | |
| hey = "yo" | |
| hey.farts # NoMethodError: undefined method `farts' for "yo":String |
This file contains hidden or 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
| outside = "foo" | |
| classy = Class.new do | |
| define_method(:get_thing) do | |
| outside | |
| end | |
| def get_thing_with_def | |
| outside | |
| end |
This file contains hidden or 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
| # via jaknowlden: | |
| irb(main):001:0> (k, v), *rest = [[1,2], [3,4], [5,6]] | |
| => [[1, 2], [3, 4], [5, 6]] | |
| irb(main):002:0> k | |
| => 1 | |
| irb(main):003:0> v | |
| => 2 | |
| irb(main):004:0> rest | |
| => [[3, 4], [5, 6]] |
This file contains hidden or 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
| hey = nil | |
| yo = "foo" | |
| baz = 3 if false | |
| puts hey.inspect | |
| puts yo.inspect | |
| puts baz.inspect # Nil!! | |
| puts spaz.inspect # Name Error |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'growl' | |
| require 'zendesk-api' | |
| require 'tinder' | |
| @z = Zendesk::Main.new("", "", "", :format => "json") | |
| def count_for_rule(rule) | |
| ticket_count = 0 |
This file contains hidden or 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
| irb(main):039:0* require 'zendesk-api' | |
| MissingSourceFile: no such file to load -- curb | |
| from /Users/alexrakoczy/local/Cellar/ruby-enterprise-edition/2009.10/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' | |
| from /Users/alexrakoczy/local/Cellar/ruby-enterprise-edition/2009.10/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' | |
| from /Users/alexrakoczy/local/Cellar/ruby-enterprise-edition/2009.10/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require' | |
| from /Users/alexrakoczy/local/Cellar/ruby-enterprise-edition/2009.10/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in' | |
| from /Users/alexrakoczy/local/Cellar/ruby-enterprise-edition/2009.10/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require' | |
| from /Users/alexrakoczy/local/Cellar/ruby-enterprise-edition/2009.10/lib/ruby/gems/1.8/ge |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'growl' | |
| require 'lighthouse/console' | |
| Lighthouse.account = "thepoint" | |
| Lighthouse.token = raise("Get your own key") | |
| proj_id = "13151-support" |
This file contains hidden or 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
| For each Ruby module/class, we have Ruby methods on the left and the equivalent | |
| Clojure functions and/or relevant notes are on the right. | |
| For clojure functions, symbols indicate existing method definitions, in the | |
| clojure namespace if none is explicitly given. clojure.contrib.*/* functions can | |
| be obtained from http://github.com/kevinoneill/clojure-contrib/tree/master, | |
| ruby-to-clojure.*/* functions can be obtained from the source files in this | |
| gist. | |
| If no method symbol is given, we use the following notation: |
This file contains hidden or 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
| #!/home/arakoczy/local/bin/ruby | |
| require 'rubygems' | |
| require 'cgi' | |
| require 'open-uri' | |
| require 'hpricot' | |
| query = CGI.escape(ARGV.shift) | |
| puts (Hpricot(open("http://google.com/search?q=#{query}"))%('.r b')).innerHTML |