personal_faker 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 50f349662c7c751848d20d89fab7d523aad0987e
4
+ data.tar.gz: 3323350b984bd84d3e3df7e2561dbd532c41d3f8
5
+ SHA512:
6
+ metadata.gz: 03b7a46943998487196c35f94273846c955f0a23470cb5654d554c01c3fffe48714734a82401d5ee21207e8eec4e467f83a607823a012b6e705b50f9bba2e836
7
+ data.tar.gz: 0c68f05e3b37e81fa18a91df0fb2d0b8dfb9260cc14213dc7b21a6c8a7ad7b9d7d5e2e9e722220762ade405ebc6ad80bbda5096240f7b02fac1fe5f1f9818815
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ .DS_Store
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.2
4
+ before_install: gem install bundler -v 1.10.5
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in personal_faker.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Stephanie Liu
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # PersonalFaker
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/personal_faker`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'personal_faker'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install personal_faker
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/personal_faker. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
36
+
37
+
38
+ ## License
39
+
40
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
+
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "personal_faker"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
data/lib/.DS_Store ADDED
Binary file
Binary file
@@ -0,0 +1,74 @@
1
+ module PersonalFaker
2
+ class Base
3
+ attr_accessor :table
4
+ attr_accessor :text
5
+ attr_accessor :file
6
+
7
+ def initialize(choose_text)
8
+ if choose_text == 'dr-seuss'
9
+ @file = 'lib/personal_faker/texts/dr-seuss.rtf'
10
+ elsif choose_text == 'pride-and-prejudice'
11
+ @file = 'lib/personal_faker/texts/pride-and-prejudice.rtf'
12
+ elsif choose_text == 'macbeth'
13
+ @file = 'lib/personal_faker/texts/macbeth.rtf'
14
+ end
15
+ end
16
+
17
+ def text
18
+ return @text unless @text.nil?
19
+ @text = File.open(@file, "r").read
20
+ @text.gsub!("\n", ' ')
21
+ @text.gsub!("\\", '')
22
+ @text.gsub!('"', '')
23
+ @text.gsub!(' ', ' ')
24
+ @text.gsub!(/[_.,!?;:]/, '')
25
+ @text.downcase!
26
+ @text.gsub!(' i ', ' I ')
27
+ end
28
+
29
+ def table
30
+ return @table unless @table.nil?
31
+ position = 0
32
+ position_of_second_word = text.index(' ', 1)
33
+ table = {}
34
+ until position_of_second_word.nil? || text.index(' ', position_of_second_word + 1).nil? do
35
+ position_of_second_word += 1
36
+ word = text[position..(position_of_second_word - 2)]
37
+ second_word = text[position_of_second_word..(text.index(' ', position_of_second_word)-1)]
38
+ table[word] ||= []
39
+ table[word] << second_word
40
+ position = position_of_second_word
41
+ position_of_second_word = text.index(' ', position + 1)
42
+ end
43
+ @table = table
44
+ end
45
+
46
+ def sentence
47
+ word = table.keys.sample.capitalize
48
+ sentence = word
49
+ 10.times do
50
+ if table[word]
51
+ word = table[word].sample
52
+ else
53
+ word = table.keys.sample
54
+ end
55
+ sentence = sentence + " " + word
56
+ end
57
+ sentence = sentence + "."
58
+ end
59
+
60
+ def question
61
+ word = table.keys.sample.capitalize
62
+ sentence = word
63
+ 10.times do
64
+ if table[word]
65
+ word = table[word].sample
66
+ else
67
+ word = table.keys.sample
68
+ end
69
+ sentence = sentence + " " + word
70
+ end
71
+ sentence = sentence + "?"
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,380 @@
1
+ Congratulations!
2
+ Today is your day.
3
+ You're off to Great Places!
4
+ You're off and away!
5
+
6
+ You have brains in your head.
7
+ You have feet in your shoes.
8
+ You can steer yourself
9
+ any direction you choose.
10
+ You're on your own. And you know what you know.
11
+ And YOU are the guy who'll decide where to go.
12
+
13
+ You'll look up and down streets. Look 'em over with care.
14
+ About some you will say, "I don't choose to go there."
15
+ With your head full of brains and your shoes full of feet,
16
+ you're too smart to go down any not-so-good street.
17
+
18
+ And you may not find any
19
+ you'll want to go down.
20
+ In that case, of course,
21
+ you'll head straight out of town.
22
+
23
+ It's opener there
24
+ in the wide open air.
25
+
26
+ Out there things can happen
27
+ and frequently do
28
+ to people as brainy
29
+ and footsy as you.
30
+
31
+ And then things start to happen,
32
+ don't worry. Don't stew.
33
+ Just go right along.
34
+ You'll start happening too.
35
+
36
+ OH!
37
+ THE PLACES YOU'LL GO!
38
+
39
+ You'll be on y our way up!
40
+ You'll be seeing great sights!
41
+ You'll join the high fliers
42
+ who soar to high heights.
43
+
44
+ You won't lag behind, because you'll have the speed.
45
+ You'll pass the whole gang and you'll soon take the lead.
46
+ Wherever you fly, you'll be best of the best.
47
+ Wherever you go, you will top all the rest.
48
+
49
+ Except when you don't.
50
+ Because, sometimes, you won't.
51
+
52
+ I'm sorry to say so
53
+ but, sadly, it's true
54
+ that Bang-ups
55
+ and Hang-ups
56
+ can happen to you.
57
+
58
+ You can get all hung up
59
+ in a prickle-ly perch.
60
+ And your gang will fly on.
61
+ You'll be left in a Lurch.
62
+
63
+ You'll come down from the Lurch
64
+ with an unpleasant bump.
65
+ And the chances are, then,
66
+ that you'll be in a Slump.
67
+
68
+ And when you're in a Slump,
69
+ you're not in for much fun.
70
+ Un-slumping yourself
71
+ is not easily done.
72
+
73
+ You will come to a place where the streets are not marked.
74
+ Some windows are lighted. But mostly they're darked.
75
+ A place you could sprain both your elbow and chin!
76
+ Do you dare to stay out? Do you dare to go in?
77
+ How much can you lose? How much can you win?
78
+
79
+ And IF you go in, should you turn left or right...
80
+ or right-and-three-quarters? Or, maybe, not quite?
81
+ Or go around back and sneak in from behind?
82
+ Simple it's not, I'm afraid you will find,
83
+ for a mind-maker-upper to make up his mind.
84
+
85
+ You can get so confused
86
+ that you'll start in to race
87
+ down long wiggled roads at a break-necking pace
88
+ and grind on for miles cross weirdish wild space,
89
+ headed, I fear, toward a most useless place.
90
+ The Waiting Place...
91
+
92
+ ...for people just waiting.
93
+ Waiting for a train to go
94
+ or a bus to come, or a plane to go
95
+ or the mail to come, or the rain to go
96
+ or the phone to ring, or the snow to snow
97
+ or the waiting around for a Yes or No
98
+ or waiting for their hair to grow.
99
+ Everyone is just waiting.
100
+
101
+ Waiting for the fish to bite
102
+ or waiting for the wind to fly a kite
103
+ or waiting around for Friday night
104
+ or waiting, perhaps, for their Uncle Jake
105
+ or a pot to boil, or a Better Break
106
+ or a string of pearls, or a pair of pants
107
+ or a wig with curls, or Another Chance.
108
+ Everyone is just waiting.
109
+
110
+ NO!
111
+ That's not for you!
112
+
113
+ Somehow you'll escape
114
+ all that waiting and staying
115
+ You'll find the bright places
116
+ where Boom Bands are playing.
117
+
118
+ With banner flip-flapping,
119
+ once more you'll ride high!
120
+ Ready for anything under the sky.
121
+ Ready because you're that kind of a guy!
122
+
123
+ Oh, the places you'll go! There is fun to be done!
124
+ There are points to be scored. There are games to be won.
125
+ And the magical things you can do with that ball
126
+ will make you the winning-est winner of all.
127
+ Fame! You'll be as famous as famous can be,
128
+ with the whole wide world watching you win on TV.
129
+
130
+ Except when they don't
131
+ Because, sometimes they won't.
132
+
133
+ I'm afraid that some times
134
+ you'll play lonely games too.
135
+ Games you can't win
136
+ 'cause you'll play against you.
137
+
138
+ All Alone!
139
+ Whether you like it or not,
140
+ Alone will be something
141
+ you'll be quite a lot.
142
+
143
+ And when you're alone, there's a very good chance
144
+ you'll meet things that scare you right out of your pants.
145
+ There are some, down the road between hither and yon,
146
+ that can scare you so much you won't want to go on.
147
+
148
+ But on you will go
149
+ though the weather be foul.
150
+ On you will go
151
+ though your enemies prowl.
152
+ On you will go
153
+ though the Hakken-Kraks howl.
154
+ Onward up many
155
+ a frightening creek,
156
+ though your arms may get sore
157
+ and your sneakers may leak.
158
+
159
+ On and on you will hike,
160
+ And I know you'll hike far
161
+ and face up to your problems
162
+ whatever they are.
163
+
164
+ You'll get mixed up, of course,
165
+ as you already know.
166
+ You'll get mixed up
167
+ with many strange birds as you go.
168
+ So be sure when you step.
169
+ Step with care and great tact
170
+ and remember that Life's
171
+ a Great Balancing Act.
172
+ Just never foget to be dexterous and deft.
173
+ And never mix up your right foot with your left.
174
+
175
+ And will you succeed?
176
+ Yes! You will, indeed!
177
+ (98 and 3/4 percent guaranteed.)
178
+
179
+ KID, YOU'LL MOVE MOUNTAINS!
180
+
181
+ So...
182
+ be your name Buxbaum or Bixby or Bray
183
+ or Mordecai Ali Van Allen O'Shea,
184
+ You're off the Great Places!
185
+ Today is your day!
186
+ Your mountain is waiting.
187
+ So...get on your way!
188
+
189
+ I am Daniel
190
+
191
+ I am Sam
192
+ Sam I am
193
+
194
+ That Sam-I-am
195
+ That Sam-I-am!
196
+ I do not like
197
+ that Sam-I-am
198
+
199
+ Do you like
200
+ green eggs and ham
201
+
202
+ I do not like them,
203
+ Sam-I-am.
204
+ I do not like
205
+ green eggs and ham.
206
+
207
+ Would you like them
208
+ Here or there?
209
+
210
+ I would not like them
211
+ here or there.
212
+ I would not like them
213
+ anywhere.
214
+ I do not like
215
+ green eggs and ham.
216
+ I do not like them,
217
+ Sam-I-am
218
+
219
+ Would you like them
220
+ in a house?
221
+ Would you like them
222
+ with a mouse?
223
+
224
+ I do not like them
225
+ in a house.
226
+ I do not like them
227
+ with a mouse.
228
+ I do not like them
229
+ here or there.
230
+ I do not like them
231
+ anywhere.
232
+ I do not like green eggs and ham.
233
+ I do not like them, Sam-I-am.
234
+
235
+
236
+ Would you eat them
237
+ in a box?
238
+ Would you eat them
239
+ with a fox?
240
+
241
+ Not in a box.
242
+ Not with a fox.
243
+ Not in a house.
244
+ Not with a mouse.
245
+ I would not eat them here or there.
246
+ I would not eat them anywhere.
247
+ I would not eat green eggs and ham.
248
+ I do not like them, Sam-I-am.
249
+
250
+ Would you? Could you?
251
+ in a car?
252
+ Eat them! Eat them!
253
+ Here they are.
254
+
255
+ I woould not,
256
+ could not,
257
+ in a car
258
+
259
+ You may like them.
260
+ You will see.
261
+ You may like them
262
+ in a tree?
263
+
264
+ I would not, could not in a tree.
265
+ Not in a car! You let me be.
266
+ I do not like them in a box.
267
+ I do not like them with a fox
268
+ I do not like them in a house
269
+ I do mot like them with a mouse
270
+ I do not like them here or there.
271
+ I do not like them anywhere.
272
+ I do not like green eggs and ham.
273
+ I do not like them, Sam-I-am.
274
+
275
+ A train! A train!
276
+ A train! A train!
277
+ Could you, would you
278
+ on a train?
279
+
280
+ Not on a train! Not in a tree!
281
+ Not in a car! Sam! Let me be!
282
+ I would not, could not, in a box.
283
+ I could not, would not, with a fox.
284
+ I will not eat them with a mouse
285
+ I will not eat them in a house.
286
+ I will not eat them here or there.
287
+ I will not eat them anywhere.
288
+ I do not like them, Sam-I-am.
289
+
290
+
291
+ Say!
292
+ In the dark?
293
+ Here in the dark!
294
+ Would you, could you, in the dark?
295
+
296
+ I would not, could not,
297
+ in the dark.
298
+
299
+ Would you, could you,
300
+ in the rain?
301
+
302
+ I would not, could not, in the rain.
303
+ Not in the dark. Not on a train,
304
+ Not in a car, Not in a tree.
305
+ I do not like them, Sam, you see.
306
+ Not in a house. Not in a box.
307
+ Not with a mouse. Not with a fox.
308
+ I will not eat them here or there.
309
+ I do not like them anywhere!
310
+
311
+ You do not like
312
+ green eggs and ham?
313
+
314
+ I do not
315
+ like them,
316
+ Sam-I-am.
317
+
318
+ Could you, would you,
319
+ with a goat?
320
+
321
+ I would not,
322
+ could not.
323
+ with a goat!
324
+
325
+ Would you, could you,
326
+ on a boat?
327
+
328
+ I could not, would not, on a boat.
329
+ I will not, will not, with a goat.
330
+ I will not eat them in the rain.
331
+ I will not eat them on a train.
332
+ Not in the dark! Not in a tree!
333
+ Not in a car! You let me be!
334
+ I do not like them in a box.
335
+ I do not like them with a fox.
336
+ I will not eat them in a house.
337
+ I do not like them with a mouse.
338
+ I do not like them here or there.
339
+ I do not like them ANYWHERE!
340
+
341
+ I do not like
342
+ green egss
343
+ and ham!
344
+
345
+ I do not like them,
346
+ Sam-I-am.
347
+
348
+ You do not like them.
349
+ SO you say.
350
+ Try them! Try them!
351
+ ANd you may.
352
+ Try them and you may I say.
353
+
354
+ Sam!
355
+ If you will let me be,
356
+ I will try them.
357
+ You will see.
358
+
359
+ Say!
360
+ I like green eggs and ham!
361
+ I do! I like them, Sam-I-am!
362
+ And I would eat them in a boat!
363
+ And I would eat them with a goat...
364
+ And I will eat them in the rain.
365
+ And in the dark. And on a train.
366
+ And in a car. And in a tree.
367
+ They are so goodm so goodm you see!
368
+
369
+ So I will eat them in a box.
370
+ And I will eat them with a fox.
371
+ And I will eat them in a house.
372
+ And I will eat them with a mouse.
373
+ And I will eat them here and there.
374
+ Say! I will eat them ANHYWHERE!
375
+
376
+ I do so like
377
+ green eggs and ham!
378
+ Thank you!
379
+ Thank you,
380
+ Sam-I-am