A summary of data about the Ruby ecosystem.

https://github.com/banister/method_source

return the sourcecode for a method
https://github.com/banister/method_source

Keywords from Contributors

rubygems activerecord mvc activejob feature-flag debugger reflection irb introspection pry

Last synced: about 3 hours ago
JSON representation

Repository metadata

return the sourcecode for a method

README.markdown

method_source

Circle Build Status

(C) John Mair (banisterfiend) 2011

retrieve the sourcecode for a method

NOTE: This simply utilizes Method#source_location; it
does not access the live AST.

method_source is a utility to return a method's sourcecode as a
Ruby string. Also returns Proc and Lambda sourcecode.

Method comments can also be extracted using the comment method.

It is written in pure Ruby (no C).

  • Some Ruby 1.8 support now available.
  • Support for MRI, RBX, JRuby, REE

method_source provides the source and comment methods to the Method and
UnboundMethod and Proc classes.

Example: display method source

Set.instance_method(:merge).source.display
# =>
def merge(enum)
  if enum.instance_of?(self.class)
    @hash.update(enum.instance_variable_get(:@hash))
  else
    do_with_enum(enum) { |o| add(o) }
  end

  self
end

Example: display method comments

Set.instance_method(:merge).comment.display
# =>
# Merges the elements of the given enumerable object to the set and
# returns self.

Example: display module/class comments

MethodSource::MethodExtensions.method(:included).module_comment
# =>
# This module is to be included by `Method` and `UnboundMethod` and
# provides the `#source` functionality

Limitations:

  • Occasional strange behaviour in Ruby 1.8
  • Cannot return source for C methods.
  • Cannot return source for dynamically defined methods.

Special Thanks

Adam Sanderson for comment functionality.

Dmitry Elastic for the brilliant Ruby 1.8 source_location hack.

Samuel Kadolph for the JRuby 1.8 source_location.

License

(The MIT License)

Copyright (c) 2011 John Mair (banisterfiend)

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: about 15 hours ago

Total Commits: 99
Total Committers: 22
Avg Commits per committer: 4.5
Development Distribution Score (DDS): 0.576

Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0

Name Email Commits
John Mair j****r@g****m 42
Conrad Irwin c****n@g****m 14
Kyrylo Silin s****n@k****g 7
Jean Boussier j****r@g****m 6
Ryan Fitzgerald r****e@g****m 6
Rob Gleeson r****b@f****o 3
Koichi ITO k****o@g****m 3
Jun Aruga j****a@r****m 2
Maciej Mensfeld m****j@m****l 2
Reginald Tan r****n@g****m 2
Nicolas Leger n****r@n****m 1
Adam Sanderson n****t@g****m 1
Jack Nagel j****l@g****m 1
Jason Karns j****s@g****m 1
Matt Larraz m****z 1
Peter M. Goldstein p****n@g****m 1
Peter Souter p****s 1
Rafael Masson r****n@g****m 1
Stas SUȘCOV s****s@n****o 1
Vít Ondruch v****h@t****z 1
Yoshiyuki Hirano y****o@m****m 1
nisusam n****l@g****m 1

Committer domains:


Issue and Pull Request metadata

Last synced: 3 months ago

Total issues: 32
Total pull requests: 56
Average time to close issues: about 2 months
Average time to close pull requests: 4 months
Total issue authors: 25
Total pull request authors: 32
Average comments per issue: 1.66
Average comments per pull request: 1.13
Merged pull request: 35
Bot issues: 0
Bot pull requests: 0

Past year issues: 0
Past year pull requests: 1
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 0
Past year pull request authors: 1
Past year average comments per issue: 0
Past year average comments per pull request: 0.0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/banister/method_source

Top Issue Authors

  • banister (4)
  • egwspiti (3)
  • kyrylo (2)
  • searls (2)
  • hkdnet (1)
  • twk3 (1)
  • bryanp (1)
  • graaff (1)
  • dmlary (1)
  • sanemat (1)
  • junaruga (1)
  • eregon (1)
  • gogainda (1)
  • benlieb (1)
  • voxik (1)

Top Pull Request Authors

  • kyrylo (8)
  • ConradIrwin (4)
  • redgetan (4)
  • casperisfine (4)
  • ccutrer (3)
  • pat (2)
  • ghost (2)
  • zheng-yongping (2)
  • koic (2)
  • junaruga (2)
  • symwell (2)
  • gogainda (1)
  • yhirano55 (1)
  • mlarraz (1)
  • rafbm (1)

Top Issue Labels

  • feature (3)

Top Pull Request Labels


Package metadata

gem.coop: method_source

