Top Level Namespace
Defined Under Namespace
Modules: Bind
Instance Method Summary collapse
- #common_options(options) ⇒ Object
- #expand_path(path) ⇒ Object
- #listener(options) ⇒ Object
- #set_common_options(c) ⇒ Object
Instance Method Details
#common_options(options) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/bind/command_helpers.rb', line 14 def .actions ||= [] .actions << lambda { |file| eval .eval } if .eval .require.each { |lib| require lib } if .require .debug = $stdout if .verbose end |
#expand_path(path) ⇒ Object
21 22 23 |
# File 'lib/bind/command_helpers.rb', line 21 def path path.include?('://') ? path : File.(path) end |
#listener(options) ⇒ Object
10 11 12 |
# File 'lib/bind/command_helpers.rb', line 10 def listener Bind::Listener.new .__hash__ end |
#set_common_options(c) ⇒ Object
2 3 4 5 6 7 8 |
# File 'lib/bind/command_helpers.rb', line 2 def c c.option '-i', '--interval SECONDS', Integer, 'Interval in seconds in which to listen for an event.' c.option '-t', '--timeout SECONDS', Integer, 'Timeout after n seconds.' c.option '-r', '--require LIBS', Array, 'Require ruby libraries.' c.option '-e', '--eval STRING', String, 'Evaluate a string of Ruby in context of Bind, so the file local variable is available.' c.option '-V', '--verbose', 'Log information to STDOUT.' end |