stylegen 0.6.0 → 0.6.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: 615869614190f084f865e58f8f64e7b2769498c6d582c0746239fff8a8f58260
4
- data.tar.gz: 529834fed7438410cb530801016277bd1a9206e4b018fdb9e68c80ec32ca8b7f
3
+ metadata.gz: 1111eac2ab1e78ddbbf145cd5e312055987fb2c5cb9d8583bfb285bed59ed0fd
4
+ data.tar.gz: 1d52bbd99656c48c30283e92f027c762c4a2bb7a9dea97f6b9011cf1697d0c90
5
5
  SHA512:
6
- metadata.gz: 9d6b421af6b58144a307056ff0a6ee5325db69651589f6a93ca8b216ac2dda98cb403b1943dd555bed4abae7f08d6946d4ad59a76933bbf014da19e5153d0cb5
7
- data.tar.gz: 280d122e2fdd15771ff59cff799c660afcd1fd2b63cda567e8d1c58bb0fc1f5993604e4e505366ff5911b4bd84a49cb42cc1591db023db22a7173eadda1f4e00
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
@@ -1,4 +1,4 @@
1
- Copyright (c) 2021 Ramon Torres
1
+ Copyright (c) 2021-2023 Ramon Torres
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
@@ -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(/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/))
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(/^#?([a-f\d])([a-f\d])([a-f\d])$/))
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
@@ -62,7 +62,7 @@ module Stylegen
62
62
  end
63
63
 
64
64
  def effective_access_level
65
- access_level == 'internal' ? '' : "#{access_level} "
65
+ access_level == 'internal' ? '' : access_level
66
66
  end
67
67
 
68
68
  def struct_name
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stylegen
4
- VERSION = '0.6.0'
4
+ VERSION = '0.6.1'
5
5
  end
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.0
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-02-16 00:00:00.000000000 Z
11
+ date: 2023-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-cli