Skip to content

Commit

Permalink
Merge pull request #460 from essentialkaos/develop
Browse files Browse the repository at this point in the history
Version 12.117.0
  • Loading branch information
andyone authored Apr 26, 2024
2 parents 955f3e9 + 958f8a1 commit 5a42e8b
Show file tree
Hide file tree
Showing 25 changed files with 536 additions and 1,006 deletions.
8 changes: 4 additions & 4 deletions .scripts/packages.list
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ L + netutil
L - system/process
* - system/procname
L + system/sensors
* - terminal
* + terminal
* ! terminal/tty
* - terminal/window
* - terminal/input
* + timeutil
* + tmp
* + usage
* + usage/update
* + usage/man
* + usage/completion/bash
* + usage/completion/fish
* + usage/completion/zsh
* + usage/man
* + usage/update
* + uuid
* + version
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
## Changelog

### 12.117.0

- `[terminal/input]` Added new package for working with user input
- `[options]` Added helper for working with errors
- `[terminal]` All methods for working with user input moved to separate package
- `[terminal]` Improved rendering messages with prefix
- `[color]` Tests refactoring
- `[options]` Code refactoring
- `[terminal]` Code refactoring

> [!IMPORTANT]
> - `[mathutil]` Removed all deprecated methods
> - `[passwd]` Removed all deprecated methods
> - `[sliceutil]` Removed all deprecated methods
> - `[terminal]` Removed all deprecated methods
> - `[usage]` Removed all deprecated methods
> - `[uuid]` Removed all deprecated methods
> - `[terminal/window]` Package removed due to deprecation of all methods
### 12.116.0

