rumm 0.0.21 → 0.0.22

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc24108bd8cdec93e429a103d5c862b94c6d1039
4
- data.tar.gz: f9effd84d6c5826a06c2eb03abafe04da5c91918
3
+ metadata.gz: f22e1d300f41259fb41cf025ec307c54f085721f
4
+ data.tar.gz: f8b7f55420594715eabf95a79de2618e15d07395
5
5
  SHA512:
6
- metadata.gz: a86d6cb0234bff1c0622330b924b7c86f7226037ad29b613f077844ae2537755e3c42e39c179082b5b8799a5f7abf0b4d8c566f71a6cbbcb6beed4e88d75eac5
7
- data.tar.gz: 480d7bde974beeb5b16170846ef7fbe8bccc4e64ce5ae030c2ae63f4260997216b37f97ac391a9fb859c741f3eaa8c7f0ed88d7b00b2187aa33500dda78c468b
6
+ metadata.gz: 2fc311104ba0b6212b14799692362c6457091b44e0913ee5cd77e4e457cc284c24a79834a1f7233173078490e9c06877cf6cef0a6faab504823f31eb10cec1ee
7
+ data.tar.gz: 320fc0ff3e01760fbc05fc08a5562449c54651441a2ceb8339bebe1d011339c2e6135ec45d5577ec3160436f2af6785d1ddb4ab95df6a3f01907f07e1502e32c
data/README.md CHANGED
@@ -11,7 +11,7 @@ to easily build and manage infrastructure for great good.
11
11
 
12
12
  ## Usage
13
13
 
14
- Authenticate with rackspace
14
+ Authenticate with rackspace using your cloud credentials as follows:
15
15
 
16
16
  rumm login
17
17
  username: joe
@@ -6,8 +6,8 @@ class NamingProvider
6
6
  self
7
7
  end
8
8
 
9
- def generate_name(first_letter = random_letter, last_letter = random_letter)
10
- "#{adjective first_letter}-#{noun last_letter}"
9
+ def generate_name(adj_first_letter = nil, noun_first_letter = nil)
10
+ "#{adjective adj_first_letter}-#{noun noun_first_letter}"
11
11
  end
12
12
 
13
13
  def random_letter
@@ -26,12 +26,16 @@ class NamingProvider
26
26
  end
27
27
 
28
28
  def noun(first_letter)
29
- list = dictionary('nouns')[first_letter]
30
- list[rand(list.length - 1)]
29
+ word 'nouns', first_letter
31
30
  end
32
31
 
33
32
  def adjective(first_letter)
34
- list = dictionary('adjectives')[first_letter]
33
+ word 'adjectives', first_letter
34
+ end
35
+
36
+ def word(type, first_letter)
37
+ first_letter ||= random_letter
38
+ list = dictionary(type)[first_letter]
35
39
  list[rand(list.length - 1)]
36
40
  end
37
41
  end
@@ -1,3 +1,3 @@
1
1
  module Rumm
2
- VERSION = "0.0.21"
2
+ VERSION = "0.0.22"
3
3
  end
@@ -10,6 +10,24 @@ describe "fancy naming" do
10
10
  Then { not name.nil? }
11
11
  Then { name.length > 1}
12
12
  end
13
+ context "with nil arguments" do
14
+ Given(:parts) { name.split '-' }
15
+ context "both nil" do
16
+ Given(:arguments) { [nil, nil] }
17
+ Then { parts.first[0] != nil}
18
+ Then { parts.last[0] != nil }
19
+ end
20
+ context "adjective nil" do
21
+ Given(:arguments) { [nil, 'z'] }
22
+ Then { parts.first[0] != nil}
23
+ Then { parts.last[0] == 'z' }
24
+ end
25
+ context "noun nil" do
26
+ Given(:arguments) { ['x', nil] }
27
+ Then { parts.first[0] == 'x'}
28
+ Then { parts.last[0] != nil }
29
+ end
30
+ end
13
31
  context "with a first letter and last letter" do
14
32
  Given(:parts) { name.split '-' }
15
33
  context "with different letters" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rumm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.21
4
+ version: 0.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Lowell