albino 1.1 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/albino.gemspec CHANGED
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'albino'
16
- s.version = '1.1'
17
- s.date = '2010-05-04'
16
+ s.version = '1.1.1'
17
+ s.date = '2011-01-11'
18
18
  s.rubyforge_project = 'albino'
19
19
 
20
20
  ## Make sure your summary is short. The description may be as long
data/lib/albino.rb CHANGED
@@ -42,7 +42,7 @@
42
42
  # GitHub // http://github.com
43
43
  #
44
44
  class Albino
45
- VERSION = '1.1'
45
+ VERSION = '1.1.1'
46
46
 
47
47
  class << self
48
48
  attr_accessor :bin
@@ -75,7 +75,7 @@ class Albino
75
75
 
76
76
  def convert_options(options = {})
77
77
  @options.merge(options).inject('') do |string, (flag, value)|
78
- string + " -#{flag} #{value}"
78
+ string + " -#{flag} #{shell_escape value}"
79
79
  end
80
80
  end
81
81
 
@@ -88,6 +88,10 @@ class Albino
88
88
  end
89
89
  end
90
90
 
91
+ def shell_escape(str)
92
+ str.to_s.gsub("'", "\\\\'").gsub(";", '\\;')
93
+ end
94
+
91
95
  def bin
92
96
  self.class.bin
93
97
  end
data/test/albino_test.rb CHANGED
@@ -46,4 +46,8 @@ class AlbinoTest < Test::Unit::TestCase
46
46
  def test_class_method_colorize
47
47
  assert_equal @syntaxer.colorize, Albino.colorize(File.new(__FILE__), :ruby)
48
48
  end
49
+
50
+ def test_escaped_shell_args
51
+ assert_equal " -f html -l \\'abc\\;\\'", @syntaxer.convert_options(:l => "'abc;'")
52
+ end
49
53
  end
metadata CHANGED
@@ -5,7 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 1
8
- version: "1.1"
8
+ - 1
9
+ version: 1.1.1
9
10
  platform: ruby
10
11
  authors:
11
12
  - Chris Wanstrath
@@ -13,7 +14,7 @@ autorequire:
13
14
  bindir: bin
14
15
  cert_chain: []
15
16
 
16
- date: 2010-05-04 00:00:00 -07:00
17
+ date: 2011-01-11 00:00:00 -08:00
17
18
  default_executable:
18
19
  dependencies:
19
20
  - !ruby/object:Gem::Dependency