rfortune 0.2.1 → 0.2.2
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.
- data/CHANGELOG.rdoc +4 -0
- data/VERSION +1 -1
- data/lib/rfortune.rb +4 -2
- data/test/test_rfortune.rb +1 -1
- metadata +2 -2
data/CHANGELOG.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1
|
1
|
+
0.2.1
|
data/lib/rfortune.rb
CHANGED
@@ -158,7 +158,9 @@ class RFortune
|
|
158
158
|
# That means FOREVER! So be careful!
|
159
159
|
# Takes 'false' as an argument if you'd like to include offensive
|
160
160
|
# fortunes.
|
161
|
-
def self.random_fortune(
|
161
|
+
def self.random_fortune( options = {} )
|
162
|
+
|
163
|
+
options.class != Hash and raise TypeError, 'Can\'t convert ' + options.class.to_s + ' to Hash'
|
162
164
|
|
163
165
|
cookie_jars = []
|
164
166
|
|
@@ -168,7 +170,7 @@ class RFortune
|
|
168
170
|
|
169
171
|
}
|
170
172
|
|
171
|
-
unless
|
173
|
+
unless options[:offensive]
|
172
174
|
|
173
175
|
Dir.foreach( FORTUNES_PATH + 'off/' ) { |filename|
|
174
176
|
|
data/test/test_rfortune.rb
CHANGED
@@ -90,7 +90,7 @@ class RFortuneTest < Test::Unit::TestCase
|
|
90
90
|
assert_equal String, RFortune.random_fortune.class, 'Try to get a random fortune from fortune\'s fortunes'
|
91
91
|
|
92
92
|
# Include offensive fortunes
|
93
|
-
assert_equal String, RFortune.random_fortune(
|
93
|
+
assert_equal String, RFortune.random_fortune( :offensive => true ).class, 'Try to get a random fortune from fortune\'s fortunes'
|
94
94
|
|
95
95
|
# From block
|
96
96
|
i = 0
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rfortune
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Helge Rausch
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2010-01-12 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|