Created
February 4, 2013 22:05
-
-
Save johnsonch/4710126 to your computer and use it in GitHub Desktop.
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
#!/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 |
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 '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