nested_inherited_jruby_include_package 0.1.0 → 0.2.0

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: 6f84fa63cba7b90887125a367a19fc17af87c88a0d5f783ea40052fc38378a35
4
- data.tar.gz: 07c16bf6709eff7d1aad7ae47f5ced1c22c83ec07abb1fff73b22059592c40e1
3
+ metadata.gz: a4b59fe4d3ce4b6fb8914041222a663ae9ec827b36aea901615e0c018f79c97a
4
+ data.tar.gz: 1aadb2acb8559a97c89fdad1dafe556b1473ce847f550b6137b4330627b99531
5
5
  SHA512:
6
- metadata.gz: 35d06a985045b47f4edb3308c6257ec55b6b98d53f0d30f5794fd86298735bbcc61cb89659033e50cc6ef01dc0669006d2c75230baab62ab19b28c1db2d16922
7
- data.tar.gz: 5c57fa8298931eaa9935e935e03a19a94b996ef6959dba90e1c59443677dddc59f4e87a7a9b33a63c3b77bffd323a5ad8cf933fb4cd12d4622b970e9293be246
6
+ metadata.gz: 17e2caf99a64dac498e790ead0f7a3bd8e76a66c2e129a8ddcb5c162535321eed1261874febf6df6a85aeda2432e997c3c866a8a03821ca497f0f359e09905a7
7
+ data.tar.gz: d05aef862b1251a36c21297db2cfaac55629226bc8fb52573f915486e7a5271692e50f9fae2777d2d7542a643c5f24f4ae30618687aab74b639e4aa9c0f771b3
data/README.md CHANGED
@@ -49,7 +49,7 @@ More examples can be found in:
49
49
 
50
50
  Add the following to `Gemfile`:
51
51
  ```
52
- gem 'nested_inherited_jruby_include_package', '~> 0.1.0'
52
+ gem 'nested_inherited_jruby_include_package', '~> 0.2.0'
53
53
  ```
54
54
 
55
55
  And, then run:
@@ -59,7 +59,13 @@ jruby -S bundle install
59
59
 
60
60
  If you are not using Bundler, run:
61
61
  ```
62
- jruby -S gem install nested_inherited_jruby_include_package -v 0.1.0
62
+ jruby -S gem install nested_inherited_jruby_include_package -v 0.2.0
63
+ ```
64
+
65
+ Then add this line to your code:
66
+
67
+ ```ruby
68
+ require 'nested_inherited_jruby_include_package'
63
69
  ```
64
70
 
65
71
  # Caveats
@@ -76,6 +82,10 @@ To avoid method and constant pollution in `Module`, the implementation intention
76
82
 
77
83
  This is an early alpha. It has only been used in a couple of projects. As such, there are no guarantees for its functionality. Please report any issues you might discover when using on your own projects.
78
84
 
85
+ # Change Log
86
+
87
+ [CHANGELOG.md](CHANGELOG.md)
88
+
79
89
  # License
80
90
 
81
91
  The MIT License
@@ -6,9 +6,24 @@ class Module
6
6
  def const_missing(constant)
7
7
  hidden_methods = {
8
8
  included_packages_from_ancestors_namespaces: lambda do |m|
9
- m.ancestors.map do |klass|
10
- hidden_methods[:included_packages_from_namespaces].call(klass)
11
- end.map(&:to_a).reduce([], :+).uniq
9
+ collection = []
10
+ hidden_methods[:collect_ancestors_namespaces].call(collection, m)
11
+ collection.uniq.map do |klass|
12
+ hidden_methods[:included_packages].call(klass)
13
+ end.map(&:to_a).reduce([], :+).uniq
14
+ end,
15
+
16
+ collect_ancestors_namespaces: lambda do |collection, m|
17
+ return if collection.include?(m)
18
+ collection << m
19
+ result = (m.ancestors + hidden_methods[:namespaces].call(m)[1..-1]).uniq
20
+ if result.size == 1
21
+ return
22
+ else
23
+ result[1..-1].each do |klass|
24
+ hidden_methods[:collect_ancestors_namespaces].call(collection, klass)
25
+ end
26
+ end
12
27
  end,
13
28
 
14
29
  included_packages_from_namespaces: lambda do |m|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nested_inherited_jruby_include_package
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-02 00:00:00.000000000 Z
11
+ date: 2020-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement