Skip to content

Instantly share code, notes, and snippets.

View 1-before_spec.rb
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe "Something doppelganger" do
describe "RailCar" do
let(:gateway) { RailCar.new :login => "a", :password => "b" }
describe "#commit" do
let(:response) { railcar.send :commit, request, {} }
describe "response" do
@pivotal-legacy
pivotal-legacy / gist:594121
Created Sep 23, 2010
Vendor Jasmine gem for Rails3
View gist:594121
require 'fileutils'
FileUtils.mkdir_p('vendor/gems')
Dir.chdir('vendor/gems') do
%x[git clone git://github.com/pivotal/jasmine-gem.git jasmine]
Dir.chdir('jasmine') do
%x[git submodule update --init]
%x[git fetch origin rspec2-rails3]
View hubcut
#!/usr/bin/env ruby
# This script copies all .gem files for all versions of a gem from gems.github.com to gemcutter.org.
# For all versions of a gem, it does a gem fetch, repackages the gem with the non-namespaced name,
# and does a gem push. You must have permission to push the gem, so your gemcutter key must be
# set in ~/.gemrc
require 'rubygems'
require 'yaml'
require 'fileutils'
View testing_desert_plugins.rb
# config/plugins/plugins_to_test.yml
- user_auth
- social_pivots
# lib/plugin_dependency_limiter.rb
class Rails::Initializer
def load_plugins
# Only load the plugin under test
Rails::Plugin.new("vendor/plugins/#{ENV['PLUGIN']}").load(self)
View gist:142237
#!/usr/bin/env ruby
# solo
def usage(message)
$stderr.puts message
$stderr.puts
$stderr.puts "#{File.basename($0)} envname [commit] [migrate]"
exit 1
end
View gist:118343
require '/Users/pivotal/workspace/honk/spec/chrome_export/chrome_exporter_spec.rb'
require '/Users/pivotal/workspace/honk/spec/controllers/access_control_spec.rb'
require '/Users/pivotal/workspace/honk/spec/controllers/application_controller_spec.rb'
require '/Users/pivotal/workspace/honk/spec/controllers/authenticated_system_spec.rb'
require '/Users/pivotal/workspace/honk/spec/controllers/dashboards_controller_spec.rb'
require '/Users/pivotal/workspace/honk/spec/controllers/direct_models_controller_spec.rb'
require '/Users/pivotal/workspace/honk/spec/controllers/direct_styles_controller_spec.rb'
require '/Users/pivotal/workspace/honk/spec/controllers/explore_controller_spec.rb'
require '/Users/pivotal/workspace/honk/spec/controllers/invites_controller_spec.rb'
require '/Users/pivotal/workspace/honk/spec/controllers/makes_controller_spec.rb'
View File.here.rb
# Require slash
# by Aaron Patterson
# inspired by Josh Susser
# use to require files relative to the current file:
#
# require __FILE__/"lib"/"foo"
# require __FILE__/%{lib foo}
class String
View File.here.rb
# require_here.rb
# by Josh Susser
class String
# __FILE__.require_here 'foo' # => require 'CURRENT_DIR/foo'
# __FILE__.require_here %w(lib foo) # joins path segments so you don't have to
# __FILE__.require_here # add the current file's directory to the load path
def require_here(path=nil)
here = File.expand_path(File.dirname(self))
if path
View geminstaller.yml
---
defaults:
install_options: --include-dependencies
gems:
<%= include_config("#{File.expand_path(File.dirname(__FILE__))}/../vendor/plugins/pivotal_core_bundle/lib/geminstaller/geminstaller_geminstaller.yml") %>
- name: rails
version: 2.1.0
- name: activesupport
version: 2.1.0
- name: activerecord
View environment.rb
@@ -18,6 +18,10 @@ require "desert"
require 'hmac-sha1'
require "extensions/string"
+# Turn NewRelic into a non-autoloaded constant, so new relic doesn't
+# try to call const_missing in a thread
+module NewRelic; end
+
Rails::Initializer.run do |config|
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
You can’t perform that action at this time.