loremarkov 0.0.0.5 → 0.0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/bin/destroy +10 -26
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c23bcd59f4c5aecef4c2d39b0924566938abd4aa
|
4
|
+
data.tar.gz: f731832c15a97daabdf1d3e6b6cbf97e0413c73b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2eaccd869e4a25aa621e1875415bff8e7649062904b59fdbf97e09f7a2635a9dc6560d45d64330e7ca607c9702732024c5eefa664accebe9bc43f64f8e83b6a1
|
7
|
+
data.tar.gz: 4b92c2d87f6e4dede7f9c7ab2c21b278860bc2bf063bbcd0508cbc8e3cf17829ea20dde9142b35b5385d471da6c690a64500235a38d1a44a0ce3c8812da8c4a5
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.0.
|
1
|
+
0.0.0.6
|
data/bin/destroy
CHANGED
@@ -1,34 +1,18 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
def usage msg=nil
|
4
|
-
puts "ERROR: #{msg}" if msg
|
5
|
-
puts "USAGE:\n destroy filename"
|
6
|
-
exit 1
|
7
|
-
end
|
8
|
-
|
9
3
|
require 'loremarkov'
|
10
4
|
|
11
5
|
# accept text from STDIN or filename
|
12
6
|
#
|
13
|
-
if $stdin.tty?
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
# from STDIN
|
23
|
-
text = $stdin.read
|
24
|
-
end
|
25
|
-
|
7
|
+
text = if $stdin.tty?
|
8
|
+
filename = ARGV.shift || 'lorem_ipsum'
|
9
|
+
unless File.exists?(filename)
|
10
|
+
filename = File.join(__dir__, '..', 'text', filename)
|
11
|
+
end
|
12
|
+
File.read(filename)
|
13
|
+
else
|
14
|
+
$stdin.read
|
15
|
+
end
|
26
16
|
|
27
|
-
# destruction parameter engage (default 5)
|
28
|
-
#
|
29
17
|
num_prefixes = ARGV.shift
|
30
|
-
|
31
|
-
|
32
|
-
# DESTROY!!!!!
|
33
|
-
#
|
34
|
-
puts Loremarkov.new(num_prefixes).destroy text
|
18
|
+
puts Loremarkov.new(num_prefixes ? num_prefixes.to_i : 5).destroy text
|