chars 0.3.0 → 0.3.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: 744e39b682dc29231aafe96056415cc38c65e032df5c2a3aff6a5a846b38f67b
4
- data.tar.gz: 47e309f42894f6d94ec2d15568d5d33df8a97600c1c227eb2366eb8fb8d56eb4
3
+ metadata.gz: 1b408bb91d6c66422ccb57e66af6cdeceeb97d50c610628a9b99780319f4af57
4
+ data.tar.gz: '039bef18f59a8ea05fd2a259839432e9ad2eee15c692969bf611d11b15255b75'
5
5
  SHA512:
6
- metadata.gz: 20755db9457fda76ceed274d18919a43dbf3c850d0aaad6a38f077b0e89fcf15d7c0a79b3ac95fe158d5abef8db4e68bd0ccc6971f8989e0b4f7c918b9a282b8
7
- data.tar.gz: 54bc4adfd93752f68454c475b57a1705428231f8decab3be8b8710d6c344c60715af7c466b21b7c398e7b2cc30801ff5fe77a4924e1ac34b4fa724c3f1a3adec
6
+ metadata.gz: 803264ba7bafc4546df334bd2a508389f525c9814ab0452ef7b2b7c9b75cc0fb952c729f0b5b093cbede36d60be5badeb29ada0e29ee5b12ae3d681878aeb163
7
+ data.tar.gz: 2e9f1c229d9987e5cb1dfc0caada8c71582e0c72e8c03e7b39313c4bc1e9e447bdbdfcf641009174de47b4e0e94384296dc26cf8a136f72881bfd664fa311720
@@ -9,12 +9,12 @@ jobs:
9
9
  fail-fast: false
10
10
  matrix:
11
11
  ruby:
12
- - 2.4
13
- - 2.5
14
- - 2.6
15
- - 2.7
16
- - 3.0
12
+ - '2.6'
13
+ - '2.7'
14
+ - '3.0'
15
+ - '3.1'
17
16
  - jruby
17
+ - truffleruby
18
18
  name: Ruby ${{ matrix.ruby }}
19
19
  steps:
20
20
  - uses: actions/checkout@v2
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 Hoe >= 2.3.3.
50
- * Require YARD >= 0.2.3.5.
51
- * Require RSpec >= 1.2.8.
52
- * Added Chars.visibile and Chars::VISIBLE (thanks flatline).
53
- * Added CharSet#random_distinct_bytes, CharSet#random_distinct_chars,
54
- and CharSet#random_distinct_string (thanks flatline).
55
- * Use 'hoe/signing' for signed RubyGems.
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#=~ to 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 wether a String or Integer
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
@@ -6,7 +6,9 @@ group :development do
6
6
  gem 'rake'
7
7
  gem 'rubygems-tasks', '~> 0.2'
8
8
  gem 'rspec', '~> 3.0'
9
+
9
10
  gem 'kramdown'
11
+ gem 'redcarpet', platform: :mri
10
12
  gem 'yard', '~> 0.9'
11
13
  gem 'yard-spellcheck', require: false
12
14
  end
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>, `+`, `=`, `|`, `\`, `<`, `>`, `/`, `\f`, `\n`, `\r`, `\t`, `\v`
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
 
@@ -44,6 +44,12 @@ module Chars
44
44
  #
45
45
  # Creates a new {CharSet}.
46
46
  #
47
+ # @param [Array<String, Integer, Enumerable>] arguments
48
+ # The chars for the CharSet.
49
+ #
50
+ # @return [CharSet]
51
+ # The new character set.
52
+ #
47
53
  # @see #initialize
48
54
  #
49
55
  # @since 0.2.1
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 | SPACE
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
@@ -1,4 +1,4 @@
1
1
  module Chars
2
2
  # chars version
3
- VERSION = '0.3.0'
3
+ VERSION = '0.3.1'
4
4
  end
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) { " !\"'(),-.:;?[]`{}~".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) { " !\"\#$%&'()*+,-./:;<=>?@[\\]^_`{|}~".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 whitespace characters" do
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
- whitespace_chars
153
+ [' ']
154
154
  )
155
155
  end
156
156
  end
@@ -58,7 +58,7 @@ describe String do
58
58
  end
59
59
 
60
60
  it "should recognize printable strings" do
61
- expect("abc, [123]\nDEF").to be_printable
61
+ expect("abc, [123] DEF").to be_printable
62
62
  end
63
63
 
64
64
  it "should recognize control strings" do
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.0
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: 2021-10-23 00:00:00.000000000 Z
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.2.22
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