xkcd_sfw_generator 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/xkcd_sfw_generator.rb +7 -4
- data/lib/xkcd_sfw_generator/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NzU0OWY3NDg4OWY0ZTA1MGUzZGU5NDllZWY5NWExOTIyNGVkN2E2ZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NmJhZWMxYzUzNjdkY2EzYWRhOTQxMTBjMTE3NjRmYTQ5N2JlYmQ3Nw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YmQxZDUzOTViNGFmNjY0NTIyODlkZDc5YjU3OTU0ZmY1YmMwOGRjYTlmNmYy
|
10
|
+
MTE4MjA1MGU5OGY4Njc3YzhiMmI3MTM4MjgyOWFmNzgzNDYwN2I4YTE1M2M2
|
11
|
+
ZjcwYTUyYTI4OTNkMTU0Y2I4NjQ4MzJkMzY2NWNjYTM3MGViYzI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZmI5ZGYzMTNmZTY4MjAwOGNiMjRjYzAwNjMyZWIyZjlkODY4MzA0ODU2ZmZh
|
14
|
+
MzE5Mzg0NjI4MDljNWU1ZDJkODJlM2FlYzczOWQxZWY2NTljYTdmNGYzODI5
|
15
|
+
NjNhYTMyYzU0OTFkOWQwOTM1YWVhNzA5ODY3MzNhYzY2YTRlZDM=
|
data/lib/xkcd_sfw_generator.rb
CHANGED
@@ -2,9 +2,9 @@ require "xkcd_sfw_generator/version"
|
|
2
2
|
|
3
3
|
module XkcdSfwGenerator
|
4
4
|
|
5
|
-
def generate(word_count,seed=nil)
|
5
|
+
def generate(word_count,seed=nil,capitalize=false)
|
6
6
|
randomizer = seed.nil? ? Random.new : Random.new(seed)
|
7
|
-
Generator.new(randomizer).generate(word_count)
|
7
|
+
Generator.new(randomizer).generate(word_count,capitalize)
|
8
8
|
end
|
9
9
|
extend self
|
10
10
|
|
@@ -16,8 +16,11 @@ module XkcdSfwGenerator
|
|
16
16
|
@dictionary = File.read(File.join(File.dirname(__FILE__), 'data', 'words.txt')).split
|
17
17
|
end
|
18
18
|
|
19
|
-
def generate(word_count)
|
20
|
-
dictionary.sample(word_count, :random => randomizer)
|
19
|
+
def generate(word_count,capitalize=false)
|
20
|
+
words = dictionary.sample(word_count, :random => randomizer)
|
21
|
+
words.each{|w| w.capitalize!} if capitalize
|
22
|
+
|
23
|
+
words.join('')
|
21
24
|
end
|
22
25
|
end
|
23
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xkcd_sfw_generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ethan Garofolo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -62,7 +62,7 @@ files:
|
|
62
62
|
- lib/xkcd_sfw_generator.rb
|
63
63
|
- lib/xkcd_sfw_generator/version.rb
|
64
64
|
- lib/data/words.txt
|
65
|
-
homepage: https://github.com/bigohstudios/
|
65
|
+
homepage: https://github.com/bigohstudios/xkcd_sfw_generator
|
66
66
|
licenses:
|
67
67
|
- MIT
|
68
68
|
metadata: {}
|