govuk-components 1.0.0 → 1.0.1

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
  SHA256:
3
- metadata.gz: c3416a15e9cff8a8ed1f34bd5936d00abef53d308b8ceda1fb1a473cf0d6b6ad
4
- data.tar.gz: 6af9343561c9eb003c16d0cceea38aa131e1b43afe0429c6af01fecf6d5ffe24
3
+ metadata.gz: '094a8aaa90e8f699ce0844e4770b91f8fc62b7481d9cd2be1fbe480726163f96'
4
+ data.tar.gz: b170c99c2ac73c56bf502f26ba232d2abfef6459cebf52c53677e70b8a84c646
5
5
  SHA512:
6
- metadata.gz: f700f825eaefe7f69808e06f27613a030aea3a86aa027d17cecbbaec08cad205344c888c1a8c97e2f6b34b0b3f9c4a0f460d1cd0fd5358782c271744ea6291cf
7
- data.tar.gz: d9a149d4b223807c8135af07c3edaf27a94fa93dc5ab028b4e7212d6decd986bc8ff73f466e23bca8381445c4c0c7cd3c380c1b63a35bb9b1f529c05270932d4
6
+ metadata.gz: 7802eb767bbcf892ab6f3fa5c149db8629f1002bafc2a787e15e67f6317d33df7f23f646f39d92280b8d3db542537ea2b023823548180e51e79042ad19401c18
7
+ data.tar.gz: f5b2381662b5c79be177c19a5fa98757e61b8f852f28316b7c12cf3589164bf582f20b83a6632f00576d723597063c130dfcb84db6e1d52a0f7fa6971b3e3c21
data/README.md CHANGED
@@ -1,8 +1,11 @@
1
- **This gem is under heavy development and the API is likely to change.**
2
-
3
1
  # GOV.UK Components
4
2
 
