Skip to content

Instantly share code, notes, and snippets.

begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
source "https://rubygems.org"
gem "rails", github: "rails/rails"
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
source "https://rubygems.org"
gem "rails", github: "rails/rails"
require 'spec_helper'
describe 'gluster::client', :type => :class do
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:facts) do
facts
end
context "with all defaults"
it { should compile.with_all_deps }
@domcleal
domcleal / cloudapp-export.rb
Last active April 15, 2016 06:59 — forked from adamcooke/cloudapp-export.rb
Export all your drops from CloudApp using this quick Ruby script
#!/usr/bin/env ruby
# A quick script to download all your files from CloudApp.
# To run this just run the script passing your e-mail & password
# to the script, for example:
#
# gem install cloudapp_api
# ruby cloudapp-export.rb adam@atechmedia.com mypassword
#
require 'minitest/autorun'
require 'minitest/spec'
describe "#parse(builder)" do
describe "without documentation" do
specify { false.must_equal true } # won't be run
end
specify { true.must_equal true } # always runs
end
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
gem 'rails', github: 'rails/rails'
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
gem 'rails', github: 'rails/rails'
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "centos-64-x64-kvm-2"
def require_ip_validation?
# if it's not managed there's nowhere to specify an IP anyway
return false unless managed?
# if the CR will provide an IP, then don't validate yet
return false if compute? && compute_resource.provided_attributes.keys.include?(:ip)
ip_for_dns = (subnet.present? && subnet.dns_id.present?) || (domain.present? && domain.dns_id.present?)
ip_for_dhcp = subnet.present? && subnet.dhcp_id.present?
ip_for_token = Setting[:token_duration] == 0 && !capabilities.include?(:image)
# Any of these conditions will require an IP, so chain with OR
ip_for_dns or ip_for_dhcp or ip_for_token
@domcleal
domcleal / -
Created November 20, 2013 12:48
diff --git a/db/migrate/20100523114430_add_ubuntu_custom_lvm_ptable.rb b/db/migrate/20100523114430_add_ubuntu_custom_lvm_ptable.rb
index 786219c..93920e5 100644
--- a/db/migrate/20100523114430_add_ubuntu_custom_lvm_ptable.rb
+++ b/db/migrate/20100523114430_add_ubuntu_custom_lvm_ptable.rb
@@ -1,6 +1,6 @@
class AddUbuntuCustomLvmPtable < ActiveRecord::Migration
def self.up
- Ptable.create :name => "Ubuntu custom LVM", :layout => <<EOF
+ p = Ptable.new :name => "Ubuntu custom LVM", :layout => <<EOF
d-i partman-auto/disk string /dev/sda