xkcd_sfw_generator 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,23 @@
1
+ require "xkcd_sfw_generator/version"
2
+
3
+ module XkcdSfwGenerator
4
+
5
+ def generate(word_count,seed=nil)
6
+ randomizer = seed.nil? ? Random.new : Random.new(seed)
7
+ Generator.new(randomizer).generate(word_count)
8
+ end
9
+ extend self
10
+
11
+ class Generator
12
+ attr_reader :randomizer, :dictionary
13
+
14
+ def initialize(randomizer=Random.new)
15
+ @randomizer = randomizer
16
+ @dictionary = File.read(File.join(File.dirname(__FILE__), 'data', 'words.txt')).split
17
+ end
18
+
19
+ def generate(word_count)
20
+ dictionary.sample(word_count, :random => randomizer).join('')
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,3 @@
1
+ module XkcdSfwGenerator
2
+ VERSION = "0.0.3"
3
+ end
metadata ADDED
@@ -0,0 +1,90 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: xkcd_sfw_generator
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ platform: ruby
6
+ authors:
7
+ - Ethan Garofolo
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-12-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: An XKCD-inspired phrase generator.
56
+ email:
57
+ - ethan@bigohstudios.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - lib/xkcd_sfw_generator.rb
63
+ - lib/xkcd_sfw_generator/version.rb
64
+ - lib/data/words.txt
65
+ homepage: https://github.com/bigohstudios/xkcd-sfw-generator
66
+ licenses:
67
+ - MIT
68
+ metadata: {}
69
+ post_install_message:
70
+ rdoc_options: []
71
+ require_paths:
72
+ - lib
73
+ required_ruby_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ required_rubygems_version: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ! '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ requirements: []
84
+ rubyforge_project:
85
+ rubygems_version: 2.0.7
86
+ signing_key:
87
+ specification_version: 4
88
+ summary: There are number of these, but the let's just say that the wordlists include
89
+ some possibilities you probably don't want to send to your customers.
90
+ test_files: []