nacelle 0.7.0 → 0.7.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
  SHA256:
3
- metadata.gz: 885386443cb6f63ebc579a91a26b91f26ced02c3161fed823bed0f57c0c99362
4
- data.tar.gz: ca1572a4234218d0a16389527e2d76977cf7ed281e098f7f56da730f818a1e93
3
+ metadata.gz: ee3c90b59d6a00b2c0ca720ab3b5b405233b403f9ceedb8ca511a93ef292dc97
4
+ data.tar.gz: 95c1ae7074088997345ca4fe40e604c99324c1d318e84742e8773becfec14593
5
5
  SHA512:
6
- metadata.gz: a864261acfe08b1fb227135200a2f630f1ac94e3849df3525323024521ed25fc9986e6019fb791167a1a53477bc26ce076e116190bec5cc283ac02026037b15d
7
- data.tar.gz: edc7341adda6efc17904f5c3f33786c58d5f1719cadf6fb7aca9d5330896448a3e0729f3ee7753d29e2b6c59dbb6a684cd2da56034f3715367a5e60faa3a6b0b
6
+ metadata.gz: 30770249809c1c67c5588f4102f2f7e8b79a71030a812af04038129be4313aad7d8c145b4319b3cd0ff432137399124959a9120ea0f8f2b81e1b506e103cd3a7
7
+ data.tar.gz: 31fc59c73a0b9d3de5d2c5817bfd19d7355eb3527e260a027daf4c95dfdac365753bb5ee6f01a4970a7ff3f10e2523c5bb8f99c0c310d9ae315c06206b904bda
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- nacelle (0.6.2)
4
+ nacelle (0.7.0)
5
5
  rails
6
6
  sprockets-rails
7
7
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- nacelle (0.6.2)
4
+ nacelle (0.7.0)
5
5
  rails
6
6
  sprockets-rails
7
7
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- nacelle (0.6.2)
4
+ nacelle (0.7.0)
5
5
  rails
6
6
  sprockets-rails
7
7
 
@@ -17,11 +17,12 @@ module Nacelle
17
17
 
18
18
  controller.response.body = controller.response.body.gsub(/(#{cells.keys.join('|')})/) do |tag|
19
19
  name, action, attrs = cells[tag]
20
- action = action.to_sym
20
+ action = action&.to_sym
21
21
  attrs = HashWithIndifferentAccess.new(attrs)
22
- cell = "#{name.camelize}Cell".constantize.new_with_controller(controller)
22
+ cell_class = "#{name.camelize}Cell".safe_constantize
23
23
  attrs.delete "class" # ignore styling class
24
- if cell.class.action_methods.include?(action)
24
+ if cell_class&.action_methods&.include?(action)
25
+ cell = cell_class.new_with_controller(controller)
25
26
  cell.action = action
26
27
  if cell.method(action).arity.zero? && attrs.empty?
27
28
  cell.send(action)
@@ -29,7 +30,7 @@ module Nacelle
29
30
  cell.send(action, attrs)
30
31
  end
31
32
  else
32
- "<strong>Cell “#{name.capitalize} #{action}” not found!</strong>"
33
+ "<strong>Cell “#{[name.capitalize, action].compact.join(" ")}” not found!</strong>"
33
34
  end
34
35
  end
35
36
  end
@@ -1,3 +1,3 @@
1
1
  module Nacelle
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nacelle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel