Permalink
Browse files

closes #5 (dont' export empty Pry.notes)

  • Loading branch information...
1 parent d66724e commit 9804669b24038be6ba89f9ccccf575c1fe8ddd78 @banister committed Dec 6, 2012
Showing with 7 additions and 4 deletions.
  1. +4 −1 lib/pry-note.rb
  2. +1 −1 lib/pry-note/version.rb
  3. +2 −2 pry-note.gemspec
View
@@ -22,7 +22,10 @@ def self.export_notes(file_name=nil)
return if !file_name && !Pry.config.notes_file
file_name ||= Pry.config.notes_file
expanded_path = File.expand_path(file_name)
- File.open(expanded_path, "w") { |f| f.puts YAML.dump(PryNote.notes) }
+
+ if PryNote.notes && PryNote.notes.any?
+ File.open(expanded_path, "w") { |f| f.puts YAML.dump(PryNote.notes) }
+ end
end
# @return [Pry::Method, Pry::WrappedModule, Pry::Command] The code_object
View
@@ -1,3 +1,3 @@
module PryNote
- VERSION = "0.2.6"
+ VERSION = "0.2.7"
end
View
@@ -2,11 +2,11 @@
Gem::Specification.new do |s|
s.name = "pry-note"
- s.version = "0.2.6"
+ s.version = "0.2.7"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["John Mair (banisterfiend)"]
- s.date = "2012-12-02"
+ s.date = "2012-12-06"
s.description = "Ease refactoring and exploration by attaching notes to methods and classes in Pry"
s.email = "jrmair@gmail.com"
s.files = ["README.md", "Rakefile", "lib/pry-note.rb", "lib/pry-note/commands.rb", "lib/pry-note/hooks.rb", "lib/pry-note/version.rb", "pry-note.gemspec", "test/helper.rb", "test/test_pry_note.rb"]

0 comments on commit 9804669

Please sign in to comment.