Module: Wake
- Defined in:
- lib/wake.rb,
lib/wake/script.rb,
lib/wake/controller.rb,
lib/wake/event_handlers/em.rb,
lib/wake/event_handlers/rev.rb,
lib/wake/event_handlers/base.rb,
lib/wake/event_handlers/unix.rb,
lib/wake/event_handlers/portable.rb
Overview
Agile development tool that monitors a directory recursively, and triggers a user defined action whenever an observed file is modified. Its most typical use is continuous testing.
Usage:
# on command line, from project's root dir
$ wake path/to/script
# default script if none is given is Wakefile.
See README for more details
Defined Under Namespace
Modules: EventHandler Classes: Controller, Refresh, Script
Constant Summary collapse
- VERSION =
'0.1.0'
Class Method Summary collapse
- .batches ⇒ Object
-
.debug(str) ⇒ Object
Outputs formatted debug statement to stdout, only if ::options.debug is true.
-
.handler ⇒ Object
Detect current OS and return appropriate handler.
- .handler=(arg) ⇒ Object
-
.options ⇒ Object
Options proxy.
- .options=(arg) ⇒ Object
-
.version ⇒ Object
backwards compatibility.
Class Method Details
.batches ⇒ Object
4 5 6 |
# File 'lib/wake/script.rb', line 4 def batches @batches ||= {} end |
.debug(str) ⇒ Object
69 70 71 |
# File 'lib/wake.rb', line 69 def debug(str) puts "[wake debug] #{str}" if .debug end |
.handler ⇒ Object
Detect current OS and return appropriate handler.
Examples
Config::CONFIG['host_os'] #=> 'linux-gnu'
Wake.handler #=> Wake::EventHandler::Unix
Config::CONFIG['host_os'] #=> 'cygwin'
Wake.handler #=> Wake::EventHandler::Portable
ENV['HANDLER'] #=> 'unix'
Wake.handler #=> Wake::EventHandler::Unix
ENV['HANDLER'] #=> 'portable'
Wake.handler #=> Wake::EventHandler::Portable
Returns
- handler<Class>
-
handler class for current architecture
92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/wake.rb', line 92 def handler @handler ||= case ENV['HANDLER'] || Config::CONFIG['host_os'] when /mswin|windows|cygwin/i Wake::EventHandler::Portable when /sunos|solaris|darwin|mach|osx|bsd|linux/i, 'unix' Wake::EventHandler::Unix.default else Wake::EventHandler::Portable end end |
.handler=(arg) ⇒ Object
104 105 106 |
# File 'lib/wake.rb', line 104 def handler= arg @handler = arg end |
.options ⇒ Object
49 50 51 52 53 54 |
# File 'lib/wake.rb', line 49 def @options ||= Struct.new(:debug,:once, :wakefile).new @options.debug ||= false @options.once.nil? and @options.once = false @options end |
.options=(arg) ⇒ Object
56 57 58 |
# File 'lib/wake.rb', line 56 def arg @options = arg end |