Skip to content
This repository has been archived by the owner on Jan 18, 2023. It is now read-only.

Commit

Permalink
Rename 'Time' struct to allow use with Sprockets.
Browse files Browse the repository at this point in the history
I had a rather painful issue recently where Dullard (specifically, its recent support for Time) broke rails (specifically, sprockets that ships with Rails 4.1 and 4.2).

As it happens, the Sprockets shipped with Rails makes a few classes via `class Foo < Struct(...)`, and within those classes then refer to `Time.parse` for asset times.

Unfortunately, those classes being in `Struct::` means that `Time` refers now to the `Struct::Time` that Dullard creates.

The class encapsulation of `Dullard::Time` isn't leaking, so that doesn't need to change -- just the name defined for the Struct.
  • Loading branch information
mrluc committed Jan 8, 2015
1 parent 1d06a61 commit f1fc805
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/dullard/reader.rb
Expand Up @@ -7,7 +7,7 @@ class Error < StandardError; end
SharedStringPath = 'xl/sharedStrings.xml'
StylesPath = 'xl/styles.xml'

class Time < Struct.new('Time', :hours, :minutes, :seconds)
class Time < Struct.new('DullTime', :hours, :minutes, :seconds)
end

end
Expand Down

0 comments on commit f1fc805

Please sign in to comment.