simple_exposure 0.0.1 → 0.0.2

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: 1d56dca6e52b4aca0a6e0997d31b63a947a8be86
4
- data.tar.gz: d702aab2f42718b45b9d66f2fe6cdbcfabdb7f96
3
+ metadata.gz: a6213f9983cd1304fe8a1ca1b5b07439dde3f44d
4
+ data.tar.gz: f51988204546151b272a6332ba049f4046901f1d
5
5
  SHA512:
6
- metadata.gz: ce2a6f63cc872a0279129c09bd632b006c9440568da9ef0feacf2c53e778e0de977e2a947c9b9d4ce9b5356907002818656ca68ee8f437f12274e5802fe20685
7
- data.tar.gz: 4190b607787e3c58ea15db46baa2ed31e0075efb221f85d29295174a5aec7cd9176466f681b8fba2cb645714be578197a81390e524a5d1bd435cfde51012ea9e
6
+ metadata.gz: c1f5e71198dcd3cf61165a39baabd819069db2ce2e790cf25244b26ed76c82058ddb375d9cc64f964d14a40e0050bbc214f4fb18e00a4d27d0c013021b454870
7
+ data.tar.gz: 9b6827ad0f3cb77ba298e115e8b0dee0163d1155951b84dea155ca27de33f10491453cea18e46bff1bdc4a95ea2b11be88d0a6cdd2261b6f8bad56feac4689bd
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0.0
5
+ - 2.1.0
6
+ script: bundle exec rspec spec
data/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # SimpleExposure
2
2
 
3
+ ![Gem version](http://img.shields.io/gem/v/simple_exposure.svg)
4
+ ![Code Climate](http://img.shields.io/codeclimate/github/mikekreeki/simple_exposure.svg)
5
+ ![Travis CI](http://img.shields.io/travis/mikekreeki/simple_exposure.svg)
6
+ ![Github Issues](http://img.shields.io/github/issues/mikekreeki/simple_exposure.svg)
7
+
3
8
  Simplify sharing state between Rails controllers and views and reduce noise in Rails controllers for those who are tired of writing the same code over and over again.
4
9
 
5
10
  Based on the idea behind [view_accessor](https://github.com/invisiblefunnel/view_accessor) borrowing features I like from [decent_exposure](https://github.com/voxdolo/decent_exposure).
@@ -22,8 +22,11 @@ module SimpleExposure
22
22
 
23
23
  def _apply_exposure_extension(attribute, extension)
24
24
  value = send(attribute)
25
- extension = _exposure_extension_class(extension)
26
- send :"#{attribute}=", extension.apply(value, self)
25
+
26
+ unless value.nil?
27
+ extension = _exposure_extension_class(extension)
28
+ send :"#{attribute}=", extension.apply(value, self)
29
+ end
27
30
  end
28
31
 
29
32
  def _exposure_extension_class(extension)
@@ -1,3 +1,3 @@
1
1
  module SimpleExposure
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
@@ -9,6 +9,8 @@ class ApplicationController < ActionController::Base
9
9
 
10
10
  expose(:posts_count) { 0 }
11
11
 
12
+ expose(:nil_value, extend: :decorate)
13
+
12
14
  def index
13
15
  @posts_count = 2
14
16
  end
@@ -3,3 +3,5 @@
3
3
  <%= current_user %>
4
4
 
5
5
  <%= posts_count %>
6
+
7
+ <%= nil_value %>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_exposure
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michal Krejčí
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-13 00:00:00.000000000 Z
11
+ date: 2014-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -68,6 +68,7 @@ files:
68
68
  - ".gitignore"
69
69
  - ".ruby-gemset"
70
70
  - ".ruby-version"
71
+ - ".travis.yml"
71
72
  - Gemfile
72
73
  - LICENSE.txt
73
74
  - README.md