Sha256: 6bb5e018cdceb5310c4d7f4b45aa4e5dfcfff6f1da8c097ea2534c4c21a19379

Contents?: true

Size: 1.15 KB

Versions: 52

Compression:

Stored size: 1.15 KB

Contents

class YARD::Handlers::C::MethodHandler < YARD::Handlers::C::Base
  MATCH1 = %r{rb_define_
                 (
                    singleton_method |
                    method           |
                    module_function  |
                    private_method
                 )
                 \s*\(\s*([\w\.]+),
                   \s*"([^"]+)",
                   \s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\()?(\w+)\)?,
                   \s*(-?\w+)\s*\)}xm
  MATCH2 = %r{rb_define_global_function\s*\(
                \s*"([^"]+)",
                \s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\()?(\w+)\)?,
                \s*(-?\w+)\s*\)}xm
  handles MATCH1
  handles MATCH2
  statement_class BodyStatement

  process do
    statement.source.scan(MATCH1) do |type, var_name, name, func_name, param_count|
      break if var_name == "ruby_top_self"
      break if var_name == "nstr"
      break if var_name == "envtbl"

      var_name = "rb_cObject" if var_name == "rb_mKernel"
      handle_method(type, var_name, name, func_name)
    end

    statement.source.scan(MATCH2) do |name, func_name, param_count|
      handle_method("method", "rb_mKernel", name, func_name)
    end
  end
end

Version data entries

52 entries across 37 versions & 5 rubygems

Version Path
candlepin-api-0.4.0 bundle/ruby/gems/yard-0.8.7/lib/yard/handlers/c/method_handler.rb
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/yard-0.8.7/lib/yard/handlers/c/method_handler.rb
candlepin-api-0.4.0 bundle/ruby/1.8/gems/yard-0.8.7/lib/yard/handlers/c/method_handler.rb
yard-0.8.7.1 lib/yard/handlers/c/method_handler.rb
yard-0.8.7 lib/yard/handlers/c/method_handler.rb
challah-1.0.0 vendor/bundle/gems/yard-0.8.6.1/lib/yard/handlers/c/method_handler.rb
yard-0.8.6.2 lib/yard/handlers/c/method_handler.rb
challah-1.0.0.beta3 vendor/bundle/gems/yard-0.8.6/lib/yard/handlers/c/method_handler.rb
challah-1.0.0.beta3 vendor/bundle/gems/yard-0.8.5.2/lib/yard/handlers/c/method_handler.rb
challah-1.0.0.beta3 vendor/bundle/gems/yard-0.8.6.1/lib/yard/handlers/c/method_handler.rb
sidekiq-statsd-0.1.1 vendor/ruby/1.9.1/gems/yard-0.8.6.1/lib/yard/handlers/c/method_handler.rb
sidekiq-statsd-0.1.0 vendor/ruby/1.9.1/gems/yard-0.8.6.1/lib/yard/handlers/c/method_handler.rb
yard-0.8.6.1 lib/yard/handlers/c/method_handler.rb
challah-1.0.0.beta2 vendor/bundle/gems/yard-0.8.6/lib/yard/handlers/c/method_handler.rb
challah-1.0.0.beta2 vendor/bundle/gems/yard-0.8.5.2/lib/yard/handlers/c/method_handler.rb
yard-0.8.6 lib/yard/handlers/c/method_handler.rb
challah-1.0.0.beta vendor/bundle/gems/yard-0.8.5.2/lib/yard/handlers/c/method_handler.rb
challah-1.0.0.beta vendor/bundle/gems/yard-0.8.3/lib/yard/handlers/c/method_handler.rb
yard-0.8.5.2 lib/yard/handlers/c/method_handler.rb
yard-0.8.5.1 lib/yard/handlers/c/method_handler.rb