rails_module_unification 0.5 → 0.5.1

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
  SHA1:
3
- metadata.gz: d534fbc4e2d179f5c74b7a474a39e3bdf44af115
4
- data.tar.gz: 1582f310105cd5e2e412522252d94a275480b579
3
+ metadata.gz: 71501a9317c80c5f091da00abee3b55755542e8f
4
+ data.tar.gz: 1e2cfebbba3b4671ee89580093392eb92eb12efb
5
5
  SHA512:
6
- metadata.gz: 7862c364eb26de506fc4be7216960636310a81c5b66e9d4d1686f05d506531d1b68e597bd6d9599c07ba1111c42252426e1c35198f9203353ea7a55ee232aff0
7
- data.tar.gz: 0309ad0ddffd8e1db286713b538f5db999eac112d4530816a790ba1ebe84ddb8d22f4c93e8f6ac240519ce6391c1d541deb6c4c62e773685dfc3778b5e6e89fd
6
+ metadata.gz: b40c277e2ba4676f2b1a77d74f9aeb75de6f4bf95a3bfd5627d12fad840aea2b6a9def255d7bb75ba56765d0b19f62a6fc604a79f7ab5deb347f7ebe65402994
7
+ data.tar.gz: 3eda030e1c103c2d27c3b4cf0398f98b09a87243a6556e3e33a5980ccef1a9be3f0e3508830ceeac93384328b08e417b49be803a1767a801b639b75de37588d7
@@ -1,8 +1,9 @@
1
+ # frozen_string_literal: true
1
2
  module RailsModuleUnification
2
3
  module ActiveSupportExtensions
3
4
  def load_from_path(file_path, qualified_name, from_mod, const_name)
4
5
  expanded = File.expand_path(file_path)
5
- expanded.sub!(/\.rb\z/, ''.freeze)
6
+ expanded.sub!(/\.rb\z/, '')
6
7
 
7
8
  if loading.include?(expanded)
8
9
  raise "Circular dependency detected while autoloading constant #{qualified_name}"
@@ -50,7 +51,6 @@ module RailsModuleUnification
50
51
  # folder/type.rb
51
52
  folder_type_name = folder_name + '/' + type_name
52
53
 
53
-
54
54
  # without a folder / namespace?
55
55
  # TODO: could this have undesired consequences?
56
56
  file_path = search_for_file(file_name)
@@ -61,11 +61,12 @@ module RailsModuleUnification
61
61
 
62
62
  return load_from_path(file_path, qualified_name, from_mod, const_name) if file_path
63
63
 
64
+ # TODO: what is the situation in which this is needed?
65
+ mod = autoload_module!(from_mod, const_name, qualified_name, file_name)
66
+ return mod if mod
64
67
 
65
- if mod = autoload_module!(from_mod, const_name, qualified_name, file_name)
66
- return mod
67
- elsif (parent = from_mod.parent) && parent != from_mod &&
68
- ! from_mod.parents.any? { |p| p.const_defined?(const_name, false) }
68
+ if (parent = from_mod.parent) && parent != from_mod &&
69
+ !from_mod.parents.any? { |p| p.const_defined?(const_name, false) }
69
70
  # If our parents do not have a constant named +const_name+ then we are free
70
71
  # to attempt to load upwards. If they do have such a constant, then this
71
72
  # const_missing must be due to from_mod::const_name, which should not
@@ -97,7 +98,7 @@ module RailsModuleUnification
97
98
  end
98
99
 
99
100
  name_error = NameError.new("uninitialized constant #{qualified_name}", const_name)
100
- name_error.set_backtrace(caller.reject {|l| l.starts_with? __FILE__ })
101
+ name_error.set_backtrace(caller.reject { |l| l.starts_with? __FILE__ })
101
102
  raise name_error
102
103
  end
103
104
  end
@@ -9,12 +9,10 @@ module RailsModuleUnification
9
9
 
10
10
  # Data
11
11
  data_paths = Dir["#{mu_dir}/data/**/"]
12
- ap data_paths
13
12
  app.config.autoload_paths += data_paths
14
13
 
15
14
  # Resources
16
15
  resource_paths = Dir["#{mu_dir}/resources/"]
17
- ap resource_paths
18
16
  app.config.autoload_paths += resource_paths
19
17
  end
20
18
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module RailsModuleUnification
3
- VERSION = '0.5'.freeze
3
+ VERSION = '0.5.1'.freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_module_unification
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.5'
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - L. Preston Sego III
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-17 00:00:00.000000000 Z
11
+ date: 2016-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -164,20 +164,6 @@ dependencies:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
- - !ruby/object:Gem::Dependency
168
- name: sqlite3
169
- requirement: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - ">="
172
- - !ruby/object:Gem::Version
173
- version: '0'
174
- type: :development
175
- prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - ">="
179
- - !ruby/object:Gem::Version
180
- version: '0'
181
167
  description: Ember's Module Unification brought to Rails
182
168
  email: LPSego3+dev@gmail.com
183
169
  executables: []
@@ -213,5 +199,5 @@ rubyforge_project:
213
199
  rubygems_version: 2.5.1
214
200
  signing_key:
215
201
  specification_version: 4
216
- summary: RailsModuleUnification-0.5
202
+ summary: RailsModuleUnification-0.5.1
217
203
  test_files: []