w-stdlib 0.0.15 → 0.1.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 +4 -4
- data/lib/w-stdlib/core_ext/hash.rb +4 -0
- data/lib/w-stdlib/core_ext/string.rb +8 -1
- data/lib/w-stdlib/prelude.rb +6 -0
- data/w-stdlib.gemspec +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: 2bbe8a05c2a3dab8eba6fca308e57529819f76c5da31e519ee604b9d8523bba9
|
4
|
+
data.tar.gz: f79d082a877a75cc90f4fb185b8ebfba489a83eee85d1c8b31541d0832b47a42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40e37fa94b0b153c26b7ea22ef00410e07db758d25979ee56335f37e90ceb42ac619663f73af2f4c0eb93ec35d1f22746cad9caa930f771704209e85c6735649
|
7
|
+
data.tar.gz: a007d86fb5ef26eb110320dbc6aab0fcc391fc293f0181974c7fc2dbf642a0a705def2f1662e7a17cb438e7d7f6b3c22812bca9435c75b4767ccdfc3a5c45d9c
|
@@ -19,7 +19,6 @@ module StringExt
|
|
19
19
|
alias_method :is_lowercase?, :is_downcase?
|
20
20
|
alias_method :is_lower?, :is_downcase?
|
21
21
|
|
22
|
-
|
23
22
|
def matches_glob?(pattern)
|
24
23
|
File.fnmatch pattern, self
|
25
24
|
end
|
@@ -33,6 +32,14 @@ module StringExt
|
|
33
32
|
Base64.decode64 self
|
34
33
|
end
|
35
34
|
|
35
|
+
def encode_hex
|
36
|
+
unpack('H*').first
|
37
|
+
end
|
38
|
+
|
39
|
+
def decode_hex
|
40
|
+
[self].pack('H*')
|
41
|
+
end
|
42
|
+
|
36
43
|
def encode_url
|
37
44
|
CGI.escape self
|
38
45
|
end
|
data/lib/w-stdlib/prelude.rb
CHANGED
@@ -1,8 +1,14 @@
|
|
1
1
|
require 'http'
|
2
2
|
require 'json'
|
3
3
|
require_relative 'core_ext/string'
|
4
|
+
require_relative 'core_ext/array'
|
5
|
+
require_relative 'core_ext/hash'
|
6
|
+
require_relative 'core_ext/object'
|
4
7
|
|
5
8
|
using StringExt
|
9
|
+
using ArrayExt
|
10
|
+
using HashExt
|
11
|
+
using ObjectExt
|
6
12
|
|
7
13
|
def fatal(msg, code=1, pref='[!] ')
|
8
14
|
STDERR.puts pref + msg
|
data/w-stdlib.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |g|
|
2
2
|
g.name = 'w-stdlib'
|
3
|
-
g.version = '0.
|
3
|
+
g.version = '0.1.1'
|
4
4
|
g.summary = 'Pre-alpha package that contains abstractions that I find useful when scripting. Not suitable for production use. Breaking changes highly likely even with minor version bumps. Use at your own risk'
|
5
5
|
g.description = g.summary
|
6
6
|
g.authors = ['will@btlr.dev']
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: w-stdlib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- will@btlr.dev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|