ama_layout 7.0.1 → 7.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: 3ca2feaab21a5bf26eb756b0e47f33f9062e894b
4
- data.tar.gz: 39d8c33eb56c90afd51ca405542493fbf5e33e31
3
+ metadata.gz: d1a9ad2f7ef87e3b1464aa180876d6d204053473
4
+ data.tar.gz: df05f8193fb1540b9e3d1082dbb6862ac307d5a4
5
5
  SHA512:
6
- metadata.gz: 08711a7f214bccc53a373fc1dee33ee8da8999b5282d86b8809b412519532f2a942a0c00f2a753eb8c63b82a8465a26af8ccd0d9df4a986d8d3df98098b7cd40
7
- data.tar.gz: 9fd1f9eb34ed8e3340a81de82a9693024ce14476441589cafbc327c8778fd59875c939d1a74a16789dd4cfb7c7503e7f5e857daeda1a66b395dcde6f90a84e84
6
+ metadata.gz: 6f000569a3ab7c8bac593ab429cd1b2051e02bc9f1aea6cd371946e28319b033175e3a32aa5701de2a7bb406ecc0f4164b41fd78410ff96268fc9f7062834998
7
+ data.tar.gz: ec90b510eaeb659fb231e0187d7cbdcd1616bc2737ab106cd57ce470497bcf5a1cb1a62dcfffcf2d8248fd7207a7ca032bbaad8420e650afd684a0727d5ad6aa
@@ -2,7 +2,6 @@ module AmaLayout
2
2
  module Agent
3
3
  class NavigationDecorator
4
4
  include AmaLayout::DraperReplacement
5
- extend AmaLayout::DraperReplacement
6
5
 
7
6
  def items
8
7
  object.items.map(&:decorate)
@@ -1,7 +1,6 @@
1
1
  module AmaLayout
2
2
  class MonerisDecorator
3
3
  include AmaLayout::DraperReplacement
4
- extend AmaLayout::DraperReplacement
5
4
 
6
5
  def textbox
7
6
  h.raw File.read textbox_style_file
@@ -1,7 +1,6 @@
1
1
  module AmaLayout
2
2
  class NavigationDecorator
3
3
  include AmaLayout::DraperReplacement
4
- extend AmaLayout::DraperReplacement
5
4
 
6
5
  def items
7
6
  object.items.map { |i| i.decorate }
@@ -1,7 +1,6 @@
1
1
  module AmaLayout
2
2
  class NavigationItemDecorator
3
3
  include AmaLayout::DraperReplacement
4
- extend AmaLayout::DraperReplacement
5
4
 
6
5
  def sub_nav
7
6
  object.sub_nav.map { |sn| sn.decorate }
@@ -1,7 +1,6 @@
1
1
  module AmaLayout
2
2
  class NotificationDecorator
3
3
  include AmaLayout::DraperReplacement
4
- extend AmaLayout::DraperReplacement
5
4
 
6
5
  ICONS = {
7
6
  notice: {
@@ -1,27 +1,31 @@
1
1
  module AmaLayout
2
2
  module DraperReplacement
3
- attr_accessor :object, :controller
3
+ extend ActiveSupport::Concern
4
4
 
5
- def h(view_data = {})
6
- AmaLayoutView.new(view_data: view_data)
7
- end
5
+ included do
6
+ attr_accessor :object, :controller
8
7
 
9
- def initialize(args = {})
10
- self.object = args
11
- end
8
+ def h(view_data = {})
9
+ AmaLayoutView.new(view_data: view_data)
10
+ end
12
11
 
13
- def self.decorate_collection(objects = {})
14
- objects.map { |o| self.new(o) }
15
- end
12
+ def initialize(args = {})
13
+ self.object = args
14
+ end
16
15
 
17
- def method_missing(method, *args, &block)
18
- return super unless delegatable?(method)
16
+ def method_missing(method, *args, &block)
17
+ return super unless delegatable?(method)
19
18
 
20
- (object || DraperReplacement).send(method, *args, &block)
21
- end
19
+ (object || DraperReplacement).send(method, *args, &block)
20
+ end
21
+
22
+ def delegatable?(method)
23
+ object.respond_to?(method) || DraperReplacement.respond_to?(method)
24
+ end
22
25
 
23
- def delegatable?(method)
24
- object.respond_to?(method) || DraperReplacement.respond_to?(method)
26
+ def self.decorate_collection(objects = {})
27
+ objects.map { |o| self.new(o) }
28
+ end
25
29
  end
26
30
  end
27
31
  end
@@ -1,3 +1,3 @@
1
1
  module AmaLayout
2
- VERSION = '7.0.1'
2
+ VERSION = '7.0.2'
3
3
  end
@@ -229,8 +229,16 @@ describe AmaLayout::NavigationDecorator do
229
229
  end
230
230
 
231
231
  describe '#notification_sidebar' do
232
+ before(:each) do
233
+ user.notifications.create(
234
+ type: :warning,
235
+ header: 'decorated_notification',
236
+ content: 'decorated_notification'
237
+ )
238
+ end
239
+
232
240
  it 'renders content to the page' do
233
- expect(subject.notification_sidebar).to include("Sign up now","off-canvas position-right")
241
+ expect(subject.notification_sidebar).to include('decorated_notification')
234
242
  end
235
243
  end
236
244
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ama_layout
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.1
4
+ version: 7.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael van den Beuken
@@ -18,7 +18,7 @@ authors:
18
18
  autorequire:
19
19
  bindir: bin
20
20
  cert_chain: []
21
- date: 2017-08-30 00:00:00.000000000 Z
21
+ date: 2017-08-31 00:00:00.000000000 Z
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
24
24
  name: foundation-rails