presenter_object 0.2.4 → 0.2.5

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: 4db23d97099762959c245d3fd2ca7dc4960922a0
4
- data.tar.gz: f69f054e06a994404e89f11a9f49b7e9c0f3df35
3
+ metadata.gz: 9bc7b88b75126bf2f6bc0470f4575c3b60d3b674
4
+ data.tar.gz: 50a6d1c69a7cee1569e6070cd0cedc86e6d83fb2
5
5
  SHA512:
6
- metadata.gz: 4db85001d3aaec96bb6b98d9a19d8d12c13b4fd1e8e383984f08f42267a7ab44c69d64d5c6347dfcbc7ec11f8702cdf99548fb7ca195a3cdb6a37412447f32f0
7
- data.tar.gz: e70d1a61d2d9c0edc6f7f67de77f6c121e1ac4e705158cb76a8a9714d72d020cbf7a635f66735f77eaa6e7bd55dcb0739eb053723439338d51d2a8b8335fa7e8
6
+ metadata.gz: 9c97848dba8ce24d2726fc6e60bed440cf458d3455223c206fe8c41896122ca892e35e7b75a9b6aeefeffc04f936293431a76bcdaadde13df0b6c0d7f4c9d249
7
+ data.tar.gz: 2d40723bd9425a3610895948ab9b64fa290272bc3ed5e42702aa1ac642848477fa21ed2122a30b05fb33997f78d57e7ae8dbfacdef6d6e35e19c6a1e8e6f3239
@@ -1,3 +1,3 @@
1
1
  module PresenterObject
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
  end
@@ -9,9 +9,20 @@ require "presenter_object/collection"
9
9
  module PresenterObject
10
10
  SUFFIX = "Presenter"
11
11
 
12
+ # If your presenters are namespaced, add the namespace module to this array
13
+ # in case you have loading problems in development. This helps me find the presenter.
14
+ # e.g
15
+ # in /lib/initializers/presenter_object.rb
16
+ # PresenterObject.namespaces << MyAwesomeSpace
17
+ #
18
+ def self.namespaces
19
+ @namespaces ||= [Object]
20
+ end
21
+
12
22
  def self.load_presenter!(name)
13
- Object.const_get "#{name}#{SUFFIX}"
14
- rescue NameError
15
- nil
23
+ namespaces.each do |space|
24
+ presenter = space.const_get "#{name}#{SUFFIX}" rescue nil
25
+ return presenter if presenter
26
+ end
16
27
  end
17
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: presenter_object
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Diego Salazar
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-08 00:00:00.000000000 Z
11
+ date: 2016-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler