ddollar-albino 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/albino.rb +5 -4
  2. metadata +1 -1
data/lib/albino.rb CHANGED
@@ -58,7 +58,9 @@ class Albino
58
58
 
59
59
  def initialize(target, lexer = nil, format = :html)
60
60
  @target = File.exists?(target) ? File.read(target) : target rescue target
61
- @options = { :l => lexer, :f => format }
61
+ @options = {}
62
+ @options[:f] = format
63
+ lexer ? @options[:l] = lexer : @options[:g] = ''
62
64
  end
63
65
 
64
66
  def execute(command)
@@ -75,8 +77,7 @@ class Albino
75
77
 
76
78
  def convert_options(options = {})
77
79
  @options.merge(options).keys.sort_by { |k| k.to_s }.inject('') do |string, flag|
78
- value = @options[flag]
79
- break(string) unless value
80
+ value = @options[flag]
80
81
  string += " -#{flag} #{value}"
81
82
  end
82
83
  end
@@ -95,7 +96,7 @@ if $0 == __FILE__
95
96
 
96
97
  specify "defaults to text with no and no syntax" do
97
98
  syntaxer = Albino.new(__FILE__)
98
- syntaxer.expects(:execute).with('pygmentize -f html').returns(true)
99
+ syntaxer.expects(:execute).with('pygmentize -f html -g ').returns(true)
99
100
  syntaxer.colorize
100
101
  end
101
102
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ddollar-albino
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Dollar