Skip to content
Browse files

Fix issue #2, to_file now can accept entry such as "~/image.png"

  • Loading branch information...
1 parent bdc9902 commit c1784185b01d02c8c89af3fc39968e2d840c17cf @siuying committed Nov 24, 2011
Showing with 3 additions and 1 deletion.
  1. +1 −1 Rakefile
  2. +2 −0 lib/websnap/websnap.rb
View
2 Rakefile
@@ -4,7 +4,7 @@ require 'echoe'
require 'rake'
require 'rspec/core/rake_task'
-Echoe.new("websnap", "0.1.3") do |p|
+Echoe.new("websnap", "0.1.4") do |p|
p.author = "Francis Chong"
p.description = "Create snapshot of webpage"
p.url = "http://github.com/siuying/websnap"
View
2 lib/websnap/websnap.rb
@@ -54,6 +54,8 @@ def to_bytes
def to_file(path, image_path=nil)
append_stylesheets
+ path = File.expand_path(path)
+
@source = Source.new(@source.to_s.gsub(/images\//, image_path)) unless image_path.nil?
File.open(path,'w') {|file| file << self.to_bytes}
end

0 comments on commit c178418

Please sign in to comment.
Something went wrong with that request. Please try again.