boston_ipsum 1.0.1 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6cbd5da62e1178670056baa2a62b1dc748320422
4
- data.tar.gz: 3d9f445901083bc06af3752129155dc45f87fa66
3
+ metadata.gz: 2220635b312be6647623878039fe1075de610b8c
4
+ data.tar.gz: 290bf86ccdd832ef6217f499fa1a75ab1bae6a48
5
5
  SHA512:
6
- metadata.gz: 6201d3d46a79749b6069eeba640cf1da347c524e72f888f9103e689c8944da77500374c8b31dff6099c3cd5b05d8b3eb18373d6b8440d3d8f53426049baff913
7
- data.tar.gz: a69369be8ffbf00dabd3e6e5101f440f46f48ed2050a32a27791f79ba29694756da40f7c2532c5f288f34bade1b98967c33837f17a641633db50e62deedf39ec
6
+ metadata.gz: be18ead5b2a6a38aacf1a2e9892f55a1ebc2698c94b6ccdcca447371f20c2fee770397e182023c882cf6f9894b574941eae5ee6da4209e9d0ce62d53e31d31f3
7
+ data.tar.gz: 297cbb828bb8f2c34b0cddbfc7583f6f73a8686d9c2821c616ec3ab9e5c7223ab9225ee065d70d6a3663bde56289546171e638bf5d38dfeef969f2cef64c6843
data/README.md CHANGED
@@ -1,8 +1,11 @@
1
1
  # BostonIpsum
2
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/boston_ipsum`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ This gem uses Boston Words to provide Lorem Ipsum like filler text for pages, such as show.html.erb
4
+ You simple install the gem, bundle, and call <%= BostonIpsum.speak(integer) %> in any view. The integer number allows you to return a randomized yet specific number of words.
4
5
 
5
- TODO: Delete this and the text above, and describe your gem
6
+ For example, <%= BostonIpsum.speak(2) %> could output "Patriots Somerville"
7
+
8
+ <%= BostonIpsum.speak(4) %> could output "Martha's Vineyard Eastie Southie MBTA"
6
9
 
7
10
  ## Installation
8
11
 
@@ -22,6 +25,10 @@ Or install it yourself as:
22
25
 
23
26
  ## Usage
24
27
 
28
+ ```ruby
29
+ <%= BostonIpsum.speak(5) %>
30
+ ```
31
+
25
32
  TODO: Write usage instructions here
26
33
 
27
34
  ## Development
Binary file
@@ -1,3 +1,3 @@
1
1
  module BostonIpsum
2
- VERSION = "1.0.1"
2
+ VERSION = "1.5.0"
3
3
  end
data/lib/boston_ipsum.rb CHANGED
@@ -3,13 +3,17 @@ require "boston_ipsum/version"
3
3
  module BostonIpsum
4
4
 
5
5
  def self.speak(integer)
6
- array = ["MGH", "Brady", "Cambridge", "Beantown", "Sox", "Patriots", "MIT", "Harvard", "Beacon Hill", "Dorchester", "Roxbury",
7
- "Brahmin", "The Cape", "Martha's Vineyard", "Eastie", "Southie", "The North End", "Somerville", "MBTA"]
8
- if integer > (array.count - 1)
9
- array.join(" ")
6
+ if integer.is_a? Integer && integer > 0
7
+ array = ["MGH", "Brady", "Cambridge", "Beantown", "Sox", "Patriots", "MIT", "Harvard", "Beacon Hill", "Dorchester", "Roxbury",
8
+ "Brahmin", "The Cape", "Martha's Vineyard", "Eastie", "Southie", "The North End", "Somerville", "MBTA", "JesseWaites.com"]
9
+ if integer > (array.count - 1)
10
+ array.join(" ")
11
+ else
12
+ string = array[0..(integer - 1)].shuffle.join(" ")
13
+ end
10
14
  else
11
- string = array[0..(integer - 1)].shuffle.join(" ")
12
- end
15
+ "Try entering an integer greater than zero."
16
+ end
13
17
  end
14
18
 
15
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boston_ipsum
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesse Waites
@@ -52,6 +52,7 @@ files:
52
52
  - Rakefile
53
53
  - bin/console
54
54
  - bin/setup
55
+ - boston_ipsum-1.0.1.gem
55
56
  - boston_ipsum.gemspec
56
57
  - lib/boston_ipsum.rb
57
58
  - lib/boston_ipsum/version.rb