lib/ronin/ui/console/context.rb in ronin-1.4.0.rc1 vs lib/ronin/ui/console/context.rb in ronin-1.4.0.rc2
- old
+ new
@@ -1,7 +1,7 @@
#
-# Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
+# Copyright (c) 2006-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
#
# This file is part of Ronin.
#
# Ronin is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -55,10 +55,19 @@
def self.const_missing(name)
Ronin.send(:const_missing,name)
end
#
+ # @note
+ # Ruby 1.8.x requires {const_missing} to be defined as an
+ # instance-method.
+ #
+ def const_missing(name)
+ Ronin.send(:const_missing,name)
+ end
+
+ #
# Populates the instance variables.
#
# @param [Hash] variables
# The variable names and values.
#
@@ -77,14 +86,16 @@
# @since 1.0.0
#
# @api semipublic
#
def inspect
- body = unless instance_variables.empty?
- ': ' << instance_variables.map { |name|
- "#{name}=#{instance_variable_get(name).inspect}"
- }.join(', ')
- end
+ unless instance_variables.empty?
+ body = ':'
+
+ instance_variables.each do |name|
+ body << " #{name}=#{instance_variable_get(name).inspect}"
+ end
+ end
return "#<Ronin::UI::Console#{body}>"
end
end