diff --git a/README.md b/README.md index a32b129..0d3ec22 100644 --- a/README.md +++ b/README.md @@ -31,9 +31,9 @@ ReplTypeCompletor.load_rbs # Could take a seconds in large projects Now you can get completion candidates. ```ruby array = [1, 2, 3] -class String; def upupup; end; end -result = ReplTypeCompletor.analyze('array.map do str = _1.chr; str.up', binding: binding) -result.completion_candidates #=> ["case", "case!", "to", "upup"] +code_to_complete = 'array.map do str = _1.chr; str.up' +result = ReplTypeCompletor.analyze(code_to_complete, binding: binding, filename: __FILE__) +result.completion_candidates #=> ["case", "case!", "to"] result.doc_namespace('case') #=> "String#upcase" ``` @@ -45,7 +45,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To ## Contributing -Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/repl_type_completor. +Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/repl_type_completor. When something is wrong, these methods will provide some debug information. ```ruby @@ -54,7 +54,7 @@ ReplTypeCompletor.rbs_load_started? ReplTypeCompletor.rbs_loaded? ReplTypeCompletor.rbs_load_error ReplTypeCompletor.last_completion_error -ReplTypeCompletor.analyze(code_to_complete, binding: binding) +ReplTypeCompletor.analyze(code_to_complete, binding: binding, filename: __FILE__) ``` ## License diff --git a/repl_type_completor.gemspec b/repl_type_completor.gemspec index 3b640ec..8bd65e1 100644 --- a/repl_type_completor.gemspec +++ b/repl_type_completor.gemspec @@ -10,15 +10,15 @@ Gem::Specification.new do |spec| spec.summary = "Type based completion for REPL." spec.description = "Type based completion for REPL." - # spec.homepage = "TODO: Put your gem's website or public repo URL here." + spec.homepage = "https://github.com/ruby/repl_type_completor" spec.license = "MIT" spec.required_ruby_version = ">= 3.0.0" spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'" - # spec.metadata["homepage_uri"] = spec.homepage - # spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here." - # spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here." + spec.metadata["homepage_uri"] = spec.homepage + spec.metadata["source_code_uri"] = "https://github.com/ruby/repl_type_completor" + spec.metadata["documentation_uri"] = spec.homepage # Specify which files should be added to the gem when it is released. # The `git ls-files -z` loads the files in the RubyGem that have been added into git.