5
- [![Build Status](https://travis-ci.com/DFE-Digital/govuk-components.svg?branch=master)](https://travis-ci.com/DFE-Digital/govuk-components)
3
+ [![Tests](https://github.com/DFE-Digital/govuk-components/workflows/Tests/badge.svg)](https://github.com/DFE-Digital/govuk-components/actions?query=workflow%3ATests)
4
+ [![Maintainability](https://api.codeclimate.com/v1/badges/cbcbc140f300b920d833/maintainability)](https://codeclimate.com/github/DFE-Digital/govuk-components/maintainability)
5
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/cbcbc140f300b920d833/test_coverage)](https://codeclimate.com/github/DFE-Digital/govuk-components/test_coverage)
6
+ [![GitHub license](https://img.shields.io/github/license/DFE-Digital/govuk-components)](https://github.com/DFE-Digital/govuk-components/blob/master/LICENSE)
7
+ [![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=DFE-Digital/govuk-components)](https://dependabot.com)
8
+ [![GOV.UK Design System Version](https://img.shields.io/badge/GOV.UK%20Design%20System-3.10.2-brightgreen)](https://design-system.service.gov.uk)
6
9
 
7
10
  This gem provides a suite of reusable components for the [GOV.UK Design System](https://design-system.service.gov.uk/). It is intended to provide a lightweight alternative to the [GOV.UK Publishing Components](https://github.com/alphagov/govuk_publishing_components) library and is built with Github's [ViewComponent](https://github.com/github/view_component) framework. ViewComponent will be [supported natively in Rails 6.1](https://edgeguides.rubyonrails.org/layouts_and_rendering.html#rendering-objects).
8
11
 
@@ -11,7 +11,7 @@ class GovukComponent::Base < ViewComponent::Base
11
11
  # with slots feel more DSL-like
12
12
  def self.wrap_slot(name)
13
13
  define_method(%(add_#{name})) do |*args, **kwargs, &block|
14
- self.slot(name, *args, **kwargs, &block)
14
+ slot(name, *args, **kwargs, &block)
15
15
  end
16
16
  end
17
17
  end
@@ -7,8 +7,7 @@
7
7
  <div class="govuk-notification-banner__content">
8
8
  <% headings.each do |heading| %>
9
9
  <p class="govuk-notification-banner__heading">
10
-
11
- <%= heading.text %>.
10
+ <%= heading.text %>
12
11
  <% if heading.link_target && heading.link_text %>
13
12
  <%= link_to(heading.link_text, heading.link_target, class: "govuk-notification-banner__link") %>.
14
13
  <% end %>
@@ -21,7 +21,7 @@ private
21
21
  end
22
22
 
23
23
  def colour_class
24
- return nil unless @colour.present?
24
+ return nil if @colour.blank?
25
25
 
26
26
  fail("invalid tag colour #{@colour}, supported colours are #{COLOURS.to_sentence}") unless @colour.in?(COLOURS)
27
27
 
@@ -1,7 +1,6 @@
1
1
  module GovukComponent
2
2
  module Traits
3
3
  module CustomClasses
4
-
5
4
  def classes
6
5
  default_classes.concat(Array.wrap(@classes))
7
6
  end
@@ -15,7 +14,7 @@ module GovukComponent
15
14
  private
16
15
 
17
16
  def parse_classes(classes)
18
- return [] unless classes.present?
17
+ return [] if classes.blank?
19
18
 
20
19
  case classes
21
20
  when Array
@@ -19,7 +19,7 @@ module GovukComponentsHelper
19
19
  define_method(name) do |*args, **kwargs, &block|
20
20
  capture do
21
21
  render(klass.constantize.new(*args, **kwargs)) do |com|
22
- block.call(com) unless block.blank?
22
+ block.call(com) if block.present?
23
23
  end
24
24
  end
25
25
  end
@@ -6,4 +6,4 @@ module Govuk
6
6
  end
7
7
  end
8
8
 
9
- Dir[Govuk::Components::Engine.root.join(*%w(app helpers *.rb))].each { |f| require f }
9
+ Dir[Govuk::Components::Engine.root.join("app", "helpers", "*.rb")].sort.each { |f| require f }
@@ -1,5 +1,5 @@
1
1
  module Govuk
2
2
  module Components
3
- VERSION = '1.0.0'.freeze
3
+ VERSION = '1.0.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk-components
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - DfE developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-15 00:00:00.000000000 Z
11
+ date: 2021-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -28,18 +28,24 @@ dependencies:
28
28
  name: view_component
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 2.22.1
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: 2.25.0
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
38
- - - "~>"
41
+ - - ">="
39
42
  - !ruby/object:Gem::Version
40
43
  version: 2.22.1
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: 2.25.0
41
47
  - !ruby/object:Gem::Dependency
42
- name: sqlite3
48
+ name: capybara
43
49
  requirement: !ruby/object:Gem::Requirement
44
50
  requirements:
45
51
  - - ">="
@@ -53,7 +59,7 @@ dependencies:
53
59
  - !ruby/object:Gem::Version
54
60
  version: '0'
55
61
  - !ruby/object:Gem::Dependency
56
- name: capybara
62
+ name: pry-byebug
57
63
  requirement: !ruby/object:Gem::Requirement
58
64
  requirements:
59
65
  - - ">="
@@ -81,7 +87,7 @@ dependencies:
81
87
  - !ruby/object:Gem::Version
82
88
  version: '0'
83
89
  - !ruby/object:Gem::Dependency
84
- name: pry-byebug
90
+ name: rubocop-govuk
85
91
  requirement: !ruby/object:Gem::Requirement
86
92
  requirements:
87
93
  - - ">="
@@ -108,6 +114,34 @@ dependencies:
108
114
  - - ">="
109
115
  - !ruby/object:Gem::Version
110
116
  version: '0'
117
+ - !ruby/object:Gem::Dependency
118
+ name: simplecov
119
+ requirement: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - "~>"
122
+ - !ruby/object:Gem::Version
123
+ version: '0.20'
124
+ type: :development
125
+ prerelease: false
126
+ version_requirements: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - "~>"
129
+ - !ruby/object:Gem::Version
130
+ version: '0.20'
131
+ - !ruby/object:Gem::Dependency
132
+ name: sqlite3
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ version: '0'
138
+ type: :development
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
111
145
  description: A collection of components intended to ease the building of GOV.UK Design
112
146
  System web applications
113
147
  email: