ffakeron 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Fakeron
2
2
 
3
- Adds the module Faker::SwansonIpsum, giving you endless hours of fun with Ron Swanson Quotes
3
+ Adds the module Faker::SwansonIpsum, Faker::SwansonQuote giving you endless hours of fun with Ron Swanson idioms.
4
4
 
5
5
  ## Why?
6
6
 
@@ -24,17 +24,28 @@ Or install it yourself as:
24
24
 
25
25
  ## Usage
26
26
 
27
+ ### Faker::SwansonIpsum
28
+
27
29
  As you would any other Ipsum generator you're able to get a few basic strings from Faker::SwansonIpsum, notably.
28
30
 
29
- Faker::SwansonIpsum.word # single word
30
- Faker::SwansonIpsum.sentence # an actual sentence quote
31
- Faker::SwansonIpsum.paragraph # a few sentences, strung together
31
+ Faker::SwansonIpsum.word # random Swanson style word
32
+ Faker::SwansonIpsum.words(count) # array of random words
33
+
34
+ Faker::SwansonIpsum.sentence # random collection of words as a sentence
35
+ Faker::SwansonIpsum.sentences(count) # array of random sentences
36
+
37
+ Faker::SwansonIpsum.paragraph # random sentences, strung together
38
+ Faker::SwansonIpsum.paragraphs(count) # array of random paragraphs
39
+
40
+ ### Faker::SwansonQuote
41
+
42
+ Instead of a pattern of gibberish Ipsum, you can generate quotes from Swanson
32
43
 
33
- Along with this you can generate multiple of each, with the parameter controlling the count
44
+ Faker::SwansonQuote.sentence # A single quote
45
+ Faker::SwansonQuote.sentences(count) # array of quotes
34
46
 
35
- Faker::SwansonIpsum.words(count) # an array of words
36
- Faker::SwansonIpsum.sentences(count) # an array of sentences
37
- Faker::SwansonIpsum.paragraphs(count) # an array of paragraphs
47
+ Faker::SwansonQuote.paragraph # A few quotes strung together
48
+ Faker::SwansonQuote.paragraphs(count) # array of paragraphs of quotes
38
49
 
39
50
  ## Contributing
40
51
 
@@ -8,19 +8,6 @@ module Faker
8
8
  SWANSON_WORDS.rand
9
9
  end
10
10
 
11
- def sentence
12
- quote = SWANSON_QUOTES.rand
13
- "#{quote}."
14
- end
15
-
16
- def sentences(num = 3)
17
- (1..num+10).map { sentence }.uniq[1..num]
18
- end
19
-
20
- def paragraphs(num = 3)
21
- (1..num+10).map { paragraph }.uniq[1..num]
22
- end
23
-
24
11
  def words(num = 3)
25
12
  SWANSON_WORDS.random_pick(num)
26
13
  end
@@ -41,48 +28,5 @@ module Faker
41
28
  "spokeshave", "sander", "preternaturally", "tolerance", "privatized", "deviled",
42
29
  "buffet"
43
30
  ]
44
-
45
- SWANSON_QUOTES = k [
46
- "I have been developing the Swanson Pyramid of Greatness for years",
47
- "The less I know about other people's affairs, the happier I am",
48
- "April really is the whole package",
49
- "You had me at meat tornado",
50
- "The Four Horsemeals of the Eggporkalypse",
51
- "It's like yoga, except I still get to kill something",
52
- "Birthdays were invented by Hallmark to sell cards",
53
- "Clear alcohols are for rich women on diets",
54
- "I don't want to paint with a broad brush here, but every single contractor in the world is a miserable, incompetent thief",
55
- "Never half-ass two things, whole-ass one thing",
56
- "From gladiators into Swansons",
57
- "The government is a greedy piglet that suckles on a taxpayer's teat until they have sore, chapped nipples",
58
- "Turkey can never beat cow",
59
- "There is only one bad word: taxes",
60
- "Child labor laws are ruining this country",
61
- "Shorts over six inches are capri pants, shorts under six inches are European",
62
- "Only women shave beneath the neck",
63
- "I work hard to make sure my department is as small and as ineffective as possible",
64
- "Jerry's work is often adequate",
65
- "When I eat it is the food that is scared",
66
- "The important thing is your dream has been crushed",
67
- "Every two weeks I need to sand down my toe nails",
68
- "It is a beautiful night for the end of the world",
69
- "We have one activity planned, not getting killed",
70
- "We use that stuff to burn warts off mules",
71
- "I hope the rest of your day is cool beans",
72
- "You have come up with a plan so spectacularly horrible that it might ruin the entire department",
73
- "I hear it has a dope aftertaste",
74
- "Everyone shut up and look at me",
75
- "I'm just making sure no one ever has to eat this",
76
- "Is that a fried turkey leg inside a grilled hamburger",
77
- "Do not stand too close when you light an ex-wife effigy",
78
- "You may have thought you heard me say I wanted a lot of bacon and eggs, but what I said was: Give me all the bacon and eggs you have"
79
- ]
80
-
81
- SWANSON_PUNCTUATION = k [
82
- ".",
83
- "?",
84
- "!"
85
- ]
86
-
87
31
  end
