From 82a7af53859023840f1257dda97f8ac3bd890f7b Mon Sep 17 00:00:00 2001 From: Philip Arndt Date: Wed, 20 May 2015 14:51:45 +1200 Subject: [PATCH] Added convenience bins --- bin/rails | 5 +++++ bin/rake | 21 +++++++++++++++++++++ bin/rspec | 22 ++++++++++++++++++++++ bin/spring | 18 ++++++++++++++++++ 4 files changed, 66 insertions(+) create mode 100755 bin/rails create mode 100755 bin/rake create mode 100755 bin/rspec create mode 100755 bin/spring diff --git a/bin/rails b/bin/rails new file mode 100755 index 00000000..0bf61b1b --- /dev/null +++ b/bin/rails @@ -0,0 +1,5 @@ +#!/usr/bin/env ruby +# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. + +ENGINE_PATH = File.expand_path('../..', __FILE__) +load File.expand_path('../../spec/dummy/bin/rails', __FILE__) diff --git a/bin/rake b/bin/rake new file mode 100755 index 00000000..6c483394 --- /dev/null +++ b/bin/rake @@ -0,0 +1,21 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'rake' is installed as part of a gem, and +# this file is here to facilitate running it. +# +begin + if Dir.exist?(File.expand_path('../../spec/dummy', __FILE__)) + load File.expand_path("../spring", __FILE__) + end +rescue LoadError +end +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('rake', 'rake') diff --git a/bin/rspec b/bin/rspec new file mode 100755 index 00000000..4970fd0e --- /dev/null +++ b/bin/rspec @@ -0,0 +1,22 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'rspec' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +begin + if Dir.exist?(File.expand_path('../../spec/dummy', __FILE__)) + load File.expand_path("../spring", __FILE__) + end +rescue LoadError +end +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('rspec-core', 'rspec') diff --git a/bin/spring b/bin/spring new file mode 100755 index 00000000..7f24d96f --- /dev/null +++ b/bin/spring @@ -0,0 +1,18 @@ +#!/usr/bin/env ruby + +# This file loads spring without using Bundler, in order to be fast +# It gets overwritten when you run the `spring binstub` command + +unless defined?(Spring) + require "rubygems" + require "bundler" + + if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m) + ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR) + ENV["GEM_HOME"] = "" + Gem.paths = ENV + + gem "spring", match[1] + require "spring/binstub" + end +end