Permalink
Browse files

move to new Pry::CodeObject.lookup API

  • Loading branch information...
1 parent 7926dba commit f78c9b2edc786a4609b8a951d6ca37f577429aae @banister committed Jan 15, 2013
Showing with 7 additions and 7 deletions.
  1. +2 −3 lib/pry-note.rb
  2. +2 −1 lib/pry-note/commands.rb
  3. +2 −2 pry-note.gemspec
  4. +1 −1 test/test_pry_note.rb
View
@@ -29,9 +29,8 @@ def self.export_notes(file_name=nil)
end
# @return [Pry::Method, Pry::WrappedModule, Pry::Command] The code_object
- def self.retrieve_code_object_safely(name, target, _pry_)
- code_object = Pry::Helpers::CommandHelpers.retrieve_code_object_from_string(name, target) ||
- _pry_.commands.find_command(name)
+ def self.retrieve_code_object_safely(name, _pry_)
+ code_object = Pry::CodeObject.lookup(name, _pry_)
if !code_object
raise Pry::CommandError, "No code object found named #{name}"
@@ -60,6 +60,7 @@ def process
add_note(opts.arguments.first, cmd_opts[:message])
elsif opts.command?(:show)
cmd_opts = opts[:show]
+ binding.pry
stagger_output create_note_output(opts.arguments.first, cmd_opts[:verbose])
elsif opts.command?(:list)
cmd_opts = opts[:list]
@@ -91,7 +92,7 @@ def process
end
def retrieve_code_object_safely(name)
- PryNote.retrieve_code_object_safely(name, target, _pry_)
+ PryNote.retrieve_code_object_safely(name, _pry_)
end
def default_object_name
View
@@ -6,13 +6,13 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["John Mair (banisterfiend)"]
- s.date = "2012-12-12"
+ s.date = "2013-01-15"
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"]
s.homepage = "https://github.com/banister"
s.require_paths = ["lib"]
- s.rubygems_version = "1.8.23"
+ s.rubygems_version = "1.8.24"
s.summary = "Ease refactoring and exploration by attaching notes to methods and classes in Pry"
s.test_files = ["test/helper.rb", "test/test_pry_note.rb"]
@@ -192,7 +192,7 @@ def ping
PryNote.notes["PryNote::TestClass"].first.should =~ /bing/
end
- # this is a regression against a bug which made it impossible to ever
+ # this is a regression test against a bug which made it impossible to ever
# edit a note in an editor
it 'should not raise an exception when amending content without -m' do
Pry.config.editor = proc { nil }

0 comments on commit f78c9b2

Please sign in to comment.