88
32
  end
@@ -0,0 +1,62 @@
1
+ module Faker
2
+ module SwansonQuote
3
+ extend ModuleUtils
4
+ extend self
5
+
6
+ def sentence
7
+ SWANSON_QUOTES.rand
8
+ end
9
+
10
+ def sentences(num = 3)
11
+ sentences_with_duplicates = (1..num+10).map { sentence }
12
+ sentences_with_duplicates.uniq[1..num]
13
+ end
14
+
15
+ def paragraph(sentence_count = 3)
16
+ sentences_with_duplicates = (1..sentence_count+10).map { sentence }
17
+ sentences_with_duplicates.uniq[1..sentence_count+rand(4)].join(' ')
18
+ end
19
+
20
+ def paragraphs(num = 3)
21
+ paragraphs_with_duplicates = (1..num+10).map { paragraph }
22
+ paragraphs_with_duplicates.uniq[1..num]
23
+ end
24
+
25
+ SWANSON_QUOTES = k [
26
+ "I have been developing the Swanson Pyramid of Greatness for years.",
27
+ "The less I know about other people's affairs, the happier I am.",
28
+ "April really is the whole package.",
29
+ "You had me at meat tornado.",
30
+ "The Four Horsemeals of the Eggporkalypse.",
31
+ "It's like yoga, except I still get to kill something.",
32
+ "Birthdays were invented by Hallmark to sell cards.",
33
+ "Clear alcohols are for rich women on diets.",
34
+ "I don't want to paint with a broad brush here, but every single contractor in the world is a miserable, incompetent thief.",
35
+ "Never half-ass two things, whole-ass one thing.",
36
+ "From gladiators into Swansons.",
37
+ "The government is a greedy piglet that suckles on a taxpayer's teat until they have sore, chapped nipples.",
38
+ "Turkey can never beat cow.",
39
+ "There is only one bad word: taxes.",
40
+ "Child labor laws are ruining this country.",
41
+ "Shorts over six inches are capri pants, shorts under six inches are European.",
42
+ "Only women shave beneath the neck.",
43
+ "I work hard to make sure my department is as small and as ineffective as possible.",
44
+ "Jerry's work is often adequate.",
45
+ "When I eat it is the food that is scared.",
46
+ "The important thing is your dream has been crushed.",
47
+ "Every two weeks I need to sand down my toe nails.",
48
+ "It is a beautiful night for the end of the world.",
49
+ "We have one activity planned, not getting killed.",
50
+ "We use that stuff to burn warts off mules.",
51
+ "I hope the rest of your day is cool beans.",
52
+ "You have come up with a plan so spectacularly horrible that it might ruin the entire department.",
53
+ "I hear it has a dope aftertaste.",
54
+ "Everyone shut up and look at me.",
55
+ "I'm just making sure no one ever has to eat this.",
56
+ "Is that a fried turkey leg inside a grilled hamburger.",
57
+ "Do not stand too close when you light an ex-wife effigy.",
58
+ "You may have thought you heard me say I wanted a lot of bacon and eggs, but what I said was: Give me all the bacon and eggs you have."
59
+ ]
60
+ end
61
+ end
62
+
@@ -6,4 +6,5 @@ module Fakeron
6
6
  end
