modulation 0.22 → 0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/modulation/builder.rb +7 -6
- data/lib/modulation/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5c49015c128b42973ab89aa6f4de9bcb7c6d12b224fe7451060cf3d0ac3eb31
|
4
|
+
data.tar.gz: e733c59b1c03b76557a8ddcc74f518e3820d222c3e9812583275991d8550b957
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd91d28403805c34fb98528f5d0181c6e8fc92c822e355bc94041d6da325f4753853fe74cb86fbabdb364889c5c55820e235e9e3296374808df73cfe295a9899
|
7
|
+
data.tar.gz: 15c8c550c91494f8c52f5d804b77b3f6fcc2b0445b72993850bef63064ce84526f73a50663bc954ec002e772faa0dd8ffa1b956d9a9733d372792fc65820729c
|
data/CHANGELOG.md
CHANGED
data/lib/modulation/builder.rb
CHANGED
@@ -108,7 +108,8 @@ module Modulation
|
|
108
108
|
|
109
109
|
# Returns exported value for a default export
|
110
110
|
# If the given value is a symbol, returns the value of the corresponding
|
111
|
-
# constant.
|
111
|
+
# constant. If the symbol refers to a method, returns a proc enveloping
|
112
|
+
# the method. Raises if symbol refers to non-existent constant or method.
|
112
113
|
# @param value [any] export_default value
|
113
114
|
# @param mod [Module] module
|
114
115
|
# @return [any] exported value
|
@@ -116,15 +117,15 @@ module Modulation
|
|
116
117
|
if value.is_a?(Symbol)
|
117
118
|
case value
|
118
119
|
when /^[A-Z]/
|
119
|
-
|
120
|
-
|
121
|
-
end
|
120
|
+
if mod.singleton_class.constants(true).include?(value)
|
121
|
+
return mod.singleton_class.const_get(value)
|
122
|
+
end
|
123
|
+
raise_exported_symbol_not_found_error(value, mod, :const)
|
122
124
|
else
|
123
125
|
if mod.singleton_class.instance_methods(true).include?(value)
|
124
126
|
return proc { |*args, &block| mod.send(value, *args, &block) }
|
125
|
-
else
|
126
|
-
raise_exported_symbol_not_found_error(value, mod, :method)
|
127
127
|
end
|
128
|
+
raise_exported_symbol_not_found_error(value, mod, :method)
|
128
129
|
end
|
129
130
|
end
|
130
131
|
value
|
data/lib/modulation/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: modulation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.23'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sharon Rosner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|