diff options
| -rw-r--r-- | .travis.yml | 4 | ||||
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | lib/axlsx/stylesheet/color.rb | 2 | ||||
| -rw-r--r-- | lib/axlsx/stylesheet/num_fmt.rb | 4 | ||||
| -rw-r--r-- | lib/axlsx/stylesheet/styles.rb | 2 | ||||
| -rw-r--r-- | lib/axlsx/workbook/defined_name.rb | 2 | ||||
| -rw-r--r-- | lib/axlsx/workbook/worksheet/row.rb | 2 | ||||
| -rw-r--r-- | test/stylesheet/tc_color.rb | 6 |
8 files changed, 13 insertions, 11 deletions
diff --git a/.travis.yml b/.travis.yml index 1dd9af85..201aa3ca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,12 +7,9 @@ notifications: on_success: always rvm: - - 1.8.7 - 1.9.2 - 1.9.3 - 2.0.0 - - jruby-18mode - - rbx-18mode - rbx-19mode - jruby-19mode - ruby-head @@ -21,6 +18,5 @@ matrix: allow_failures: - rvm: ruby-head - rvm: jruby-head - - rvm: 1.8.7 before_install: - gem install nokogiri -- --with-cflags='--std=gnu99' @@ -23,7 +23,7 @@ appreciation for the gem, please don't hesitate to make a donation. **Latest Version**: 1.3.7 -**Ruby Version**: 1.8.7 (soon to be depreciated!!!), 1.9.2, 1.9.3, 2.0.0 +**Ruby Version**: 1.8.7 (soon to be deprecated!!!), 1.9.2, 1.9.3, 2.0.0 **JRuby Version**: 1.6.7 1.8 and 1.9 modes diff --git a/lib/axlsx/stylesheet/color.rb b/lib/axlsx/stylesheet/color.rb index 744e63d5..e736af7f 100644 --- a/lib/axlsx/stylesheet/color.rb +++ b/lib/axlsx/stylesheet/color.rb @@ -51,7 +51,7 @@ module Axlsx # @see color def rgb=(v) Axlsx::validate_string(v) - v.upcase! + v = v.upcase v = v * 3 if v.size == 2 v = v.rjust(8, 'FF') raise ArgumentError, "Invalid color rgb value: #{v}." unless v.match(/[0-9A-F]{8}/) diff --git a/lib/axlsx/stylesheet/num_fmt.rb b/lib/axlsx/stylesheet/num_fmt.rb index a796b1c7..7016c989 100644 --- a/lib/axlsx/stylesheet/num_fmt.rb +++ b/lib/axlsx/stylesheet/num_fmt.rb @@ -10,7 +10,7 @@ module Axlsx # Creates a new NumFmt object # @param [Hash] options Options for the number format object # @option [Integer] numFmtId The predefined format id or new format id for this format - # @option [String] fomratCode The format code for this number format + # @option [String] formatCode The format code for this number format def initialize(options={}) @numFmtId = 0 @formatCode = "" @@ -23,7 +23,7 @@ module Axlsx # @see http://support.microsoft.com/kb/264372 attr_reader :formatCode - # @return [Integer] An unsinged integer referencing a standard or custom number format. + # @return [Integer] An unsigned integer referencing a standard or custom number format. # @note # These are the known formats I can dig up. The constant NUM_FMT_PERCENT is 9, and uses the default % formatting. Axlsx also defines a few formats for date and time that are commonly used in asia as NUM_FMT_YYYYMMDD and NUM_FRM_YYYYMMDDHHMMSS. # 1 0 diff --git a/lib/axlsx/stylesheet/styles.rb b/lib/axlsx/stylesheet/styles.rb index 44ccb752..067ed1fa 100644 --- a/lib/axlsx/stylesheet/styles.rb +++ b/lib/axlsx/stylesheet/styles.rb @@ -183,7 +183,7 @@ module Axlsx # :border=>Axlsx::STYLE_THIN_BORDER) # # # build your rows - # ws.add_row ["Genreated At:", Time.now], :styles=>[nil, date_time] + # ws.add_row ["Generated At:", Time.now], :styles=>[nil, date_time] # ws.add_row ["Previous Year Quarterly Profits (JPY)"], :style=>title # ws.add_row ["Quarter", "Profit", "% of Total"], :style=>title # ws.add_row ["Q1", 4000, 40], :style=>[title, currency, percent] diff --git a/lib/axlsx/workbook/defined_name.rb b/lib/axlsx/workbook/defined_name.rb index b55856de..3a606024 100644 --- a/lib/axlsx/workbook/defined_name.rb +++ b/lib/axlsx/workbook/defined_name.rb @@ -105,7 +105,7 @@ module Axlsx attr_reader :local_sheet_id # The local sheet index (0-based) - # @param [Integer] value the unsinged integer index of the sheet this defined_name applies to. + # @param [Integer] value the unsigned integer index of the sheet this defined_name applies to. def local_sheet_id=(value) Axlsx::validate_unsigned_int(value) @local_sheet_id = value diff --git a/lib/axlsx/workbook/worksheet/row.rb b/lib/axlsx/workbook/worksheet/row.rb index 43c85b59..5e335ca5 100644 --- a/lib/axlsx/workbook/worksheet/row.rb +++ b/lib/axlsx/workbook/worksheet/row.rb @@ -97,7 +97,7 @@ module Axlsx str << '</row>' end - # Adds a singel sell to the row based on the data provided and updates the worksheet's autofit data. + # Adds a single sell to the row based on the data provided and updates the worksheet's autofit data. # @return [Cell] def add_cell(value="", options={}) c = Cell.new(self, value, options) diff --git a/test/stylesheet/tc_color.rb b/test/stylesheet/tc_color.rb index affa2227..dd8e98d2 100644 --- a/test/stylesheet/tc_color.rb +++ b/test/stylesheet/tc_color.rb @@ -27,6 +27,12 @@ class TestColor < Test::Unit::TestCase assert_equal(@item.rgb, "FF00FF00" ) end + def test_rgb_writer_doesnt_mutate_its_argument + my_rgb = 'ff00ff00' + @item.rgb = my_rgb + assert_equal 'ff00ff00', my_rgb + end + def test_tint assert_raise(ArgumentError) { @item.tint = -1 } assert_nothing_raised { @item.tint = -1.0 } |
