expo 0.4.4 → 0.5.0

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.
Files changed (3) hide show
  1. checksums.yaml +14 -6
  2. data/lib/expo2.rb +4 -19
  3. metadata +6 -5
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: e7d55e7458c5c0d5821be9440046b6510dab4a73
4
- data.tar.gz: 6fbaae04214ee9dd763de47b8928dd6d6ebe9a1d
5
- SHA512:
6
- metadata.gz: d54e793cdc2bfdf8c06edfadb943339596666ef06f210ba6d47272866126aa29a6d1800dbae53e578b1182b41d80576ed32a2ab7cc4f6998dd2fd6ab589ea8db
7
- data.tar.gz: cbd745662c20f20e926b3a18591e597e63fa4cde0396900ff7b1a15dbeb8add8c9e9f86304c640d092c483ef2233ca3728e56a8883ed1800a518e7e8e561ea4a
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ OGNkYWM2OTNlZjgwNzRiMGE3NmM1ODM0ZmEwN2I3OTc3ZTY5OWNlZQ==
5
+ data.tar.gz: !binary |-
6
+ OGFiZDI0OTAxYzE3OTczNWU3NGNjMTA1M2JmM2VmM2U2Y2M1ZWViMA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ OTRkYzcxNDcyOWM0ZjcyNGMzNjkyMDFkZDkwOGE0OWZkNmM4MWE4N2IyOGJm
10
+ YjBlMWQ1ZjllMWZlZTk5MDdhMDNjZWJhMTBkZjliNjAyMWQwOWYwMDYzZjhk
11
+ MDk2ODM5YzdmNDNlZTc0MjI3NWIxZGEwOGI4YjBkNDM2YzRkODA=
12
+ data.tar.gz: !binary |-
13
+ MDc3ZTEyZmQ3N2Y5MGE3Yzc5YjhhMjE3NzYwNGUwZjIyMDI1ZWFkM2Y2ODgy
14
+ YmY3ZGQ0ZTlkY2Y2NGI5N2NlODY4ZDhjMTJkZDJhODY3ODZlOTUyNjcxNGQ3
15
+ NTU5MTgzMGEyMjNiNzAxMmY4MjNkODE4NDU2MThkZmNiNzIxYjA=
data/lib/expo2.rb CHANGED
@@ -43,7 +43,7 @@ class Expo2
43
43
  def go(object, context, index=nil)
44
44
  preso = {}
45
45
  perspective = if self.presenter
46
- self.presenter.new(object)
46
+ self.presenter.to_proc.call(object)
47
47
  else
48
48
  object
49
49
  end
@@ -79,12 +79,7 @@ class Expo2
79
79
  # end
80
80
  class SubExpo < Struct.new(:presenter, :key, :sub_expo, :block)
81
81
  def go(object, context, index=nil, user_expo)
82
- assoc = self.presenter
83
- associated = if assoc.respond_to?(:new)
84
- assoc.new(object)
85
- else
86
- assoc.call(object)
87
- end
82
+ associated = self.presenter.to_proc.call(object)
88
83
  sub = Expo2.new(self.sub_expo, &self.block)
89
84
  if associated
90
85
  { self.key => sub.expo(associated, context) }
@@ -96,12 +91,7 @@ class Expo2
96
91
 
97
92
  class MergeExpo < Struct.new(:presenter, :sub_expo, :block)
98
93
  def go(object, context, index=nil, user_expo)
99
- assoc = self.presenter
100
- associated = if assoc.respond_to?(:new)
101
- assoc.new(object)
102
- else
103
- assoc.call(object)
104
- end
94
+ associated = self.presenter.to_proc.call(object)
105
95
  sub = Expo2.new(self.sub_expo, &self.block)
106
96
  if associated
107
97
  sub.expo(associated, context)
@@ -113,12 +103,7 @@ class Expo2
113
103
 
114
104
  class SubCollection < Struct.new(:associator, :key, :sub_expo, :block)
115
105
  def go(object, context, index=nil)
116
- assoc = self.associator
117
- associated = if assoc.respond_to?(:new)
118
- assoc.new(object)
119
- else
120
- assoc.call(object)
121
- end
106
+ associated = self.associator.to_proc.call(object)
122
107
  sub = Expo2.new(self.sub_expo, &self.block)
123
108
  { self.key => sub.expo_collection(associated, context) }
124
109
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: expo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Serguei Filimonov
@@ -10,7 +10,8 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2013-07-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: Constructs a presentation of object tree sub-graphs... or something.
13
+ description: Expo hopes to ease writing smaller, more cohesive objects in a Rails-like
14
+ setting.
14
15
  email: serguei.filimonov@gmail.com
15
16
  executables: []
16
17
  extensions: []
@@ -27,12 +28,12 @@ require_paths:
27
28
  - lib
28
29
  required_ruby_version: !ruby/object:Gem::Requirement
29
30
  requirements:
30
- - - '>='
31
+ - - ! '>='
31
32
  - !ruby/object:Gem::Version
32
33
  version: '0'
33
34
  required_rubygems_version: !ruby/object:Gem::Requirement
34
35
  requirements:
35
- - - '>='
36
+ - - ! '>='
36
37
  - !ruby/object:Gem::Version
37
38
  version: '0'
38
39
  requirements: []
@@ -40,5 +41,5 @@ rubyforge_project:
40
41
  rubygems_version: 2.0.3
41
42
  signing_key:
42
43
  specification_version: 4
43
- summary: Expo of object presentations
44
+ summary: Expo of object perspectives
44
45
  test_files: []