decent_exposure 2.3.0 → 2.3.1
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/README.md +31 -1
- data/lib/decent_exposure/constant_resolver.rb +3 -1
- data/lib/decent_exposure/expose.rb +1 -1
- data/lib/decent_exposure/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9722fc0ed5a4c4b217a0b10579f7164768046372
|
4
|
+
data.tar.gz: 55f47a182884af1156416dd6747de0d3dec0b139
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c92c4720690ef3d66fdf7084f7abedf2edda56fddc90e5c6232089a7ea06affb612ed2ebc3be125b1c70ef7d63cbe9183589e6a5b9314bc908797ecab5471991
|
7
|
+
data.tar.gz: b5aec6de47e0733e094d8c35272fdc9066c344bd4bda227f20d0ce0dc0b6c22a9fac8321da1fd50355bd6fdab7f334b139f7bd613b812809fcebf3d57ce09f34
|
data/README.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
[](http://badge.fury.io/rb/decent_exposure) [](https://travis-ci.org/voxdolo/decent_exposure) [](https://codeclimate.com/github/voxdolo/decent_exposure)
|
2
2
|
|
3
|
+
**Note**: Version 2.3.x will be the last series of releases that support
|
4
|
+
Rails 3.x and Ruby 1.8/1.9. Starting with version 3.0, Decent Exposure
|
5
|
+
will only support Rails 4.0 and above, and Ruby 2.0 and above.
|
6
|
+
|
3
7
|
## Mad Decent
|
4
8
|
|
5
9
|
Rails controllers are the sweaty armpit of every rails app. This is due, in
|
@@ -64,6 +68,32 @@ class Controller
|
|
64
68
|
end
|
65
69
|
```
|
66
70
|
|
71
|
+
And your views from this:
|
72
|
+
|
73
|
+
```ruby
|
74
|
+
@person.email
|
75
|
+
```
|
76
|
+
|
77
|
+
To simply this:
|
78
|
+
|
79
|
+
```ruby
|
80
|
+
person.email
|
81
|
+
```
|
82
|
+
|
83
|
+
In your forms, instead of this:
|
84
|
+
|
85
|
+
```ruby
|
86
|
+
= form_for @person do |f|
|
87
|
+
...
|
88
|
+
```
|
89
|
+
|
90
|
+
To this:
|
91
|
+
|
92
|
+
```ruby
|
93
|
+
= form_for person do |f|
|
94
|
+
...
|
95
|
+
```
|
96
|
+
|
67
97
|
`decent_exposure` makes it easy to define named methods that are made available
|
68
98
|
to your views and which memoize the resultant values. It also tucks away the
|
69
99
|
details of the common fetching, initializing and updating of resources and
|
@@ -302,7 +332,7 @@ This block is evaluated and the memoized result is returned whenever you call
|
|
302
332
|
|
303
333
|
If you don't want to go too far off the beaten path, the value of the default
|
304
334
|
exposure can be easily obtained inside of your custom block. The block will
|
305
|
-
receive a proxy object that you can use to lazily evaluate
|
335
|
+
receive a proxy object that you can use to lazily evaluate
|
306
336
|
the default decent_exposure logic. For example:
|
307
337
|
|
308
338
|
```ruby
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decent_exposure
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Caudill
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2014-01-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|