diff options
| -rw-r--r-- | axlsx.gemspec | 2 | ||||
| -rw-r--r-- | lib/axlsx/stylesheet/styles.rb | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/axlsx.gemspec b/axlsx.gemspec index ae3d2aaa..3aa66863 100644 --- a/axlsx.gemspec +++ b/axlsx.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |s| s.add_runtime_dependency 'rmagick4j', '>= 0.3.7' if Object.const_defined? :JRUBY_VERSION s.add_runtime_dependency 'rubyzip', '>= 0.9.5' - s.add_runtime_dependency 'rake', '0.8.7' if RUBY_VERSION == "1.9.2" +# s.add_runtime_dependency 'rake', '0.8.7' if RUBY_VERSION == "1.9.2" s.add_runtime_dependency 'rake', '>= 0.8.7' if ["1.9.3", "1.8.7"].include?(RUBY_VERSION) s.add_development_dependency 'yard' # s.add_development_dependency 'rdiscount' diff --git a/lib/axlsx/stylesheet/styles.rb b/lib/axlsx/stylesheet/styles.rb index 1fb2e9b3..cd8c7139 100644 --- a/lib/axlsx/stylesheet/styles.rb +++ b/lib/axlsx/stylesheet/styles.rb @@ -204,10 +204,12 @@ module Axlsx if borderId.is_a?(Hash) raise ArgumentError, "border hash definitions must include both style and color" unless borderId.keys.include?(:style) && borderId.keys.include?(:color) - s = borderId.delete :style - c = borderId.delete :color + s = borderId[:style] + c = borderId[:color] + edges = borderId[:edges] || [:left, :right, :top, :bottom] + border = Border.new - [:left, :right, :top, :bottom].each {|pr| border.prs << BorderPr.new(:name => pr, :style=>s, :color => Color.new(:rgb => c))} + edges.each {|pr| border.prs << BorderPr.new(:name => pr, :style=>s, :color => Color.new(:rgb => c))} borderId = self.borders << border end |
