crazipsum 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,253 @@
1
+ abap
2
+ abc
3
+ actionscript
4
+ ada
5
+ agilentvee
6
+ algol
7
+ alice
8
+ angelscript
9
+ apex
10
+ apl
11
+ applescript
12
+ arc
13
+ arduino
14
+ asp
15
+ aspectj
16
+ assembly
17
+ atlas
18
+ augeas
19
+ autohotkey
20
+ autoit
21
+ autolisp
22
+ automator
23
+ avenue
24
+ awk
25
+ bash
26
+ basic
27
+ bc
28
+ bcpl
29
+ beta
30
+ blitzmax
31
+ boo
32
+ bourneshell
33
+ bro
34
+ c
35
+ cshell
36
+ c#
37
+ c++
38
+ c++/cli
39
+ c-omega
40
+ caml
41
+ ceylon
42
+ cfml
43
+ cg
44
+ ch
45
+ chill
46
+ cil
47
+ cl
48
+ clarion
49
+ clean
50
+ clipper
51
+ clojure
52
+ clu
53
+ cobol
54
+ cobra
55
+ coffeescript
56
+ coldfusion
57
+ comal
58
+ commonlisp
59
+ coq
60
+ ct
61
+ curl
62
+ d
63
+ dart
64
+ dcl
65
+ delphi
66
+ dibol
67
+ dylan
68
+ e
69
+ ec
70
+ ecl
71
+ ecmascript
72
+ egl
73
+ eiffel
74
+ elixir
75
+ emacslisp
76
+ erlang
77
+ etoys
78
+ euphoria
79
+ exec
80
+ f#
81
+ factor
82
+ falcon
83
+ fancy
84
+ fantom
85
+ felix
86
+ forth
87
+ fortran
88
+ fortress
89
+ foxpro
90
+ gambas
91
+ octave
92
+ go
93
+ googleappsscript
94
+ gosu
95
+ groovy
96
+ haskell
97
+ haxe
98
+ heron
99
+ hpl
100
+ hypertalk
101
+ icon
102
+ idl
103
+ inform
104
+ informix-4gl
105
+ intercal
106
+ io
107
+ ioke
108
+ j
109
+ j#
110
+ jade
111
+ java
112
+ javafxscript
113
+ javascript
114
+ jscript
115
+ julia
116
+ kornshell
117
+ kotlin
118
+ labview
119
+ ladderlogic
120
+ lasso
121
+ limbo
122
+ lingo
123
+ lisp
124
+ logo
125
+ logtalk
126
+ lotusscript
127
+ lpc
128
+ lua
129
+ lustre
130
+ m4
131
+ mad
132
+ magic
133
+ magik
134
+ malbolge
135
+ mantis
136
+ maple
137
+ mathematica
138
+ matlab
139
+ max/msp
140
+ maxscript
141
+ mel
142
+ mercury
143
+ mirah
144
+ miva
145
+ ml
146
+ monkey
147
+ modula-2
148
+ modula-3
149
+ moo
150
+ moto
151
+ ms-dosbatch
152
+ mumps
153
+ natural
154
+ nemerle
155
+ nimrod
156
+ nqc
157
+ nsis
158
+ nu
159
+ nxt-g
160
+ oberon
161
+ objectrexx
162
+ objective-c
163
+ objective-j
164
+ ocaml
165
+ occam
166
+ ooc
167
+ opa
168
+ opencl
169
+ openedgeabl
170
+ opl
171
+ oz
172
+ paradox
173
+ parrot
174
+ pascal
175
+ perl
176
+ php
177
+ pike
178
+ pilot
179
+ pl/i
180
+ pl/sql
181
+ pliant
182
+ postscript
183
+ pov-ray
184
+ powerbasic
185
+ powerscript
186
+ powershell
187
+ processing
188
+ prolog
189
+ puppet
190
+ puredata
191
+ python
192
+ q
193
+ r
194
+ racket
195
+ realbasic
196
+ rebol
197
+ revolution
198
+ rexx
199
+ rpg
200
+ ruby
201
+ rust
202
+ s
203
+ s-plus
204
+ sas
205
+ sather
206
+ scala
207
+ scheme
208
+ scilab
209
+ scratch
210
+ sed
211
+ seed7
212
+ self
213
+ shell
214
+ signal
215
+ simula
216
+ simulink
217
+ slate
218
+ smalltalk
219
+ smarty
220
+ spark
221
+ spss
222
+ sqr
223
+ squeak
224
+ squirrel
225
+ standardml
226
+ suneido
227
+ supercollider
228
+ tacl
229
+ tcl
230
+ tex
231
+ thinbasic
232
+ tom
233
+ transact-sql
234
+ turing
235
+ typescript
236
+ vala/genie
237
+ vbscript
238
+ verilog
239
+ vhdl
240
+ viml
241
+ visualbasic
242
+ webdna
243
+ whitespace
244
+ x10
245
+ xbase
246
+ xbase++
247
+ xen
248
+ xpl
249
+ xslt
250
+ xquery
251
+ yacc
252
+ yorick
253
+ zshell
data/data/religion.txt ADDED
@@ -0,0 +1,43 @@
1
+ agnostic
2
+ amish
3
+ apostolic
4
+ atheist
5
+ aztec
6
+ baptist
7
+ buddhism
8
+ buddhism
9
+ canaanite
10
+ catholic
11
+ christian
12
+ episcopal
13
+ evolutionist
14
+ gnosticism
15
+ hinduism
16
+ islam
17
+ jewish
18
+ kabbalah
19
+ lutheran
20
+ mennonite
21
+ methodist
22
+ mormon
23
+ nazarene
24
+ pagan
25
+ pentecostal
26
+ presbyterian
27
+ psychianna
28
+ quaker
29
+ rastafarian
30
+ santeria
31
+ scientologist
32
+ shaker
33
+ shintoism
34
+ sikhism
35
+ spiritualist
36
+ sufism
37
+ taoism
38
+ umbanda
39
+ unitarian
40
+ unity
41
+ vedanta
42
+ wiccan
43
+ yoga
data/lib/crazipsum.rb ADDED
@@ -0,0 +1,86 @@
1
+ require 'crazipsum/version'
2
+
3
+ class Crazipsum
4
+ REGISTER = Hash.new { Crazipsum.new([], fillers: false) }
5
+
6
+ class << self
7
+ def register(type, path, opts = {})
8
+ fillers = opts[:fillers]
9
+ opts[:fillers] = parse_dictionnary(local_dictionnary_path(:fillers)) if fillers.nil? || fillers
10
+ words = parse_dictionnary(path)
11
+ REGISTER[type] = new(words, opts)
12
+ end
13
+
14
+ private
15
+
16
+ def parse_dictionnary(path_or_array)
17
+ return path_or_array if path_or_array.is_a?(Array)
18
+ file_content = File.read(path_or_array)
19
+ file_content.split("\n")
20
+ end
21
+
22
+ def register_from_gem(type)
23
+ register(type, local_dictionnary_path(type))
24
+ end
25
+
26
+ def local_dictionnary_path(type)
27
+ File.expand_path("../../data/#{type}.txt", __FILE__)
28
+ end
29
+ end
30
+
31
+ def sentence(opts = {})
32
+ quantity = opts[:word_count] || rand(7..15)
33
+ quantity = 0 if quantity < 0
34
+ sentence_fillers = opts[:fillers]
35
+ sentence_fillers = fillers if sentence_fillers.nil?
36
+ dict = dictionnary
37
+ words = (0...quantity).map do
38
+ next dict.sample unless sentence_fillers
39
+ rand(3) == 0 ? dict.sample : sentence_fillers.sample
40
+ end
41
+ return '' if words.empty?
42
+ words[0] = words[0].capitalize
43
+ words = words.join(' ')
44
+ "#{words}."
45
+ end
46
+
47
+ def paragraph(opts = {})
48
+ quantity = opts[:sentence_count] || rand(4..7)
49
+ paragraph = []
50
+ quantity.times do
51
+ s = sentence(opts)
52
+ paragraph << s unless s.empty?
53
+ end
54
+ paragraph.join(' ')
55
+ end
56
+ alias sentences paragraph
57
+
58
+ def paragraphs(opts = {})
59
+ quantity = opts[:paragraph_count] || rand(3..5)
60
+ paragraphs = []
61
+ quantity.times do
62
+ p = paragraph(opts)
63
+ paragraphs << p unless p.empty?
64
+ end
65
+ paragraphs.join(opts[:seperator] || "\n\n")
66
+ end
67
+
68
+ private
69
+
70
+ attr_reader :dictionnary, :fillers
71
+
72
+ def initialize(words, opts = {})
73
+ @fillers = opts[:fillers]
74
+ @dictionnary = words
75
+ end
76
+
77
+ register_from_gem(:phobia)
78
+ register_from_gem(:religion)
79
+ register_from_gem(:fruit)
80
+ register_from_gem(:mineral)
81
+ register_from_gem(:programming_language)
82
+ end
83
+
84
+ def Crazipsum(type)
85
+ Crazipsum::REGISTER[type]
86
+ end
@@ -0,0 +1,3 @@
1
+ class Crazipsum
2
+ VERSION = '0.1.2'.freeze
3
+ end
metadata ADDED
@@ -0,0 +1,135 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: crazipsum
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.2
5
+ platform: ruby
6
+ authors:
7
+ - Yohan Robert
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-06-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.12'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.12'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubocop
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '='
46
+ - !ruby/object:Gem::Version
47
+ version: 0.40.0
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '='
53
+ - !ruby/object:Gem::Version
54
+ version: 0.40.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: pry-byebug
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '='
60
+ - !ruby/object:Gem::Version
61
+ version: 3.4.0
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '='
67
+ - !ruby/object:Gem::Version
68
+ version: 3.4.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: coveralls
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.8'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.8'
83
+ description: Ever wanted some dumber, crazier (fancier?) lorem ipsum? Here you go!
84
+ email:
85
+ - yohan.robert@outlook.fr
86
+ executables: []
87
+ extensions: []
88
+ extra_rdoc_files: []
89
+ files:
90
+ - ".gitignore"
91
+ - ".rspec"
92
+ - ".rubocop.yml"
93
+ - ".rubocop_todo.yml"
94
+ - ".travis.yml"
95
+ - Gemfile
96
+ - LICENSE.md
97
+ - README.md
98
+ - Rakefile
99
+ - bin/console
100
+ - bin/setup
101
+ - crazipsum.gemspec
102
+ - data/fillers.txt
103
+ - data/fruit.txt
104
+ - data/mineral.txt
105
+ - data/phobia.txt
106
+ - data/programming_language.txt
107
+ - data/religion.txt
108
+ - lib/crazipsum.rb
109
+ - lib/crazipsum/version.rb
110
+ homepage: https://www.github.com/groyoh/crazipsum
111
+ licenses:
112
+ - MIT
113
+ metadata: {}
114
+ post_install_message:
115
+ rdoc_options: []
116
+ require_paths:
117
+ - lib
118
+ required_ruby_version: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ required_rubygems_version: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - ">="
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
128
+ requirements: []
129
+ rubyforge_project:
130
+ rubygems_version: 2.5.1
131
+ signing_key:
132
+ specification_version: 4
133
+ summary: Lorem ipsum remixed
134
+ test_files: []
135
+ has_rdoc: