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
print "How old are you?", | |
age = raw_input() | |
print "How tall are you?", | |
height = raw_input() | |
print "How much do you weigh?", | |
weight = raw_input() | |
print "So, you're %r old, %r tall and %r heavy." % ( | |
age, height, weight) |
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
require 'highline' | |
hl = HighLine.new | |
desc "Create an admin user for the current environment" | |
task :create_admin => :environment do | |
puts "\n== Creating an admin ==\n" | |
email = hl.ask(' Email: ') | |
password = hl.ask(' Password: ') { |q| q.echo = '*' } |
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
Running: 'time rake spec' | |
== ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.6.0] | |
Finished in 0.31999 seconds | |
5 examples, 0 failures | |
real 0m12.500s | |
user 0m10.200s | |
sys 0m1.676s |
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
Rubinius Crash Report #rbxcrashreport | |
[[Exception]] | |
A toplevel exception occurred | |
Thread has been interrupted (Interrupt) | |
Backtrace: | |
{ } in Rubinius::Loader#signals at kernel/loader.rb:124 | |
Signal.run_handler at kernel/common/signal.rb:68 | |
Rubinius.received_signal at kernel/delta/rubinius.rb:240 |
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
# config/initializers/app_config.rb | |
# An initializer that contains config stuff | |
# ... | |
class RedisConfig < Settingslogic | |
source "#{Rails.root}/config/redis.yml" | |
namespace Rails.env | |
end |
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
... | |
group :development, :test do | |
gem 'rspec-rails' | |
gem 'capybara' | |
gem 'spork', '~> 0.9.0.rc' | |
... | |
gem 'rb-fsevent' # recommended for non-polling filesystem event notifications | |
gem 'growl' | |
gem 'guard' |
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
require 'rubygems' | |
require 'spork' | |
Spork.prefork do | |
# Loading more in this block will cause your tests to run faster. However, | |
# if you change any configuration or code from libraries loaded here, you'll | |
# need to restart spork for it take effect. | |
ENV["RAILS_ENV"] ||= 'test' | |
require File.expand_path("../../config/environment", __FILE__) | |
require 'rspec/rails' |
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
redis_instance.pipelined do | |
[1,2,3].each do |item| | |
redis_instance.sadd 'some_key', item | |
end | |
end |
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
/Users/jacortinas/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/x86_64-darwin11.4.0/psych.bundle: warning: already initialized constant ANY | |
/Users/jacortinas/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/x86_64-darwin11.4.0/psych.bundle: warning: already initialized constant UTF8 | |
/Users/jacortinas/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/x86_64-darwin11.4.0/psych.bundle: warning: already initialized constant UTF16LE | |
/Users/jacortinas/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/x86_64-darwin11.4.0/psych.bundle: warning: already initialized constant UTF16BE | |
/Users/jacortinas/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/psych/nodes/stream.rb:12: warning: already initialized constant ANY | |
/Users/jacortinas/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/psych/nodes/stream.rb:15: warning: already initialized constant UTF8 | |
/Users/jacortinas/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/psych/nodes/stream.rb:18: warning: already initialized constant UTF16LE | |
/Users/jacortinas/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/psych/nodes/stream.rb: |
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
# app/models/user/authentication.rb | |
require 'bcrypt' | |
class User | |
# Password authentication related methods and utilities. | |
module Authentication | |
extend ActiveSupport::Concern | |
module ClassMethods |