Skip to content

Instantly share code, notes, and snippets.

bash -c '
<%= "export https_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%>
distro=`uname -s`
if test "x$distro" = "xSunOS"; then
if test -d "/usr/sfw/bin"; then
PATH=/usr/sfw/bin:$PATH
export PATH
fi
@marcparadise
marcparadise / gist:7043972
Created October 18, 2013 16:20
An alias to send files to a shared vim session that is specific to the current tmux window. Allows you to have one vim session for each window that is used to open files from any pane in that window. Requires vim to be built w/ `+clientserver`
if [[ -z $TMUX ]]; then
server_name="--servername VIM"
else
server_name="--servername vim-`tmux display-message -p '#S.#I'`"
fi
alias vis="vim $server_name --remote-tab-silent"
require 'spec_helper'
require 'open-uri'
require 'pedant/rspec/common'
require 'pedant/rspec/node_util'
require 'spec/support/node_run_util'
describe "Node Runs API endpoint" do
include_context "node_run_util"
include Pedant::RSpec::NodeUtil
Gem::Specification.new do |s|
s.name = 'oc-reporting-pedant-tests'
s.version = '0.0.1'
s.date = '2012-11-05'
s.summary = "API tests for Opscode's Private Chef Reporting Services"
s.description = "API tests for Opscode's Private Chef Reporting Server; requires Pedant to actually run"
s.authors = ["Marc Paradise"]
s.email = '[email protected]'
s.files = Dir['spec/**/*_spec.rb'] + Dir['lib/**/*.rb']
s.homepage = 'http://opscode.com'
source :rubygems
gem 'chef-pedant-core', :git => "[email protected]:opscode/chef-pedant-core.git"
gem 'oc-chef-pedant-core', :git => "[email protected]:opscode/oc-chef-pedant-core.git"
gem 'oc-reporting-pedant-tests', :path => "."
def run_callback_from_file(callback_file)
if whyrun_mode?
recipe_eval { }
else
if ::File.exist?(callback_file)
Dir.chdir(release_path) do
Chef::Log.info "#{@new_resource} running deploy hook #{callback_file}"
recipe_eval { from_file(callback_file) }
end
end
class Chef::Provider::Service::Simple <<< Chef::Provider::Service
def shared_requirements
requirements.assert(:all_actions) do |a|
a.assertion { @new_resource.status_command or @new_resource.supports[:status] or
(!ps_cmd.nil? and !ps_cmd.empty?) }
a.failure_message Chef::Exceptions::Service, "#{@new_resource} could not determine how to inspect the process table, please set this nodes 'command.ps' attribute"
end
requirements.assert(:all_actions) do |a|
a.assertion { !@ps_command_failed }
elsif File.exists?('/etc/slackware-version')
platform "slackware"
platform_family "slackware"
platform_version File.read("/etc/slackware-version").scan(/(\d+|\.+)/).join
elsif File.exists?('/etc/arch-release')
platform "arch"
platform_family "arch"
# no way to determine platform_version in a rolling release distribution
# kernel release will be used - ex. 2.6.32-ARCH