Skip to content

Commit

Permalink
Merge pull request #2583 from hennevogel/dist
Browse files Browse the repository at this point in the history
[dist] Use binstubs for executeables
  • Loading branch information
bgeuken committed Jan 19, 2017
2 parents 5ddd557 + 868c436 commit c7e6bce
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 13 deletions.
1 change: 1 addition & 0 deletions Vagrantfile
Expand Up @@ -23,6 +23,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

# Execute commands in the frontend directory
fe.exec.commands %w(rails rake rspec bundle), directory: '/vagrant/src/api'
fe.exec.commands %w(rails rake rspec bundle), env: {'PATH' => './bin:$PATH'}
fe.exec.commands 'script/start_test_backend', directory: '/vagrant/src/api'
fe.exec.commands 'contrib/start_development_backend', directory: '/vagrant'
fe.exec.commands '*', directory: '/vagrant'
Expand Down
14 changes: 1 addition & 13 deletions contrib/common.sh
Expand Up @@ -49,27 +49,15 @@ function install_common_packages() {
grub2-install /dev/sda
}

function setup_ruby() {
echo -e "\nsetup ruby binaries...\n"
[ -f /usr/bin/ruby ] ||ln -s /usr/bin/ruby.ruby2.4 /usr/bin/ruby
for bin in rake rdoc ri; do
/usr/sbin/update-alternatives --set $bin /usr/bin/$bin.ruby.ruby2.4
done
}

function setup_ruby_gem() {
echo -e "\ndisabling versioned gem binary names...\n"
echo 'install: --no-format-executable' >> /etc/gemrc
}

function install_bundler_package() {
echo -e "\ninstalling bundler...\n"
gem install bundler
}

function install_bundle() {
echo -e "\ninstalling your bundle...\n"
su - vagrant -c "cd /vagrant/src/api/; bundle install --quiet"
bundle binstubs railties rake rdoc rspec-core --force
}

function setup_mariadb() {
Expand Down
16 changes: 16 additions & 0 deletions src/api/bin/pry
@@ -0,0 +1,16 @@
#!/usr/bin/ruby.ruby2.4
# frozen_string_literal: true
#
# This file was generated by Bundler.
#
# The application 'pry' 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("pry", "pry")
16 changes: 16 additions & 0 deletions src/api/bin/rdoc
@@ -0,0 +1,16 @@
#!/usr/bin/ruby.ruby2.4
# frozen_string_literal: true
#
# This file was generated by Bundler.
#
# The application 'rdoc' 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("rdoc", "rdoc")
16 changes: 16 additions & 0 deletions src/api/bin/ri
@@ -0,0 +1,16 @@
#!/usr/bin/ruby.ruby2.4
# frozen_string_literal: true
#
# This file was generated by Bundler.
#
# The application 'ri' 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("rdoc", "ri")
16 changes: 16 additions & 0 deletions src/api/bin/rspec
@@ -0,0 +1,16 @@
#!/usr/bin/ruby.ruby2.4
# 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")
16 changes: 16 additions & 0 deletions src/api/bin/rubocop
@@ -0,0 +1,16 @@
#!/usr/bin/ruby.ruby2.4
# frozen_string_literal: true
#
# This file was generated by Bundler.
#
# The application 'rubocop' 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("rubocop", "rubocop")

0 comments on commit c7e6bce

Please sign in to comment.