subvisual-utils 0.1.0 → 0.2.0

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: 3a07b8529bb6e59849c36637e584e2a91be62712ba5236d51f7436f86a7786cf
4
- data.tar.gz: 202942f03626ce641c95747c7d2564bbf8d9a1a68c04c7880dc1dd058c8e2392
3
+ metadata.gz: 3e06a11e616f5f329837b8446e9435f4a92ac97c479b83b71d65e47fcf087aad
4
+ data.tar.gz: c9066f71c06801f9c8eae2f97bf5f84386508ba795b17b2fd4051aa0b77d2e64
5
5
  SHA512:
6
- metadata.gz: 68247b0c72c4c154652e167b6aac00d23ffb47a4ee0fb7da7426148815aeef59ed671c235227dd715d34e46a0ae6ae3e42b2ebf15537e9de2bb52d6a0a902d9a
7
- data.tar.gz: e9c5ad92e8a5a096137ba121b26cd871dacc18a29de1eca667b45e971ed887d3e473b8645253191d344a43b243aa24361f86c6e262357a107aface1cc46343d0
6
+ metadata.gz: 693ca65ca473999ba2817f7d14935175485f4bd9966d498631b6fe2e1a28b19e31622a8444dd1777daa5fc59205b9809456d3c7665425bb094818caa236a6a1e
7
+ data.tar.gz: bfaac0e139f9ed70af40ab92936b363d328f0052de008bb311d6655b7c36354779e197a8df3440925425d0451c1898d274fde5be9c034c80866fdb4344caae5b
@@ -8,7 +8,14 @@ The format is based on [Keep a Changelog],
8
8
  and this project adheres to [Semantic Versioning].
9
9
 
10
10
 
11
- ## Unreleased
11
+ Unreleased
12
+ ----------
13
+
14
+ - Added `ArrayUtils.pad_right(array, size, padding = nil)`.
15
+
16
+
17
+ v0.1.0 - 2020-05-06
18
+ -------------------
12
19
 
13
20
  - Added `MathUtils.least_common_denominator(a,b)`.
14
21
  - Added `MathUtils.greatest_common_divisor(a,b)`.
data/Gemfile CHANGED
@@ -4,6 +4,7 @@ source "https://rubygems.org"
4
4
 
5
5
  gemspec
6
6
 
7
+ gem "faker", "~> 2.x"
7
8
  gem "rake", "~> 12.0"
8
9
  gem "rspec", "~> 3.0"
9
- gem "rubocop"
10
+ gem "rubocop", "~> 0.82.x"
@@ -1,13 +1,18 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- subvisual-utils (0.1.0)
4
+ subvisual-utils (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
9
  ast (2.4.0)
10
+ concurrent-ruby (1.1.6)
10
11
  diff-lcs (1.3)
12
+ faker (2.11.0)
13
+ i18n (>= 1.6, < 2)
14
+ i18n (1.8.2)
15
+ concurrent-ruby (~> 1.0)
11
16
  jaro_winkler (1.5.4)
12
17
  parallel (1.19.1)
13
18
  parser (2.7.1.2)
@@ -43,9 +48,10 @@ PLATFORMS
43
48
  ruby
44
49
 
45
50
  DEPENDENCIES
51
+ faker (~> 2.x)
46
52
  rake (~> 12.0)
47
53
  rspec (~> 3.0)
48
- rubocop
54
+ rubocop (~> 0.82.x)
49
55
  subvisual-utils!
50
56
 
51
57
  BUNDLED WITH
data/README.md CHANGED
@@ -28,6 +28,15 @@ Usage
28
28
  Utilities are exposed as module methods grouped by the type of utility.
29
29
 
30
30
 
31
+ ### `Subvisual::ArrayUtils.pad_right(array, size, padding = nil)`
32
+
33
+ Fills an array with some padding up to the specified size.
34
+
35
+ ```ruby
36
+ Subvisual::ArrayUtils.pad_right([1, 2, 3], 5, 0) # => [1, 2, 3, 0, 0]
37
+ ```
38
+
39
+
31
40
  ### `Subvisual::MathUtils.greatest_common_divisor(a,b)`
32
41
 
33
42
  Computes the Greatest Common Divisor of two numbers.
@@ -86,4 +95,4 @@ Subvisual::Utils is maintained with :heart: by [Subvisual][subvisual].
86
95
 
87
96
  [license]: ./LICENSE.txt
88
97
  [subvisual]: http://subvisual.com
89
- [subvisual-logo]: https://raw.githubusercontent.com/subvisual/guides/master/github/templates/logos/blue.png
98
+ [subvisual-logo]: https://raw.githubusercontent.com/subvisual/guides/master/github/templates/logos/blue.png
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "subvisual/array_utils/pad"
4
+
5
+ module Subvisual
6
+ module ArrayUtils
7
+ extend Pad
8
+ end
9
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Subvisual
4
+ module ArrayUtils
5
+ module Pad
6
+ def pad_right(array, size, padding = nil)
7
+ return array if array.size >= size
8
+
9
+ array + Array.new(size - array.size, padding)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Subvisual
4
4
  module Utils
5
- VERSION = "0.1.0"
5
+ VERSION = "0.2.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: subvisual-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pedro Costa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-06 00:00:00.000000000 Z
11
+ date: 2020-05-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -27,6 +27,8 @@ files:
27
27
  - LICENSE.txt
28
28
  - README.md
29
29
  - Rakefile
30
+ - lib/subvisual/array_utils.rb
31
+ - lib/subvisual/array_utils/pad.rb
30
32
  - lib/subvisual/math_utils.rb
31
33
  - lib/subvisual/math_utils/greatest_common_divisor.rb
32
34
  - lib/subvisual/math_utils/least_common_denominator.rb