summaryrefslogtreecommitdiff
path: root/lib/method_source.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add MethodSource.clear_cacheYoshiyuki Hirano2021-11-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | We often need to clear cache. For example, in web application development, when we changed source code, we would like the change applied to the app server without reboot. In the case of a Rails application, this requires the following configuration: ```ruby Rails.application.configure do config.to_prepare do MethodSource.instance_variable_set(:@lines_for_file, {}) end end ``` It seems so ugly, isn't it? So I feel we need to add `MethodSource.clear_cache` interface. ```diff Rails.application.configure do config.to_prepare do - MethodSource.instance_variable_set(:@lines_for_file, {}) + MethodSource.clear_cache end end ```
* Allow fetching class/module comments.Stas SUȘCOV2021-11-031-0/+31
|
* Fix procs/lambdasConrad Irwin2012-06-031-2/+2
|
* Improve error messagesConrad Irwin2012-06-031-9/+12
|
* Import some CodeHelpers from Pry.Conrad Irwin2012-06-031-96/+43
| | | | | The hope is that they can live in this gem permanently, and Pry can also include MethodSource::CodeHelpers in the relevant places.
* Added SourceNotFoundError classReginald Tan2012-06-021-6/+8
|
* Fix regex warnings on ruby-1.8.7Conrad Irwin2012-05-261-1/+1
|
* If displaying method source fails for *_evaled methods, retry again.Reginald Tan2012-05-231-10/+36
| | | | | | | | | This time, assume inside eval string and simulate interpolation of #{} by replacing with a placeholder when doing syntax validation Only works if *_eval contains the arguments filename and lineno + 1. Without them, UnboundMethod#source_location would not return the proper filename and lineno needed to display the source.
* replace ruby_parser dependency with evalRyan Fitzgerald2011-11-301-30/+17
|
* added Proc#source_location support for ruby 1.8John Mair2011-06-091-4/+1
|
* added source_location to procs for rbx, all tests passing on rbxJohn Mair2011-06-011-16/+21
|
* Fix warnings emitted by -w.Rob Gleeson2011-05-191-1/+1
|
* defaults to RubyParser on all 1.9 implementations except MRIJohn Mair2011-04-111-1/+1
|
* changed (C) to 2011 from 2010John Mair2011-03-051-1/+1
|
* version 0.3.5, now has support to take advantage of Method#source on rubiniusJohn Mair2011-03-051-0/+24
|
* version 0.3.4, fixed 1.8 1.9 String#clear incompat in Method#commentv0.3.4John Mair2011-02-281-1/+1
|
* version 0.3.0, some ruby 1.8 supportdevJohn Mair2011-02-281-12/+36
|
* refactor to use File block instead of manually closingJohn Mair2010-12-191-26/+23
|
* removed kruft (stringio and explicit receiver for valid_expression?)John Mair2010-12-181-2/+1
|
* version 0.2.0, support for method comments (and a few minor changes), thanks ↵Adam Sanderson2010-12-181-17/+61
| | | | | | | | | | to Adam Sanderson * Merged in Adam's changes * Refactored source_helper to reflect comment_helper style * Made some adjustments to Adam's code: removed buffer.strip, now doing an lstrip on each line before adding to buffer * No longer including blank lines in comment buffer (blank lines ignored) * Added large number of comment-related tests
* replaced RubyVM::ISeq with Ripper; method_source should now work on all 1.9 ↵John Mair2010-12-171-17/+5
| | | | Ruby implementations that support Ripper
* added warning about YARV only (due to RubyVM, so not JRuby compatible). Also ↵John Mair2010-12-171-0/+4
| | | | added support and tests for Proc#source
* first commitJohn Mair2010-12-171-0/+94