imposter 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/.document ADDED
@@ -0,0 +1,10 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ <<<<<<< HEAD:.document
4
+ lib/imposter/*.rb
5
+ lib/imposter/*.db
6
+ =======
7
+ >>>>>>> b1541b59303844fd485497f5bc41b507a2df846d:.document
8
+ bin/*
9
+ features/**/*.feature
10
+ LICENSE
data/.gitignore ADDED
@@ -0,0 +1,21 @@
1
+ ## MAC OS
2
+ .DS_Store
3
+
4
+ ## TEXTMATE
5
+ *.tmproj
6
+ tmtags
7
+
8
+ ## EMACS
9
+ *~
10
+ \#*
11
+ .\#*
12
+
13
+ ## VIM
14
+ *.swp
15
+
16
+ ## PROJECT::GENERAL
17
+ coverage
18
+ rdoc
19
+ pkg
20
+
21
+ ## PROJECT::SPECIFIC
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Robert Hall
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,17 @@
1
+ = imposter
2
+
3
+ Description goes here.
4
+
5
+ == Note on Patches/Pull Requests
6
+
7
+ * Fork the project.
8
+ * Make your feature addition or bug fix.
9
+ * Add tests for it. This is important so I don't break it in a
10
+ future version unintentionally.
11
+ * Commit, do not mess with rakefile, version, or history.
12
+ (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
13
+ * Send me a pull request. Bonus points for topic branches.
14
+
15
+ == Copyright
16
+
17
+ Copyright (c) 2009 Robert Hall. See LICENSE for details.
data/Rakefile ADDED
@@ -0,0 +1,63 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "imposter"
8
+ gem.summary = "Real fake data"
9
+ gem.description = "Create rails based schema level fake data."
10
+ gem.email = "robert.hall@itatc.com"
11
+ gem.homepage = "http://imposter.itatc.com"
12
+ gem.authors = ["Robert Hall"]
13
+ gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
14
+ gem.add_dependency "sqlite3-ruby", ">= 1.2.5"
15
+ gem.add_dependency "faker", ">= 0"
16
+ gem.add_dependency "fastercsv", ">= 0"
17
+ gem.files.include %w(lib/imposter/*.rb lib/imposter/*.db generators/**/*.rb)
18
+ gem.summary = %Q{Real fake data}
19
+ gem.description = %Q{Add generator and rake tasks via YAML based imposters for schema level data faking}
20
+ gem.email = "robert.hall@itatc.com"
21
+ gem.homepage = "http://github.com/golsombe/imposter"
22
+ gem.authors = ["Robert Hall"]
23
+ gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
24
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
25
+ end
26
+ Jeweler::GemcutterTasks.new
27
+ rescue LoadError
28
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
29
+ end
30
+
31
+ require 'rake/testtask'
32
+ Rake::TestTask.new(:test) do |test|
33
+ test.libs << 'lib' << 'test'
34
+ test.pattern = 'test/**/test_*.rb'
35
+ test.verbose = true
36
+ end
37
+
38
+ begin
39
+ require 'rcov/rcovtask'
40
+ Rcov::RcovTask.new do |test|
41
+ test.libs << 'test'
42
+ test.pattern = 'test/**/test_*.rb'
43
+ test.verbose = true
44
+ end
45
+ rescue LoadError
46
+ task :rcov do
47
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
48
+ end
49
+ end
50
+
51
+ task :test => :check_dependencies
52
+
53
+ task :default => :test
54
+
55
+ require 'rake/rdoctask'
56
+ Rake::RDocTask.new do |rdoc|
57
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
58
+
59
+ rdoc.rdoc_dir = 'rdoc'
60
+ rdoc.title = "imposter #{version}"
61
+ rdoc.rdoc_files.include('README*')
62
+ rdoc.rdoc_files.include('lib/**/*.rb')
63
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.2
@@ -0,0 +1,86 @@
1
+ require 'rubygems'
2
+ require 'activerecord'
3
+ require 'pathname'
4
+ require 'activesupport'
5
+
6
+
7
+ class ImposterGenerator < Rails::Generator::Base
8
+ dbc = YAML.load(File.read('config/database.yml'))
9
+ conn = ActiveRecord::Base.establish_connection(dbc["development"])
10
+
11
+ def manifest
12
+ record do |m|
13
+ puts "Generating"
14
+ if not File.directory? "test/imposter"
15
+ Dir.mkdir("test/imposter")
16
+ end
17
+ case ARGV.length
18
+ when 1
19
+ genmodel(ARGV[0])
20
+ else
21
+ genmodels
22
+ end
23
+ end
24
+ end
25
+
26
+
27
+ def genmodel(model_name)
28
+ mn = Pathname.new(model_name).basename.to_s.chomp(File.extname(model_name))
29
+ require model_name
30
+ puts " " + mn
31
+ mh = Hash.new
32
+ ma = Hash.new
33
+ mf = Hash.new
34
+ eval(mn.camelcase).columns.each do |mod|
35
+ if mod.name.include? "_id" then
36
+ vl = "@" + mod.name.sub("_id","").pluralize + "[rand(@" + mod.name.sub('_id','').pluralize + ".length)][1]"
37
+ mh = {mod.name => vl}
38
+ ma.merge!(mh)
39
+ else
40
+ case mod.type.to_s.downcase
41
+ when 'string'
42
+ case (1 + rand(3))
43
+ when 1
44
+ vl = 'Imposter::Noun.multiple'
45
+ when 2
46
+ vl = 'Imposter::Animal.one'
47
+ when 3
48
+ vl = 'Imposter::Vegtable.multiple'
49
+ when 4
50
+ vl = 'Imposter::Mineral.one'
51
+ end
52
+ when 'text' then
53
+ vl = 'Faker::Lorem.sentence(3)'
54
+ when 'integer' then
55
+ vl = 'i.to_s'
56
+ when 'datetime' || 'date'
57
+ vl = 'Date.today.to_s'
58
+ when 'decimal' then
59
+ vl = 'rand(50).to_s + "." + (1000+rand(2000)).to_s'
60
+ else
61
+ puts "=-------=============> " + mod.type.to_s.downcase
62
+ end
63
+ if not mod.name.include? "_at" and :include_special
64
+ mh = {mod.name => vl}
65
+ ma.merge!(mh)
66
+ end
67
+ end
68
+ end
69
+ mf.merge!(mn => {"fields" => ma})
70
+ mf[mn].merge!({"quantity" => 10})
71
+ File.open("test/imposter/" + "%03d" % eval(mn.camelcase).reflections.count + "-" + mn + ".yml","w") do |out|
72
+ #+ Time.now.strftime("%Y%m%d%H%m%s") + "_" + mn + ".yaml","w") do |out|
73
+ YAML.dump(mf,out)
74
+ end
75
+ end
76
+
77
+ def genmodels
78
+
79
+ models_dir = Dir.glob("app/models/*.rb")
80
+ models_dir.each do |model_dir|
81
+ genmodel(model_dir)
82
+ end
83
+ end
84
+
85
+
86
+ end
data/id_rsa.pub ADDED
@@ -0,0 +1 @@
1
+ ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA07d+kNjinydoDakKuXJDArDGevujnc9/lOmY8Op/poBHJuCfJtxcnfF8T1MlV7CtwLmXxp2AtXiRHakyBB1GfjwUPvzbsfkZkxtg7rPukaYgfBJyaKRR9QDxiUKt7AU7FBcTYapuDnaqVIb3U9jhI7ryCyY1RCsJbR5cSjWsw74a0GnhcuO0Ex20RYkv8sUPvLeNsAJn4H+aY+OCwRW2HFgEv0ewAtmV0MxOAuBduxWgXszX/U6jQAEMjiqZcJoJnb7g6dxA3oV0UghsB1n4wy1UDWAe4IG21iIl7gq6U54xZGad5IgtnHmCMvweJkaM65cO9EeDevGmlKG1G1jTMw== robert.hall@itatc.com
data/imposter.gemspec ADDED
@@ -0,0 +1,80 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{imposter}
8
+ s.version = "0.1.2"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Robert Hall"]
12
+ s.date = %q{2009-12-09}
13
+ s.description = %q{Add generator and rake tasks via YAML based imposters for schema level data faking}
14
+ s.email = %q{robert.hall@itatc.com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ ".gitignore",
22
+ "LICENSE",
23
+ "README.rdoc",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "generators/imposter_generator.rb",
27
+ "id_rsa.pub",
28
+ "imposter.gemspec",
29
+ "lib/imposter.rb",
30
+ "lib/imposter/animal.rb",
31
+ "lib/imposter/csz.db",
32
+ "lib/imposter/csz.rb",
33
+ "lib/imposter/mineral.rb",
34
+ "lib/imposter/minerals_short.lst",
35
+ "lib/imposter/noun.rb",
36
+ "lib/imposter/noun.xx",
37
+ "lib/imposter/vegtable.rb",
38
+ "lib/imposter/verb.rb",
39
+ "lib/imposter/verb.xx",
40
+ "lib/imposter/version.rb",
41
+ "lib/tasks/databases.rake",
42
+ "test/helper.rb",
43
+ "test/test_imposter.rb"
44
+ ]
45
+ s.homepage = %q{http://github.com/golsombe/imposter}
46
+ s.rdoc_options = ["--charset=UTF-8"]
47
+ s.require_paths = ["lib"]
48
+ s.rubygems_version = %q{1.3.5}
49
+ s.summary = %q{Real fake data}
50
+ s.test_files = [
51
+ "test/test_imposter.rb",
52
+ "test/helper.rb"
53
+ ]
54
+
55
+ if s.respond_to? :specification_version then
56
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
57
+ s.specification_version = 3
58
+
59
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
60
+ s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
61
+ s.add_runtime_dependency(%q<sqlite3-ruby>, [">= 1.2.5"])
62
+ s.add_runtime_dependency(%q<faker>, [">= 0"])
63
+ s.add_runtime_dependency(%q<fastercsv>, [">= 0"])
64
+ s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
65
+ else
66
+ s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
67
+ s.add_dependency(%q<sqlite3-ruby>, [">= 1.2.5"])
68
+ s.add_dependency(%q<faker>, [">= 0"])
69
+ s.add_dependency(%q<fastercsv>, [">= 0"])
70
+ s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
71
+ end
72
+ else
73
+ s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
74
+ s.add_dependency(%q<sqlite3-ruby>, [">= 1.2.5"])
75
+ s.add_dependency(%q<faker>, [">= 0"])
76
+ s.add_dependency(%q<fastercsv>, [">= 0"])
77
+ s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
78
+ end
79
+ end
80
+
data/lib/imposter.rb ADDED
@@ -0,0 +1,80 @@
1
+ require 'rubygems'
2
+ require 'faker'
3
+ require 'fastercsv'
4
+ require 'pathname'
5
+ require 'date'
6
+ require 'activesupport'
7
+
8
+ require 'imposter/noun'
9
+ require 'imposter/verb'
10
+ require 'imposter/animal'
11
+ require 'imposter/vegtable'
12
+ require 'imposter/mineral'
13
+ #require 'imposter/csv'
14
+
15
+ module Imposter
16
+
17
+ def self.gencsv(filename,cnt,fields,values)
18
+ puts " #{filename.sub(/.csv/,'')}..."
19
+ vl = values
20
+ l = Array.new
21
+ m = Array.new(cnt,0)
22
+ FasterCSV.open(filename,"w") do |csv|
23
+ csv << fields
24
+ #begin
25
+ (1..cnt).each do |i|
26
+ vl.each do |v|
27
+ begin
28
+ l << eval(v)
29
+ rescue
30
+ puts "Error evaluating " + v.to_s + " in " + filename
31
+ end
32
+ end
33
+ m[i,0] = l
34
+ csv << l
35
+ l.clear
36
+ end
37
+ #rescue
38
+ # puts "Some format/data error in " + filename
39
+ #end
40
+ end
41
+ return m
42
+ end
43
+
44
+ def self.getfixtures
45
+ fixtures_dir = Dir.glob("test/fixtures/*.csv")
46
+ #Loading existing CSV structures
47
+ fixtures_dir.each do |fixture_csv|
48
+ fn = Pathname.new(fixture_csv).basename.to_s.chomp(File.extname(fixture_csv))
49
+ eval("@" + fn + "= FasterCSV.open(fixture_csv,'r').to_a")
50
+ end
51
+ end
52
+
53
+ def self.parseyaml(yamlfilename)
54
+ imp_yaml = YAML.load(File.read(yamlfilename))
55
+ #mn = Pathname.new(yamlfilename).basename.to_s.chomp(File.extname(yamlfilename))
56
+ mn = imp_yaml.first[0]
57
+ imp_values = imp_yaml[mn]["fields"].values
58
+ imp_fields = imp_yaml[mn]["fields"].keys
59
+ imp_qty = imp_yaml[mn]["quantity"]
60
+ #load existing csv as array assigned to @[csv] variable
61
+ #process yaml to csv
62
+ rl = gencsv("test/fixtures/" + mn.pluralize + ".csv",imp_qty,imp_fields, imp_values)
63
+ eval("@" + mn.pluralize + "= rl")
64
+ end
65
+
66
+ def self.genimposters
67
+ models_dir = Dir.glob("test/imposter/*.yml")
68
+ #puts models_dir
69
+ models_dir.each do |imposter_yaml|
70
+ getfixtures #reloading each time to get model level data
71
+ parseyaml(imposter_yaml)
72
+ end
73
+ end
74
+
75
+ def announce(message)
76
+ text = "#{@version} #{name}: #{message}"
77
+ length = [0, 75 - text.length].max
78
+ write "== %s %s" % [text, "=" * length]
79
+ end
80
+ end
@@ -0,0 +1,14 @@
1
+ module Imposter
2
+ # Based on Faker::Lorem
3
+ class Animal
4
+ Animals = %w(aardvark anteater argali badger beaver budgerigar burro cat chimpanzee coati cow deer donkey dugong ermine finch gazelle gnu grizzly bear hamster hippopotamus ibex jaguar kinkajou lamb lizard mandrill mink moose musk deer mynah bird opossum ox parrot polar bear prairie dog quagga rat roebuck shrew snake steer turtle waterbuck wolf yak addax antelope armadillo basilisk bighorn buffalo camel chameleon chinchilla colt coyote dingo dormouse eland ewe fish gemsbok goat ground hog hare hog iguana jerboa kitten lemur llama mare mole mountain goat musk-ox newt orangutan panda peccary pony pronghorn rabbit reindeer salamander silver fox springbok tapir vicuna weasel wolverine zebra alligator aoudad ass bat bison bull canary chamois chipmunk cony crocodile doe dromedary elephant fawn fox gila monster gopher guanaco hartebeest horse impala kangaroo koala leopard lovebird marmoset mongoose mouse muskrat ocelot oryx panther pig porcupine puma raccoon reptile seal skunk squirrel tiger walrus whale wombat zebu alpaca ape baboon bear boar bunny capybara cheetah civet cougar crow dog duckbill elk ferret frog giraffe gorilla guinea pig hedgehog hyena jackal kid koodoo lion lynx marten monkey mule mustang okapi otter parakeet platypus porpoise puppy ram rhinoceros sheep sloth stallion toad warthog wildcat woodchuck)
5
+
6
+ def self.one(num = 1)
7
+ Animals.shuffle[0, num]
8
+ end
9
+
10
+ def self.multiple(word_count = 2)
11
+ one(word_count).join(' ').capitalize
12
+ end
13
+ end
14
+ end
Binary file
@@ -0,0 +1,18 @@
1
+ require 'rubygems'
2
+ require 'sqlite3'
3
+
4
+ @db = SQLite3::Database.new('csz.db')
5
+
6
+ def postal(code=nil)
7
+ case code
8
+ when nil
9
+ cnt = @db.get_first_value("select count(*) from us").to_i # could probably hardcode this since the data is static
10
+ # but I didn't really see a speed difference without it
11
+ @db.execute2("select * from us")[1+rand(cnt-1)]
12
+ else
13
+ @db.execute2("select * from us where postal = '" + code + "'")
14
+ end
15
+
16
+ end
17
+
18
+ puts postal
@@ -0,0 +1,14 @@
1
+ module Imposter
2
+ # Based on Faker::Lorem
3
+ class Mineral
4
+ Minerals = %w(Abelsonite Abenakiite Abernathyite Abhurite Abswurmbachite Actinolite Acuminite Adamite Adamsite Adelite Admontite Aegirine Aenigmatite Aerinite Aerugite Aeschynite Aeschynite Aeschynite Aetites Afghanite Afwillite Agardite Agrellite Agrinierite Aguilarite Aheylite Ahlfeldite Aikinite Ajoite Akaganéite Akatoreite Akdalaite Åkermanite Aksaite Alabandite Alamosite Alarsite Albite Alforsite Algodonite Aliettite Allabogdanite Allanite Alloclasite Allophane Almandine Alstonite Altaite Aluminite Aluminium Alunite Alunogen Amblygonite Ameghinite Amphibole Analcite Anapaite Anatase Andalusite Andesine Andradite Anglesite Anhydrite Ankerite Annabergite Anorthite Anorthoclase Anthophyllite Antigorite Antimony Antitaenite Antlerite Apatite Apophyllite Aragonite Archerite Arctite Arcubisite Arfvedsonite Argentite Argutite Armalcolite Arsenic Arsenopyrite Arthurite Artinite Artroeite Asisite Astrophyllite Atacamite Atheneite Aubertite Augelite Augite Aurichalcite Auricupride Aurostibite Autunite Axinite Azurite Babingtonite Baddeleyite Baotite Barstowite Baryte Barytocalcite Bastnäsite Bazzite Benitoite Bensonite Bentorite Berryite Berthierite Bertrandite Beryl Beryllonite Biotite Birnessite Bismite Bismuth Bismuthinite Bixbyite Blödite Blossite Boehmite Boracite Borax Bornite Botryogen Boulangerite Bournonite Brammallite Brassite Braunite Brazilianite Breithauptite Brewsterite Brianite Briartite Brochantite Brookite Bromargyrite Bromellite Bronzite Brucite Brushite Buddingtonite Buergerite Bukovskyite Bytownite Bauxite Beckerite Bixbite Cabriite Cadmium Cafetite Calaverite Calcite Cancrinite Calderite Caledonite Cancrinite Canfieldite Carnallite Carnotite Carobbiite Carrollite Cassiterite Cavansite Celadonite Celestine Celsian Cementite Cerite Cerussite Cesbronite Ceylonite Chabazite Chalcanthite Chalcocite Chalcopyrite Challacolloite Chaoite Chapmanite Charoite Childrenite Chlorargyrite Chlorastrolite Chlorite Chloritoid Chondrodite Chromite Chromium Chrysoberyl Chrysocolla Cinnabar Clarkeite Clinochrysotile Clinoclase Clinohedrite Clinohumite Clinoptilolite Clinozoisite Clintonite Cobaltite Coesite Coffinite Colemanite Coloradoite Columbite Combeite Connellite Cooperite Copiapite Copper Corderoite Cordierite Corundum Covellite Creedite Cristobalite Crocoite Cronstedtite Crookesite Crossite Cryolite Cumberlandite Cummingtonite Cuprite Cyanotrichite Cylindrite Carnelian Chalcedony Chrysolite Chrysoprase Chrysotile Citrine Cleveite Coltan Crocidolite Cymophane Danburite Datolite Davidite Dawsonite Delvauxite Descloizite Diadochite Diamond Diaspore Dickite Digenite Diopside Dioptase Djurleite Dollaseite Dolomite Domeykite Dumortierite Delessite Diatomite Edingtonite Ekanite Elbaite Elsmoreite Emery Empressite Enargite Enstatite Eosphorite Epidote Epsomite Erythrite Esperite Ettringite Euchroite Euclase Eucryptite Eudialyte Euxenite Emerald Fabianite Fayalite Feldspar Feldspathoid Ferberite Fergusonite Feroxyhyte Ferrierite Ferrihydrite Ferro Ferrocolumbite Ferrohortonolite Ferropericlase Ferrotantalite Fergusonite Fichtelite Fluorapatite Fluorcaphite Fluorichterite Fluorite Fluorspar Fornacite Forsterite Franckeite Frankhawthorneite Franklinite Freibergite Freieslebenite Fukuchilite Fassaite Ferricrete Gadolinite Gahnite Galaxite Galena Garnet Garnierite Gaylussite Gehlenite Geigerite Geocronite Germanite Gersdorffite Gibbsite Gismondine Glauberite Glaucochroite Glaucodot Glauconite Glaucophane Gmelinite Goethite Gold Goslarite Graftonite Graphite Greenockite Greigite Grossular Grunerite Guanine Gummite Gunningite Gypsum Gedanite Glessite Hematite carving. Haggertyite Haidingerite Halite Halloysite Halotrichite Hanksite Hapkeite Hardystonite Harmotome Hauerite Hausmannite Hauyne Hawleyite Haxonite Heazlewoodite Hectorite Hedenbergite Hellyerite Hematite Hemimorphite Herbertsmithite Herderite Hessite Hessonite Heulandite Hibonite Hilgardite Hisingerite Holmquistite Homilite Hopeite Hornblende Howlite Hübnerite Humite Hutchinsonite Hyalophane Hydrogrossular Hydromagnesite Hydroxylapatite Hydrozincite Hypersthene Heliodor Heliotrope Hiddenite Hyalite Idocrase Idrialite Ikaite Illite Ilmenite Ilvaite Iodargyrite Jacobsite Jadarite Jadeite Jamesonite Jarosewichite Jarosite Jeffersonite Jerrygibbsite Juonniite Jurbanite Jade Jasper Jet Kaatialaite Kadyrelite Kainite Kalininite Kalinite Kalsilite Kamacite Kambaldaite Kankite Kaolinite Kassite Keilite Kermesite Kernite Kerolite Kieserite Kinoite Knebelite Knorringite Kobellite Kogarkoite Kolbeckite Kornerupine Kratochvilite Kremersite Krennerite Kukharenkoite Kutnohorite Kyanite Keilhauite Krantzite Kunzite Labradorite Lanarkite Langbeinite Lansfordite Lanthanite Laumontite Laurite Lawsonite Lazulite Lazurite Lead Leadhillite Legrandite Lepidocrocite Lepidolite Leucite Leucophanite Leucoxene Levyne Lewisite Libethenite Linarite Liroconite Litharge Lithiophilite Livingstonite Lizardite Lollingite Lonsdaleite Loparite Lopezite Lorandite Lorenzenite Ludwigite Lyonsite Lapis lazuli Larimar Lechatelierite Lignite Limonite Lodestone Lublinite Muscovite Mackinawite Maghemite Magnesite Magnesioferrite Magnetite Majorite Malachite Malacolite Magnesioferrite Manganite Manganocolumbite Manganotantalite Marcasite Margaritasite Margarite Mascagnite Massicot McKelveyite Meionite Melaconite Melanite Melilite Melonite Mendozite Meneghinite Mercury Mesolite Metacinnabarite Metatorbernite Miargyrite Mica Microcline Microlite Millerite Mimetite Minium Mirabilite Mixite Moganite Mohite Moissanite Molybdenite Monazite Monohydrocalcite Monticellite Montmorillonite Moolooite Mordenite Mottramite Mullite Murdochite Muscovite Magnesia Mariposite Menilite Meerschaum Milky quartz Morganite Nabesite Nacrite Nagyagite Nahcolite Native Natrolite Natron Natrophilite Nekrasovite Nelenite Nenadkevichite Nepheline Nephrite Neptunite Nickel Nickeline Niedermayrite Niningerite Niobite Niobite Nissonite Nitratine Nitre Nontronite Nosean Nsutite Nyerereite Oligoclase Olivine Olivenite Omphacite Ordonezite Oregonite Orpiment Orthochrysotile Orthoclase Osarizawaite Osmium Osumilite Otavite Ottrelite Overite Polished Onyx Opal Painite Palladium Palygorskite Papagoite Parachrysotile Paragonite Pararealgar Parisite Partheite Pectolite Pelagosite Pentlandite Periclase Perovskite Petalite Petzite Pezzottaite Pharmacosiderite Phenakite Phillipsite Phlogopite Phoenicochroite Phosgenite Phosphophyllite Pigeonite Plagioclase Na Platinum Polarite Pollucite Polybasite Potassium Polycrase Polydymite Polyhalite Powellite Prehnite Proustite Psilomelane Purpurite Pumpellyite Pyrargyrite Pyrite Pyrochlore Pyrolusite Pyromorphite Pyrope Pyrophyllite Pyroxene Pyroxferroite Pyrrhotite Palagonite Perlite Phosphorite Plessite Pitchblende Pumicite Quartz Quenstedtite Rambergite Rammelsbergite Realgar Renierite Rheniite Rhodium Rhodochrosite Rhodonite Rhomboclase Rickardite Riebeckite Romanèchite Robertsite Rosasite Roscoelite Rosenbergite Routhierite Ruthenium Rutherfordine Rutile Rynersonite Rock crystal Rose Roumanite Ruby Sabatierite Sabieite Sabinaite Safflorite Sal Saliotite Samarskite Samsonite Sanbornite Saneroite Sanidine Santite Saponite Sapphirine Sassolite Sauconite Scapolite Scheelite Schoepite Schorl Schreibersite Schwertmannite Scolecite Scorodite Scorzalite Seamanite Seeligerite Segelerite Sekaninaite Selenite Selenium Seligmannite Sellaite Senarmontite Sepiolite Serpentine Shattuckite Siderite Siderotil Siegenite Sillimanite Silver Simetite Simonellite Skutterudite Smaltite Smectite Smithsonite Soda Sodalite Sperrylite Spessartite Sphalerite Sphene Spinel Spodumene Spurrite Stannite Staurolite Steacyite Steatite Stephanite Stibnite Stichtite Stilbite Stilleite Stolzite Stromeyerite Strontianite Struvite Studtite Sugilite Sulfur Sussexite Sylvanite Sylvite Sapphire Sard Satinspar Smoky quartz Soapstone Spectrolite Stantienite Massive Turquoise Tachyhydrite Taenite Talc Tantalite Tantite Tanzanite Tarapacaite Tausonite Teallite Tellurite Tellurium Tellurobismuthite Temagamite Tennantite Tenorite Tephroite Terlinguaite Teruggite Tetradymite Tetrahedrite Thaumasite Thenardite Thomasclarkite Thomsenolite Thorianite Thorite Thortveitite Thuringite Tiemannite Tin Tincalconite Titanite Titanowodginite Todorokite Tokyoite Topaz Torbernite Tourmaline Tremolite Trevorite Tridymite Triphylite Triplite Triploidite Trona Tsavorite Tschermigite Tugtupite Tungstite Tyrolite Turquoise Tusionite Tyuyamunite Tanzanite Thulite Travertine Tsavorite Uchucchacuaite Uklonskovite Ulexite Ullmannite Ulvospinel Umangite Umber Umbite Upalite Uraninite Uranophane Uranopilite Uvarovite Ultramarine Unakite Uralite Vaesite Valentinite Vanadinite Variscite Vaterite Vauquelinite Vauxite Vermiculite Vesuvianite Villiaumite Violarite Vivianite Volborthite Wagnerite Wardite Warwickite Wavellite Weddellite Weilite Weissite Weloganite Whewellite Whitlockite Willemite Wiluite Witherite Wolframite Wollastonite Wulfenite Wurtzite Wüstite Wyartite Wad Xenotime Xifengite Xonotlite Ye`'`elimite Yttrialite Yttrocerite Yttrocolumbite Zabuyelite Zaccagnaite Zaherite Zajacite Zakharovite Zanazziite Zaratite Zeolite Zhanghengite Zharchikhite Zektzerite Zhemchuzhnikovite Zhonghuacerite Ziesite Zimbabweite Zinalsite Zinc Zincite Zincobotryogen Zincochromite Zinkenite Zinnwaldite Zippeite Zircon Zirconolite Zircophyllite Zirkelite Zoisite Zunyite)
5
+
6
+ def self.one(num = 1)
7
+ Minerals.shuffle[0, num]
8
+ end
9
+
10
+ def self.multiple(word_count = 2)
11
+ one(word_count).join(' ').capitalize
12
+ end
13
+ end
14
+ end