7
7
  module Faker
8
8
  autoload :SwansonIpsum, 'ffaker/swanson_ipsum'
9
+ autoload :SwansonQuote, 'ffaker/swanson_quote'
9
10
  end
@@ -1,3 +1,3 @@
1
1
  module Fakeron
2
- VERSION = "0.0.2"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -11,12 +11,10 @@ class TestSwansonIpsum < Test::Unit::TestCase
11
11
 
12
12
  def test_paragraphs
13
13
  assert_match /1\+|[ a-z]+/i, Faker::SwansonIpsum.paragraphs.join(" ")
14
- assert_equal 3, Faker::SwansonIpsum.paragraphs.uniq.length
15
14
  end
16
15
 
17
16
  def test_sentences
18
17
  assert_match /1\+|[ a-z]+/i, Faker::SwansonIpsum.sentences.join(" ")
19
- assert_equal 3, Faker::SwansonIpsum.sentences.uniq.length
20
18
  end
21
19
 
22
20
  def test_words
@@ -0,0 +1,26 @@
1
+ require 'helper'
2
+
3
+ class TestSwansonQuote < Test::Unit::TestCase
4
+ def test_sentence
5
+ assert_match /1\+|[ a-z]+\./i, Faker::SwansonQuote.sentence
6
+ end
7
+
8
+ def test_sentences
9
+ assert_match /1\+|[ a-z]+/i, Faker::SwansonQuote.sentences.join(" ")
10
+ assert_equal 3, Faker::SwansonQuote.sentences.uniq.length
11
+ assert_equal 5, Faker::SwansonQuote.sentences(5).uniq.length
12
+ end
13
+
14
+ def test_paragraph
15
+ assert_match /1\+|[ a-z]+/i, Faker::SwansonQuote.paragraph
16
+ assert_operator 3, :<=, Faker::SwansonQuote.paragraph.split(". ").uniq.length
17
+ assert_operator 5, :<=, Faker::SwansonQuote.paragraph(5).split(". ").uniq.length
18
+ end
19
+
20
+ def test_paragraphs
21
+ assert_match /1\+|[ a-z]+/i, Faker::SwansonQuote.paragraphs.join(" ")
22
+ assert_equal 3, Faker::SwansonQuote.paragraphs.uniq.length
23
+ assert_equal 5, Faker::SwansonQuote.paragraphs(5).uniq.length
24
+ end
25
+ end
26
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffakeron
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-24 00:00:00.000000000 Z
12
+ date: 2012-09-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffaker
@@ -73,10 +73,12 @@ files:
73
73
  - Rakefile
74
74
  - ffakeron.gemspec
75
75
  - lib/ffaker/swanson_ipsum.rb
76
+ - lib/ffaker/swanson_quote.rb
76
77
  - lib/ffakeron.rb
77
78
  - lib/ffakeron/version.rb
78
79
  - test/helper.rb
79
80
  - test/test_swanson_ipsum.rb
81
+ - test/test_swanson_quote.rb
80
82
  homepage: http://swansonipsum.com
81
83
  licenses: []
82
84
  post_install_message:
@@ -91,7 +93,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
91
93
  version: '0'
92
94
  segments:
93
95
  - 0
94
- hash: -1140191769023032100
96
+ hash: 1526826891248648513
95
97
  required_rubygems_version: !ruby/object:Gem::Requirement
96
98
  none: false
97
99
  requirements:
@@ -100,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
102
  version: '0'
101
103
  segments:
102
104
  - 0
103
- hash: -1140191769023032100
105
+ hash: 1526826891248648513
104
106
  requirements: []
105
107
  rubyforge_project:
106
108
  rubygems_version: 1.8.24
@@ -110,3 +112,4 @@ summary: Generates dummy data based off Ron Swanson quotes
110
112
  test_files:
111
113
  - test/helper.rb
112
114
  - test/test_swanson_ipsum.rb
115
+ - test/test_swanson_quote.rb