shiv 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/README.md +7 -0
  2. data/VERSION +1 -1
  3. data/lib/shiv.rb +6 -1
  4. data/shiv.gemspec +64 -0
  5. metadata +5 -4
data/README.md CHANGED
@@ -3,6 +3,13 @@ Shiv
3
3
 
4
4
  Shiv is a quick and dirty hack to use chef node names in place of their hostnames.
5
5
 
6
+ Install
7
+ -------
8
+
9
+ ```
10
+ gem install shiv
11
+ ```
12
+
6
13
  Examples
7
14
  --------
8
15
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
data/lib/shiv.rb CHANGED
@@ -3,6 +3,8 @@ require 'chef/knife'
3
3
  require 'chef/config'
4
4
 
5
5
  module Shiv
6
+ PROVIDERS = ['ec2', 'rackspace']
7
+
6
8
  def self.edit(command)
7
9
  configure
8
10
  nodes.each do |node|
@@ -16,7 +18,10 @@ module Shiv
16
18
  end
17
19
 
18
20
  def self.hostname_from(node)
19
- Chef::Node.load(node)["ec2"]["public_hostname"]
21
+ node = Chef::Node.load(node)
22
+ hostnames = (PROVIDERS & node.keys).map do |provider|
23
+ node[provider]['public_hostname']
24
+ end.compact.first
20
25
  end
21
26
 
22
27
  def self.configure
data/shiv.gemspec ADDED
@@ -0,0 +1,64 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{shiv}
8
+ s.version = "0.1.1"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = [%q{vanstee}]
12
+ s.date = %q{2011-09-03}
13
+ s.description = %q{Shiv is a quick and dirty hack to use chef node names in place of their hostnames.}
14
+ s.email = %q{vanstee@highgroove.com}
15
+ s.executables = [%q{shiv}]
16
+ s.extra_rdoc_files = [
17
+ "LICENSE.txt",
18
+ "README.md"
19
+ ]
20
+ s.files = [
21
+ ".document",
22
+ "Gemfile",
23
+ "Gemfile.lock",
24
+ "LICENSE.txt",
25
+ "README.md",
26
+ "Rakefile",
27
+ "VERSION",
28
+ "bin/shiv",
29
+ "lib/shiv.rb",
30
+ "shiv.gemspec",
31
+ "test/helper.rb",
32
+ "test/test_shiv.rb"
33
+ ]
34
+ s.homepage = %q{http://github.com/vanstee/shiv}
35
+ s.licenses = [%q{MIT}]
36
+ s.require_paths = [%q{lib}]
37
+ s.rubygems_version = %q{1.8.6}
38
+ s.summary = %q{Shiv is a quick and dirty hack to use chef node names in place of their hostnames.}
39
+
40
+ if s.respond_to? :specification_version then
41
+ s.specification_version = 3
42
+
43
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
44
+ s.add_runtime_dependency(%q<chef>, [">= 0"])
45
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
46
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
47
+ s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
48
+ s.add_development_dependency(%q<rcov>, [">= 0"])
49
+ else
50
+ s.add_dependency(%q<chef>, [">= 0"])
51
+ s.add_dependency(%q<shoulda>, [">= 0"])
52
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
53
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
54
+ s.add_dependency(%q<rcov>, [">= 0"])
55
+ end
56
+ else
57
+ s.add_dependency(%q<chef>, [">= 0"])
58
+ s.add_dependency(%q<shoulda>, [">= 0"])
59
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
60
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
61
+ s.add_dependency(%q<rcov>, [">= 0"])
62
+ end
63
+ end
64
+
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shiv
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - vanstee
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-30 00:00:00 Z
18
+ date: 2011-09-03 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  type: :runtime
@@ -110,6 +110,7 @@ files:
110
110
  - VERSION
111
111
  - bin/shiv
112
112
  - lib/shiv.rb
113
+ - shiv.gemspec
113
114
  - test/helper.rb
114
115
  - test/test_shiv.rb
115
116
  homepage: http://github.com/vanstee/shiv