From ac92478a468855f82ad3a07caf942de0bede0327 Mon Sep 17 00:00:00 2001 From: Ken Low Date: Thu, 30 Jun 2016 15:40:09 +0800 Subject: [PATCH 1/2] Update .gitignore to add bin folder --- .gitignore | 4 ++-- bin/bundle | 3 +++ bin/rails | 4 ++++ bin/rake | 4 ++++ bin/setup | 29 +++++++++++++++++++++++++++++ 5 files changed, 42 insertions(+), 2 deletions(-) create mode 100755 bin/bundle create mode 100755 bin/rails create mode 100755 bin/rake create mode 100755 bin/setup diff --git a/.gitignore b/.gitignore index 35761dd..59abb45 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ # git config --global core.excludesfile '~/.gitignore_global' # Ignore bundler config. -/bin +/.bundle # Ignore the default SQLite database. /db/*.sqlite3 @@ -24,5 +24,5 @@ *.iml -*.keep +*.keep app/assets/images/.keep diff --git a/bin/bundle b/bin/bundle new file mode 100755 index 0000000..66e9889 --- /dev/null +++ b/bin/bundle @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +load Gem.bin_path('bundler', 'bundle') diff --git a/bin/rails b/bin/rails new file mode 100755 index 0000000..5191e69 --- /dev/null +++ b/bin/rails @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +APP_PATH = File.expand_path('../../config/application', __FILE__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/bin/rake b/bin/rake new file mode 100755 index 0000000..1724048 --- /dev/null +++ b/bin/rake @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +require_relative '../config/boot' +require 'rake' +Rake.application.run diff --git a/bin/setup b/bin/setup new file mode 100755 index 0000000..acdb2c1 --- /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 From 6ca62fc4805b1ab7e4fc8fe6cd22be8b165ec73a Mon Sep 17 00:00:00 2001 From: Ken Low Date: Fri, 8 Jul 2016 10:14:59 +0800 Subject: [PATCH 2/2] Update README.md --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a4822a6..61b36e9 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,7 @@ Setup: 5. bundle install - 6. rake rails:update:bin - - 7. rails s + 6. rails s That's it! @@ -41,4 +39,4 @@ In the spirit of [free software](http://www.fsf.org/licensing/essays/free-sw.htm - Report bugs or issues - Fix bugs and submit pull requests. - Write, clarify or fix documentation. - - Refactor code. \ No newline at end of file + - Refactor code.