word-tokens 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ pkg/*
2
+ *.gem
3
+ .bundle
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in word-tokens.gemspec
4
+ gemspec
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,11 @@
1
+ class WordTokens
2
+ def self.token(num = 3, delimiter = "-", filter = [], path = "/usr/share/dict/words")
3
+ word_list = File.read(path).split
4
+ filter.each {|f| word_list.delete(f) }
5
+ list_size = word_list.length
6
+
7
+ output = word_list[rand(list_size)]
8
+ (num - 1).times { output << "#{delimiter}#{word_list[rand(list_size)]}" }
9
+ output.downcase
10
+ end
11
+ end
@@ -0,0 +1,3 @@
1
+ class WordTokens
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,19 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "word-tokens/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "word-tokens"
7
+ s.version = WordTokens::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Jamie Murai"]
10
+ s.email = ["murai.jamie@gmail.com"]
11
+ s.homepage = "http://rubygems.org/gems/word-tokens"
12
+ s.description = %q{Generates tokens consisting of readable words from your system dictionary}
13
+ s.summary = s.description
14
+
15
+ s.files = `git ls-files`.split("\n")
16
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
17
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
+ s.require_paths = ["lib"]
19
+ end
metadata ADDED
@@ -0,0 +1,70 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: word-tokens
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 1
9
+ version: 0.0.1
10
+ platform: ruby
11
+ authors:
12
+ - Jamie Murai
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2011-01-06 00:00:00 -05:00
18
+ default_executable:
19
+ dependencies: []
20
+
21
+ description: Generates tokens consisting of readable words from your system dictionary
22
+ email:
23
+ - murai.jamie@gmail.com
24
+ executables: []
25
+
26
+ extensions: []
27
+
28
+ extra_rdoc_files: []
29
+
30
+ files:
31
+ - .gitignore
32
+ - Gemfile
33
+ - Rakefile
34
+ - lib/word-tokens.rb
35
+ - lib/word-tokens/version.rb
36
+ - word-tokens.gemspec
37
+ has_rdoc: true
38
+ homepage: http://rubygems.org/gems/word-tokens
39
+ licenses: []
40
+
41
+ post_install_message:
42
+ rdoc_options: []
43
+
44
+ require_paths:
45
+ - lib
46
+ required_ruby_version: !ruby/object:Gem::Requirement
47
+ none: false
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ segments:
52
+ - 0
53
+ version: "0"
54
+ required_rubygems_version: !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ segments:
60
+ - 0
61
+ version: "0"
62
+ requirements: []
63
+
64
+ rubyforge_project:
65
+ rubygems_version: 1.3.7
66
+ signing_key:
67
+ specification_version: 3
68
+ summary: Generates tokens consisting of readable words from your system dictionary
69
+ test_files: []
70
+