librex 0.0.37 → 0.0.38

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,7 @@
3
3
  A non-official re-packaging of the Rex library as a gem for easy of usage of the Metasploit REX framework in a non Metasploit application. I received permission from HDM to create this package.
4
4
 
5
5
  Currently based on:
6
- SVN Revision: 12994
6
+ SVN Revision: 13029
7
7
 
8
8
  # Credits
9
9
  The Metasploit development team <http://www.metasploit.com>
data/Rakefile CHANGED
@@ -42,7 +42,7 @@ task :update do
42
42
 
43
43
  version = ""
44
44
 
45
- print "[*] Updating librex.gemspec with new Version and Revision Number"
45
+ print "[*] Updating librex.gemspec with new Version and Revision Number v"
46
46
  File.open("librex.gemspec.1", "w+") do |output|
47
47
  File.open("librex.gemspec", "r") do |input|
48
48
  while (line = input.gets)
@@ -90,5 +90,5 @@ task :update do
90
90
  system "git push &> /dev/null"
91
91
 
92
92
  #Twitter tweet for the update, I am that lazy yes.
93
- puts "Updated librex to v#{version} based on SVN Revision: #{rev[1]} of the #metasploit rex library. Available in rubygems."
93
+ puts "[*] Updated librex to v#{version} based on SVN Revision: #{rev[1]} of the #metasploit rex library. Available in rubygems."
94
94
  end
@@ -16,6 +16,7 @@ class Output < Rex::Ui::Output
16
16
  require 'rex/ui/text/output/socket'
17
17
  require 'rex/ui/text/output/buffer'
18
18
  require 'rex/ui/text/output/file'
19
+ require 'rex/ui/text/output/tee'
19
20
  require 'rex/ui/text/color'
20
21
 
21
22
  include Rex::Ui::Text::Color
@@ -0,0 +1,55 @@
1
+ require 'rex/ui'
2
+
3
+ module Rex
4
+ module Ui
5
+ module Text
6
+
7
+ ###
8
+ #
9
+ # This class implements output against a file and stdout
10
+ #
11
+ ###
12
+ class Output::Tee < Rex::Ui::Text::Output
13
+
14
+ attr_accessor :fd
15
+
16
+ def initialize(path)
17
+ self.fd = ::File.open(path, "ab")
18
+ super()
19
+ end
20
+
21
+ def supports_color?
22
+ case config[:color]
23
+ when true
24
+ return true
25
+ when false
26
+ return false
27
+ else # auto
28
+ term = Rex::Compat.getenv('TERM')
29
+ return (term and term.match(/(?:vt10[03]|xterm(?:-color)?|linux|screen|rxvt)/i) != nil)
30
+ end
31
+ end
32
+
33
+ #
34
+ # Prints the supplied message to file output.
35
+ #
36
+ def print_raw(msg = '')
37
+ $stdout.print(msg)
38
+ $stdout.flush
39
+
40
+ return if not self.fd
41
+ self.fd.write(msg)
42
+ self.fd.flush
43
+ msg
44
+ end
45
+
46
+ def close
47
+ self.fd.close if self.fd
48
+ self.fd = nil
49
+ end
50
+ end
51
+
52
+ end
53
+ end
54
+ end
55
+
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: librex
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.37
5
+ version: 0.0.38
6
6
  platform: ruby
7
7
  authors:
8
8
  - Metasploit Development Team
@@ -11,11 +11,11 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2011-06-20 00:00:00 -05:00
14
+ date: 2011-06-25 00:00:00 -05:00
15
15
  default_executable:
16
16
  dependencies: []
17
17
 
18
- description: Rex provides a variety of classes useful for security testing and exploit development. Based on SVN Revision 12994
18
+ description: Rex provides a variety of classes useful for security testing and exploit development. Based on SVN Revision 13029
19
19
  email:
20
20
  - hdm@metasploit.com
21
21
  - jacob.hammack@hammackj.com
@@ -464,6 +464,7 @@ files:
464
464
  - lib/rex/ui/text/output/file.rb
465
465
  - lib/rex/ui/text/output/socket.rb
466
466
  - lib/rex/ui/text/output/stdio.rb
467
+ - lib/rex/ui/text/output/tee.rb
467
468
  - lib/rex/ui/text/output.rb
468
469
  - lib/rex/ui/text/progress_tracker.rb
469
470
  - lib/rex/ui/text/progress_tracker.rb.ut.rb