This file contains hidden or 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
#!/bin/bash | |
if [[ -z $GOLANG_VERSION ]]; then | |
GOLANG_VERSION=1.1.1 | |
echo "No version provided for go, will use the last one: $GOLANG_VERSION" 1>&2 | |
fi | |
set -e | |
ARCH=`uname -m` |
This file contains hidden or 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
RSpec.configure do |conf| | |
conf.module_path = File.join(fixture_path, 'modules') | |
conf.manifest_dir = File.join(fixture_path, 'manifests') | |
conf.hiera_config = File.join(fixture_path, 'hiera.yaml') | |
end | |
# Not sure this works for all types of https://github.com/rodjek/rspec-puppet tests. I think it works with host tests | |
if ENV['PUPPET_DEBUG'] | |
Puppet::Util::Log.level = :debug | |
Puppet::Util::Log.newdestination(:console) |
This file contains hidden or 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
def vcr_to_pacto_request vcr_request | |
uri = URI(vcr_request.uri) | |
definition = { | |
'method' => vcr_request.method, | |
'path' => uri.path, | |
# How do we get params from VCR? | |
'params' => {}, | |
'headers' => vcr_request.headers | |
} | |
Pacto::Request.new uri.host, definition |
This file contains hidden or 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
Dir['**/*.rb'].each do |f| | |
begin | |
puts f unless File.read(f) =~ /^$\Z/ | |
rescue => e | |
$stderr.puts "Couldn't read #{f}: #{e.message}" | |
end | |
end |
This file contains hidden or 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
# If you just do: | |
# $ vagrant plugin install vagrant-aws | |
# $ vagrant plugin install vagrant-rackspace | |
# $ vagrant plugin list | |
# Then it will downgrade vagrant-aws to 0.0.1 (rather than downgrading fog) | |
# A sample Gemfile | |
source "https://rubygems.org" | |
group :plugins do |
This file contains hidden or 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
source "http://rubygems.org" | |
group :development do | |
gem 'jekyll', '~> 1.5.0' | |
gem 'stringex', '~> 1.4.0' | |
gem 'rake' | |
end | |
group :semantic_web do | |
# rdf-raptor requires libraptor |
This file contains hidden or 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
# Disable automatic box update checking. If you disable this, then | |
# boxes will only be checked for updates when the user runs | |
# `vagrant box outdated`. This is not recommended. |
This file contains hidden or 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 'rouge' | |
module Rouge | |
module Lexers | |
class Android < Rouge::Lexers::Java | |
tag 'android' | |
end | |
end | |
end |
This file contains hidden or 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
# Usage: `yardoc -e dash_property_handler.rb lib/**/*.rb` | |
class DashPropertyHandler < YARD::Handlers::Ruby::AttributeHandler | |
handles method_call(:property) | |
namespace_only | |
def process | |
name = statement.parameters.first.jump(:tstring_literal, :ident).source | |
scope = :instance | |
namespace.attributes[scope][name] ||= SymbolHash[:read => nil, :write => nil] | |
o = YARD::CodeObjects::MethodObject.new(namespace, name) |
This file contains hidden or 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
# You'll receive "E: unexpected token tNL" if you run rubocop broken_spec.rb | |
module A | |
module B | |
class C | |
end | |
end | |
end | |
module A | |
module B do |