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

Sprockets 3 support #2

Closed
wants to merge 1 commit into from
Closed

Conversation

jaredbeck
Copy link
Contributor

It seems that each_file used to yield Pathnames, now yields strings?

I didn't research this very thoroughly, this just seemed like the simplest fix.

There's probably a better way that preserves compat. w/ sprockets 2.

@sonnym
Copy link
Owner

sonnym commented Aug 21, 2015

I definitely want to preserve backwards compatibility, which I think should be pretty easy to accomplish using Pathname#to_s. Something like filepath = ::Pathname.new(filepath_str.to_s) will work with both String and Pathname objects, right?

@jaredbeck
Copy link
Contributor Author

Something like filepath = ::Pathname.new(filepath_str.to_s) will work with both String and Pathname objects, right?

Sounds good to me. We may want to rename the argument too: filepath_str could be misleading.

It seems that `each_file` used to yield `Pathname`s, now yields strings.
@jaredbeck
Copy link
Contributor Author

As a side note, this is kind of a success story for dynamically typed langs, isn't it, the fact that we can take different data types for an argument. If sprockets were in a strongly typed lang, i wonder how they'd deal. Maybe they would change data types in their API so casually.

@sbleon
Copy link
Contributor

sbleon commented Sep 19, 2015

@jaredbeck I'm still getting some failures using this with Sprockets 3. I think we'll need to work on this a bit more.

js-asset_paths was generating an asset hash that lookeds like:

{
  #<Pathname:images/campaign.png>=>"campaign-\x83\xDB\x99\xD6\xA5\xBA\xB5\x11\xAE\x03\x80\xB9\x92\xD5V\x8A\x8C\xBCm\xE7
\xD9\x99\xC0\xAC\xD1+?\x0Fe\xFC\xFF\xE3.png"
}

Note the \x gobbledegook where we should just have hexadecimal strings.

@jaredbeck
Copy link
Contributor Author

closing due to inactivity

@jaredbeck jaredbeck closed this Feb 10, 2017
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.

None yet

3 participants