aaf-lipstick 3.0.4 → 3.0.5

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: 8309d32d19af7aae228523c7bb0a08a67504367c18bb98ba00fd7ca8e9c2bfb8
4
- data.tar.gz: cf88c9a55218f2abae34f59c1f37ee9f6c64064b17fd220752f5bb63b789beda
3
+ metadata.gz: 30884f936338853aa5702dd7a077d6483aa38deed30396d80223b9248fa9ef60
4
+ data.tar.gz: ac12517625509e89676f06c3eb99f58e02a64d0ed6b58e88940b574177e68e51
5
5
  SHA512:
6
- metadata.gz: 920421d4d590fefe053d5301dd160cdf6a1df7bd13496733b3d18c385698cc0e2228c0653c779d1b8a04c0269d371a33d90836eb338433588163b2568ccde61e
7
- data.tar.gz: 634a50fb305d9159669860b66626ee37478736797ccf0a5fa2cdd028855ae96c86132746dc14e77ccbc5c09d4d731f831bfd2d90bd116f2221fc79e3ab231e2f
6
+ metadata.gz: 2b323895a88710e6dd0d0be90165837fd434940a68a73e1235329c373f1d8069e3353962e49ef355b02eccf8dea1dea8442d1f0e3a3cb6100e2b10e7874e6225
7
+ data.tar.gz: b67600c60a54ff5dab02881889caadc327e86ffb3861fda534d271d47404b57082ec215d0e115b6313c40965e9cde9a4172ea7c69cdb5bd8f6fa8f45f384281e
@@ -26,6 +26,7 @@ module Lipstick
26
26
  def lipstick_field_name(attr)
27
27
  map = @lipstick_field_names || {}
28
28
  return map[attr] if map.key?(attr)
29
+
29
30
  attr.to_s.humanize(capitalize: false)
30
31
  end
31
32
 
@@ -42,6 +43,7 @@ module Lipstick
42
43
  def lipstick_validator(attr, validator)
43
44
  VALIDATOR_TRANSLATORS.each do |klass, sym|
44
45
  next unless validator.is_a?(klass)
46
+
45
47
  return send(sym, attr, validator, lipstick_field_name(attr.to_sym))
46
48
  end
47
49
  nil
@@ -18,6 +18,7 @@ module Lipstick
18
18
 
19
19
  opts.each do |k, v|
20
20
  next validate_with_hash(target, k, v) if v.is_a?(Hash)
21
+
21
22
  validate_with_param(target, k, v)
22
23
  end
23
24
  end
@@ -64,6 +65,7 @@ module Lipstick
64
65
 
65
66
  def wrap_name(name)
66
67
  return name if @sym.nil?
68
+
67
69
  "#{@sym}[#{name}]"
68
70
  end
69
71
  end
@@ -21,10 +21,11 @@ module Lipstick
21
21
 
22
22
  def logged_in_user(user)
23
23
  return if user.nil?
24
+
24
25
  content_tag('p') do
25
26
  concat('Logged in as: ')
26
27
  concat(content_tag('strong', user.name))
27
- concat(" (#{user.targeted_id})") if user.targeted_id
28
+ concat(" (#{user.targeted_id})") if user&.targeted_id
28
29
  end
29
30
  end
30
31
 
@@ -165,6 +166,7 @@ module Lipstick
165
166
 
166
167
  def aaf_environment_string(environment)
167
168
  return unless environment&.present?
169
+
168
170
  content_tag('span', environment, class: 'environment')
169
171
  end
170
172
 
@@ -178,6 +180,7 @@ module Lipstick
178
180
 
179
181
  def breadcrumb_link(item)
180
182
  return item if item.is_a?(String)
183
+
181
184
  item.reduce(nil) { |_, (k, v)| content_tag('a', k, href: v) }
182
185
  end
183
186
  end
@@ -31,11 +31,13 @@ module Lipstick
31
31
  def prefix
32
32
  return [:prev] if !show_first? || short_list?
33
33
  return [:prev, 1, :gap] if prefix_gap?
34
+
34
35
  [:prev, 1]
35
36
  end
36
37
 
37
38
  def middle
38
39
  return page_range(1, total) if short_list?
40
+
39
41
  page_range(*page_window)
40
42
  end
41
43
 
@@ -52,6 +54,7 @@ module Lipstick
52
54
  def suffix
53
55
  return [:next] if !show_last? || short_list?
54
56
  return [:gap, total, :next] if suffix_gap?
57
+
55
58
  [total, :next]
56
59
  end
57
60
 
@@ -96,6 +99,7 @@ module Lipstick
96
99
  icon = template.content_tag('span', "\u25C0", 'aria-hidden': 'true')
97
100
 
98
101
  return disabled_item(icon) if current < 2
102
+
99
103
  link_to_page(icon, page: current - 1, 'aria-label': 'Previous')
100
104
  end
101
105
 
@@ -103,6 +107,7 @@ module Lipstick
103
107
  icon = template.content_tag('span', "\u25B6", 'aria-hidden': 'true')
104
108
 
105
109
  return disabled_item(icon) if current >= total
110
+
106
111
  link_to_page(icon, page: current + 1, 'aria-label': 'Next')
107
112
  end
108
113
 
@@ -84,6 +84,7 @@ module Lipstick
84
84
 
85
85
  def annotate_environment(canvas)
86
86
  return if blank_environment?
87
+
87
88
  environment_format.annotate(canvas, 0, 0, env_x, env_y, @environment)
88
89
  end
89
90
 
@@ -115,6 +116,7 @@ module Lipstick
115
116
 
116
117
  def env_metrics
117
118
  return OpenStruct.new(width: 0, height: 0) if blank_environment?
119
+
118
120
  environment_format.get_type_metrics(@environment)
119
121
  end
120
122
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lipstick
4
- VERSION = '3.0.4'
4
+ VERSION = '3.0.5'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aaf-lipstick
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.4
4
+ version: 3.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shaun Mangelsdorf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-29 00:00:00.000000000 Z
11
+ date: 2018-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: erubis
@@ -339,7 +339,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
339
339
  version: '0'
340
340
  requirements: []
341
341
  rubyforge_project:
342
- rubygems_version: 2.7.6
342
+ rubygems_version: 2.7.7
343
343
  signing_key:
344
344
  specification_version: 4
345
345
  summary: A gem for applying AAF branding to our services