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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Y2Q1YzQ1YmQ5ZTBlODNjZjYyYTdhMTJkMzZkOGFmYTk5YmNlNmMzYw==
4
+ NzU0OWY3NDg4OWY0ZTA1MGUzZGU5NDllZWY5NWExOTIyNGVkN2E2ZA==
5
5
  data.tar.gz: !binary |-
6
- M2JkMDVkZDE4YzZmMDBkYzQ3ODU3ODkxNzUzNjM0MTkyZDMwNjY5ZQ==
6
+ NmJhZWMxYzUzNjdkY2EzYWRhOTQxMTBjMTE3NjRmYTQ5N2JlYmQ3Nw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YTBkZjk1ODk4MzNlYzRlMjdkODE1ODU0Mzk1ZDM4MTU3MzEzOTBlZTA0ZmNm
10
- YWJjNTZmOGVlMDJiNzVjZGJlZTIzMDRlNzhlMDQ2MDBlOWE3MDMzOWZiNDhk
11
- MDZhYTNiNDkzMDU1ZjIwNTQyZmFlZTgwYjhjNDE1YjU0OTRlMGI=
9
+ YmQxZDUzOTViNGFmNjY0NTIyODlkZDc5YjU3OTU0ZmY1YmMwOGRjYTlmNmYy
10
+ MTE4MjA1MGU5OGY4Njc3YzhiMmI3MTM4MjgyOWFmNzgzNDYwN2I4YTE1M2M2
11
+ ZjcwYTUyYTI4OTNkMTU0Y2I4NjQ4MzJkMzY2NWNjYTM3MGViYzI=
12
12
  data.tar.gz: !binary |-
13
- M2Y4NjQ5OTlhZDExM2I2MmI4YjdmYWIyODZlODIwMzQ3MWFkYmNjY2ZjYTA0
14
- ZWJmMDI5YTY2OTU5ZTY0ZmNiNzIyOTUxM2JkMDQ0ZjBjNDExZTMwZDc0YTlm
15
- MThkMzU4NWRkN2M0Mzc3ZWJiMDU4ZTJmYWRjYzJjZTAzY2I0MzY=
13
+ ZmI5ZGYzMTNmZTY4MjAwOGNiMjRjYzAwNjMyZWIyZjlkODY4MzA0ODU2ZmZh
14
+ MzE5Mzg0NjI4MDljNWU1ZDJkODJlM2FlYzczOWQxZWY2NTljYTdmNGYzODI5
15
+ NjNhYTMyYzU0OTFkOWQwOTM1YWVhNzA5ODY3MzNhYzY2YTRlZDM=
@@ -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).join('')
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
@@ -1,3 +1,3 @@
1
1
  module XkcdSfwGenerator
2
- VERSION = "0.0.3"
2
+ VERSION = "0.1.0"
3
3
  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.3
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: 2013-12-21 00:00:00.000000000 Z
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/xkcd-sfw-generator
65
+ homepage: https://github.com/bigohstudios/xkcd_sfw_generator
66
66
  licenses:
67
67
  - MIT
68
68
  metadata: {}