Skip to content

Instantly share code, notes, and snippets.

>> require 'time'
=> true
>> t = Time.parse("Thu Mar 15 17:24:22 +0000 2007")
=> Thu Mar 15 11:24:22 -0600 2007
>> File.utime(t,t,"test")
=> 1
>> File.mtime("test")
=> Thu Mar 15 11:24:22 -0600 2007
class RPSLS
TYPES = ["Rock", "Paper", "Scissors", "Lizard", "Spock"]
RESOLVER = { "Rock" => ["Scissors", "Lizard"],
"Paper" => ["Rock", "Spock"],
"Scissors" => ["Paper", "Lizard"],
"Lizard" => ["Paper", "Spock"],
"Spock" => ["Scissors", "Rock"] }
def self.get_type(type)
case
when a.include?('2')
puts 'something'
when a.include?('b')
puts 'something else'
else
puts 'whatever'
end
vagrant up
[INFO 05-03-2010 22:25:35] Vagrant: Importing base VM (/Users/andrew/.vagrant/boxes/base/box.ovf)...
[INFO 05-03-2010 22:27:45] Vagrant: Persisting the VM UUID (5a8eb3b4-c885-4e0b-8d2f-936c49c16a94)...
/opt/local/lib/ruby/gems/1.8/gems/json_pure-1.2.4/lib/json/common.rb:132:in `initialize': A JSON text must at least contain two octets! (JSON::ParserError)
[INFO 05-04-2010 00:30:02] Vagrant: Persisting the VM UUID (0efa8468-c1c8-4c48-a337-3f74eb0c42a9)...
/opt/local/lib/ruby/gems/1.8/gems/json_pure-1.2.4/lib/json/common.rb:132:in `initialize': A JSON text must at least contain two octets! (JSON::ParserError)
from /opt/local/lib/ruby/gems/1.8/gems/json_pure-1.2.4/lib/json/common.rb:132:in `new'
from /opt/local/lib/ruby/gems/1.8/gems/json_pure-1.2.4/lib/json/common.rb:132:in `parse'
from /opt/local/lib/ruby/gems/1.8/gems/vagrant-0.3.3.dev/lib/vagrant/active_list.rb:29:in `list'
from /opt/local/lib/ruby/gems/1.8/gems/vagrant-0.3.3.dev/lib/vagrant/active_list.rb:28:in `open'
from /opt/local/lib/ruby/gems/1.8/gems/vagrant-0.3.3.dev/lib/vagrant/active_list.rb:28:in `list'
from /opt/local/lib/ruby/gems/1.8/gems/vagrant-0.3.3.dev/lib/vagrant/active_list.rb:51:in `add'
from /opt/local/lib/ruby/gems/1.8/gems/vagrant-0.3.3.dev/lib/vagrant/environment.rb:220:in `persist_vm'
from /opt/local/lib/ruby/gems/1.8/ge
baraka:vagrant andrew$ vagrant up
[INFO 05-04-2010 00:44:40] Vagrant: VM already created. Starting VM if its not already running...
[INFO 05-04-2010 00:44:41] Vagrant: Running any VM customizations...
[INFO 05-04-2010 00:44:42] Vagrant: Deleting any previously set forwarded ports...
[INFO 05-04-2010 00:44:42] Vagrant: Forwarding ports...
[INFO 05-04-2010 00:44:42] Vagrant: Forwarding "ssh": 22 => 2222
[INFO 05-04-2010 00:44:42] Vagrant: Clearing previously set shared folders...
[INFO 05-04-2010 00:44:43] Vagrant: Creating shared folders metadata...
[INFO 05-04-2010 00:44:44] Vagrant: Booting VM...
[INFO 05-04-2010 00:44:44] Vagrant: Waiting for VM to boot...
instead of billing_step_1
class ContactInfo
attr_accessor :address_line_1, :address_line_2, :city, :region_id, :country_id, :phone
def initialize
def initialize(addy_line_1, addy_line_2, city, region_id, country_id, phone)
@address_line_1 = addy_line_1
@address_line_2 = addy_line_2
class Browser
def self.get_instance
@@browser || = Watir::Browser.new
@@browser
end
end
directory foo do
not_if "test -d #{foo}"
end
Vagrant::Config.run do |config|
# All Vagrant configuration is done here. For a detailed explanation
# and listing of configuration options, please view the documentation
# online.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "lensid"
#chef stuff
config.vm.provisioner = :chef_solo