LoremKnight 3.0.0 → 3.1.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
  SHA1:
3
- metadata.gz: 8b8cb43a6ee59f489019548aafba7209dd048bc7
4
- data.tar.gz: 8062f5ea33c60b0e6280960fe257ef8a67b35e88
3
+ metadata.gz: 309c5595c15cc833b17dc139a8731c7ffacb4b8f
4
+ data.tar.gz: 11360809cf86a077ba95ca0e0856dcf7b967914d
5
5
  SHA512:
6
- metadata.gz: 901b6b4085697e0e5f936c3db040497a6b6c190abd551d3c97e24926911165fc68be66f799f5ccfa02f33ffac01974f38d564b3d79d3d34c2370b246f829a55e
7
- data.tar.gz: 44e98ae57cd7ba05b858376983fe6c3d1f86d3b4db5930de93baad66ce2267a8e28cd72b7c20acce89355909cd70950cc983056951fe4fcf0ad519fb2bee0be5
6
+ metadata.gz: 71690fcab0b4bf21d6e00eaf5ee2d615bcc4949da80f37528c1f4cb925a539dce8ab7ea723d2cae0d2b7d5b12fef473c5dfe28ca424157ac8d8651d58477048d
7
+ data.tar.gz: 7b2ebf3032a591f9cb7c0c1313893d31718b99e378c184e34a83c1f079bfd9c0bda5be772f4c227f547a2e4cb935bb7edda51cb41c978f3aa52fb63e25f56702
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- LoremKnight (3.0.0)
4
+ LoremKnight (3.1.0)
5
5
  rainbow
6
6
  thor
7
7
 
@@ -19,4 +19,4 @@ DEPENDENCIES
19
19
  bundler (~> 1.6)
20
20
 
21
21
  BUNDLED WITH
22
- 1.13.6
22
+ 1.14.6
data/Tiger.gemspec CHANGED
@@ -3,16 +3,16 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = 'LoremKnight'
6
- s.version = '3.0.0'
7
- s.date = '2017-02-22'
6
+ s.version = '3.1.1'
7
+ s.date = '2017-03-10'
8
8
  s.summary = "The Knight in the Panther's Skin!"
9
- s.description = "lorem generating words from georgian epic poem : The Knight in the Panther's Skin,now with Terminal support"
9
+ s.description = "lorem generating words from georgian epic poem : The Knight in the Panther's Skin,now with Terminal support,offline mode <3"
10
10
  s.authors = ["Guga katsiashvili"]
11
11
  s.email = 'guga.katsiashvili@gmail.com'
12
12
  s.files = `git ls-files -z`.split("\x0")
13
13
  s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
14
14
  s.homepage =
15
- 'https://github.com/Pimpify/LoremKnight/wiki'
15
+ 'https://github.com/Pimpify/LoremKnight/wiki/3.0.0'
16
16
  s.license = 'MIT'
17
17
  s.add_dependency 'thor'
18
18
  s.add_dependency 'rainbow'
data/lib/tiger.rb CHANGED
@@ -12,14 +12,8 @@ class Tiger
12
12
  @contentType = "RAW"
13
13
  @hasPreSentence = false
14
14
 
15
- contentFromhttp = ""
16
- source = open('https://raw.githubusercontent.com/gugakatsi/LoremKnight/master/lib/words.txt')
17
-
18
- source.each do |char|
19
- contentFromhttp += char
20
- end
21
-
22
- @content = contentFromhttp.split(" ")
15
+ source = File.open("#{$source_location}/words.txt","r+")
16
+ @content = source.sysread(source.size).split(" ")
23
17
 
24
18
  def self.getSentence(sentenceN)
25
19
  lorem(sentenceN,@sentenceStandartSize,'')
@@ -46,7 +40,7 @@ class Tiger
46
40
  @words += pendingWord.length <= @wordLength ? pendingWord+" " : ""
47
41
  @wordArray = @words.split(" ")
48
42
  end
49
- return @words;
43
+ return @words.force_encoding('UTF-8');
50
44
  end
51
45
 
52
46
  def self.setSentenceSize(size)
@@ -82,13 +76,13 @@ class Tiger
82
76
  end
83
77
 
84
78
  def lorem(header,body,startWith = '')
85
-
86
79
  @preSentence = @hasPreSentence == true ? "რომელმან შექმნა სამყარო" : ""
87
80
  @sentence = @contentType == 'text/html' ? "<p> #{@preSentence} " : " #{@preSentence} "
88
81
 
89
82
  header.times do |x|
90
83
  body.times do
91
- @sentence += @content[rand(@content.size)]+" "
84
+ randomWord = @content[rand(@content.size)].force_encoding('UTF-8')
85
+ @sentence += randomWord+" "
92
86
  end
93
87
  if @contentType == 'text/html'
94
88
  @sentence += x != header - 1 ? " </p> <br> <br> <p> #{@preSentence} " : " </p> <br> "
@@ -96,9 +90,7 @@ def lorem(header,body,startWith = '')
96
90
  @sentence += x != header-1 ? " \n \n #{@preSentence} " : " \n "
97
91
  end
98
92
  end
99
-
100
- return @sentence
101
-
93
+ return @sentence.force_encoding('UTF-8')
102
94
  end
103
95
 
104
96
  def generateList
@@ -115,6 +107,6 @@ def generateList
115
107
  list += x != @listStandartSize-1 ? "<li>" : "</ul><br><br>"
116
108
  end
117
109
 
118
- return list
110
+ return list.force_encoding('UTF-8')
119
111
 
120
112
  end
Binary file
Binary file
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: 3.0.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guga katsiashvili
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-22 00:00:00.000000000 Z
11
+ date: 2017-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -53,7 +53,7 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.6'
55
55
  description: 'lorem generating words from georgian epic poem : The Knight in the Panther''s
56
- Skin,now with Terminal support'
56
+ Skin,now with Terminal support,offline mode <3'
57
57
  email: guga.katsiashvili@gmail.com
58
58
  executables:
59
59
  - LoremKnight
@@ -73,7 +73,8 @@ files:
73
73
  - lib/tiger.rb
74
74
  - lib/words.txt
75
75
  - pkg/LoremKnight-3.0.0.gem
76
- homepage: https://github.com/Pimpify/LoremKnight/wiki
76
+ - pkg/LoremKnight-3.1.0.gem
77
+ homepage: https://github.com/Pimpify/LoremKnight/wiki/3.0.0
77
78
  licenses:
78
79
  - MIT
79
80
  metadata: {}