code 0.9.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 05fa15a206f463a64d2581741587e6334025bb8d5a098530e44c3903950eae40
4
- data.tar.gz: 14837035ebdee079fa31bea0283d8cbe7534e99ab6961f3ac8a28a33cb0ee18b
3
+ metadata.gz: 49fe0c5a7b314944359601ecc87e0531e7c9c11b46f09f73cfe7bf07647f1d33
4
+ data.tar.gz: b91b6fc3c2f5c8a15d80f893b06de04b4c3bc1397e2270311cfe0e5ea2c3a9c8
5
5
  SHA512:
6
- metadata.gz: '05837025b663771b48727ea8843e332e0ee7fca116bdc461bdb8da88ded538d71e4e4b99fbe9c357c6ea03e8e734909a1725f02d7704c5655bb394f5906e531a'
7
- data.tar.gz: b14d52243e2bc639153aa9ec6e10952da8e5f0ad0302d16f39a6d1afb72cb88077877da90477ad2e36a21c5188dca0ab4624fe56eabe49fa75b2d148613984eb
6
+ metadata.gz: 0f0526e09b717649255cdc4700c264a6c5efcc5b8fce51ed5e4a64dd3bb20c5d507f7e6d598f7f409f769a94308eef179757f4ac9086f3adf89441913a030814
7
+ data.tar.gz: c5b53aa70dd3c1624e287a05ffa98754a9733bb107c8bd99d2607e336d18d497d3c6c123ffdcb2461c9f170ab114c3b741236c0286b95058601a3f44825614f4
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## CHANGELOG
2
2
 
3
+ ### 0.9.4
4
+
5
+ * Support `Method` and `UnboundMethod` objects as argument
6
+
3
7
  ### 0.9.3
4
8
 
5
9
  * Loosen dependencies to Ruby and method_source
data/code.gemspec CHANGED
@@ -16,6 +16,7 @@ Gem::Specification.new do |gem|
16
16
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ['lib']
19
+ gem.metadata = { "rubygems_mfa_required" => "true" }
19
20
 
20
21
  gem.required_ruby_version = ">= 2.0", "< 4.0"
21
22
  gem.add_dependency "method_source", ">= 0.9", "< 2.0"
data/lib/code/version.rb CHANGED
@@ -1,5 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Code
2
- VERSION = "0.9.3".freeze
4
+ VERSION = "0.9.4"
3
5
  end
4
-
5
-
data/lib/code.rb CHANGED
@@ -15,7 +15,12 @@ module Code
15
15
 
16
16
  # API for end user
17
17
  def self.for(object = self, method_name)
18
- m = object.method(method_name)
18
+ if method_name.is_a?(Method) || method_name.is_a?(UnboundMethod)
19
+ m = method_name
20
+ else
21
+ m = object.method(method_name)
22
+ end
23
+
19
24
  begin
20
25
  from_ruby(m)
21
26
  rescue MethodSource::SourceNotFoundError
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: code
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Lelis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-29 00:00:00.000000000 Z
11
+ date: 2022-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: method_source
@@ -63,7 +63,8 @@ files:
63
63
  homepage: https://github.com/janlelis/code
64
64
  licenses:
65
65
  - MIT
66
- metadata: {}
66
+ metadata:
67
+ rubygems_mfa_required: 'true'
67
68
  post_install_message:
68
69
  rdoc_options: []
69
70
  require_paths:
@@ -82,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
83
  - !ruby/object:Gem::Version
83
84
  version: '0'
84
85
  requirements: []
85
- rubygems_version: 3.2.3
86
+ rubygems_version: 3.4.1
86
87
  signing_key:
87
88
  specification_version: 4
88
89
  summary: Displays a method's code.