Class: StyleScript::CommandLine
- Inherits:
-
Object
- Object
- StyleScript::CommandLine
- Defined in:
- lib/style_script/command_line.rb
Overview
The CommandLine handles all of the functionality of the ‘style` utility.
Constant Summary collapse
- BANNER =
"style compiles StyleScript source files into JavaScript.\n\nUsage:\n style path/to/script.style\n"- WATCH_INTERVAL =
Seconds to pause between checks for changed source files.
0.5
- ROOT =
Path to the root of the StyleScript install.
File.(File.dirname(__FILE__) + '/../..')
- RUNNERS =
Commands to execute StyleScripts.
{ :node => "node #{ROOT}/lib/style_script/runner.js", :std => "std -p #{ROOT} -e 'require(\"style-script\").run(system.args);'" }
Instance Method Summary collapse
-
#initialize ⇒ CommandLine
constructor
Run the CommandLine off the contents of ARGV.
-
#usage ⇒ Object
The “–help” usage message.
Constructor Details
#initialize ⇒ CommandLine
Run the CommandLine off the contents of ARGV.
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/style_script/command_line.rb', line 38 def initialize @mtimes = {} return launch_repl if [:interactive] return eval_scriptlet if [:eval] check_sources return run_scripts if [:run] @sources.each {|source| compile_javascript(source) } watch_style_scripts if [:watch] end |
Instance Method Details
#usage ⇒ Object
The “–help” usage message.
50 51 52 53 |
# File 'lib/style_script/command_line.rb', line 50 def usage puts "\n#{@option_parser}\n" exit end |