decent_exposure 2.3.0 → 2.3.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: d0b3584786f08fa92a4a19b425f21c2916edf332
4
- data.tar.gz: 99b35c17b658c58bba300b4079e1a038eafabe3d
3
+ metadata.gz: 9722fc0ed5a4c4b217a0b10579f7164768046372
4
+ data.tar.gz: 55f47a182884af1156416dd6747de0d3dec0b139
5
5
  SHA512:
6
- metadata.gz: 940f770c0a27c186bd9ec2d5e7a9540e8dbc007074520d2d107d96bc7690a3ad66bcaf4d5b174541283669b999727f87ba9e8661ee07c7d6fd65eb4bdd70be3a
7
- data.tar.gz: c196f21d5c6b6edfd9be8c246f31bfaba9d484f9826792f330e0743d9534a316a7cfce96885857702dc8c82a96ad41d8de02727df735303c9e8f7397bde7370c
6
+ metadata.gz: c92c4720690ef3d66fdf7084f7abedf2edda56fddc90e5c6232089a7ea06affb612ed2ebc3be125b1c70ef7d63cbe9183589e6a5b9314bc908797ecab5471991
7
+ data.tar.gz: b5aec6de47e0733e094d8c35272fdc9066c344bd4bda227f20d0ce0dc0b6c22a9fac8321da1fd50355bd6fdab7f334b139f7bd613b812809fcebf3d57ce09f34
data/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/decent_exposure.png)](http://badge.fury.io/rb/decent_exposure) [![Build Status](https://api.travis-ci.org/voxdolo/decent_exposure.png?branch=master)](https://travis-ci.org/voxdolo/decent_exposure) [![Code Climate](https://codeclimate.com/github/voxdolo/decent_exposure.png)](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
@@ -26,7 +26,9 @@ module DecentExposure
26
26
 
27
27
  def namespace
28
28
  path = context.to_s
29
- path[0...(path.rindex('::') || 0)].constantize
29
+ name = path[0...(path.rindex('::') || 0)]
30
+ return Object if name.blank?
31
+ name.constantize
30
32
  end
31
33
  end
32
34
  end
@@ -13,7 +13,7 @@ module DecentExposure
13
13
  end
14
14
  hide_action :_resources
15
15
 
16
- protected_instance_variables.push("@_resources")
16
+ protected_instance_variables << "@_resources"
17
17
  end
18
18
  end
19
19
 
@@ -1,3 +1,3 @@
1
1
  module DecentExposure #:nodoc
2
- VERSION = "2.3.0"
2
+ VERSION = "2.3.1"
3
3
  end
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.0
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: 2013-09-24 00:00:00.000000000 Z
13
+ date: 2014-01-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec