Skip to content

Instantly share code, notes, and snippets.

@johnsonch
Created February 4, 2013 22:05
Show Gist options
  • Save johnsonch/4710126 to your computer and use it in GitHub Desktop.
Save johnsonch/4710126 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# In order to make this script run stand alone it needs to run in the context of the gem set that has 'fog' installed.
# However to run as an included file in a spec file it will already need to be in that gemset
if $0 == __FILE__
require 'rvm'
File.open(File.join(File.dirname(__FILE__), '..', '.rvmrc')) do |f|
@rvmrc_gemset = f.read.match(/(ruby[^ ]+)/)[1]
end
RVM.current.use! @rvmrc_gemset
end
end
require 'rubygems'
require 'fog'
# Do some fun scripting stuff with fog!
Class Servers
def new
server = Compute[:aws].servers.create(:image_id => 'ami-5ee70037')
end
end
require 'script.rb'
describe "my test" do
it 'is a fake test' do
Servers.new.should
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment