monty_ipsum 1.0.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8cf277a4addc1e7dd5f6f0bbcd37eb56ccf0fe30
4
- data.tar.gz: 2b21e82ea015c5a7d6f35ba5908a773f45da7879
3
+ metadata.gz: d1aeff6e3673c76f7c5ddd7d84bae90ac1d8fc17
4
+ data.tar.gz: 0fa6f59f3858a216c1735478440f4d7f994ed5f1
5
5
  SHA512:
6
- metadata.gz: 1844e25caf7391c8b9b3092a2a1c9bcc6fc577f139e57d92b7856393fa1e593fa20efa274ac816c12e20bb25d59ee6a9359eb8e9732185a06cad10e752da3a31
7
- data.tar.gz: 18193da1b23042c3c9a791df0dc9efe64f60b0a53086d33cd240860cb4c8b93d0755061e0b0d1c43888b4f72700eb92e81ed663da7e4ce2210c3049c32967910
6
+ metadata.gz: 7761e2108304c2302b52a740fc50f5b2f5ecddb7b8e2d434e6ca3b6679c0e9f66247b1a8d204de1551a2f2d2cbe68c18fa7ba6caf8f009005759c13cfabce806
7
+ data.tar.gz: 160544fc1880274e2e41f067cc68999bdad51a2c9298422c77483dee40c8cd618bc4e4385fe301243df0e449799e0b54bed898971d6a47247e2a99601244bd87
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MontyIpsum
2
2
 
