aaf-lipstick 4.4.0 → 4.5.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: b5363261834c54bd4fbb319de946010a977697f6f65fa76d2b946d9d918a9e26
4
- data.tar.gz: '082da376d1711c5919bea6e743efca5754c2f924050e9064815f06e1edfe80f7'
3
+ metadata.gz: f2caf959c20a2e01119e0d94f22871de8e26be71c025ca7a0ffcc82bae4498fc
4
+ data.tar.gz: e3ff033e8e9bc31807628156a184f513dde949e13e2b219ad193f9865466684b
5
5
  SHA512:
6
- metadata.gz: 54bbf507c582831bd47dff9672148956c1e3c249af95dca0e341ea836d00f674f2e2dc5ed086fd58433e1ae5c437126731ca60231c5f89cfbf078947ca41c2b0
7
- data.tar.gz: 4bb678a77f00d82db4fcdb0c55d1fb63388aea5548ed970900d429de6a7fcad022b7c4260108b08a3f358b5a5bce2ae96cfd7a862994bfdff7f679f238bbd50c
6
+ metadata.gz: ec124d3dea3ef4a4b0781df1b44a3da910aa18ecc6ddf4e4857914b89eee4febc662b14d5472c00979926ff5c42a5ae3f1dc065cd7acc1f0d7436fad17ac88b3
7
+ data.tar.gz: a1d805be84d463fcfe5a788f992ca8e390fbda488b5ea975de7954e50a699fb57b659679d7be20f998a5d33f6dc8e846c61238c93aa5704df224c9652c8affd6
@@ -10,6 +10,7 @@ module Lipstick
10
10
  attr_reader :attribute, :collation
11
11
 
12
12
  def initialize(attribute, collation)
13
+ super()
13
14
  @attribute = attribute
14
15
  @collation = collation
15
16
  end
@@ -27,20 +27,20 @@ class BootstrapFormBuilder < ActionView::Helpers::FormBuilder
27
27
  super
28
28
  end
29
29
 
30
- def check_box(*)
30
+ def check_box(*, &block)
31
31
  template.content_tag('div', class: 'checkbox') do
32
32
  template.content_tag('label') do
33
33
  template.concat(super)
34
- template.concat(template.capture { yield })
34
+ template.concat(template.capture(&block))
35
35
  end
36
36
  end
37
37
  end
38
38
 
39
- def radio_button(*)
39
+ def radio_button(*, &block)
40
40
  template.content_tag('div', class: 'radio') do
41
41
  template.content_tag('label') do
42
42
  template.concat(super)
43
- template.concat(template.capture { yield })
43
+ template.concat(template.capture(&block))
44
44
  end
45
45
  end
46
46
  end
@@ -5,34 +5,36 @@ module Lipstick
5
5
  module FormHelper
6
6
  include ActionView::Helpers::FormTagHelper
7
7
 
8
- def field_block(html_opts = {})
8
+ def field_block(html_opts = {}, &block)
9
9
  add_css_class(html_opts, 'form-group')
10
- content_tag('div', html_opts) { yield }
10
+ content_tag('div', html_opts, &block)
11
11
  end
12
12
 
13
- def radio_button_tag(name, value, checked = false, options = {})
13
+ # rubocop:disable Style/OptionalBooleanParameter
14
+ def radio_button_tag(name, value, checked = false, options = {}, &block)
14
15
  content_tag('div', class: 'radio') do
15
16
  content_tag('label') do
16
17
  concat(super)
17
- concat(capture { yield })
18
+ concat(capture(&block))
18
19
  end
19
20
  end
20
21
  end
22
+ # rubocop:enable Style/OptionalBooleanParameter
21
23
 
22
- def check_box_tag(*)
24
+ def check_box_tag(*, &block)
23
25
  content_tag('div', class: 'checkbox') do
24
26
  content_tag('label') do
25
27
  concat(super)
26
- concat(capture { yield })
28
+ concat(capture(&block))
27
29
  end
28
30
  end
29
31
  end
30
32
 
31
33
  alias orig_form_tag form_tag
32
34
 
33
- def inline_form_tag(url_for_options = {}, options = {})
35
+ def inline_form_tag(url_for_options = {}, options = {}, &block)
34
36
  add_css_class(options, 'form-inline')
35
- form_tag(url_for_options, options) { yield }
37
+ form_tag(url_for_options, options, &block)
36
38
  end
