madweblibs 0.0.1

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/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in madweblibs.gemspec
4
+ gemspec
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/lib/madweblibs.rb ADDED
@@ -0,0 +1,18 @@
1
+ require_relative "madweblibs/version"
2
+ require_relative "madweblibs/generator.rb"
3
+
4
+ module Madweblibs
5
+ class << self
6
+ DEFAULT_ADJECTIVES_COUNT = 3
7
+ DEFAULT_ADVERB_PROBABILITY = 0.20
8
+
9
+ def generate
10
+ generator = Generator.new(adjective_count = DEFAULT_ADJECTIVES_COUNT,
11
+ adverb_probability = DEFAULT_ADVERB_PROBABILITY)
12
+ puts generator.generate
13
+ end
14
+ end
15
+ end
16
+
17
+ #testing
18
+ Madweblibs.generate
@@ -0,0 +1,196 @@
1
+ require 'linguistics'
2
+ Linguistics::use( :en )
3
+
4
+ module Madweblibs
5
+ class Generator
6
+
7
+ def initialize(adjective_count, adverb_probability)
8
+ @adjective_count = adjective_count
9
+ @adverb_probability = adverb_probability
10
+ end
11
+
12
+ def generate
13
+ get_random_components
14
+ shortname = generate_shortname
15
+ description = generate_description
16
+ "#{shortname}: #{description}"
17
+ end
18
+ def get_random_components
19
+ @adjectives = ADJECTIVES.sample(@adjective_count).map do |adjective|
20
+ rand < @adverb_probability ? "#{ADVERBS.sample}-#{adjective}" : adjective
21
+ end
22
+ @database = DATABASES.sample
23
+ @noun1 = NOUNS1.sample
24
+ @noun2 = NOUNS2.sample
25
+ @platform = PLATFORMS.keys.sample
26
+ end
27
+ def shortname_component(string)
28
+ component = if PLATFORMS.key? string.to_sym
29
+ PLATFORMS[string.to_sym]
30
+ else
31
+ string[0..2]
32
+ end
33
+ component.capitalize
34
+ end
35
+ def generate_shortname
36
+ [@database, @platform, @noun1].map do |string|
37
+ shortname_component string
38
+ end.join("") + shortname_suffix
39
+ end
40
+ def shortname_suffix
41
+ %w{
42
+ _fu
43
+ gasm
44
+ ie
45
+ ify
46
+ ist
47
+ ize
48
+ tastic
49
+ ly
50
+ }.sample
51
+ end
52
+ def generate_description
53
+ article = %w{a the}.sample
54
+ desc = "#{adjective_clause} #{storage_clause} #{noun_clause}#{as_a_service_clause} #{platform_clause}."
55
+ if article == 'a'
56
+ first_adjective = desc.split(',').first
57
+ desc.sub!(first_adjective, first_adjective.en.a)
58
+ else
59
+ desc = "#{article} #{desc}"
60
+ end
61
+ desc
62
+ end
63
+ def adjective_clause
64
+ @adjectives.join(', ')
65
+ end
66
+ def storage_clause
67
+ "#{@database}-backed"
68
+ end
69
+ def noun_clause
70
+ "#{@noun1} #{@noun2}"
71
+ end
72
+ def as_a_service_clause
73
+ ["-as-a-service", "", "", ""].sample
74
+ end
75
+ def platform_clause
76
+ "for #{@platform}"
77
+ end
78
+ ADVERBS = %w{
79
+ awesomely
80
+ fully
81
+ highly
82
+ incredibly
83
+ readily
84
+ semantically
85
+ syntactically
86
+ wonderfully
87
+ }
88
+ ADJECTIVES = %w{
89
+ accessible
90
+ asynchronous
91
+ awesome
92
+ beautiful
93
+ consistent
94
+ customizable
95
+ dead-simple
96
+ distributed
97
+ DRY
98
+ durable
99
+ dynamic
100
+ eager-loading
101
+ encrypted
102
+ flexible
103
+ free-as-in-beer
104
+ free-as-in-speech
105
+ full-stack
106
+ functional
107
+ highly-optimized
108
+ lazy-loading
109
+ little
110
+ localized
111
+ modular
112
+ object-oriented
113
+ parallel
114
+ scalable
115
+ schemaless
116
+ semantic
117
+ social
118
+ static
119
+ test-driven
120
+ turing-complete
121
+ type-safe
122
+ unfancy
123
+ web-scale
124
+ }
125
+ DATABASES = %w{
126
+ bigtable
127
+ cassandra
128
+ cloud
129
+ couch-db
130
+ memory
131
+ mongo
132
+ postgres
133
+ redis
134
+ yaml
135
+ }
136
+ NOUNS1 = [
137
+ 'canvas',
138
+ 'css',
139
+ 'fibers',
140
+ 'factories',
141
+ 'fixtures',
142
+ 'HTML5',
143
+ 'javascript',
144
+ 'key-value store',
145
+ 'message queue',
146
+ 'web-socket',
147
+ 'web font'
148
+ ]
149
+ NOUNS2 = [
150
+ 'adapter',
151
+ 'client',
152
+ 'cms',
153
+ 'crm',
154
+ 'dsl',
155
+ 'extension',
156
+ 'framework',
157
+ 'generator',
158
+ 'interface',
159
+ 'middleware',
160
+ 'orm',
161
+ 'parser',
162
+ 'plugin',
163
+ 'pre-compiler',
164
+ 'replacement',
165
+ 'state machine',
166
+ 'toolkit',
167
+ 'wrapper'
168
+ ]
169
+ PLATFORMS = {
170
+ ActiveRecord: 'active',
171
+ capistrano: 'cap',
172
+ clojure: 'cloj',
173
+ Django: 'jang',
174
+ emacs: 'macs',
175
+ Erlang: 'erl',
176
+ gopher: 'goph',
177
+ groovy: 'groo',
178
+ hadoop: 'doop',
179
+ haskell: 'hask',
180
+ javascript: 'java',
181
+ json: 'jas',
182
+ lua: 'lu',
183
+ NodeJs: 'node',
184
+ python: 'py',
185
+ rails: 'rail',
186
+ ruby: 'ru',
187
+ rvm: 'rev',
188
+ sass: 'sassy',
189
+ scala: 'scal',
190
+ sinatra: 'sin',
191
+ TextMate2: 'mate',
192
+ vim: 'vim'
193
+ }
194
+ end
195
+ end
196
+
@@ -0,0 +1,3 @@
1
+ module Madweblibs
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "madweblibs/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "madweblibs"
7
+ s.version = Madweblibs::VERSION
8
+ s.authors = ["Ian Anderson"]
9
+ s.email = ["anderson.ian.c@gmail.com"]
10
+ s.homepage = ""
11
+ s.summary = %q{Generates 1 million dollar ideas for web libraries.}
12
+ s.description = %q{Because the world needs more buzzwords.}
13
+
14
+ s.rubyforge_project = "madweblibs"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ # specify any dependencies here; for example:
22
+ # s.add_development_dependency "rspec"
23
+ s.add_runtime_dependency "linguistics", "~> 1.0.9"
24
+ end
metadata ADDED
@@ -0,0 +1,63 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: madweblibs
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Ian Anderson
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-12-07 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: linguistics
16
+ requirement: &2152788660 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 1.0.9
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *2152788660
25
+ description: Because the world needs more buzzwords.
26
+ email:
27
+ - anderson.ian.c@gmail.com
28
+ executables: []
29
+ extensions: []
30
+ extra_rdoc_files: []
31
+ files:
32
+ - .gitignore
33
+ - Gemfile
34
+ - Rakefile
35
+ - lib/madweblibs.rb
36
+ - lib/madweblibs/generator.rb
37
+ - lib/madweblibs/version.rb
38
+ - madweblibs.gemspec
39
+ homepage: ''
40
+ licenses: []
41
+ post_install_message:
42
+ rdoc_options: []
43
+ require_paths:
44
+ - lib
45
+ required_ruby_version: !ruby/object:Gem::Requirement
46
+ none: false
47
+ requirements:
48
+ - - ! '>='
49
+ - !ruby/object:Gem::Version
50
+ version: '0'
51
+ required_rubygems_version: !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ! '>='
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ requirements: []
58
+ rubyforge_project: madweblibs
59
+ rubygems_version: 1.8.10
60
+ signing_key:
61
+ specification_version: 3
62
+ summary: Generates 1 million dollar ideas for web libraries.
63
+ test_files: []