zoo_pass 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/zoo_pass.rb +14 -5
  2. data/lib/zoo_pass/version.rb +1 -1
  3. metadata +2 -2
data/lib/zoo_pass.rb CHANGED
@@ -1,10 +1,19 @@
1
- #require "zoo_pass/version"
2
-
3
1
  module ZooPass
4
- ANIMALS = %w( aardvark alligator alpaca anteater antelope ape armadillo baboon badger bat bear beaver bighorn bison boar buffalo bull bunny burro camel canary capybara cat chameleon cheetah chimpanzee chipmunk civet colt cougar cow coyote crocodile crow deer dingo dog donkey elephant elk ewe fawn ferret finch fish fox frog gazelle giraffe gnu goat gopher gorilla hamster hare hedgehog hippopotamus hog horse hyena ibex iguana impala jackal jaguar kangaroo kid kitten koala lamb lemur leopard lion lizard llama lynx mare marmoset marten mink mole mongoose monkey moose mouse mule musk-ox muskrat mustang newt ocelot opossum orangutan otter ox panda panther parakeet parrot pig platypus pony porcupine porpoise puma puppy rabbit raccoon ram rat reindeer reptile rhino salamander seal sheep shrew skunk sloth snake squirrel stallion steer tiger toad turtle walrus warthog weasel whale wildcat wolf wolverine wombat woodchuck yak zebra )
2
+ DEFAULT_LENGTH = 3
3
+ ANIMALS = %w(aardvark alligator alpaca anteater antelope ape armadillo baboon badger bat bear beaver bighorn bison boar buffalo bull bunny burro camel canary capybara cat chameleon cheetah chimpanzee chipmunk civet colt cougar cow coyote crocodile crow deer dingo dog donkey elephant elk ewe fawn ferret finch fish fox frog gazelle giraffe gnu goat gopher gorilla hamster hare hedgehog hippopotamus hog horse hyena ibex iguana impala jackal jaguar kangaroo kid kitten koala lamb lemur leopard lion lizard llama lynx mare marmoset marten mink mole mongoose monkey moose mouse mule musk-ox muskrat mustang newt ocelot opossum orangutan otter ox panda panther parakeet parrot pig platypus pony porcupine porpoise puma puppy rabbit raccoon ram rat reindeer reptile rhino salamander seal sheep shrew skunk sloth snake squirrel stallion steer tiger toad turtle walrus warthog weasel whale wildcat wolf wolverine wombat woodchuck yak zebra)
5
4
 
6
- def self.generate(length = 3)
7
- ANIMALS.shuffle.take(length).join('-')
5
+ def self.generate(length = DEFAULT_LENGTH)
6
+ ZooPass::Generator.new.generate(length)
8
7
  end
9
8
 
9
+ class Generator
10
+ def initialize(animals = ANIMALS)
11
+ @animals = animals
12
+ end
13
+
14
+ def generate(length = DEFAULT_LENGTH)
15
+ @animals.shuffle.take(length).join('-')
16
+ end
17
+
18
+ end
10
19
  end
@@ -1,3 +1,3 @@
1
1
  module ZooPass
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zoo_pass
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-21 00:00:00.000000000 Z
12
+ date: 2012-07-10 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A simple passphrase creator for non-secure things. Use it for creating
15
15
  one-time tokens, sign-up codes, and anything else that doesn't require security.