3
- TODO: Write a gem description
3
+ MontyIpsum gives you different types of [Ipsum text](http://en.wikipedia.org/wiki/Lorem_ipsum) with the flavour of Monty Python!
4
4
 
5
5
  ## Installation
6
6
 
@@ -18,7 +18,34 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- TODO: Write usage instructions here
21
+ ### `ipsum`
22
+ Call the module and request the `ipsum` method. This will return a random Ipsum element in the set of quotes.
23
+
24
+ ~~~
25
+ > MontyIpsum.ipsum
26
+ => "And now, for something completely different."
27
+ ~~~
28
+
29
+ ### `header`
30
+ By requesting the header method, the module will return proper Ipsum for a section title or header.
31
+
32
+ ~~~
33
+ > MontyIpsum.header
34
+ => "And so on, and so on, and so on."
35
+ ~~~
36
+
37
+ ### `paragraph`
38
+ Will return medium to long sentences of Ipsum. Recieves a Hash with a `:count` key. The returned paragraph will be a concatenation of `:count` different Ipsums.
39
+
40
+
41
+ ## Todo
42
+ * Add more quotes
43
+ * Build category system following something like:
44
+ * ~~Short One-liners (for header elements)~~
45
+ * ~~Long One-liners (for paragraph openers and/or quote elements)~~
46
+ * Short Two-people Dialogs
47
+ * ~~Long Monologs for paragraphs content (Malcom Peter Brain Telescope Adrian Umbrella....)~~
48
+ * Names for Quote/Recomendation Sections
22
49
 
23
50
  ## Contributing
24
51
 
data/Rakefile CHANGED
@@ -1,2 +1,3 @@
1
1
  require "bundler/gem_tasks"
2
+ Dir.glob('tasks/**/*.rake').each(&method(:import))
2
3
 
@@ -1,21 +1,63 @@
1
1
  require "monty_ipsum/version"
2
2
 
3
3
  module MontyIpsum
4
- @@quotes = [
4
+ @@paragraph_headers = [
5
+ "It's just a flesh wound.",
6
+ "There, it moved!",
7
+ "And so on, and so on, and so on.",
5
8
  "Wait till Biggus Dickus hears of this",
6
- "He has a wife, you know. You know what she's called? She's called Incontinentia...Incontinentia Buttocks.",
7
- "Well, it's certainly uncontaminated by cheese.",
8
- "This parrot is no more! He has ceased to be!",
9
+ "And now, for something completely different.",
10
+ "Wait a minute, you are a fraud!",
9
11
  "Not much of a cheese shop really, is it?",
12
+ "Well, it's certainly uncontaminated by cheese.",
13
+ "This parrot is no more!",
14
+ "If she weighed the same as a duck... she's made of wood.",
15
+ "We are the knights who said Ni.",
16
+ "Welcome, brave sir Knight. Welcome to the Castle Anthrax.",
17
+ "Bring out your dead! Bring out your dead!",
18
+ "We are the keepers of the sacred words: Ni, Ping, and Nee-womm!",
19
+ "You're really interested in silly walks, aren't you?"
20
+ ]
21
+
22
+ @@paragraph_pieces = [
23
+ "He has a wife, you know. You know what she's called? She's called Incontinentia...Incontinentia Buttocks.",
10
24
  "Now, you listen here! He's not the Messiah. He's a very naughty boy!",
11
- "It's just a flesh wound.",
12
- "There, it moved!",
13
25
  "Well...lets move on to our guest who not only lives in Essex but also speaks only the ends of words. Mr. Ohm Ith.",
14
- "Wait a minute, you are a fraud!",
15
- "And so on, and so on, and so on.",
16
- "And now, for something completely different."
17
- ]
26
+ "Well, this is largely as I predicted, except that the Silly Party won. I think this is largely due to the number of votes cast. Gerald?",
27
+ "Here at Luton it's a three-cornered fight between Alan Jones - Sensible Party, in the middle, Tarquin Fin- tim- lim- bim- whin- bim- lim- bus- stop- F'tang- F'tang- Olè- Biscuitbarrel - Silly Party, and Kevin Phillips-Bong, the Slightly Silly candidate.",
28
+ "Hello, from Harpenden. This is a key seat because in addition to the official Silly candidate there is an independent Very Silly candidate who may split the silly vote.",
29
+ "Well, I've just heard from Luton that my auntie's ill, er, possibly, possibly gastro-enteritis.",
30
+ "Can I just add at this point that this is in fact the second time I've ever been on television?",
31
+ "Well it's a straight fight here at Leicester...On the left of the Returning Officer (camera shoes grey-suited man) you can see Arthur Smith, the Sensible candidate and his agent, (camera pans to silly people) and on the other side is the silly candidate Jethro Walrustitty with his agent and his wife.",
32
+ "I don't want to talk to you no more, you empty-headed animal food trough wiper! I fart in your general direction! Your mother was a hamster and your father smelt of elderberries!.",
33
+ "Listen, strange women lyin' in ponds distributin' swords is no basis for a system of government. Supreme executive power derives from a mandate from the masses, not from some farcical aquatic ceremony.",
34
+ "Good morning. I'm sorry to have kept you waiting, but I'm afraid my walk has become rather sillier recently, and so it takes me rather longer to get to work.",
35
+ "The very real problem is one of money. I'm afraid that the Ministry of Silly Walks is no longer getting the kind of support it needs. You see there's Defense, Social Security, Health, Housing, Education, Silly Walks ... they're all supposed to get the same. But last year, the Government spent less on the Ministry of Silly Walks than it did on National Defence. Now we get £348,000,000 a year, which is supposed to be spent on all our available products.",
36
+ " Now the Japanese have a man who can bend his leg back over his head and back again with every single step. While the Israelis... ah, here's the coffee."
37
+ ]
38
+
39
+ @@silly = [
40
+ "Malcom Peter Brian Telescope Adrian Umbrella Stand Jasper Wednesday *pops mouth twice* Stoatgobbler John Raw Vegetable *sound effect of horse whinnying* Arthur Norman Micheal *blows squeker* Featherstone Smith *blows whistle* Northgot Edwards Harris *fires pistol which goes 'whoop'* Mason *chuff-chuff-chuff* Frampton Jones Fruitbat Gilbert *sings 'We'll keep a welcome in the'* *three shots* Williams If I Could Walk That Way Jenkin *squeker* Tiger-draws Pratt Thompson *sings 'Raindrops Keep Falling On My Head'* Darcy Carter *horn* Pussycat *sings 'Don't Sleep In The Subway'* Barton Mannering *hoot 'whoop'* Smith."]
41
+
42
+ @@quotes = [].concat(@@paragraph_headers).concat(@@paragraph_pieces).concat(@@silly)
43
+
18
44
  def self.ipsum
19
45
  @@quotes.shuffle.first
20
46
  end
47
+
48
+ def self.header
49
+ @@paragraph_headers.shuffle.first
50
+ end
51
+
52
+ def self.paragraph(args)
53
+ if args[:count] and args[:count].is_a? Integer
54
+ if args[:count].zero?
55
+ "Sure, let's pass a zero as argument. I bet it'll explode."
56
+ else
57
+ @@paragraph_pieces.shuffle.take(args[:count]).join " "
58
+ end
59
+ else
60
+ @@paragraph_pieces.shuffle.first
61
+ end
62
+ end
21
63
  end
@@ -1,3 +1,3 @@
1
1
  module MontyIpsum
2
- VERSION = "1.0.0"
2
+ VERSION = "1.2.0"
3
3
  end
@@ -20,4 +20,5 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_development_dependency "bundler", "~> 1.6"
22
22
  spec.add_development_dependency "rake", '~> 0'
23
+ spec.add_development_dependency "rspec", '~> 0'
23
24
  end
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ describe MontyIpsum do
4
+ subject { MontyIpsum }
5
+ describe '#paragraph' do
6
+ let(:input) { {count: 0} }
7
+ let(:output) { subject.paragraph(input) }
8
+
9
+ it 'should return message if count argument is 0' do
10
+ expect(output).to eq "Sure, let's pass a zero as argument. I bet it'll explode."
11
+ end
12
+ end
13
+
14
+ describe '#header' do
15
+ let(:input) {}
16
+ let(:output) { subject.header }
17
+
18
+ it 'should return less than 70 characters' do
19
+ expect(output.length).to be <= 70
20
+ end
21
+ end
22
+ end
@@ -0,0 +1 @@
1
+ require 'monty_ipsum'
@@ -0,0 +1,3 @@
1
+ require 'rspec/core/rake_task'
2
+
3
+ RSpec::Core::RakeTask.new(:spec)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: monty_ipsum
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Gonzalez M.
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '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'
41
55
  description: I'm afraid that the Ministry of Lorem Ipsum is no longer getting the
42
56
  kind of support it needs. You see there's Regular Lorem Ipsum, Samuel L Ipsum, and
43
57
  then there's Monty Ipsum...they're all supposed to get the same.
@@ -55,6 +69,9 @@ files:
55
69
  - lib/monty_ipsum.rb
56
70
  - lib/monty_ipsum/version.rb
57
71
  - monty_ipsum.gemspec
72
+ - spec/monty_ipsum_spec.rb
73
+ - spec/spec_helper.rb
74
+ - tasks/rspec.rake
58
75
  homepage: ''
59
76
  licenses:
60
77
  - MIT
@@ -79,5 +96,7 @@ rubygems_version: 2.2.2
79
96
  signing_key:
80
97
  specification_version: 4
81
98
  summary: Who threw the Lorem? Who threw the Lorem, tell me this instant!
82
- test_files: []
99
+ test_files:
100
+ - spec/monty_ipsum_spec.rb
101
+ - spec/spec_helper.rb
83
102
  has_rdoc: