Skip to content

Commit

Permalink
Merge pull request #1 from sticksnleaves/to-file-fix
Browse files Browse the repository at this point in the history
Return a file instance when calling #to_file
  • Loading branch information
Anthony Smith committed Apr 21, 2015
2 parents e667316 + 654fd70 commit e6723c1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
8 changes: 7 additions & 1 deletion lib/vcardio/vcard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ def to_abnf
alias_method :to_s, :to_abnf

def to_file(path)
File.write(path, to_abnf)
file = File.new(path, 'w')

file.write(to_abnf)
file.flush
file.close

file
end

def ==(other)
Expand Down
2 changes: 1 addition & 1 deletion lib/vcardio/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module VCardio
VERSION = "0.1.0"
VERSION = "0.1.1"
end
7 changes: 4 additions & 3 deletions vcardio.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ Gem::Specification.new do |spec|
end
)

spec.bindir = 'exe'
spec.executables = spec.files.grep(/^exe\//) { |f| File.basename(f) }
spec.require_paths = ['lib']
spec.bindir = 'exe'
spec.executables = spec.files.grep(/^exe\//) { |f| File.basename(f) }
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 1.9.2'

spec.add_dependency 'manilla', '~> 1.0.0'

Expand Down

0 comments on commit e6723c1

Please sign in to comment.