From 87a2709641cc79b9d548319736af41de8daa8ef3 Mon Sep 17 00:00:00 2001 From: Georg Gadinger Date: Fri, 31 Mar 2017 22:42:45 +0200 Subject: [PATCH] Fix binstubs --- .gitignore | 3 --- bin/rails | 19 +++---------------- bin/rake | 19 +++---------------- bin/rspec | 17 ----------------- bin/setup | 29 +++++++++++++++++++++++++++++ bin/spring | 17 ----------------- 6 files changed, 35 insertions(+), 69 deletions(-) delete mode 100755 bin/rspec create mode 100755 bin/setup delete mode 100755 bin/spring diff --git a/.gitignore b/.gitignore index 92729322..e489110c 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,3 @@ desktop.ini # ignore exports /public/export - -# fucking binstubs -/bin/* diff --git a/bin/rails b/bin/rails index 0a7aba05..5191e692 100755 --- a/bin/rails +++ b/bin/rails @@ -1,17 +1,4 @@ #!/usr/bin/env ruby -# frozen_string_literal: true -# -# 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") +APP_PATH = File.expand_path('../../config/application', __FILE__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/bin/rake b/bin/rake index 486010f4..17240489 100755 --- a/bin/rake +++ b/bin/rake @@ -1,17 +1,4 @@ #!/usr/bin/env ruby -# frozen_string_literal: true -# -# 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") +require_relative '../config/boot' +require 'rake' +Rake.application.run diff --git a/bin/rspec b/bin/rspec deleted file mode 100755 index d738b23c..00000000 --- a/bin/rspec +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# 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. -# - -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/setup b/bin/setup new file mode 100755 index 00000000..acdb2c13 --- /dev/null +++ b/bin/setup @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +require 'pathname' + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +Dir.chdir APP_ROOT do + # This script is a starting point to setup your application. + # Add necessary setup steps to this file: + + 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 diff --git a/bin/spring b/bin/spring deleted file mode 100755 index 43731fe8..00000000 --- a/bin/spring +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# 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) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("spring", "spring")