Skip to content

Commit b8e4145

Browse files
author
Noah Cantor
committed
Allowing whitespace between options and roles, now.
1 parent 61d262f commit b8e4145

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Changelog.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
## 1.2.6 (Mar 06, 2012)
1+
## 1.2.6 (May 16, 2012)
22

33
Notes:
44

55
- Minor refactoring to make the code clearer
6+
- Updated code to allow commas and any amount of whitespace between options and roles (Thanks ennui2342)
7+
- Updated documentation to reflect multiple correct formats.
68

79
Bugfixes:
810

9-
- Documentation showed whitespaces in Options and Roles, but they weren't supported in the code. (Thanks ennui2342)
10-
1111
## 1.2.5 (Jan 26, 2012)
1212

1313
Features:

lib/capify-ec2.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def desired_instances(region = nil)
5757
end
5858

5959
def get_instances_by_role(role)
60-
desired_instances.select {|instance| instance.tags['Roles'].split(%r{[, ]+}).include?(role.to_s) rescue false}
60+
desired_instances.select {|instance| instance.tags['Roles'].split(%r{,\s*}).include?(role.to_s) rescue false}
6161
end
6262

6363
def get_instances_by_region(roles, region)

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ capify-ec2 is used to generate capistrano namespaces using ec2 tags.
55

66
eg: If you have three servers on amazon's ec2.
77

8-
server-1 Tag: Roles => "web", Options => "cron,resque"
8+
server-1 Tag: Roles => "web", Options => "cron,resque, db"
99
server-2 Tag: Roles => "db"
10-
server-3 Tag: Roles => "web,db"
10+
server-3 Tag: Roles => "web,db, app"
1111

1212
Installing
1313

0 commit comments

Comments
 (0)