LoremKnight 0.0.0 → 0.6.9
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/lib/tiger.rb +16 -16
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ce0e811c5eee3e7dcfd69524f0a9fb85735e2ba
|
4
|
+
data.tar.gz: 3cf02a4aa2d692359d1d9e61fa16f34075ba62be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e29721c82503185201a392a55620e976c73a7cc2cedb0f8fe263adbd8054a46175e6954b9bfc429ce9848e5377e52713b08d26830b464705c9296406fb0ff248
|
7
|
+
data.tar.gz: 00bbd3c8b7222b20d2957446766ea9df14ebf40e7ca29b189118033fe5e1f5df6420799c6bda23e3592fe35e44f10b5792c4c90cc7d57bf749656fb0c7653c65
|
data/lib/tiger.rb
CHANGED
@@ -1,30 +1,30 @@
|
|
1
1
|
$source_location = File.dirname(__FILE__)
|
2
|
-
|
3
|
-
|
2
|
+
require 'open-uri'
|
3
|
+
|
4
|
+
class Tiger
|
5
|
+
def self.generate(sentence,words)
|
4
6
|
@sentence = ""
|
7
|
+
@content = ""
|
5
8
|
|
6
|
-
|
7
|
-
tofile = File.new("#{filename.to_s}","w+")
|
9
|
+
source = open('https://raw.githubusercontent.com/gugakatsi/LoremKnight/master/lib/words.txt')
|
8
10
|
|
9
|
-
|
10
|
-
content
|
11
|
-
@words = content.split(" ")
|
12
|
-
else
|
13
|
-
puts "unable to locate Knight's source file"
|
11
|
+
source.each do |char|
|
12
|
+
@content += char
|
14
13
|
end
|
15
14
|
|
15
|
+
@words = @content.split(" ")
|
16
16
|
|
17
17
|
sentenceTimes = sentence.to_i
|
18
18
|
wordTimes = words.to_i
|
19
19
|
|
20
|
-
sentenceTimes.times do
|
21
|
-
wordTimes.times do
|
22
|
-
|
20
|
+
sentenceTimes.times do
|
21
|
+
wordTimes.times do
|
22
|
+
@sentence += @words[rand(@words.size)]+" "
|
23
23
|
end
|
24
|
-
|
25
|
-
tofile.syswrite("\n")
|
24
|
+
@sentence += " , "
|
26
25
|
end
|
26
|
+
|
27
|
+
return @sentence
|
28
|
+
|
27
29
|
end
|
28
30
|
end
|
29
|
-
|
30
|
-
#require_relative("#{$source_location}/words.txt")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: LoremKnight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guga katsiashvili
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: 'lorem generating words from georgian epic poem : The Knight in the Panther''s
|
14
14
|
Skin'
|