Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract sheets in the correct order #196

Merged
merged 2 commits into from
Apr 9, 2015

Conversation

stevendaniels
Copy link
Contributor

Fixes #166.

Both Numbers 3.1 and Google are capable of creating xlsx documents with sheets that don't fit the normal order. Therefore, these changes are already tested under the Numbers 3.1 export test case.

https://github.com/stevendaniels/roo/blob/return-the-correct-sheet/test/test_roo.rb#L1954-L1967

@coveralls
Copy link

Coverage Status

Coverage increased (+0.07%) to 93.62% when pulling 474c40c on stevendaniels:return-the-correct-sheet into 97e8fc5 on roo-rb:master.

@simonoff
Copy link
Member

simonoff commented Apr 9, 2015

Looks good but I think process_zipfile need to be refactored. Too many lines.

Extracted another method from process_zipfile. I could do more
refactoring to reduce the line count, but readability might suffer.
e.g.

      when /sharedstrings.xml$/
        ...
      when /styles\.xml$/
        ...

becomes

    when /(sharedstrings|styles)\.xml$/
      "#{tmpdir}/roo_#{Regexp.last_match[1]}.xml"
@stevendaniels
Copy link
Contributor Author

I extracted another method, but I don't see anymore easy refactors. I don't like the process_zipfile method very much and agree it should be better, but I think further changes would need to be a part of changes to how Roo loads excel files in general.

Those changes can wait until after the 2.0.0 release (#172).

@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) to 93.6% when pulling 4e93b7c on stevendaniels:return-the-correct-sheet into 97e8fc5 on roo-rb:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.08%) to 93.63% when pulling 4e93b7c on stevendaniels:return-the-correct-sheet into 97e8fc5 on roo-rb:master.

simonoff added a commit that referenced this pull request Apr 9, 2015
@simonoff simonoff merged commit ab59137 into roo-rb:master Apr 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.sheet() method returns wrong sheet
3 participants