lib/qcmd.rb in qcmd-0.1.6 vs lib/qcmd.rb in qcmd-0.1.7
- old
+ new
@@ -1,23 +1,27 @@
+require 'socket'
+require 'osc-ruby'
+
require 'qcmd/version'
+
+require 'qcmd/plaintext'
+require 'qcmd/commands'
require 'qcmd/input_completer'
require 'qcmd/core_ext/array'
require 'qcmd/core_ext/osc/message'
+require 'qcmd/core_ext/osc/stopping_server'
module Qcmd
- # Your code goes here...
autoload :Handler, 'qcmd/handler'
autoload :Server, 'qcmd/server'
autoload :Context, 'qcmd/context'
autoload :Parser, 'qcmd/parser'
autoload :CLI, 'qcmd/cli'
autoload :Machine, 'qcmd/machine'
autoload :Network, 'qcmd/network'
autoload :QLab, 'qcmd/qlab'
- autoload :Plaintext, 'qcmd/plaintext'
- autoload :Commands, 'qcmd/commands'
autoload :VERSION, 'qcmd/version'
class << self
include Qcmd::Plaintext
@@ -31,16 +35,24 @@
def quiet!
self.log_level = :warning
end
+ def silent!
+ self.log_level = :none
+ end
+
+ def silent?
+ self.log_level == :none
+ end
+
def quiet?
self.log_level == :warning
end
def while_quiet
previous_level = self.log_level
- self.log_level = :warning unless previous_level == :debug
+ self.log_level = :warning
yield
self.log_level = previous_level
end
def debug?