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
| ruby-1.9.2-p0 > def greeter name | |
| ruby-1.9.2-p0 ?> print "hello, #{name}" | |
| ruby-1.9.2-p0 ?> end | |
| => nil | |
| ruby-1.9.2-p0 > greeter "hooobs" | |
| hello, hooobs => nil | |
| ruby-1.9.2-p0 > greeterhash = { "greet" => greeter } | |
| ArgumentError: wrong number of arguments (0 for 1) | |
| from (irb):2:in `greeter' | |
| from (irb):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
| [2011-05-30 23:43:25] /usr/local/rvm/wrappers/rbx-head/ruby ./configure --prefix=/usr/local/rvm/rubies/rbx-head --skip-system | |
| You are attempting to build using the instance of Rubinius that you are building. | |
| To resolve this issue: | |
| * Remove '/usr/local/rvm/rubies/rbx-head/bin' from your PATH. | |
| * Use a Ruby executable other than '/usr/local/rvm/rubies/rbx-head/bin/rbx' to build. | |
| 'configure' has failed. Please check configure.log for more details. |
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
| ruby-1.9.2-p180 :046 > Class Foo | |
| NameError: uninitialized constant Object::Foo | |
| from (irb):46 | |
| from /home/christopher/.rvm/rubies/ruby-1.9.2-p180/bin/irb:16:in `<main>' | |
| ruby-1.9.2-p180 :047 > class Foo | |
| ruby-1.9.2-p180 :048?> class Bar | |
| ruby-1.9.2-p180 :049?> end | |
| ruby-1.9.2-p180 :050?> end | |
| => nil | |
| ruby-1.9.2-p180 :051 > Foo.new |
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
| !!! | |
| %html | |
| %head | |
| %meta{'http-equiv' => 'Content-Type', :content => 'text/html; charset=UTF-8'}/ | |
| %body | |
| %p== Yo #{@user.first_name}, | |
| %p== We heard you like testing mailers, so we put a mailer in your spec so you could test while you mail! | |
| %p | |
| = link_to "Click this here link!", swanky_meme_url | |
| %p |
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
| # this goes in lib/resque/failure/notifier.rb | |
| require 'resque/failure/multiple' | |
| require 'resque/failure/redis' | |
| require 'postmark' | |
| require 'mail' | |
| module Resque | |
| module Failure | |
| class Notifier < Base |
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
| # fancy code here for the post model | |
| extend Resque::Plugins::Retry | |
| @queue = :posts | |
| # set to 120 limit at 30 delay (one post every 30sec for 1hr) | |
| @retry_limit = 120 | |
| @retry_delay = 30 | |
| # more fancy post model code here as well |
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
| def execute_watches | |
| self.class.watchers.collect do |watcher_array| | |
| label, watcher_hash = watcher_array | |
| triggered_times[label] ||= 0 | |
| matcher_result = self.instance_eval(&watcher_hash[:matcher])#.call(@redis) | |
| triggered = matcher_result[:triggered] | |
| value = matcher_result[:value] | |
| notice = append_label_value(label, value, triggered) | |
| times_was = triggered_times[label] |
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
| require 'rubygems' | |
| require 'sinatra' | |
| require 'redis' | |
| # To use, simply start your Redis server and boot this | |
| # example app with: | |
| # ruby example_note_keeping_app.rb | |
| # | |
| # Point your browser to http://localhost:4567 and enjoy! | |
| # |
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
| source 'http://rubygems.org' | |
| gem 'scamp' | |
| gem 'slop' | |
| gem 'minitest' |
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
| [22:40][christopher@hbp:~]$ rvm install rbx -- --default-version=1.9 | |
| rbx-head installing #dependencies | |
| Pulling from origin head | |
| ERROR: Error running 'git reset --hard HEAD ; git pull --rebase origin head', please read /Users/christopher/.rvm/log/rbx-head/rbx.repo.log | |
| Copying from repo to source... | |
| rbx-head - #configuring | |
| ERROR: Error running '/Users/christopher/.rvm/wrappers/ruby-1.8.7-p334/ruby ./configure --prefix=/Users/christopher/.rvm/rubies/rbx-head --skip-system --default-version=1.9', please read /Users/christopher/.rvm/log/rbx-head/configure.log | |
| ERROR: There has been an error while running '/Users/christopher/.rvm/wrappers/ruby-1.8.7-p334/ruby ./configure --prefix=/Users/christopher/.rvm/rubies/rbx-head --skip-system --default-version=1.9'. | |
| Halting the installation. |