chars 0.1.1 → 0.2.3

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.
@@ -1,28 +0,0 @@
1
- === 0.1.1 / 2009-04-01
2
-
3
- * Renamed CharSet#=~ to CharSet#===.
4
- * Added an alias from CharSet#=~ to CharSet#===.
5
-
6
- === 0.1.0 / 2009-03-16
7
-
8
- * Initial release.
9
- * Provides character sets for:
10
- * Numeric
11
- * Octal
12
- * Uppercase Hexadecimal
13
- * Lowercase Hexadecimal
14
- * Hexadecimal
15
- * Uppercase Alpha
16
- * Lowercase Alpha
17
- * Alpha
18
- * Alpha-numeric
19
- * Punctuation
20
- * Symbols
21
- * Space
22
- * Printable
23
- * Control
24
- * ASCII
25
- * Provides convenience methods for testing wether a String or Integer
26
- belongs to a certain character set.
27
- * Supports random text generation using specific character sets.
28
-
@@ -1,18 +0,0 @@
1
- History.txt
2
- Manifest.txt
3
- README.txt
4
- TODO.txt
5
- Rakefile
6
- lib/chars.rb
7
- lib/chars/char_set.rb
8
- lib/chars/chars.rb
9
- lib/chars/extensions.rb
10
- lib/chars/extensions/integer.rb
11
- lib/chars/extensions/string.rb
12
- lib/chars/version.rb
13
- tasks/spec.rb
14
- spec/spec_helper.rb
15
- spec/char_set_spec.rb
16
- spec/chars_spec.rb
17
- spec/integer_spec.rb
18
- spec/string_spec.rb
data/README.txt DELETED
@@ -1,104 +0,0 @@
1
- = Chars
2
-
3
- * http://chars.rubyforge.org/
4
- * http://github.com/postmodern/chars/
5
- * Postmodern (postmodern.mod3 at gmail.com)
6
-
7
- == DESCRIPTION:
8
-
9
- Chars is a Ruby library for working with various character sets,
10
- recognizing text and generating random text from specific character sets.
11
-
12
- == FEATURES:
13
-
14
- * Provides character sets for:
15
- * Numeric ('0' - '9')
16
- * Octal ('0' - '7')
17
- * Uppercase Hexadecimal ('0' - '9', 'A' - 'F')
18
- * Lowercase Hexadecimal ('0' - '9', 'a' - 'f')
19
- * Hexadecimal ('0' - '9', 'a' - 'f', 'A' - 'F')
20
- * Uppercase Alpha ('A' - 'Z')
21
- * Lowercase Alpha ('a' - 'z')
22
- * Alpha ('a' - 'z', 'A' - 'Z')
23
- * Alpha-numeric ('0' - '9', 'a' - 'z', 'A' - 'Z')
24
- * Punctuation (' ', '\'', '"', '`', ',', ';', ':', '~', '-', '(', ')',
25
- '[', ']', '{', '}', '.', '?', '!')
26
- * Symbols (' ', '\'', '"', '`', ',', ';', ':', '~', '-', '(', ')',
27
- '[', ']', '{', '}', '.', '?', '!', '@', '#', '$', '%', '^', '&', '*',
28
- '_', '+', '=', '|', '\\', '<', '>', '/')
29
- * Space (' ', '\f', '\n', '\r', '\t', '\v')
30
- * Printable ('0' - '9', 'a' - 'z', 'A' - 'Z', ' ', '\'', '"', '`', ',',
31
- ';', ':', '~', '-', '(', ')', '[', ']', '{', '}', '.', '?', '!', '@',
32
- '#', '$', '%', '^', '&', '*', '_', '+', '=', '|', '\\', '<', '>', '/',
33
- '\f', '\n', '\r', '\t', '\v')
34
- * Control ('\x00' - '\x1f', '\x7f')
35
- * ASCII ('\x00' - '\x7f')
36
- * All ('\x00' - '\xff')
37
-
38
- == EXAMPLES:
39
-
40
- * Determine whether a byte belongs to a character set:
41
-
42
- 0x41.alpha?
43
- # => true
44
-
45
- * Determine whether a String belongs to a character set:
46
-
47
- "22e1c0".hex?
48
- # => true
49
-
50
- * Find all sub-strings that belong to a character set within a String:
51
-
52
- ls = File.read('/bin/ls')
53
- Chars.printable.strings_in(ls)
54
- # => ["/lib64/ld-linux-x86-64.so.2", "KIq/", "5J~!", "%L~!", ...]
55
-
56
- * Return a random character from the set of all characters:
57
-
58
- Chars.all.random_char
59
- # => "\x94"
60
-
61
- * Return a random Array of characters from the alpha-numeric character set:
62
-
63
- Chars.alpha_numeric.random_array(10)
64
- # => ["Q", "N", "S", "4", "x", "z", "3", "M", "F", "F"]
65
-
66
- * Return a random String from the set of all characters:
67
-
68
- Chars.all.random_string(10)
69
- # => "\xc2h\xad\xccm7\x1e6J\x13"
70
-
71
- * Return a random String with a random length between 5 and 10, from the
72
- set of space characters:
73
-
74
- Chars.space.random_string(5..10)
75
- # => "\r\v\n\t\n\f"
76
-
77
- == INSTALL:
78
-
79
- $ sudo gem install chars
80
-
81
- == LICENSE:
82
-
83
- The MIT License
84
-
85
- Copyright (c) 2009 Hal Brodigan
86
-
87
- Permission is hereby granted, free of charge, to any person obtaining
88
- a copy of this software and associated documentation files (the
89
- 'Software'), to deal in the Software without restriction, including
90
- without limitation the rights to use, copy, modify, merge, publish,
91
- distribute, sublicense, and/or sell copies of the Software, and to
92
- permit persons to whom the Software is furnished to do so, subject to
93
- the following conditions:
94
-
95
- The above copyright notice and this permission notice shall be
96
- included in all copies or substantial portions of the Software.
97
-
98
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
99
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
100
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
101
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
102
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
103
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
104
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/TODO.txt DELETED
@@ -1,13 +0,0 @@
1
- == TODO:
2
-
3
- === 0.1.2:
4
-
5
- * Remove CharSet#=~.
6
-
7
- === 0.2.0:
8
-
9
- * Implement unicode CharSets.
10
- * Rewrite CharSet#===.
11
- * Rewrite CharSet#strings_in.
12
- * Add unicode sets to Chars.
13
-
@@ -1,9 +0,0 @@
1
- require 'spec/rake/spectask'
2
-
3
- desc "Run all specifications"
4
- Spec::Rake::SpecTask.new(:spec) do |t|
5
- t.libs += ['lib', 'spec']
6
- t.spec_opts = ['--colour', '--format', 'specdoc']
7
- end
8
-
9
- task :default => :spec