LoremKnight 2.7.0 → 2.7.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tiger.rb +36 -17
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d45e18c5b6af143785e275d7e20712fbb84bcc41
4
- data.tar.gz: 84ac366c2090e40a343061ff6b2967afc7377f83
3
+ metadata.gz: 6b6b7fc310653a8f8fa9d8bbd29728109723787d
4
+ data.tar.gz: 33df82adc5e3672d0268b344efde85c604218d69
5
5
  SHA512:
6
- metadata.gz: 9d6d236f26b1185fef3737f3a98cfd0c3f5b18dd6fd9c386d4df642d34149b72a5d959a2b0161893b89cec3bc35376902527170bfe10ff42b9ef901b106e78c9
7
- data.tar.gz: 8ad0cd081bdd945d1d33844f328780acd207bf4c1a9ac77b20399cbaf140bbd7d6513bd53a8eb4d1bc9e0ec78db48ed2576c25398a8a793efa1e4af9a8c41072
6
+ metadata.gz: 9391a06c32c7867b4a8c97b0df3429b568673b2db8adf8502942ec1163aeb71bfb652d04a17d6f769f18e0086302e6824c6241f1676e85a43db986ac22568303
7
+ data.tar.gz: 694d4236bcfc9eb2b5ce22b0adf5302cd392cc73013a11b17f3409d9e98be1495c316ee285cc1c3e9ce0c853e1fd50fc14d9cfbbe40477f7c902eb9484e422e7
data/lib/tiger.rb CHANGED
@@ -6,6 +6,7 @@ class Tiger
6
6
  @content = ""
7
7
  @paragraphStandartSize = 70;
8
8
  @sentenceStandartSize = 7;
9
+ @listStandartSize = 5;
9
10
  @wordLength = 20;
10
11
 
11
12
  @contentType = "RAW"
@@ -28,6 +29,14 @@ class Tiger
28
29
  lorem(paragraphN,@paragraphStandartSize,'')
29
30
  end
30
31
 
32
+ def self.getList(listN)
33
+ lists = ""
34
+ listN.to_i.times do
35
+ lists += generateList
36
+ end
37
+ return lists
38
+ end
39
+
31
40
  def self.getWords(wordN)
32
41
  @words = ""
33
42
  @wordArray = @words.split(" ")
@@ -40,28 +49,20 @@ class Tiger
40
49
  return @words;
41
50
  end
42
51
 
43
- def self.setSentenceStandartSize(size)
44
- if size.to_i > 0
45
- @sentenceStandartSize = size.to_i
46
- else
47
- puts "Value can not be less or equal to 0"
48
- end
52
+ def self.setSentenceSize(size)
53
+ @sentenceStandartSize = size.to_i > 0 ? size.to_i : @sentenceStandartSize;
49
54
  end
50
55
 
51
- def self.setParagraphStandartSize(size)
52
- if size.to_i > 0
53
- @paragraphStandartSize = size.to_i
54
- else
55
- puts "Value can not be less or equal to 0"
56
- end
56
+ def self.setParagraphSize(size)
57
+ @paragraphStandartSize = size.to_i > 0 ? size.to_i : @paragraphStandartSize;
58
+ end
59
+
60
+ def self.setListSize(size)
61
+ @listStandartSize = size.to_i > 0 ? size.to_i : @listStandartSize;
57
62
  end
58
63
 
59
64
  def self.setWordMaximumLength(length)
60
- if length.to_i > 0
61
- @wordLength = length.to_i
62
- else
63
- puts "Value can not be less than or equal to 0"
64
- end
65
+ @wordLength = length.to_i > 0 ? length.to_i : @wordLength;
65
66
  end
66
67
 
67
68
  def self.setContentType(type)
@@ -99,3 +100,21 @@ def lorem(header,body,startWith = '')
99
100
  return @sentence
100
101
 
101
102
  end
103
+
104
+ def generateList
105
+ @preSentence = @hasPreSentence == true ? "რომელმან შექმნა სამყარო" : ""
106
+
107
+ list = "<ul><li>"
108
+ randomSize = rand(20) #setRandBound
109
+
110
+ @listStandartSize.times do |x|
111
+ list += " #{@preSentence}"
112
+ randomSize.times do |y|
113
+ list += y != randomSize-1 ? " #{@content[rand(@content.size-1)]}" : " #{@content[rand(@content.size-1)]}</li>"
114
+ end
115
+ list += x != @listStandartSize-1 ? "<li>" : "</ul><br><br>"
116
+ end
117
+
118
+ return list
119
+
120
+ end
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: 2.7.0
4
+ version: 2.7.3
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-12-02 00:00:00.000000000 Z
11
+ date: 2016-12-16 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'