aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/gems/rspec-1.3.1/lib/spec/test
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-05-25 12:30:50 +0100
committerRobin Houston <robin.houston@gmail.com>2012-05-25 12:30:50 +0100
commitc1256d99630d82be1085f943d35abb3e407f6093 (patch)
tree55663b3284f2b969363e76f02e451a1fc5f6d790 /vendor/gems/rspec-1.3.1/lib/spec/test
parent88d5103ec40120b64a7579994ad2f11334dee71a (diff)
parentb58f2d6b2847f5d438468bfdd317308f60d32be3 (diff)
Merge branch 'master' into wdtk
Diffstat (limited to 'vendor/gems/rspec-1.3.1/lib/spec/test')
0 files changed, 0 insertions, 0 deletions
0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#! /usr/bin/ruby

require 'optparse'
require 'rubygems'
require 'ole/storage'

def oletool
	opts = {:verbose => false, :action => :tree}
	op = OptionParser.new do |op|
		op.banner = "Usage: oletool [options] [files]"
		op.separator ''
		op.on('-t', '--tree', 'Dump ole trees for files (default)') { opts[:action] = :tree }
		op.on('-r', '--repack', 'Repack the ole files in canonical form') { opts[:action] = :repack }
		op.on('-m', '--mimetype', 'Print the guessed mime types') { opts[:action] = :mimetype }
		op.on('-y', '--metadata', 'Dump the internal meta data as YAML') { opts[:action] = :metadata }
		op.separator ''
		op.on('-v', '--[no-]verbose', 'Run verbosely') { |v| opts[:verbose] = v }
		op.on_tail('-h', '--help', 'Show this message') { puts op; exit }
	end
	files = op.parse ARGV
	if files.empty?
		puts 'Must specify 1 or more msg files.'
		puts op
		exit 1
	end
	Ole::Log.level = opts[:verbose] ? Logger::WARN : Logger::FATAL
	files.each do |file|
		case opts[:action]
		when :tree
			Ole::Storage.open(file) { |ole| puts ole.root.to_tree }
		when :repack
			Ole::Storage.open file, 'rb+', &:repack
		when :metadata
			Ole::Storage.open(file) { |ole| y ole.meta_data.to_h }
		when :mimetype
			puts Ole::Storage.open(file) { |ole| ole.meta_data.mime_type }
		end
	end
end

oletool