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 =
<<-EOS style compiles StyleScript source files into JavaScript. Usage: style path/to/script.style EOS
- 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 @options[:interactive] return eval_scriptlet if @options[:eval] check_sources return run_scripts if @options[:run] @sources.each {|source| compile_javascript(source) } watch_style_scripts if @options[: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 |