rfortune 0.2.2 → 0.2.3
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 +6 -1
- data/lib/rfortune.rb +10 -10
- metadata +2 -2
data/CHANGELOG.rdoc
CHANGED
data/lib/rfortune.rb
CHANGED
@@ -114,9 +114,8 @@ class RFortune
|
|
114
114
|
|
115
115
|
end
|
116
116
|
|
117
|
-
|
118
117
|
# Returns all cookies in cookie jar file format
|
119
|
-
def
|
118
|
+
def formatted
|
120
119
|
|
121
120
|
cookies = @cookies.collect { |c| c = "\n%\n" + c }
|
122
121
|
|
@@ -126,13 +125,13 @@ class RFortune
|
|
126
125
|
|
127
126
|
end
|
128
127
|
|
129
|
-
|
130
|
-
#
|
131
|
-
|
132
|
-
|
128
|
+
# Depricated. I take the fact that nobody told me, the method name is
|
129
|
+
# spelled wrong as permission to drop it in a near future.
|
130
|
+
# Actually I just left it for this message.
|
131
|
+
def formated
|
132
|
+
formatted
|
133
133
|
end
|
134
134
|
|
135
|
-
|
136
135
|
# Saves the content of the jar to the file specified by argument given
|
137
136
|
# to itself or to the initialize method
|
138
137
|
def save new_file_path = nil
|
@@ -142,7 +141,7 @@ class RFortune
|
|
142
141
|
new_file_path or new_file_path = @file_path or raise 'No file name given'
|
143
142
|
|
144
143
|
# Write all cookies in cookie jar format to the file specified
|
145
|
-
File.open( new_file_path, 'w') { |jar| jar.puts
|
144
|
+
File.open( new_file_path, 'w') { |jar| jar.puts formatted }
|
146
145
|
|
147
146
|
end
|
148
147
|
|
@@ -156,8 +155,9 @@ class RFortune
|
|
156
155
|
# Returns a random fortune from fortune's fortunes. If a block is
|
157
156
|
# given it passes one fortune per iteration to the block. Infinite.
|
158
157
|
# That means FOREVER! So be careful!
|
159
|
-
#
|
160
|
-
#
|
158
|
+
#
|
159
|
+
# Possible options:
|
160
|
+
# :offensive includes offensive fortunes, defaults to false
|
161
161
|
def self.random_fortune( options = {} )
|
162
162
|
|
163
163
|
options.class != Hash and raise TypeError, 'Can\'t convert ' + options.class.to_s + ' to Hash'
|
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.3
|
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: 2010-01-
|
12
|
+
date: 2010-01-14 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|