ruby/trema/executables.rb in trema-0.4.6 vs ruby/trema/executables.rb in trema-0.4.7

- old
+ new

@@ -14,13 +14,13 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # -require "trema/monkey-patch/module" -require "trema/monkey-patch/string" -require "trema/path" +require 'trema/monkey-patch/module' +require 'trema/monkey-patch/string' +require 'trema/path' # # Holds a list of executables found in Trema.objects directory. # @@ -34,11 +34,11 @@ # false if a file name is not an executable program or a list of all # file names that are. # def compiled? @list.each do | each | - return false unless FileTest.executable?( __send__ each ) + return false unless FileTest.executable?(__send__ each) end end ############################################################################ @@ -47,11 +47,11 @@ # # Adds the name to a list. # - def add name + def add(name) @list ||= [] @list << name end @@ -66,30 +66,30 @@ # @param [String] path # the relative path to an executable program. # # @return [Array] a list of a class method to access each executable program. # - def path path - name = File.basename( path ).underscore - define_class_method( name ) do + def path(path) + name = File.basename(path).underscore + define_class_method(name) do File.join Trema.objects, path end add name end end - path "openvswitch/bin/ovs-ofctl" - path "openvswitch/bin/ovs-openflowd" - path "packetin_filter/packetin_filter" - path "phost/cli" - path "phost/phost" - path "switch_manager/switch" - path "switch_manager/switch_manager" - path "tremashark/packet_capture" - path "tremashark/stdin_relay" - path "tremashark/syslog_relay" - path "tremashark/tremashark" + path 'openvswitch/bin/ovs-ofctl' + path 'openvswitch/bin/ovs-openflowd' + path 'packetin_filter/packetin_filter' + path 'phost/cli' + path 'phost/phost' + path 'switch_manager/switch' + path 'switch_manager/switch_manager' + path 'tremashark/packet_capture' + path 'tremashark/stdin_relay' + path 'tremashark/syslog_relay' + path 'tremashark/tremashark' end ### Local variables: ### mode: Ruby