37
39
 
38
40
  def search_form_tag(filter, url: nil,
@@ -111,7 +113,7 @@ module Lipstick
111
113
  end
112
114
 
113
115
  def delete_button_tag(url, text: true, **opts)
114
- action = text&.is_a?(String) ? text : 'Delete'
116
+ action = text.is_a?(String) ? text : 'Delete'
115
117
 
116
118
  content_tag('div', class: 'btn-group') do
117
119
  concat(delete_dropdown_opener(text && action, opts))
@@ -135,7 +137,7 @@ module Lipstick
135
137
  # v.validate_field(:name, ...) # Validate the test_object[name] field
136
138
  # end
137
139
  # %>
138
- def validate_form(selector, sym = nil)
140
+ def validate_form(selector, sym = nil, &block)
139
141
  opts = {
140
142
  type: 'application/vnd.aaf.lipstick.validations+json',
141
143
  'data-target': selector,
@@ -143,7 +145,7 @@ module Lipstick
143
145
  }
144
146
 
145
147
  content_tag('script', opts) do
146
- validation_json(sym) { |v| yield v }.html_safe
148
+ validation_json(sym, &block).html_safe
147
149
  end
148
150
  end
149
151
 
@@ -42,9 +42,7 @@ module Lipstick
42
42
 
43
43
  return validate_with_param(target, validation, true) if opts.empty?
44
44
 
45
- if opts.keys == [:param]
46
- return validate_with_param(target, validation, opts[:param])
47
- end
45
+ return validate_with_param(target, validation, opts[:param]) if opts.keys == [:param]
48
46
 
49
47
  add_rule(target, validation, opts)
50
48
  end
@@ -10,11 +10,11 @@ module Lipstick
10
10
  end
11
11
  end
12
12
 
13
- def aaf_footer
13
+ def aaf_footer(&block)
14
14
  content_tag('footer') do
15
15
  content_tag('div', class: 'footer-content') do
16
16
  concat(aaf_logo)
17
- concat(capture { yield })
17
+ concat(capture(&block))
18
18
  end
19
19
  end
20
20
  end
@@ -3,8 +3,8 @@
3
3
  module Lipstick
4
4
  module Helpers
5
5
  module NavHelper
6
- def nav_bar
7
- content_tag('nav', class: 'navbar shrink') { yield }
6
+ def nav_bar(&block)
7
+ content_tag('nav', class: 'navbar shrink', &block)
8
8
  end
9
9
 
10
10
  def nav_first_item(text, url)
@@ -14,10 +14,10 @@ module Lipstick
14
14
  end
15
15
  end
16
16
 
17
- def nav_collapsing_items
17
+ def nav_collapsing_items(&block)
18
18
  attrs = { class: 'collapse navbar-collapse', id: 'aaf-nav-collapse' }
19
19
  content_tag('div', attrs) do
20
- content_tag('ul', class: 'nav navbar-nav') { yield }
20
+ content_tag('ul', class: 'nav navbar-nav', &block)
21
21
  end
22
22
  end
23
23
 
@@ -25,13 +25,13 @@ module Lipstick
25
25
  link_to request.query_parameters.merge(sort_by: param_name,
26
26
  direction: opposite_direction) do
27
27
  concat("#{name} ")
28
- concat(
29
- content_tag('div', class: 'glyphicon') do
30
- content_tag('div',
31
- class: "glyphicon-chevron-#{icon(direction)}") do
32
- end
33
- end
34
- )
28
+ concat(glyphicon(direction))
29
+ end
30
+ end
31
+
32
+ def glyphicon(direction)
33
+ content_tag('div', class: 'glyphicon') do
34
+ content_tag('div', nil, class: "glyphicon-chevron-#{icon(direction)}")
35
35
  end
36
36
  end
37
37
 
@@ -51,7 +51,7 @@ module Lipstick
51
51
  title.pointsize = 36
52
52
  title.gravity = Magick::ForgetGravity
53
53
  title.fill = '#bc2028'
54
- title.rotation = (-1) * ANGLE_DEGREES
54
+ title.rotation = -1 * ANGLE_DEGREES
55
55
  end
56
56
  end
57
57
 
@@ -97,11 +97,11 @@ module Lipstick
97
97
  m = env_metrics
98
98
 
99
99
  # The horizontal width of the environment text is found by:
100
- # w cos(Θ) + h sin(Θ)
100
+ # w cos(0) + h sin(0)
101
101
  #
102
102
  # w = text width
103
103
  # h = text ascent
104
- # Θ = angle of text rotation
104
+ # 0 = angle of text rotation
105
105
  #
106
106
  # Contrary to the description in `EmailBanner`, since we're upper
107
107
  # casing the environment string here, we don't need to worry about text
@@ -117,9 +117,9 @@ module Lipstick
117
117
  m = env_metrics
118
118
 
119
119
  # The horizontal width of the environment text is found by:
120
- # w sin(Θ) + h cos(Θ)
120
+ # w sin(0) + h cos(0)
121
121
  h = Math.sin(ANGLE_RADIANS) * m.width +
122
- Math.cos(ANGLE_RADIANS) * m.ascent
122
+ Math.cos(ANGLE_RADIANS) * m.ascent
123
123
 
124
124
  # We use addition here instead of the usual subtraction, as the text
125
125
  # moves in the upward direction from the position we set.
@@ -16,7 +16,7 @@ module Lipstick
16
16
  end
17
17
  # rubocop:enable Security/Eval
18
18
 
19
- def email_banner(image: 'logo.png', title:, environment:, **kwargs)
19
+ def email_banner(title:, environment:, image: 'logo.png', **kwargs)
20
20
  @context.depend_on_asset(image)
21
21
  asset = @context.environment.find_asset(image)
22
22
 
@@ -29,7 +29,7 @@ module Lipstick
29
29
  ).to_png
