fillertext 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.rvmrc +1 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +30 -0
- data/LICENSE.txt +20 -0
- data/README.mkd +78 -0
- data/Rakefile +51 -0
- data/VERSION +1 -0
- data/lib/fillertext/fillertext.rb +71 -0
- data/lib/fillertext/fixnum.rb +14 -0
- data/lib/fillertext/styles/hipster.rb +16 -0
- data/lib/fillertext/styles/lorem.rb +28 -0
- data/lib/fillertext/styles/yinzer.rb +7 -0
- data/lib/fillertext.rb +7 -0
- data/spec/fillertext_spec.rb +97 -0
- data/test/fillertext_test.rb +26 -0
- metadata +131 -0
data/.document
ADDED
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm --create use 1.9.3@fillertext
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
ansi (1.4.3)
|
5
|
+
git (1.2.5)
|
6
|
+
jeweler (1.8.4)
|
7
|
+
bundler (~> 1.0)
|
8
|
+
git (>= 1.2.5)
|
9
|
+
rake
|
10
|
+
rdoc
|
11
|
+
json (1.7.4)
|
12
|
+
multi_json (1.3.6)
|
13
|
+
rake (0.9.2.2)
|
14
|
+
rdoc (3.12)
|
15
|
+
json (~> 1.4)
|
16
|
+
simplecov (0.6.4)
|
17
|
+
multi_json (~> 1.0)
|
18
|
+
simplecov-html (~> 0.5.3)
|
19
|
+
simplecov-html (0.5.3)
|
20
|
+
turn (0.9.6)
|
21
|
+
ansi
|
22
|
+
|
23
|
+
PLATFORMS
|
24
|
+
ruby
|
25
|
+
|
26
|
+
DEPENDENCIES
|
27
|
+
jeweler (~> 1.8.4)
|
28
|
+
rdoc (~> 3.12)
|
29
|
+
simplecov
|
30
|
+
turn
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2012 Colin Dean
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.mkd
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
FillerText
|
2
|
+
==========
|
3
|
+
|
4
|
+
by @colindean
|
5
|
+
|
6
|
+
Introduction
|
7
|
+
------------
|
8
|
+
|
9
|
+
FillerText is a gem useful for generating, well, filler text. It can do the
|
10
|
+
standard "lorem ipsum" text or a variety of other clever substitute texts.
|
11
|
+
|
12
|
+
Installing FillerText
|
13
|
+
---------------------
|
14
|
+
**NOTE:** *This isn't actually live on rubygems yet.*
|
15
|
+
|
16
|
+
Install using:
|
17
|
+
|
18
|
+
gem install fillertext
|
19
|
+
|
20
|
+
or add the gem to your project's Gemfile:
|
21
|
+
|
22
|
+
gem 'fillertext'
|
23
|
+
|
24
|
+
Using FillerText
|
25
|
+
----------------
|
26
|
+
|
27
|
+
Here's how you use FillerText.
|
28
|
+
|
29
|
+
There are two main ways. One is cleaner because it keeps FillerText within its
|
30
|
+
own namespace. The other method will add Integer#filler to keep some tasty
|
31
|
+
syntactical sugar.
|
32
|
+
|
33
|
+
FillerText::FillerText.sentences 5
|
34
|
+
FillerText::FillerText.words 2
|
35
|
+
FillerText::FillerText.characters 5
|
36
|
+
FillerText::FillerText.bytes 4
|
37
|
+
FillerText::FillerText.paragraphs 1
|
38
|
+
|
39
|
+
or the *much* easier and intended method:
|
40
|
+
|
41
|
+
2.filler.sentences
|
42
|
+
1.filler.paragraphs
|
43
|
+
|
44
|
+
You can also change the style from the default "lorem ipsum" to something else.
|
45
|
+
|
46
|
+
FillerText::FillerText.style = FillerText::Style::LoremIpsum
|
47
|
+
FillerText::FillerText.style = FillerText::Style::HipsterIpsum
|
48
|
+
FillerText::FillerText.style = FillerText::Style::YinzerIpsum
|
49
|
+
|
50
|
+
Contributing to FillerText
|
51
|
+
--------------------------
|
52
|
+
|
53
|
+
Patches welcome. Please file using Github issues.
|
54
|
+
|
55
|
+
License
|
56
|
+
-------
|
57
|
+
|
58
|
+
FillerText is licensed under the MIT license.
|
59
|
+
|
60
|
+
Copyright (C) 2011 by Colin Dean
|
61
|
+
|
62
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
63
|
+
of this software and associated documentation files (the "Software"), to deal
|
64
|
+
in the Software without restriction, including without limitation the rights
|
65
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
66
|
+
copies of the Software, and to permit persons to whom the Software is
|
67
|
+
furnished to do so, subject to the following conditions:
|
68
|
+
|
69
|
+
The above copyright notice and this permission notice shall be included in
|
70
|
+
all copies or substantial portions of the Software.
|
71
|
+
|
72
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
73
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
74
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
75
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
76
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
77
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
78
|
+
THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'rake'
|
11
|
+
require 'rake/testtask'
|
12
|
+
require 'jeweler'
|
13
|
+
require 'simplecov'
|
14
|
+
require 'rdoc/task'
|
15
|
+
|
16
|
+
Jeweler::Tasks.new do |gem|
|
17
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
18
|
+
gem.name = "fillertext"
|
19
|
+
gem.homepage = "http://github.com/colindean/fillertext"
|
20
|
+
gem.license = "MIT"
|
21
|
+
gem.summary = %Q{Generates filler/placeholder text in a Rubyistic way}
|
22
|
+
gem.description = %Q{Generates filler text through a direct interface or by monkeypatching Fixnum}
|
23
|
+
gem.email = "git+gems@cad.cx"
|
24
|
+
gem.authors = ["Colin Dean"]
|
25
|
+
# dependencies defined in Gemfile
|
26
|
+
end
|
27
|
+
|
28
|
+
Jeweler::RubygemsDotOrgTasks.new
|
29
|
+
|
30
|
+
Rake::TestTask.new(:spec) do |t|
|
31
|
+
t.libs.push 'lib'
|
32
|
+
t.test_files = FileList['spec/*_spec.rb']
|
33
|
+
t.verbose = true
|
34
|
+
end
|
35
|
+
|
36
|
+
desc "Run :spec with code coverage"
|
37
|
+
task :coverage do
|
38
|
+
`rake spec COVERAGE=true`
|
39
|
+
`open coverage/index.html`
|
40
|
+
end
|
41
|
+
|
42
|
+
Rake::RDocTask.new do |rdoc|
|
43
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
44
|
+
|
45
|
+
rdoc.rdoc_dir = 'rdoc'
|
46
|
+
rdoc.title = "fillertext #{version}"
|
47
|
+
rdoc.rdoc_files.include('README*')
|
48
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
49
|
+
end
|
50
|
+
|
51
|
+
task :default => :test
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
@@ -0,0 +1,71 @@
|
|
1
|
+
module FillerText
|
2
|
+
#this has to be here because of file require order issues
|
3
|
+
#todo: fix this
|
4
|
+
module Style; class LoremIpsum; end; end
|
5
|
+
|
6
|
+
def self.paragraphs(n=nil)
|
7
|
+
FillerText.paragraphs n
|
8
|
+
end
|
9
|
+
def self.words(n=nil)
|
10
|
+
FillerText.words n
|
11
|
+
end
|
12
|
+
def self.bytes(n=nil)
|
13
|
+
FillerText.bytes n
|
14
|
+
end
|
15
|
+
def self.characters(n=nil)
|
16
|
+
FillerText.characters n
|
17
|
+
end
|
18
|
+
def self.sentences(n=nil)
|
19
|
+
FillerText.sentences n
|
20
|
+
end
|
21
|
+
|
22
|
+
class FillerText
|
23
|
+
|
24
|
+
@@style = Style::LoremIpsum
|
25
|
+
|
26
|
+
def self.style=(style)
|
27
|
+
@@style = style
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.style
|
31
|
+
@@style
|
32
|
+
end
|
33
|
+
|
34
|
+
@@num = 0
|
35
|
+
|
36
|
+
def self.n=(n)
|
37
|
+
@@num = n
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.n
|
41
|
+
@@num
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.bytes(n=nil)
|
45
|
+
n ||= self.n
|
46
|
+
self.style.text[0,n]
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.characters(n=nil)
|
50
|
+
#same thing for now
|
51
|
+
self.bytes(n)
|
52
|
+
end
|
53
|
+
|
54
|
+
def self.words(n=nil)
|
55
|
+
n ||= self.n
|
56
|
+
#the idea here is to find the nth space and return everything before it
|
57
|
+
self.style.text.split[0,n].join(" ").gsub(/[^\w\s]/,'')
|
58
|
+
end
|
59
|
+
|
60
|
+
def self.sentences(n=nil)
|
61
|
+
n ||= self.n
|
62
|
+
self.style.text.split('.').slice(0,n).join(". ")
|
63
|
+
end
|
64
|
+
|
65
|
+
def self.paragraphs(n=nil)
|
66
|
+
n ||= self.n
|
67
|
+
self.style.text.split("\n").slice(0,n).join("\n")
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module FillerText::Style
|
2
|
+
class HipsterIpsum
|
3
|
+
|
4
|
+
def self.text
|
5
|
+
|
6
|
+
"Hipster ipsum 3 wolf moon retro fap, quinoa Austin banksy keytar vegan gluten-free next level echo park brunch mustache. Stumptown photo booth mcsweeney's, cred banksy aesthetic keffiyeh. Stumptown blog etsy, banksy quinoa iphone vice mlkshk +1 american apparel. Art party mcsweeney's iphone, PBR fap gentrify keffiyeh DIY lo-fi +1 single-origin coffee butcher cosby sweater bicycle rights synth. Dreamcatcher seitan letterpress trust fund fanny pack, brunch Austin butcher mixtape american apparel +1. Jean shorts tofu twee cardigan, gentrify salvia beard mustache keffiyeh lomo tumblr fixie vegan seitan biodiesel. Fanny pack raw denim squid four loko, jean shorts trust fund you probably haven't heard of them thundercats mustache keytar salvia ethical photo booth put a bird on it synth.
|
7
|
+
Aesthetic iphone vice raw denim wolf, +1 retro mlkshk stumptown Austin sartorial biodiesel bicycle rights. Chambray blog DIY squid, keytar marfa freegan +1 farm-to-table ethical artisan photo booth fanny pack viral tofu. Sustainable wes anderson yr, marfa vice terry richardson cliche four loko photo booth mlkshk artisan hoodie. Put a bird on it biodiesel organic, craft beer thundercats wolf 8-bit brooklyn stumptown butcher cardigan quinoa cosby sweater banh mi. Put a bird on it cosby sweater quinoa, banksy vice lo-fi cliche salvia organic helvetica +1 yr. Tattooed put a bird on it wes anderson carles fixie sustainable. Mlkshk sartorial shoreditch, pitchfork biodiesel aesthetic wes anderson gentrify echo park carles etsy put a bird on it.
|
8
|
+
Wolf keytar williamsburg VHS. Terry richardson farm-to-table wolf butcher iphone, wes anderson organic synth. Artisan Austin single-origin coffee, thundercats 3 wolf moon williamsburg mlkshk vice craft beer mixtape keytar wolf photo booth wayfarers quinoa. Lo-fi readymade vinyl scenester wes anderson vegan american apparel, biodiesel squid chambray. Brooklyn leggings viral jean shorts skateboard scenester, squid VHS pitchfork cred tofu williamsburg seitan irony. Yr cred banksy, PBR trust fund mustache irony. Before they sold out wes anderson DIY, sustainable 3 wolf moon fixie quinoa.
|
9
|
+
Irony scenester gentrify +1 whatever thundercats put a bird on it. Leggings 8-bit you probably haven't heard of them, echo park organic trust fund iphone tofu. Photo booth keytar messenger bag, quinoa blog VHS echo park Austin +1. Single-origin coffee mixtape stumptown, art party skateboard before they sold out locavore chambray sustainable trust fund put a bird on it vice jean shorts keffiyeh. Artisan gluten-free hoodie before they sold out seitan bicycle rights, fap whatever biodiesel mixtape PBR pitchfork. Skateboard photo booth 3 wolf moon, twee banh mi tofu biodiesel synth cosby sweater. DIY quinoa tumblr shoreditch, PBR fanny pack banh mi wayfarers you probably haven't heard of them terry richardson seitan four loko thundercats brunch vegan.
|
10
|
+
Stumptown wes anderson letterpress, thundercats helvetica beard irony organic. Letterpress mixtape wes anderson etsy gentrify. Mustache american apparel messenger bag, ethical iphone put a bird on it thundercats portland PBR +1 8-bit fanny pack lo-fi. Art party thundercats fanny pack leggings raw denim, gentrify put a bird on it stumptown mcsweeney's freegan artisan master cleanse sartorial 8-bit synth. Jean shorts vice 8-bit, vinyl gluten-free portland fixie biodiesel readymade four loko keffiyeh organic butcher skateboard. Lo-fi butcher ethical, etsy twee portland wayfarers organic next level vinyl single-origin coffee beard. Fixie messenger bag beard readymade, synth williamsburg four loko.
|
11
|
+
Seitan photo booth chambray sartorial tumblr, williamsburg trust fund gluten-free locavore thundercats cliche biodiesel brooklyn. Art party vinyl portland, letterpress messenger bag helvetica retro pitchfork VHS iphone 3 wolf moon put a bird on it. Aesthetic PBR four loko twee cred, VHS carles blog vice. Put a bird on it thundercats wayfarers viral, PBR leggings vinyl. Wolf seitan mixtape synth keffiyeh vice, vinyl PBR whatever bicycle rights single-origin coffee craft beer cred. Mlkshk before they sold out Austin etsy bicycle rights retro keytar aesthetic brunch wolf art party. Lomo you probably haven't heard of them williamsburg fanny pack sustainable tattooed, dreamcatcher next level tumblr portland organic before they sold out gluten-free.
|
12
|
+
Marfa skateboard gluten-free wes anderson tattooed american apparel yr gentrify, iphone vinyl brunch cred farm-to-table DIY food truck. Wes anderson sustainable vice tumblr. Iphone next level lomo chambray. Twee thundercats chambray, carles banksy vice raw denim brunch gluten-free williamsburg portland mlkshk american apparel biodiesel leggings. Etsy fap iphone, high life brooklyn scenester gentrify banksy tumblr bicycle rights craft beer gluten-free helvetica single-origin coffee quinoa. Freegan organic sartorial, gluten-free keytar DIY whatever scenester wayfarers portland mlkshk thundercats. Quinoa mustache etsy, ethical sartorial food truck 8-bit.
|
13
|
+
"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module FillerText::Style
|
2
|
+
class LoremIpsum
|
3
|
+
|
4
|
+
def self.text
|
5
|
+
|
6
|
+
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas hendrerit condimentum enim, at venenatis nibh pulvinar et. Ut viverra gravida justo at pellentesque. Phasellus tincidunt est a erat feugiat vel dictum quam hendrerit. Mauris turpis augue, imperdiet eu dictum id, laoreet vitae enim. Donec nunc mi, consectetur nec pretium quis, pulvinar et mauris. Integer tristique arcu ut quam mollis tincidunt. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Proin vel mauris mi, id vulputate massa. Cras fermentum, turpis quis elementum dapibus, odio lorem porttitor dui, non eleifend nulla lacus vitae eros. Curabitur eros libero, aliquet quis mollis vitae, rutrum id arcu.
|
7
|
+
Curabitur vel risus neque, a iaculis nisl. Proin suscipit erat sed enim dignissim tincidunt. Proin vel sapien vel lectus accumsan condimentum. Quisque bibendum sodales orci, sit amet lacinia nulla ornare ac. Duis ac felis porta orci egestas ullamcorper. Nunc ut dolor massa. Suspendisse potenti. Suspendisse et felis ligula. Nullam gravida erat eget sem accumsan convallis. Cras sagittis felis in lorem mattis luctus. Vivamus at blandit leo. Vivamus rhoncus dignissim enim laoreet bibendum. Maecenas in tortor sit amet enim suscipit fringilla. Maecenas venenatis, nisi nec tristique scelerisque, nisl elit eleifend mi, porttitor bibendum mi leo eget nunc.
|
8
|
+
Morbi pellentesque imperdiet feugiat. Suspendisse consequat, massa commodo scelerisque egestas, metus neque dignissim eros, sit amet semper magna sapien a urna. Vestibulum sed enim lectus, at eleifend massa. Cras lorem orci, interdum ac rutrum non, adipiscing vel lorem. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Duis facilisis elementum ipsum, ut blandit mauris mollis sed. In hac habitasse platea dictumst. Pellentesque elit augue, pharetra sed porttitor iaculis, tincidunt sed mi. Cras consectetur erat a velit laoreet vel hendrerit lectus consequat. Ut risus nisl, bibendum a faucibus ut, hendrerit ut metus. Morbi sodales justo id quam tincidunt et lobortis mi pulvinar. Praesent ac tellus enim. Quisque mi tellus, pellentesque vitae malesuada eget, ullamcorper vel velit. Maecenas imperdiet arcu a eros adipiscing faucibus. Vestibulum vel enim odio. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.
|
9
|
+
Vestibulum pulvinar consectetur laoreet. Nam pharetra massa ac purus luctus molestie. Duis ut sem nisi, at faucibus est. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse eu pretium erat. Phasellus condimentum vulputate nulla a euismod. In in urna dapibus metus posuere lobortis sed sit amet massa. Nam libero nulla, ultricies nec blandit sed, accumsan et eros.
|
10
|
+
Donec sed erat at risus sollicitudin consectetur nec at nulla. Praesent a semper urna. Morbi eu eros ut tellus commodo varius commodo a lorem. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vivamus sed nunc elit, in ornare ipsum. Phasellus et metus ac nibh elementum gravida. Suspendisse dignissim diam sit amet ante aliquam rutrum. Maecenas sit amet eleifend magna.
|
11
|
+
Pellentesque dictum rhoncus odio, eget hendrerit est egestas fermentum. Mauris nec vulputate felis. Duis luctus felis eu enim semper posuere. Maecenas quis elit metus. Aliquam blandit euismod arcu porta euismod. Sed quis ante vel ante hendrerit sollicitudin. Sed lobortis scelerisque tortor non tristique. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Etiam interdum, elit vitae condimentum sagittis, orci sapien gravida magna, non elementum risus neque eget nisl.
|
12
|
+
Etiam adipiscing, ante id pharetra pulvinar, dolor tortor dapibus velit, id commodo tellus metus vehicula elit. Maecenas in bibendum eros. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vivamus pellentesque est vel dolor consectetur et condimentum nulla rhoncus. Vivamus gravida bibendum metus viverra condimentum. Mauris ac purus elit. Suspendisse potenti. Sed eu neque vel ante pellentesque dapibus.
|
13
|
+
Fusce porttitor egestas est, sit amet mollis nisl dignissim et. Proin rutrum nunc orci, eget eleifend leo. Fusce commodo, tellus eget volutpat euismod, mauris leo luctus arcu, a porttitor lorem turpis a elit. Mauris porta orci at quam aliquam consectetur. Donec lobortis, quam sed rutrum bibendum, urna tellus rutrum erat, et convallis lacus lectus vel elit. Nullam ultricies neque ut dui dapibus eget laoreet sem placerat. Aliquam mi diam, luctus id commodo eu, molestie quis mauris. Nulla sed nulla augue. Fusce id quam eros. Suspendisse mi ante, tempus non sodales ac, commodo at sapien. Ut augue purus, rutrum a posuere a, vestibulum eu risus. Praesent id elit orci, vitae tristique ipsum.
|
14
|
+
Phasellus eleifend sapien at elit vulputate tincidunt. Praesent quis turpis eros. Proin fermentum elit sit amet augue facilisis at lobortis tortor vestibulum. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed massa quam, suscipit non aliquam non, commodo ut neque. Etiam sodales porttitor ligula, id varius justo aliquet in. Cras hendrerit, augue non interdum ullamcorper, enim ante pharetra tortor, ac ultrices nulla lacus eget nunc. Curabitur sit amet mauris turpis, vel rhoncus nisi. Nullam venenatis odio vel arcu tincidunt ac pharetra metus dictum. Mauris fringilla nisl sit amet nunc vestibulum sed laoreet sapien porta. Morbi eget mi nec felis egestas tincidunt a eu nisi. Aenean diam ipsum, pretium id cursus nec, vulputate in massa. Sed ut blandit elit. Cras ut arcu neque, fermentum egestas augue. Maecenas ultrices turpis sit amet diam suscipit rutrum. Aliquam iaculis rhoncus ultricies.
|
15
|
+
Nunc feugiat augue id magna dictum condimentum. Sed vehicula, lorem et molestie ornare, nulla dolor mattis augue, eget vulputate quam massa molestie nisl. Phasellus vestibulum elit sit amet lorem congue ornare. Sed lacinia porta mollis. Pellentesque lacinia accumsan velit, vitae feugiat nibh pharetra eget. Aliquam erat volutpat. Pellentesque dignissim arcu at neque suscipit vel vehicula justo dictum. Suspendisse sit amet imperdiet dui. Fusce egestas pellentesque lorem, vel vestibulum odio vestibulum non.
|
16
|
+
Maecenas commodo ligula aliquet leo viverra hendrerit. Aliquam erat volutpat. Vestibulum convallis metus in turpis dignissim vitae elementum est blandit. Quisque diam magna, fringilla a tincidunt id, tincidunt ac nunc. In hac habitasse platea dictumst. Pellentesque varius velit ac ligula congue laoreet. Donec rhoncus vehicula dignissim. Nulla feugiat congue pellentesque. Aliquam consequat dapibus ligula vel aliquet. Duis molestie ullamcorper gravida. Morbi tellus magna, ultricies quis vestibulum in, accumsan nec metus. Donec tincidunt condimentum massa, sed viverra neque molestie ac.
|
17
|
+
Duis congue euismod lacus id posuere. Vestibulum bibendum consectetur nunc. Vestibulum tempus tristique blandit. Suspendisse tincidunt libero neque, eget aliquet tellus. Pellentesque sit amet erat ut odio pellentesque congue. Cras cursus aliquet odio non consectetur. Donec tempor nulla lectus, id hendrerit orci.
|
18
|
+
Integer leo arcu, tincidunt convallis elementum sit amet, aliquet eu nibh. Sed vitae orci sed justo aliquam laoreet. Aenean feugiat pretium urna ac malesuada. Sed porttitor, arcu ac vulputate feugiat, nulla ipsum eleifend neque, vitae sollicitudin leo purus eu magna. Mauris sit amet ligula nec velit accumsan egestas non id nisl. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Mauris sed nibh eu justo blandit laoreet eget sed risus.
|
19
|
+
Mauris consectetur, tellus in imperdiet imperdiet, felis sem semper tellus, quis dignissim lectus mi et justo. Nulla condimentum tempor ante, eget ultricies ante convallis a. Quisque eget blandit elit. Praesent ornare purus ut purus viverra molestie. In eget nisl nisl, sit amet consectetur eros. Vestibulum at felis turpis. Nulla eu diam rhoncus risus malesuada dictum quis fringilla tellus. Praesent adipiscing justo in ligula consequat at vulputate diam semper. Donec in lectus vel lorem adipiscing venenatis a sed lacus. Integer venenatis porta luctus. Phasellus at mi augue, quis consequat nisi. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nullam neque lacus, pulvinar volutpat convallis at, aliquam eget turpis.
|
20
|
+
Nullam at velit urna. Donec tincidunt ligula vel est fringilla bibendum egestas orci euismod. Donec tempus dolor id lectus porta consectetur. Cras lorem urna, lobortis at sollicitudin eget, interdum eu nisi. Nullam orci ipsum, mattis nec tempus sed, imperdiet non metus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nullam quis justo diam, tincidunt dictum purus. Suspendisse elementum, augue et congue bibendum, lorem dui egestas turpis, interdum mattis mauris massa eu enim. Donec nulla mauris, faucibus sit amet fermentum at, volutpat a risus.
|
21
|
+
Donec ornare ullamcorper mi, non porttitor est hendrerit ac. Curabitur id turpis a velit tincidunt laoreet. Phasellus consectetur felis sed turpis ullamcorper rhoncus. Donec condimentum justo a orci venenatis sagittis. Aliquam consectetur magna at turpis auctor blandit at sit amet felis. Fusce ac lectus venenatis ante imperdiet fringilla. In quis nisi vitae neque rutrum adipiscing. Nullam dignissim, leo eu bibendum ultrices, dui erat mollis eros, blandit rutrum eros erat at enim. Fusce justo ante, faucibus vehicula semper et, luctus in nulla. Vestibulum mattis ante non diam tempus tempor id non nibh. Maecenas id nisl vitae massa tempor eleifend. Nullam luctus eros vitae lectus porta sodales. Donec vitae nisl dolor. Nulla in tellus at neque consequat ornare. Aliquam varius, ligula ut facilisis pulvinar, dolor ipsum posuere metus, et euismod ligula diam nec sapien. Etiam mollis, odio nec semper condimentum, nulla mauris auctor libero, et volutpat leo quam sit amet diam.
|
22
|
+
Pellentesque mauris arcu, tincidunt gravida elementum a, sollicitudin in ante. Pellentesque vel tellus quam. Integer consequat turpis ut nisl pharetra id molestie mi porta. Nullam est tellus, faucibus at vehicula ac, eleifend ut erat. Nullam id arcu nunc, quis condimentum urna. Nunc lorem orci, scelerisque et mollis eget, consequat et eros. Cras eu mauris sed felis suscipit gravida. Fusce eu ante neque. Mauris dignissim eleifend augue, id cursus urna facilisis id. Suspendisse consequat lacus in dolor tempor cursus. Maecenas eleifend tortor et nisl congue bibendum. Suspendisse iaculis fringilla nisi at viverra. Proin mi elit, euismod et hendrerit quis, commodo ac orci. Mauris imperdiet, nibh in volutpat suscipit, tortor diam venenatis risus, sed viverra arcu nunc vitae massa. Nunc facilisis erat at orci auctor aliquam.
|
23
|
+
Maecenas varius consectetur felis, a dictum libero adipiscing et. Pellentesque dapibus, nulla ac pulvinar lobortis, lorem arcu auctor velit, nec iaculis libero augue nec justo. Vestibulum placerat porttitor metus in vulputate. In elementum massa sed risus malesuada pulvinar. Donec in urna eget dui suscipit consequat et sit amet erat. Quisque vel leo eros, sed elementum sem. Sed vehicula tincidunt cursus. Proin interdum, arcu non semper aliquet, ligula felis mattis lacus, ut malesuada nisl nisi ut mi."
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
data/lib/fillertext.rb
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
require 'minitest/autorun'
|
2
|
+
begin; require 'turn'; rescue LoadError; rescue RuntimeError; end
|
3
|
+
require 'simplecov'
|
4
|
+
SimpleCov.start if ENV['COVERAGE']
|
5
|
+
require_relative '../lib/fillertext'
|
6
|
+
|
7
|
+
describe FillerText do
|
8
|
+
|
9
|
+
describe "when explicity called" do
|
10
|
+
include FillerText
|
11
|
+
it "should output sentences" do
|
12
|
+
f = FillerText.sentences 5
|
13
|
+
#look for the periods
|
14
|
+
f.scan(/\./).size.must_equal 4
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should output words" do
|
18
|
+
f = FillerText.words 5
|
19
|
+
#look for four spaces
|
20
|
+
f.must_equal "Lorem ipsum dolor sit amet"
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should output characters" do
|
24
|
+
f = FillerText.characters 5
|
25
|
+
f.must_equal "Lorem"
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should output bytes" do
|
29
|
+
f = FillerText.bytes 5
|
30
|
+
f.must_equal "Lorem"
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should output paragraphs" do
|
34
|
+
f = FillerText.paragraphs 5
|
35
|
+
#look for newlines
|
36
|
+
f.scan(/\n/).size.must_equal 4
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe "when called from an integer" do
|
41
|
+
include FillerText
|
42
|
+
|
43
|
+
it "should output sentences" do
|
44
|
+
f = 5.filler.sentences
|
45
|
+
#look for the periods
|
46
|
+
f.scan(/\./).size.must_equal 4
|
47
|
+
end
|
48
|
+
|
49
|
+
it "should output words" do
|
50
|
+
f = 3.filler.words
|
51
|
+
#look for four spaces
|
52
|
+
f.must_equal "Lorem ipsum dolor"
|
53
|
+
end
|
54
|
+
|
55
|
+
it "should output characters" do
|
56
|
+
f = 5.filler.characters
|
57
|
+
f.must_equal "Lorem"
|
58
|
+
end
|
59
|
+
|
60
|
+
it "should output bytes" do
|
61
|
+
f = 5.filler.bytes
|
62
|
+
f.must_equal "Lorem"
|
63
|
+
end
|
64
|
+
|
65
|
+
it "should output paragraphs" do
|
66
|
+
f = 5.filler.paragraphs
|
67
|
+
#look for newlines
|
68
|
+
f.scan(/\n/).size.must_equal 4
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
describe "when changing filler text style" do
|
73
|
+
include FillerText
|
74
|
+
|
75
|
+
it "should use LoremIpsum" do
|
76
|
+
FillerText::FillerText.style = FillerText::Style::LoremIpsum
|
77
|
+
t = "Lorem ipsum"
|
78
|
+
t.length.filler.characters.must_equal t
|
79
|
+
end
|
80
|
+
|
81
|
+
it "should use hipster ipsum" do
|
82
|
+
FillerText::FillerText.style = FillerText::Style::HipsterIpsum
|
83
|
+
t = "Hipster ipsum"
|
84
|
+
t.length.filler.characters.must_equal t
|
85
|
+
end
|
86
|
+
|
87
|
+
it "should use yinzer ipsum" do
|
88
|
+
t = "Yinzer ipsum"
|
89
|
+
FillerText::FillerText.style = FillerText::Style::YinzerIpsum
|
90
|
+
t.length.filler.characters.must_equal t
|
91
|
+
end
|
92
|
+
|
93
|
+
#add more styles here
|
94
|
+
|
95
|
+
end
|
96
|
+
|
97
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'minitest/autorun'
|
2
|
+
require_relative '../lib/fillertext'
|
3
|
+
|
4
|
+
class FillerTextTest < MiniTest::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
|
8
|
+
end
|
9
|
+
|
10
|
+
test "should generate some text" do
|
11
|
+
FillerText.sentences 5
|
12
|
+
FillerText.words 2
|
13
|
+
FillerText.characters 5
|
14
|
+
FillerText.bytes 4
|
15
|
+
FillerText.paragraphs 1
|
16
|
+
|
17
|
+
2.filler.sentences
|
18
|
+
1.filler.paragraphs
|
19
|
+
|
20
|
+
|
21
|
+
FillerText.style = FillerText::LoremIpsum
|
22
|
+
FillerText.style = FillerText::HipsterIpsum
|
23
|
+
FillerText.style = FillerText::YinzerIpsum
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,131 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fillertext
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Colin Dean
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-08-07 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rdoc
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '3.12'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.12'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: jeweler
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 1.8.4
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.8.4
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: simplecov
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: turn
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
description: Generates filler text through a direct interface or by monkeypatching
|
79
|
+
Fixnum
|
80
|
+
email: git+gems@cad.cx
|
81
|
+
executables: []
|
82
|
+
extensions: []
|
83
|
+
extra_rdoc_files:
|
84
|
+
- LICENSE.txt
|
85
|
+
- README.mkd
|
86
|
+
files:
|
87
|
+
- .document
|
88
|
+
- .rvmrc
|
89
|
+
- Gemfile
|
90
|
+
- Gemfile.lock
|
91
|
+
- LICENSE.txt
|
92
|
+
- README.mkd
|
93
|
+
- Rakefile
|
94
|
+
- VERSION
|
95
|
+
- lib/fillertext.rb
|
96
|
+
- lib/fillertext/fillertext.rb
|
97
|
+
- lib/fillertext/fixnum.rb
|
98
|
+
- lib/fillertext/styles/hipster.rb
|
99
|
+
- lib/fillertext/styles/lorem.rb
|
100
|
+
- lib/fillertext/styles/yinzer.rb
|
101
|
+
- spec/fillertext_spec.rb
|
102
|
+
- test/fillertext_test.rb
|
103
|
+
homepage: http://github.com/colindean/fillertext
|
104
|
+
licenses:
|
105
|
+
- MIT
|
106
|
+
post_install_message:
|
107
|
+
rdoc_options: []
|
108
|
+
require_paths:
|
109
|
+
- lib
|
110
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
111
|
+
none: false
|
112
|
+
requirements:
|
113
|
+
- - ! '>='
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: '0'
|
116
|
+
segments:
|
117
|
+
- 0
|
118
|
+
hash: -2412435519573485363
|
119
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
|
+
none: false
|
121
|
+
requirements:
|
122
|
+
- - ! '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
requirements: []
|
126
|
+
rubyforge_project:
|
127
|
+
rubygems_version: 1.8.24
|
128
|
+
signing_key:
|
129
|
+
specification_version: 3
|
130
|
+
summary: Generates filler/placeholder text in a Rubyistic way
|
131
|
+
test_files: []
|