retrieve the sourcecode for a method

  • Homepage: http://banisterfiend.wordpress.com
  • Documentation: http://www.rubydoc.info/gems/method_source/
  • Licenses: MIT
  • Latest release: 1.1.0 (published almost 2 years ago)
  • Last Synced: 2026-03-02T20:30:44.673Z (1 day ago)
  • Versions: 29
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 715,382,401 Total
  • Docker Downloads: 1,474,848,442
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Downloads: 0.021%
    • Average: 0.022%
    • Docker downloads count: 0.065%
  • Maintainers (4)
rubygems.org: method_source

retrieve the sourcecode for a method

  • Homepage: http://banisterfiend.wordpress.com
  • Documentation: http://www.rubydoc.info/gems/method_source/
  • Licenses: MIT
  • Latest release: 1.1.0 (published almost 2 years ago)
  • Last Synced: 2026-03-02T18:03:54.663Z (1 day ago)
  • Versions: 29
  • Dependent Packages: 134
  • Dependent Repositories: 558,379
  • Downloads: 715,332,869 Total
  • Docker Downloads: 1,474,848,442
  • Rankings:
    • Downloads: 0.022%
    • Dependent repos count: 0.026%
    • Docker downloads count: 0.106%
    • Dependent packages count: 0.269%
    • Average: 1.256%
    • Stargazers count: 3.058%
    • Forks count: 4.054%
  • Maintainers (4)
proxy.golang.org: github.com/banister/method_source

  • Homepage:
  • Documentation: https://pkg.go.dev/github.com/banister/method_source#section-documentation
  • Licenses: mit
  • Latest release: v1.1.0 (published almost 2 years ago)
  • Last Synced: 2026-03-01T20:02:08.089Z (2 days ago)
  • Versions: 15
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Stargazers count: 3.025%
    • Forks count: 3.625%
    • Average: 6.757%
    • Dependent packages count: 9.576%
    • Dependent repos count: 10.802%
debian-10: ruby-method-source

  • Homepage: https://github.com/banister/method_source
  • Documentation: https://packages.debian.org/buster/ruby-method-source
  • Licenses:
  • Latest release: 0.9.2-1 (published 21 days ago)
  • Last Synced: 2026-02-13T04:22:53.944Z (19 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-23.10: ruby-method-source

  • Homepage: https://github.com/banister/method_source
  • Licenses:
  • Latest release: 1.0.0-2 (published 18 days ago)
  • Last Synced: 2026-02-13T18:25:31.042Z (18 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-24.04: ruby-method-source

  • Homepage: https://github.com/banister/method_source
  • Licenses:
  • Latest release: 1.0.0-2 (published 25 days ago)
  • Last Synced: 2026-02-06T15:33:56.670Z (25 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
debian-11: ruby-method-source

  • Homepage: https://github.com/banister/method_source
  • Documentation: https://packages.debian.org/bullseye/ruby-method-source
  • Licenses:
  • Latest release: 1.0.0-2 (published 21 days ago)
  • Last Synced: 2026-02-13T08:22:06.602Z (19 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-20.04: ruby-method-source

  • Homepage: https://github.com/banister/method_source
  • Licenses: mit
  • Latest release: 0.9.2-1 (published 19 days ago)
  • Last Synced: 2026-02-13T07:17:36.961Z (19 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-24.10: ruby-method-source

  • Homepage: https://github.com/banister/method_source
  • Licenses:
  • Latest release: 1.0.0-2ubuntu1 (published 22 days ago)
  • Last Synced: 2026-02-09T16:55:26.098Z (22 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
guix: ruby-method-source

Retrieve the source code for Ruby methods

ubuntu-22.04: ruby-method-source

  • Homepage: https://github.com/banister/method_source
  • Licenses:
  • Latest release: 1.0.0-2 (published 18 days ago)
  • Last Synced: 2026-02-13T13:20:22.407Z (18 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-23.04: ruby-method-source

  • Homepage: https://github.com/banister/method_source
  • Licenses:
  • Latest release: 1.0.0-2 (published 21 days ago)
  • Last Synced: 2026-02-11T06:43:14.596Z (21 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
debian-12: ruby-method-source

  • Homepage: https://github.com/banister/method_source
  • Documentation: https://packages.debian.org/bookworm/ruby-method-source
  • Licenses:
  • Latest release: 1.0.0-2 (published 19 days ago)
  • Last Synced: 2026-02-12T23:34:56.952Z (19 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
debian-13: ruby-method-source

  • Homepage: https://github.com/banister/method_source
  • Documentation: https://packages.debian.org/trixie/ruby-method-source
  • Licenses:
  • Latest release: 1.1.0-1 (published 19 days ago)
  • Last Synced: 2026-02-13T13:17:27.605Z (18 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%

Dependencies

.github/workflows/main.yml actions
  • actions/checkout v4 composite
  • ruby/setup-ruby v1 composite
Gemfile rubygems
  • rake >= 0
  • rspec >= 0
method_source.gemspec rubygems

Score: 31.283044241344033