Module: TiyoHw
- Defined in:
- lib/tiyo_hw/shell_function.rb,
lib/tiyo_hw.rb,
lib/tiyo_hw/run.rb,
lib/tiyo_hw/setup.rb,
lib/tiyo_hw/version.rb,
lib/tiyo_hw/runners/base.rb,
lib/tiyo_hw/runners/ruby.rb,
lib/tiyo_hw/runners/javascript.rb
Overview
function hw()
URL=$1
OUTPUT="$(~/code/tiyo-hw/bin/hw setup $URL)"
eval ${OUTPUT
OUTPUT="$(~/code/tiyo-hw/bin/hw run $PWD)"
eval $OUTPUT
}
Defined Under Namespace
Modules: Runners Classes: Run, Setup, ShellFunction
Constant Summary collapse
- SLEEP_TIME =
4- HOMEWORK_DIR =
"~/theironyard/homework".freeze
- EDITOR =
EDITOR = ENV || “atom”.freeze
"atom".freeze
- VERSION =
"0.1.0".freeze
Class Method Summary collapse
Class Method Details
.fail_msg(msg) ⇒ Object
24 25 26 |
# File 'lib/tiyo_hw.rb', line 24 def self.fail_msg(msg) "echo '#{msg}'" end |
.generate_cmd(command, url_or_path = nil) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/tiyo_hw.rb', line 12 def self.generate_cmd(command, url_or_path = nil) return ShellFunction.cmd if command == "init" return fail_msg("Please enter a valid URL: #{url_or_path.inspect} is not a valid url ") if url_or_path.to_s.blank? case command when "setup" Setup.new(url_or_path).cmd when "run" Run.new(url_or_path).cmd end end |