matrext 0.2 → 0.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.
- checksums.yaml +4 -4
- data/bin/matrext +8 -4
- data/lib/matrext/{string_manip.rb → core.rb} +9 -3
- data/lib/matrext/version.rb +1 -1
- data/lib/matrext.rb +5 -3
- metadata +5 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff9d59839509a209c0882930de6dafee2b114ba3
|
4
|
+
data.tar.gz: 4296aef4a17918a45dff47d0654841db5da336ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4af561a093f5c01ecf8d3085e28702b593c6fe0718a1d95708f0358a811be672a4dafa23a074a809a917386c53e08586cbf4480f7a721a78bf5d48ce22da8cee
|
7
|
+
data.tar.gz: 4487e79f25b350187aedf38ff34ba3b69aea5af4b833b6a062659640fa62b2467c588309687af68d3b77c9a54d76fc12f23832ca7381e03e04b487cda95a5de0
|
data/bin/matrext
CHANGED
@@ -5,11 +5,15 @@ require_relative '../lib/matrext'
|
|
5
5
|
require_relative '../lib/matrext/version'
|
6
6
|
|
7
7
|
def parse_options
|
8
|
-
options = {}
|
8
|
+
options = {:sl => false}
|
9
9
|
|
10
10
|
optparse = OptionParser.new do |opts|
|
11
11
|
opts.banner = 'usage: matrext "phrase"'
|
12
12
|
|
13
|
+
opts.on('-sl', '--sameline', 'Display text on the same line') do |sl|
|
14
|
+
options[:sl] = true
|
15
|
+
end
|
16
|
+
|
13
17
|
opts.on('-v', '--version', 'Display version number and exit') do
|
14
18
|
puts "#{$PROGRAM_NAME} #{Matrext::VERSION}"
|
15
19
|
exit
|
@@ -40,10 +44,10 @@ begin
|
|
40
44
|
options = parse_options
|
41
45
|
|
42
46
|
if (ARGV.count > 0)
|
43
|
-
phrase = ARGV[0]
|
44
|
-
Matrext::Base.new(
|
47
|
+
options[:phrase] = ARGV[0]
|
48
|
+
Matrext::Base.new(options)
|
45
49
|
else
|
46
|
-
puts "#{PROGRAM_NAME}: missing phrase"
|
50
|
+
puts "#{$PROGRAM_NAME} error: missing phrase"
|
47
51
|
end
|
48
52
|
rescue => error
|
49
53
|
print_error(error)
|
@@ -1,8 +1,11 @@
|
|
1
|
+
# lib/matrext/core.rb
|
2
|
+
# The core processing unit
|
3
|
+
|
1
4
|
module Matrext
|
2
5
|
CHAR_POOL = (33..126).map{ |i| i.chr }
|
3
6
|
|
4
|
-
def self.
|
5
|
-
letters = phrase
|
7
|
+
def self.process(options)
|
8
|
+
letters = options[:phrase]
|
6
9
|
|
7
10
|
letters.each_char do |l|
|
8
11
|
letter_noise = rand(1..10)
|
@@ -16,6 +19,9 @@ module Matrext
|
|
16
19
|
print l.upcase
|
17
20
|
sleep(letter_delay)
|
18
21
|
end
|
19
|
-
|
22
|
+
|
23
|
+
if options[:sl].equal? false
|
24
|
+
puts
|
25
|
+
end
|
20
26
|
end
|
21
27
|
end
|
data/lib/matrext/version.rb
CHANGED
data/lib/matrext.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
# lib/matrext.rb
|
2
|
-
|
2
|
+
# Main jumping off point
|
3
|
+
|
4
|
+
require_relative "matrext/core"
|
3
5
|
|
4
6
|
module Matrext
|
5
7
|
class Base
|
6
|
-
def initialize(
|
7
|
-
Matrext::
|
8
|
+
def initialize(options)
|
9
|
+
Matrext::process(options)
|
8
10
|
end
|
9
11
|
end
|
10
12
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: matrext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.3'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Chadwick
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -57,7 +57,7 @@ files:
|
|
57
57
|
- Rakefile
|
58
58
|
- bin/matrext
|
59
59
|
- lib/matrext.rb
|
60
|
-
- lib/matrext/
|
60
|
+
- lib/matrext/core.rb
|
61
61
|
- lib/matrext/version.rb
|
62
62
|
- matrext.gemspec
|
63
63
|
- spec/matrext_spec.rb
|
@@ -82,10 +82,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
82
|
version: '0'
|
83
83
|
requirements: []
|
84
84
|
rubyforge_project:
|
85
|
-
rubygems_version: 2.4.
|
85
|
+
rubygems_version: 2.4.6
|
86
86
|
signing_key:
|
87
87
|
specification_version: 4
|
88
88
|
summary: Make text phrases look like they're being decoded, Matrix-style
|
89
|
-
test_files:
|
90
|
-
- spec/matrext_spec.rb
|
91
|
-
- spec/spec_helper.rb
|
89
|
+
test_files: []
|