stylegen 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/LICENSE +1 -1
- data/lib/stylegen/colors/color.rb +4 -2
- data/lib/stylegen/data.rb +1 -1
- data/lib/stylegen/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1111eac2ab1e78ddbbf145cd5e312055987fb2c5cb9d8583bfb285bed59ed0fd
|
4
|
+
data.tar.gz: 1d52bbd99656c48c30283e92f027c762c4a2bb7a9dea97f6b9011cf1697d0c90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1644652ac415fd8c664d212fb6e5124f343534db30ab826e90393ba021b8ee1b6adf41553a05e0f1a85fc26fc577fa32ff3378e7d8fe4daa5027bf3f53f9d490
|
7
|
+
data.tar.gz: bd3b5852200b345aa27c654c37f7d2ff93d22bede05b36ca2952769f51466fb759efaa00acecf26ca8fbe83cc9c6665828b38440a29b2376527bd0e82137d496
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# Changelog
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
+
## v0.6.1
|
5
|
+
### Fixed
|
6
|
+
- Fixed a bug where an extra space was being added after the access-level modifier in the generated code.
|
7
|
+
|
4
8
|
## v0.6.0
|
5
9
|
### Changed
|
6
10
|
- Switched from GLI to dry-cli for CLI. Some may produce slightly different STDOUT and STDERR output.
|
data/LICENSE
CHANGED
@@ -4,6 +4,8 @@ module Stylegen
|
|
4
4
|
class Color
|
5
5
|
attr_reader :red, :green, :blue, :alpha
|
6
6
|
|
7
|
+
SIX_DIGIT_HEX_REGEX = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/.freeze
|
8
|
+
THREE_DIGIT_HEX_REGEX = /^#?([a-f\d])([a-f\d])([a-f\d])$/.freeze
|
7
9
|
MAX_PRECISION = 16
|
8
10
|
|
9
11
|
def initialize(red, green, blue, alpha)
|
@@ -14,11 +16,11 @@ module Stylegen
|
|
14
16
|
end
|
15
17
|
|
16
18
|
def self.from_hex(hex, alpha = nil)
|
17
|
-
if (match = hex.downcase.match(
|
19
|
+
if (match = hex.downcase.match(SIX_DIGIT_HEX_REGEX))
|
18
20
|
r = Integer(match.captures[0], 16) / 255.0
|
19
21
|
g = Integer(match.captures[1], 16) / 255.0
|
20
22
|
b = Integer(match.captures[2], 16) / 255.0
|
21
|
-
elsif (match = hex.downcase.match(
|
23
|
+
elsif (match = hex.downcase.match(THREE_DIGIT_HEX_REGEX))
|
22
24
|
r = Integer(match.captures[0] * 2, 16) / 255.0
|
23
25
|
g = Integer(match.captures[1] * 2, 16) / 255.0
|
24
26
|
b = Integer(match.captures[2] * 2, 16) / 255.0
|
data/lib/stylegen/data.rb
CHANGED
data/lib/stylegen/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stylegen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ramon Torres
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-cli
|