chars 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +5 -5
- data/ChangeLog.md +20 -11
- data/Gemfile +2 -0
- data/README.md +3 -3
- data/gemspec.yml +1 -0
- data/lib/chars/char_set.rb +6 -0
- data/lib/chars/chars.rb +9 -2
- data/lib/chars/version.rb +1 -1
- data/spec/chars_spec.rb +4 -4
- data/spec/extensions/string_spec.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b408bb91d6c66422ccb57e66af6cdeceeb97d50c610628a9b99780319f4af57
|
4
|
+
data.tar.gz: '039bef18f59a8ea05fd2a259839432e9ad2eee15c692969bf611d11b15255b75'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 803264ba7bafc4546df334bd2a508389f525c9814ab0452ef7b2b7c9b75cc0fb952c729f0b5b093cbede36d60be5badeb29ada0e29ee5b12ae3d681878aeb163
|
7
|
+
data.tar.gz: 2e9f1c229d9987e5cb1dfc0caada8c71582e0c72e8c03e7b39313c4bc1e9e447bdbdfcf641009174de47b4e0e94384296dc26cf8a136f72881bfd664fa311720
|
data/.github/workflows/ruby.yml
CHANGED
data/ChangeLog.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
### 0.3.1 / 2022-12-01
|
2
|
+
|
3
|
+
* Removed the space character from {Chars::PUNCTUATION}, as spaces are not
|
4
|
+
technically a punctuation character.
|
5
|
+
* Removed `\f`, `\n`, `\r`, `\t`, and `\v` from {Chars::PRINTABLE}, as other
|
6
|
+
whitespace characters besides space (`' '`) are not considered printable
|
7
|
+
characters.
|
8
|
+
|
1
9
|
### 0.3.0 / 2021-10-23
|
2
10
|
|
3
11
|
* Added {Chars::WHITESPACE}.
|
@@ -22,7 +30,7 @@
|
|
22
30
|
|
23
31
|
### 0.2.2 / 2012-05-28
|
24
32
|
|
25
|
-
* {Chars::CharSet#initialize} now raises a TypeError when given arguments
|
33
|
+
* {Chars::CharSet#initialize} now raises a `TypeError` when given arguments
|
26
34
|
that were neither a `String`, `Integer` or `Enumerable`.
|
27
35
|
* Allow {Chars::CharSet#strings_in} to yield results as they are found.
|
28
36
|
* Improved the performance of {Chars::CharSet#strings_in} when operating on
|
@@ -46,20 +54,21 @@
|
|
46
54
|
|
47
55
|
### 0.1.2 / 2009-09-21
|
48
56
|
|
49
|
-
* Require
|
50
|
-
* Require
|
51
|
-
* Require
|
52
|
-
* Added Chars.visibile and Chars::VISIBLE (thanks flatline).
|
53
|
-
* Added CharSet#random_distinct_bytes,
|
54
|
-
and CharSet#random_distinct_string
|
55
|
-
|
57
|
+
* Require `hoe` >= 2.3.3.
|
58
|
+
* Require `yard` >= 0.2.3.5.
|
59
|
+
* Require `rspec` >= 1.2.8.
|
60
|
+
* Added {Chars.visibile} and {Chars::VISIBLE} (thanks flatline).
|
61
|
+
* Added {Chars::CharSet#random_distinct_bytes},
|
62
|
+
{Chars::CharSet#random_distinct_chars}, and {CharSet#random_distinct_string}
|
63
|
+
(thanks flatline).
|
64
|
+
* Use `hoe/signing` for signed RubyGems.
|
56
65
|
* Moved to YARD based documentation.
|
57
66
|
* All specs now pass on JRuby 1.3.1.
|
58
67
|
|
59
68
|
### 0.1.1 / 2009-04-01
|
60
69
|
|
61
|
-
* Renamed CharSet#=~ to CharSet
|
62
|
-
* Added an alias from CharSet
|
70
|
+
* Renamed {Chars::CharSet#=~} to {Chars::CharSet#===}.
|
71
|
+
* Added an alias from `Chars::CharSet#=~` to {Chars::CharSet#===}.
|
63
72
|
|
64
73
|
### 0.1.0 / 2009-03-16
|
65
74
|
|
@@ -80,7 +89,7 @@
|
|
80
89
|
* Printable
|
81
90
|
* Control
|
82
91
|
* ASCII
|
83
|
-
* Provides convenience methods for testing
|
92
|
+
* Provides convenience methods for testing whether a `String` or `Integer`
|
84
93
|
belongs to a certain character set.
|
85
94
|
* Supports random text generation using specific character sets.
|
86
95
|
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -23,11 +23,11 @@ recognizing text and generating random text from specific character sets.
|
|
23
23
|
* Lowercase Alpha: `a` - `z`
|
24
24
|
* Alpha: `a` - `z`, `A` - `Z`
|
25
25
|
* Alpha-numeric: `0` - `9`, `a` - `z`, `A` - `Z`
|
26
|
-
* Punctuation: `'
|
27
|
-
* Symbols: `'
|
26
|
+
* Punctuation: `'`, `"`, `` ` ``, `,`, `;`, `:`, `~`, `-`, `(`, `)`, `[`, `]`, `{`, `}`, `.`, `?`, `!`
|
27
|
+
* Symbols: `'`, `"`, `` ` ``, `,`, `;`, `:`, `~`, `-`, `(`, `)`, `[`, `]`, `{`, `}`, `.`, `?`, `!`, `@`, `#`, `$`, `%`, `^`, `&`, `*`, `_`, `+`, `=`, `|`, `\`, `<`, `>`, `/`
|
28
28
|
* Space: `' '`, `\f`, `\n`, `\r`, `\t`, `\v`
|
29
29
|
* Visible: `0` - `9`, `a` - `z`, `A` - `Z`, `'`, `"`, `` ` ``, `,`, `;`, `:`, `~`, `-`, `(`, `)`, `[`, `]`, `{`, `}`, `.`, `?`, `!`, `@`, `#`, `$`, `%`, `^`, `&`, `*`, `_`, `+`, `=`, `|`, `\`, `<`, `>`, `/`
|
30
|
-
* Printable: `0` - `9`, `a` - `z`, `A` - `Z`, `' '`, `'`, `"`, `` ` ``, `,`, `;`, `:`, `~`, `-`, `(`, `)`, `[`, `]`, `{`, `}`, `.`, `?`, `!`, `@`, `#`, `$`, `%`, `^`, `&`, <code>*</code>, <code>_</code>, `+`, `=`, `|`, `\`, `<`, `>`,
|
30
|
+
* Printable: `0` - `9`, `a` - `z`, `A` - `Z`, `' '`, `'`, `"`, `` ` ``, `,`, `;`, `:`, `~`, `-`, `(`, `)`, `[`, `]`, `{`, `}`, `.`, `?`, `!`, `@`, `#`, `$`, `%`, `^`, `&`, <code>*</code>, <code>_</code>, `+`, `=`, `|`, `\`, `<`, `>`, `/`
|
31
31
|
* Control: `\x00` - `\x1f`, `\x7f`
|
32
32
|
* Signed ASCII: `\x00` - `\x7f`
|
33
33
|
* ASCII: `\x00` - `\xff`
|
data/gemspec.yml
CHANGED
@@ -15,6 +15,7 @@ metadata:
|
|
15
15
|
source_code_uri: https://github.com/postmodern/chars.rb
|
16
16
|
bug_tracker_uri: https://github.com/postmodern/chars.rb/issues
|
17
17
|
changelog_uri: https://github.com/postmodern/chars.rb/blob/master/ChangeLog.md
|
18
|
+
rubygems_mfa_required: 'true'
|
18
19
|
|
19
20
|
required_ruby_version: ">= 2.0.0"
|
20
21
|
|
data/lib/chars/char_set.rb
CHANGED
data/lib/chars/chars.rb
CHANGED
@@ -36,7 +36,7 @@ module Chars
|
|
36
36
|
ALPHA_NUMERIC = ALPHA | NUMERIC
|
37
37
|
|
38
38
|
# The punctuation character set
|
39
|
-
PUNCTUATION = CharSet['
|
39
|
+
PUNCTUATION = CharSet['\'', '"', '`', ',', ';', ':', '~', '-',
|
40
40
|
'(', ')', '[', ']', '{', '}', '.', '?', '!']
|
41
41
|
|
42
42
|
# The symbolic character set
|
@@ -60,7 +60,7 @@ module Chars
|
|
60
60
|
]
|
61
61
|
|
62
62
|
# The set of printable characters (including spaces)
|
63
|
-
PRINTABLE = ALPHA_NUMERIC | PUNCTUATION | SYMBOLS |
|
63
|
+
PRINTABLE = ALPHA_NUMERIC | PUNCTUATION | SYMBOLS | CharSet[' ']
|
64
64
|
|
65
65
|
# The control-char character set
|
66
66
|
CONTROL = CharSet[0..0x1f, 0x7f]
|
@@ -83,6 +83,11 @@ module Chars
|
|
83
83
|
NUMERIC
|
84
84
|
end
|
85
85
|
|
86
|
+
#
|
87
|
+
# Alias for {numeric}.
|
88
|
+
#
|
89
|
+
# @return [CharSet]
|
90
|
+
# The decimal-digit character set.
|
86
91
|
#
|
87
92
|
# @see numeric
|
88
93
|
#
|
@@ -229,6 +234,8 @@ module Chars
|
|
229
234
|
#
|
230
235
|
# The whitespace character set.
|
231
236
|
#
|
237
|
+
# @return [CharSet]
|
238
|
+
#
|
232
239
|
# @see #whitespace
|
233
240
|
#
|
234
241
|
def self.space
|
data/lib/chars/version.rb
CHANGED
data/spec/chars_spec.rb
CHANGED
@@ -96,7 +96,7 @@ describe Chars do
|
|
96
96
|
end
|
97
97
|
end
|
98
98
|
|
99
|
-
let(:punctuation_chars) { "
|
99
|
+
let(:punctuation_chars) { "!\"'(),-.:;?[]`{}~".chars }
|
100
100
|
|
101
101
|
describe "PUNCTUATION" do
|
102
102
|
subject { described_class::PUNCTUATION }
|
@@ -106,7 +106,7 @@ describe Chars do
|
|
106
106
|
end
|
107
107
|
end
|
108
108
|
|
109
|
-
let(:symbolic_chars) { "
|
109
|
+
let(:symbolic_chars) { "!\"\#$%&'()*+,-./:;<=>?@[\\]^_`{|}~".chars }
|
110
110
|
|
111
111
|
describe "SYMBOLS" do
|
112
112
|
subject { described_class::SYMBOLS }
|
@@ -145,12 +145,12 @@ describe Chars do
|
|
145
145
|
describe "PRINTABLE" do
|
146
146
|
subject { described_class::PRINTABLE }
|
147
147
|
|
148
|
-
it "must contain all alpha-numeric, punctuation, symbols, and
|
148
|
+
it "must contain all alpha-numeric, punctuation, symbols, and space characters" do
|
149
149
|
expect(subject.chars).to match_array(
|
150
150
|
alpha_numeric_chars |
|
151
151
|
punctuation_chars |
|
152
152
|
symbolic_chars |
|
153
|
-
|
153
|
+
[' ']
|
154
154
|
)
|
155
155
|
end
|
156
156
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chars
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Postmodern
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -71,6 +71,7 @@ metadata:
|
|
71
71
|
source_code_uri: https://github.com/postmodern/chars.rb
|
72
72
|
bug_tracker_uri: https://github.com/postmodern/chars.rb/issues
|
73
73
|
changelog_uri: https://github.com/postmodern/chars.rb/blob/master/ChangeLog.md
|
74
|
+
rubygems_mfa_required: 'true'
|
74
75
|
post_install_message:
|
75
76
|
rdoc_options: []
|
76
77
|
require_paths:
|
@@ -86,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
86
87
|
- !ruby/object:Gem::Version
|
87
88
|
version: '0'
|
88
89
|
requirements: []
|
89
|
-
rubygems_version: 3.
|
90
|
+
rubygems_version: 3.3.7
|
90
91
|
signing_key:
|
91
92
|
specification_version: 4
|
92
93
|
summary: A Ruby library for working with various character sets
|