Skip to content

Commit

Permalink
update binstubs
Browse files Browse the repository at this point in the history
  • Loading branch information
turino committed Apr 12, 2016
1 parent 5763f19 commit 0d54b35
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 54 deletions.
23 changes: 8 additions & 15 deletions bin/rails
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
#!/usr/bin/env ruby
#
# This file was generated by Bundler.
#
# The application 'rails' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

require "rubygems"
require "bundler/setup"

load Gem.bin_path("railties", "rails")
begin
load File.expand_path('../spring', __FILE__)
rescue LoadError => e
raise unless e.message.include?('spring')
end
APP_PATH = File.expand_path('../../config/application', __FILE__)
require_relative '../config/boot'
require 'rails/commands'
23 changes: 8 additions & 15 deletions bin/rake
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
#!/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.
#

require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

require "rubygems"
require "bundler/setup"

load Gem.bin_path("rake", "rake")
begin
load File.expand_path('../spring', __FILE__)
rescue LoadError => e
raise unless e.message.include?('spring')
end
require_relative '../config/boot'
require 'rake'
Rake.application.run
5 changes: 5 additions & 0 deletions bin/rspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/usr/bin/env ruby
begin
load File.expand_path('../spring', __FILE__)
rescue LoadError => e
raise unless e.message.include?('spring')
end
#
# This file was generated by Bundler.
#
Expand Down
37 changes: 25 additions & 12 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
#!/usr/bin/env ruby
#
# This file was generated by Bundler.
#
# The application 'setup' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require 'pathname'

require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
# path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)

require "rubygems"
require "bundler/setup"
Dir.chdir APP_ROOT do
# This script is a starting point to setup your application.
# Add necessary setup steps to this file:

load Gem.bin_path("factory_girl_rails", "setup")
puts "== Installing dependencies =="
system "gem install bundler --conservative"
system "bundle check || bundle install"

# puts "\n== Copying sample files =="
# unless File.exist?("config/database.yml")
# system "cp config/database.yml.sample config/database.yml"
# end

puts "\n== Preparing database =="
system "bin/rake db:setup"

puts "\n== Removing old logs and tempfiles =="
system "rm -f log/*"
system "rm -rf tmp/cache"

puts "\n== Restarting application server =="
system "touch tmp/restart.txt"
end
23 changes: 11 additions & 12 deletions bin/spring
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
#!/usr/bin/env ruby
#
# This file was generated by Bundler.
#
# The application 'spring' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
# This file loads spring without using Bundler, in order to be fast.
# It gets overwritten when you run the `spring binstub` command.

require "rubygems"
require "bundler/setup"
unless defined?(Spring)
require 'rubygems'
require 'bundler'

load Gem.bin_path("spring", "spring")
if (match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m))
Gem.paths = { 'GEM_PATH' => [Bundler.bundle_path.to_s, *Gem.path].uniq.join(Gem.path_separator) }
gem 'spring', match[1]
require 'spring/binstub'
end
end

0 comments on commit 0d54b35

Please sign in to comment.