elpong-rails 0.2.0 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7c1d51243ca69f2f13d48c1b71d46315906dd21a
4
- data.tar.gz: b24e5aaaf399b733ef5aca652510d8699e21a222
3
+ metadata.gz: 43f3907fb147b914356de01271a2112d2521bf4c
4
+ data.tar.gz: 886fb4b982d9cda420310d2d7c05584e379f4fec
5
5
  SHA512:
6
- metadata.gz: 05edb05e6b20678ac68db73cb8b1b5a24e722d44140d6e899d5af95f4f92f825da4d6192087157814fe605b561c6e6dff7b10631d4672062a11477192efbb28c
7
- data.tar.gz: 07d094e797966b5ccd514e0ac9e53a5ffbc55733e7426855d2988d649487f0fe2522e1922a1ec4ec93961ae47f29afdbb8ec0bd93509f4944ff75c1a559a059a
6
+ metadata.gz: 7353798d0648e98a2f6556c334f7ee898dec26ff14e864e62bdd7be40f4ecff9919dac2c3d70f5475f7bcad5f3944e2aa381caaacce6f0a031cad580825110f7
7
+ data.tar.gz: a4c0fa6818cb851b5962d97460ac4b126762625b9862ccab526385e9183f2fd3bd8006de9e522252e2ebd1dd3a64254400138418448fbcc2575610fb5ccc4099
@@ -9,10 +9,14 @@ module Elpong
9
9
  def elpong_collection(name, options = {})
10
10
  scheme = get_scheme_from_name_or_scheme(options[:scheme])
11
11
  # options[:locals] ||=
12
- throw new StandardError('No path') if !options[:path]
12
+ raise StandardError, 'No path or data' unless options[:path] || options[:data]
13
+
14
+ content =
15
+ options[:data] || h( render(formats: [:json], template: options[:path], locals: options[:locals] || {}) )
16
+
13
17
  attributes = {
14
18
  name: 'elpong-collection',
15
- content: h( render(template: options[:path], locals: options[:locals] || {}) ),
19
+ content: content,
16
20
  scheme: scheme.name,
17
21
  collection: name
18
22
  }
@@ -21,10 +25,14 @@ module Elpong
21
25
 
22
26
  def elpong_element(singular_name, options = {})
23
27
  scheme = get_scheme_from_name_or_scheme(options[:scheme])
24
- throw new StandardError('No path') if !options[:path]
28
+ raise StandardError, 'No path or data' unless options[:path] || options[:data]
29
+
30
+ content =
31
+ options[:data] || h( render(formats: [:json], template: options[:path], locals: options[:locals] || {}) )
32
+
25
33
  attributes = {
26
34
  name: 'elpong-element',
27
- content: h( render(template: options[:path], locals: options[:locals] || {}) ),
35
+ content: content,
28
36
  scheme: scheme.name,
29
37
  collection: singular_name.pluralize
30
38
  }
@@ -1,5 +1,5 @@
1
1
  module Elpong
2
2
  module Rails
3
- VERSION = '0.2.0'
3
+ VERSION = '0.2.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elpong-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hans Otto Wirtz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-02 00:00:00.000000000 Z
11
+ date: 2017-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -44,6 +44,20 @@ dependencies:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
46
  version: 0.2.1
47
+ - !ruby/object:Gem::Dependency
48
+ name: rspec
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '3.5'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '3.5'
47
61
  description:
48
62
  email:
49
63
  - hansottowirtz@gmail.com
@@ -79,9 +93,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
93
  version: '0'
80
94
  requirements: []
81
95
  rubyforge_project:
82
- rubygems_version: 2.6.6
96
+ rubygems_version: 2.6.8
83
97
  signing_key:
84
98
  specification_version: 4
85
99
  summary: Elpong for Rails
86
100
  test_files: []
87
- has_rdoc: