rwr-view_helpers 0.1.1 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8e3a4e5135d2b09ac2fea7a07d0786d404e206e6
4
- data.tar.gz: 98fea2b640d9beaa4dde664671ba3b390855f8a9
3
+ metadata.gz: de1962d5359182d1c0fe8c599216147a81d3cdb6
4
+ data.tar.gz: 35d04a38931284253ff3149dc5b97f0c5bf1281f
5
5
  SHA512:
6
- metadata.gz: e9f7b2b71132308f57ae0d1d77a0b59f902c3f952de72ac20348da5322de4a50fdf9db11ca0a6e328824849def57562878311e3c4153b6380d9899e8f292dc2c
7
- data.tar.gz: b29816efa438c2e57039ab098caa526f28b27d9bbe6858397edb203b33194db50e2730f1216339d89cfe9b5809f4b2429d82bd98c793bbef134381f05a4cd145
6
+ metadata.gz: 3984cb591dd820ca5cf32e1b45b8fd49bc2a64b0f04ad2098e5c5ec891296feaf20d5ac53300340706a8bfd0b01a5d558c4d459ea3f2f1b02001291cfe4c4b37
7
+ data.tar.gz: 682b7dfff52e68289afed75db1aa6cfb38fc9552d22c47ba3bd9cb8cc3211a1f76c603814bb3aa4edadf0fbd75549cfb4182206cbe7287815122897249164a3a
data/README.md CHANGED
@@ -26,12 +26,13 @@ First add this require statement in your `/app/assets/javascripts/application.js
26
26
 
27
27
  Then use it in your React components
28
28
 
29
- ```jsx
29
+ ```js
30
30
  import React from 'react';
31
31
  import { imagePath } from 'rwr-view-helpers';
32
+ import { facebookIcon } from 'constants/icon-urls';
32
33
 
33
34
  export default ({ alt }) => (
34
- <img alt={alt} src={imagePath('spongebob.png')} />
35
+ <img alt={alt} src={imagePath(facebookIcon)} />
35
36
  );
36
37
  ```
37
38
 
@@ -1,2 +1,3 @@
1
- export const imagePath =
2
- path => (global || window).__RWR_VIEW_HELPERS__.imagePaths[path] || path;
1
+ export const imagePath = path => typeof window !== 'undefined'
2
+ ? window.__RWR_VIEW_HELPERS__.imagePaths[path] || path
3
+ : global.__RWR_VIEW_HELPERS__.imagePaths[path] || path;
@@ -1 +1 @@
1
- export default '0.1.1';
1
+ export default '0.2.0';
@@ -1,5 +1,5 @@
1
1
  module ReactWebpackRails
2
2
  module RWRViewHelpers
3
- VERSION = "0.1.1"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rwr-view-helpers",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "ReactWebpackRails integration with useful view helpers.",
5
5
  "main": "js/lib/index.js",
6
6
  "files": [
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rwr-view_helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oskar Cieslik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-19 00:00:00.000000000 Z
11
+ date: 2016-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: react_webpack_rails
@@ -227,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
227
227
  version: '0'
228
228
  requirements: []
229
229
  rubyforge_project:
230
- rubygems_version: 2.4.5.1
230
+ rubygems_version: 2.5.1
231
231
  signing_key:
232
232
  specification_version: 4
233
233
  summary: ''