30
30
  end
31
31
 
32
- def logo_only_email_banner(image: 'logo.png', environment:, **kwargs)
32
+ def logo_only_email_banner(environment:, image: 'logo.png', **kwargs)
33
33
  @context.depend_on_asset(image)
34
34
  asset = @context.environment.find_asset(image)
35
35
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lipstick
4
- VERSION = '4.4.0'
4
+ VERSION = '4.5.1'
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: 4.4.0
4
+ version: 4.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shaun Mangelsdorf
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-16 00:00:00.000000000 Z
11
+ date: 2020-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: erubis
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: kramdown
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '1.5'
33
+ version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '1.5'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rails
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -252,22 +252,16 @@ dependencies:
252
252
  name: sqlite3
253
253
  requirement: !ruby/object:Gem::Requirement
254
254
  requirements:
255
- - - "~>"
256
- - !ruby/object:Gem::Version
257
- version: '1.3'
258
- - - "<"
255
+ - - ">="
259
256
  - !ruby/object:Gem::Version
260
- version: '1.4'
257
+ version: '0'
261
258
  type: :development
262
259
  prerelease: false
263
260
  version_requirements: !ruby/object:Gem::Requirement
264
261
  requirements:
265
- - - "~>"
266
- - !ruby/object:Gem::Version
267
- version: '1.3'
268
- - - "<"
262
+ - - ">="
269
263
  - !ruby/object:Gem::Version
270
- version: '1.4'
264
+ version: '0'
271
265
  - !ruby/object:Gem::Dependency
272
266
  name: tilt
273
267
  requirement: !ruby/object:Gem::Requirement
@@ -282,7 +276,7 @@ dependencies:
282
276
  - - ">="
283
277
  - !ruby/object:Gem::Version
284
278
  version: '0'
285
- description:
279
+ description:
286
280
  email:
287
281
  - s.mangelsdorf@gmail.com
288
282
  executables: []
@@ -332,7 +326,7 @@ homepage: https://github.com/ausaccessfed/aaf-lipstick
332
326
  licenses:
333
327
  - Apache-2.0
334
328
  metadata: {}
335
- post_install_message:
329
+ post_install_message:
336
330
  rdoc_options: []
337
331
  require_paths:
338
332
  - lib
@@ -340,15 +334,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
340
334
  requirements:
341
335
  - - ">="
342
336
  - !ruby/object:Gem::Version
343
- version: '0'
337
+ version: '2.7'
344
338
  required_rubygems_version: !ruby/object:Gem::Requirement
345
339
  requirements:
346
340
  - - ">="
347
341
  - !ruby/object:Gem::Version
348
342
  version: '0'
349
343
  requirements: []
350
- rubygems_version: 3.0.1
351
- signing_key:
344
+ rubygems_version: 3.1.2
345
+ signing_key:
352
346
  specification_version: 4
353
347
  summary: A gem for applying AAF branding to our services
354
348
  test_files: []