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

Fix compatibility with older versions of Ruby (< 1.9.2). #2

Merged
merged 2 commits into from
Jul 31, 2013

Conversation

Kami
Copy link
Contributor

@Kami Kami commented Jul 31, 2013

Currently "compare_images" tasks fail when using Ruby < 1.9.3, because File.write is only available in Ruby 1.9.3 and above:

rake aborted!
undefined method `write' for File:Class
/wraith/Rakefile:72
Tasks: TOP => default => compare_images
(See full trace by running task with --trace

This pull requests fixes that and uses a method which is also available in older versions.

Reference:

File.write (IO.write) is only available in Ruby 1.9.3 and above.
@sthulb
Copy link
Contributor

sthulb commented Jul 31, 2013

@Kami Thanks for the pull request :)

We intentionally made it > 1.9.3 due to EOL for 1.8.7, but we'll merge this in 👍

end


File.open("data.txt", "w") do |file| file.write(contents) end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you convert do/end to braces please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, is 8e0cf6f better?

@Kami
Copy link
Contributor Author

Kami commented Jul 31, 2013

@sthulbourn Thanks!

@dblooman
Copy link
Contributor

Our first pull request

4wwvdrw

dblooman added a commit that referenced this pull request Jul 31, 2013
Fix compatibility with older versions of Ruby (< 1.9.2).
@dblooman dblooman merged commit 594f407 into bbc:master Jul 31, 2013
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.

3 participants