diff options
author | George Claghorn <george.claghorn@gmail.com> | 2019-01-04 23:09:12 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-04 23:09:12 -0500 |
commit | df8ee09ce71338cdf9816225df1bdebc707f3560 (patch) | |
tree | 5b2d265cdaca5c5859205389088b2bdc2327d935 /actiontext/test/dummy/bin | |
parent | 88349cee3cb8f7bba662232fbc444eeebc8bb227 (diff) | |
parent | 0decd2ddc4a94cf522fc8ea8e6c73b9deedfdd93 (diff) | |
download | rails-df8ee09ce71338cdf9816225df1bdebc707f3560.tar.gz rails-df8ee09ce71338cdf9816225df1bdebc707f3560.tar.bz2 rails-df8ee09ce71338cdf9816225df1bdebc707f3560.zip |
Merge pull request #34873 from georgeclaghorn/actiontext
Import Action Text
Diffstat (limited to 'actiontext/test/dummy/bin')
-rwxr-xr-x | actiontext/test/dummy/bin/bundle | 3 | ||||
-rwxr-xr-x | actiontext/test/dummy/bin/rails | 4 | ||||
-rwxr-xr-x | actiontext/test/dummy/bin/rake | 4 | ||||
-rwxr-xr-x | actiontext/test/dummy/bin/setup | 36 | ||||
-rwxr-xr-x | actiontext/test/dummy/bin/update | 31 | ||||
-rwxr-xr-x | actiontext/test/dummy/bin/yarn | 11 |
6 files changed, 89 insertions, 0 deletions
diff --git a/actiontext/test/dummy/bin/bundle b/actiontext/test/dummy/bin/bundle new file mode 100755 index 0000000000..f19acf5b5c --- /dev/null +++ b/actiontext/test/dummy/bin/bundle @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) +load Gem.bin_path('bundler', 'bundle') diff --git a/actiontext/test/dummy/bin/rails b/actiontext/test/dummy/bin/rails new file mode 100755 index 0000000000..0739660237 --- /dev/null +++ b/actiontext/test/dummy/bin/rails @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +APP_PATH = File.expand_path('../config/application', __dir__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/actiontext/test/dummy/bin/rake b/actiontext/test/dummy/bin/rake new file mode 100755 index 0000000000..17240489f6 --- /dev/null +++ b/actiontext/test/dummy/bin/rake @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +require_relative '../config/boot' +require 'rake' +Rake.application.run diff --git a/actiontext/test/dummy/bin/setup b/actiontext/test/dummy/bin/setup new file mode 100755 index 0000000000..94fd4d7977 --- /dev/null +++ b/actiontext/test/dummy/bin/setup @@ -0,0 +1,36 @@ +#!/usr/bin/env ruby +require 'fileutils' +include FileUtils + +# path to your application root. +APP_ROOT = File.expand_path('..', __dir__) + +def system!(*args) + system(*args) || abort("\n== Command #{args} failed ==") +end + +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') || system!('bundle install') + + # Install JavaScript dependencies if using Yarn + # system('bin/yarn') + + # puts "\n== Copying sample files ==" + # unless File.exist?('config/database.yml') + # cp 'config/database.yml.sample', 'config/database.yml' + # end + + puts "\n== Preparing database ==" + system! 'bin/rails db:setup' + + puts "\n== Removing old logs and tempfiles ==" + system! 'bin/rails log:clear tmp:clear' + + puts "\n== Restarting application server ==" + system! 'bin/rails restart' +end diff --git a/actiontext/test/dummy/bin/update b/actiontext/test/dummy/bin/update new file mode 100755 index 0000000000..58bfaed518 --- /dev/null +++ b/actiontext/test/dummy/bin/update @@ -0,0 +1,31 @@ +#!/usr/bin/env ruby +require 'fileutils' +include FileUtils + +# path to your application root. +APP_ROOT = File.expand_path('..', __dir__) + +def system!(*args) + system(*args) || abort("\n== Command #{args} failed ==") +end + +chdir APP_ROOT do + # This script is a way to update your development environment automatically. + # Add necessary update steps to this file. + + puts '== Installing dependencies ==' + system! 'gem install bundler --conservative' + system('bundle check') || system!('bundle install') + + # Install JavaScript dependencies if using Yarn + # system('bin/yarn') + + puts "\n== Updating database ==" + system! 'bin/rails db:migrate' + + puts "\n== Removing old logs and tempfiles ==" + system! 'bin/rails log:clear tmp:clear' + + puts "\n== Restarting application server ==" + system! 'bin/rails restart' +end diff --git a/actiontext/test/dummy/bin/yarn b/actiontext/test/dummy/bin/yarn new file mode 100755 index 0000000000..460dd565b4 --- /dev/null +++ b/actiontext/test/dummy/bin/yarn @@ -0,0 +1,11 @@ +#!/usr/bin/env ruby +APP_ROOT = File.expand_path('..', __dir__) +Dir.chdir(APP_ROOT) do + begin + exec "yarnpkg", *ARGV + rescue Errno::ENOENT + $stderr.puts "Yarn executable was not detected in the system." + $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" + exit 1 + end +end |