- `[support]` Added Yandex Serverless support
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ go get -u github.com/essentialkaos/ek/v12
* [`system/procname`](https://kaos.sh/g/ek.v12/system/procname) — Package provides methods for changing process name in the process tree
* [`system/sensors`](https://kaos.sh/g/ek.v12/system/sensors) — Package provide methods for collecting sensors information
* [`system`](https://kaos.sh/g/ek.v12/system) — Package provides methods for working with system data (metrics/users)
* [`terminal`](https://kaos.sh/g/ek.v12/terminal) — Package provides methods for working with user input
* [`terminal`](https://kaos.sh/g/ek.v12/terminal) — Package provides methods for printing messages to terminal
* [`terminal/input`](https://kaos.sh/g/ek.v12/terminal/input) — Package provides methods for working with user input
* [`terminal/tty`](https://kaos.sh/g/ek.v12/terminal/tty) — Package provides methods for working with TTY
* [`timeutil`](https://kaos.sh/g/ek.v12/timeutil) — Package provides methods for working with time and date
* [`tmp`](https://kaos.sh/g/ek.v12/tmp) — Package provides methods for working with temporary data
Expand Down
13 changes: 6 additions & 7 deletions color/color_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//go:build 386 || amd64
// +build 386 amd64

package color

// ////////////////////////////////////////////////////////////////////////////////// //
Expand All @@ -13,6 +10,8 @@ package color
import (
"testing"

"github.com/essentialkaos/ek/v12/mathutil"

. "github.com/essentialkaos/check"
)

Expand Down Expand Up @@ -206,13 +205,13 @@ func (s *ColorSuite) TestTerm(c *C) {
func (s *ColorSuite) TestLuminance(c *C) {
c.Assert(Luminance(NewHex(0xffffff).ToRGB()), Equals, 1.0)
c.Assert(Luminance(NewHex(0x000000).ToRGB()), Equals, 0.0)
c.Assert(Luminance(NewHex(0x808080).ToRGB()), Equals, 0.2158605001138992)
c.Assert(Luminance(NewHex(0x2861bd).ToRGB()), Equals, 0.12674627666892935)
c.Assert(mathutil.Round(Luminance(NewHex(0x808080).ToRGB()), 8), Equals, 0.2158605)
c.Assert(mathutil.Round(Luminance(NewHex(0x2861bd).ToRGB()), 8), Equals, 0.12674628)
}

func (s *ColorSuite) TestContrast(c *C) {
c.Assert(Contrast(NewHex(0xffffff), NewHex(0x000000)), Equals, 21.0)
c.Assert(Contrast(NewHex(0x000000), NewHex(0x000000)), Equals, 1.0)
c.Assert(Contrast(NewHex(0x755757), NewHex(0x63547c)), Equals, 1.0542371982635754)
c.Assert(Contrast(NewHex(0x333333), NewHex(0xd0b5ff)), Equals, 7.0606832983463805)
c.Assert(mathutil.Round(Contrast(NewHex(0x755757), NewHex(0x63547c)), 8), Equals, 1.0542372)
c.Assert(mathutil.Round(Contrast(NewHex(0x333333), NewHex(0xd0b5ff)), 8), Equals, 7.0606833)
}
2 changes: 1 addition & 1 deletion ek.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
// ////////////////////////////////////////////////////////////////////////////////// //

// VERSION is current ek package version
const VERSION = "12.116.0"
const VERSION = "12.117.0"

// ////////////////////////////////////////////////////////////////////////////////// //

Expand Down
257 changes: 0 additions & 257 deletions mathutil/mathutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,261 +87,4 @@ func Round(v float64, p int) float64 {
return math.Floor(digit) / pow
}

// BetweenU returns value between min and max values
//
// Deprecated: Use method Between instead
func BetweenU(val, min, max uint) uint {
return Between(val, min, max)
}

// MinU returns a smaller value
//
// Deprecated: Use method Min instead
func MinU(val1, val2 uint) uint {
return Min(val1, val2)
}

// MaxU returns a greater value
//
// Deprecated: Use method Max instead
func MaxU(val1, val2 uint) uint {
return Max(val1, val2)
}

// Between8 returns value between min and max values
//
// Deprecated: Use method Between instead
func Between8(val, min, max int8) int8 {
return Between(val, min, max)
}

// Min8 returns a smaller value
//
// Deprecated: Use method Min instead
func Min8(val1, val2 int8) int8 {
return Min(val1, val2)
}

// Max8 returns a greater value
//
// Deprecated: Use method Max instead
func Max8(val1, val2 int8) int8 {
return Max(val1, val2)
}

// Between16 returns value between min and max values
//
// Deprecated: Use method Between instead
func Between16(val, min, max int16) int16 {
return Between(val, min, max)
}

// Min16 returns a smaller value
//
// Deprecated: Use method Min instead
func Min16(val1, val2 int16) int16 {
return Min(val1, val2)
}

// Max16 returns a greater value
//
// Deprecated: Use method Max instead
func Max16(val1, val2 int16) int16 {
return Max(val1, val2)
}

// Between32 returns value between min and max values
//
// Deprecated: Use method Between instead
func Between32(val, min, max int32) int32 {
return Between(val, min, max)
}

// Min32 returns a smaller value
//
// Deprecated: Use method Min instead
func Min32(val1, val2 int32) int32 {
return Min(val1, val2)
}

// Max32 returns a greater value
//
// Deprecated: Use method Max instead
func Max32(val1, val2 int32) int32 {
return Max(val1, val2)
}

// Between64 returns value between min and max values
//
// Deprecated: Use method Between instead
func Between64(val, min, max int64) int64 {
return Between(val, min, max)
}

// Min64 returns a smaller value
//
// Deprecated: Use method Min instead
func Min64(val1, val2 int64) int64 {
return Min(val1, val2)
}

// Max64 returns a greater value
//
// Deprecated: Use method Max instead
func Max64(val1, val2 int64) int64 {
return Max(val1, val2)
}

// BetweenU8 returns value between min and max values
//
// Deprecated: Use method Between instead
func BetweenU8(val, min, max uint8) uint8 {
return Between(val, min, max)
}

// MinU8 returns a smaller value
//
// Deprecated: Use method Min instead
func MinU8(val1, val2 uint8) uint8 {
return Min(val1, val2)
}

// MaxU8 returns a greater value
//
// Deprecated: Use method Max instead
func MaxU8(val1, val2 uint8) uint8 {
return Max(val1, val2)
}

// BetweenU16 returns value between min and max values
//
// Deprecated: Use method Between instead
func BetweenU16(val, min, max uint16) uint16 {
return Between(val, min, max)
}

// MinU16 returns a smaller value
//
// Deprecated: Use method Min instead
func MinU16(val1, val2 uint16) uint16 {
return Min(val1, val2)
}

// MaxU16 returns a greater value
//
// Deprecated: Use method Max instead
func MaxU16(val1, val2 uint16) uint16 {
return Max(val1, val2)
}

// BetweenU32 returns value between min and max values
//
// Deprecated: Use method Between instead
func BetweenU32(val, min, max uint32) uint32 {
return Between(val, min, max)
}

// MinU32 returns a smaller value
//
// Deprecated: Use method Min instead
func MinU32(val1, val2 uint32) uint32 {
return Min(val1, val2)
}

// MaxU32 returns a greater value
//
// Deprecated: Use method Max instead
func MaxU32(val1, val2 uint32) uint32 {
return Max(val1, val2)
}

// BetweenU64 returns value between min and max values
//
// Deprecated: Use method Between instead
func BetweenU64(val, min, max uint64) uint64 {
return Between(val, min, max)
}

// MinU64 returns a smaller value
func MinU64(val1, val2 uint64) uint64 {
return Min(val1, val2)
}

// MaxU64 returns a greater value
//
// Deprecated: Use method Max instead
func MaxU64(val1, val2 uint64) uint64 {
return Max(val1, val2)
}

// BetweenF returns value between min and max values
//
// Deprecated: Use method Between instead
func BetweenF(val, min, max float64) float64 {
return Between(val, min, max)
}

// BetweenF32 returns value between min and max values
//
// Deprecated: Use method Between instead
func BetweenF32(val, min, max float32) float32 {
return Between(val, min, max)
}

// BetweenF64 returns value between min and max values
//
// Deprecated: Use method Between instead
func BetweenF64(val, min, max float64) float64 {
return Between(val, min, max)
}

// Abs8 returns absolute value
//
// Deprecated: Use method Abs instead
func Abs8(val int8) int8 {
return Abs(val)
}

// Abs16 returns absolute value
//
// Deprecated: Use method Abs instead
func Abs16(val int16) int16 {
return Abs(val)
}

// Abs32 returns absolute value
//
// Deprecated: Use method Abs instead
func Abs32(val int32) int32 {
return Abs(val)
}

// Abs64 returns absolute value
//
// Deprecated: Use method Abs instead
func Abs64(val int64) int64 {
return Abs(val)
}

// AbsF returns absolute value
//
// Deprecated: Use method Abs instead
func AbsF(val float64) float64 {
return Abs(val)
}

// AbsF32 returns absolute value
//
// Deprecated: Use method Abs instead
func AbsF32(val float32) float32 {
return Abs(val)
}

// AbsF64 returns absolute value
//
// Deprecated: Use method Abs instead
func AbsF64(val float64) float64 {
return Abs(val)
}

// ////////////////////////////////////////////////////////////////////////////////// //
Loading

0 comments on commit 5a42e8b

Please sign in to comment.