Module: Katapult::BinaryUtil
Instance Method Summary collapse
- #create_rails_app(name) ⇒ Object
- #git_commit(message, options = nil) ⇒ Object
- #puts(*args) ⇒ Object
-
#run(command) ⇒ Object
With clean Bundler env.
Instance Method Details
#create_rails_app(name) ⇒ Object
17 18 19 |
# File 'lib/katapult/binary_util.rb', line 17 def create_rails_app(name) run "rails _#{ Katapult::RAILS_VERSION }_ new #{ name } --skip-test-unit --skip-bundle --database postgresql" end |
#git_commit(message, options = nil) ⇒ Object
12 13 14 15 |
# File 'lib/katapult/binary_util.rb', line 12 def git_commit(, = nil) .gsub! /'/, "" # remove single quotes system "git add --all; git commit -m '#{ }' --author='katapult <[email protected]>' #{ }" end |
#puts(*args) ⇒ Object
21 22 23 24 |
# File 'lib/katapult/binary_util.rb', line 21 def puts(*args) = "\n> #{ args.join ' ' }" Kernel.puts "\e[35m#{ }\e[0m" # pink end |
#run(command) ⇒ Object
With clean Bundler env
27 28 29 30 31 32 33 34 |
# File 'lib/katapult/binary_util.rb', line 27 def run(command) success = Bundler.with_clean_env { system command } if !success puts 'x Something went wrong' exit(1) end end |