euca 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZjljYWM4MWM3OGMyYmY1NDI5NmEzMzYyYzQ1NzU3M2FkMWJkY2FjNQ==
4
+ MzliODA2MmY3ZWUyNThjODllMWViZWJlY2IyY2E2MjI4ZDU1MjY1MQ==
5
5
  data.tar.gz: !binary |-
6
- MjU2NGQ5N2Q0ZmZjNTllZWI4ZWEyNDQ5Mjg0MjUzYTdlOGE2MmUzNw==
6
+ ZjliYjA2NGU0MTJjZTIwMzMzN2YyMDhkYzVlZjYxODUwZmYxZTIyOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ODc3ZWM3YWEyNTIzNmY5YmYzNGFmMjY1NDNkOTY3ZWIyYzQxNmE3NjBkMzhh
10
- ZDUxNzJiNzEyNDJhMzZhZWZmMWY0YTUwYmU0YThhNWQ2NmVlM2QyNWQ0N2M0
11
- NmJkOTI5ZjM4MDdjZmYyZjE3NjMyMmE0MGQxOWI2NjU1NzQzYmM=
9
+ ZDkzMTNiZmYyMzlmYTA2Y2QyOTM5MjdkMGViYjk4MjdiMmYxNDJmYjI5Yjli
10
+ NGYyNDFiYjYyN2VkNDVlNWUwN2ZjZDk3YTY2NjE3ODEyZDRhZGJhOGMzMzE2
11
+ N2E4MGQ5OWFiMzk2ZDE5M2I2ZGQwNDg5MDFlMTQzYjYxNTQzODQ=
12
12
  data.tar.gz: !binary |-
13
- YmExM2U0MDVlMGY2NWMyNzhkNGJiMmIzM2RlOGRlYjY2ZmFlODYxOWFkYTk2
14
- ZDBjN2Q1ZTA1YzcwODVkMzVjNWMwNTE5NmI5MmIxOTdkOGRjM2Y3MDVmMzZi
15
- NGE3ODVlYTk5YzM3MzcwNTFiNDg4YjVjYThkZmUyOWMwYjVhZWQ=
13
+ MGNmMTAwYmI1YTY1ZjljY2U1MTNmNjAyZDY5YzRjN2M4ZGM0NzhjNGJiYzAz
14
+ YTJmYjk1MDlmMzU5NzIwYmQ0NmNiMTM4MDFiNWU4YjgzNzlkNjEwYjlkMzEw
15
+ MWJhYmNmYTdiZmYyMTAwZWIzZDkxMzI0ZDZjMGFjNzJmMDA5MmE=
@@ -1,22 +1,24 @@
1
- Copyright (c) 2014 Onur Uyar
1
+ This is free and unencumbered software released into the public domain.
2
2
 
3
- MIT License
3
+ Anyone is free to copy, modify, publish, use, compile, sell, or
4
+ distribute this software, either in source code form or as a compiled
5
+ binary, for any purpose, commercial or non-commercial, and by any
6
+ means.
4
7
 
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
8
+ In jurisdictions that recognize copyright laws, the author or authors
9
+ of this software dedicate any and all copyright interest in the
10
+ software to the public domain. We make this dedication for the benefit
11
+ of the public at large and to the detriment of our heirs and
12
+ successors. We intend this dedication to be an overt act of
13
+ relinquishment in perpetuity of all present and future rights to this
14
+ software under copyright law.
15
15
 
16
16
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
17
  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
23
+
24
+ For more information, please refer to <http://unlicense.org/>
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Onur Uyar"]
10
10
  spec.email = ["me@onuruyar.com"]
11
11
  spec.summary = %q{Ultra thin Ruby wrapper for euca2ools command line tools}
12
- spec.homepage = ""
13
- spec.license = "MIT"
12
+ spec.homepage = "https://github.com/lemmycaution/euca"
13
+ spec.license = "Unlicense"
14
14
 
15
15
  spec.files = `git ls-files -z`.split("\x0")
16
16
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
@@ -20,6 +20,6 @@ Gem::Specification.new do |spec|
20
20
  spec.add_development_dependency "bundler", "~> 1.5"
21
21
  spec.add_development_dependency "rake"
22
22
  spec.add_development_dependency "minitest"
23
- spec.add_dependency 'vhs', '~> 0.0.4'
24
23
  spec.add_dependency 'activesupport', '~> 4.0.2'
24
+ spec.add_dependency 'rye', '0.9.12'
25
25
  end
@@ -1,32 +1,36 @@
1
- require 'logger'
2
- require 'vhs'
3
- require "euca/version"
1
+ require 'rye'
4
2
  require "euca/api"
5
3
 
6
4
  module Euca
7
- BIN_NAME="euca2ools".freeze
8
- BIN_VERSION="euca-version".freeze
9
- UBUNTU_13_10="qmi-c4c45230"
10
- UBUNTU_12_04="qmi-b58041dd"
11
- T1_NANO="t1.nano"
12
5
 
13
- def self.logger
14
- @@logger ||= Logger.new(STDOUT)
15
- end
6
+ EUCA_VERSION = "euca-version".freeze
7
+ UBUNTU_13_10 = "qmi-c4c45230"
8
+ UBUNTU_12_04 = "qmi-b58041dd"
9
+ T1_NANO = "t1.nano"
16
10
 
17
11
  def self.has_cli?
18
- !(self.version =~ /\d+\.\d+\.\d+/).nil?
12
+ self.version.exit_status == 0
19
13
  end
20
14
 
21
15
  def self.version
22
- sh(BIN_VERSION).gsub(/#{BIN_NAME} /,"")
16
+ sh(BIN_VERSION)
23
17
  end
24
18
 
25
19
  def self.api_methods
26
- @@api_methods ||= sh("ls -1 #{self.exec_path}/euca-*").gsub(/#{self.exec_path}\/euca-/m,"").split("\n")
20
+ @@api_methods ||= begin
21
+ sh(:ls, :"1", "#{self.exec_path}/euca-*").
22
+ gsub(/#{self.exec_path}\/euca-/m,"").split("\n")
23
+ end
27
24
  end
28
25
 
29
26
  def self.exec_path
30
- @@euca_home ||= sh("dirname $(which euca-version)")
27
+ @@euca_home ||= sh(:dirname, "$(which euca-version)")
28
+ end
29
+
30
+ def self.sh *args
31
+ ret = Rye.shell *args
32
+ raise RuntimeError.new(ret.stderr.join($/)) if ret.exit_status != 0
33
+ ret.to_s
31
34
  end
35
+
32
36
  end
@@ -9,7 +9,7 @@ module Euca
9
9
  def self.create email, path = "~/.ssh"
10
10
  keyfile = "#{path}/#{email}.id"
11
11
  keypairs = euca("create-keypair", email, ">", keyfile)
12
- sh("chmod 600 #{keyfile}")
12
+ Euca.sh :chmod, 600, keyfile
13
13
  {"id" => email}
14
14
  end
15
15
 
@@ -1,3 +1,3 @@
1
1
  module Euca
2
- VERSION = "0.0.14"
2
+ VERSION = "0.0.15"
3
3
  end
@@ -7,7 +7,8 @@ module Euca
7
7
  end
8
8
 
9
9
  def run api, *args
10
- parse(sh("euca-#{api} #{args.join(" ")}"))
10
+ raise NoMethodError.new("Euca#run: #{api} not found") and return false unless Euca.api_methods.include?(api)
11
+ parse Euca.sh(:"euca-#{api}", *args).to_s
11
12
  end
12
13
 
13
14
  def parse response
@@ -0,0 +1,9 @@
1
+ require 'support/minitest_helper'
2
+ require 'euca'
3
+
4
+ describe Euca do
5
+ it "knows all available euca commands" do
6
+ Euca.api_methods.must_be_kind_of Array
7
+ Euca.api_methods.size.must_equal 64
8
+ end
9
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: euca
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Onur Uyar
@@ -53,33 +53,33 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: vhs
56
+ name: activesupport
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: 0.0.4
61
+ version: 4.0.2
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ~>
67
67
  - !ruby/object:Gem::Version
68
- version: 0.0.4
68
+ version: 4.0.2
69
69
  - !ruby/object:Gem::Dependency
70
- name: activesupport
70
+ name: rye
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 4.0.2
75
+ version: 0.9.12
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 4.0.2
82
+ version: 0.9.12
83
83
  description:
84
84
  email:
85
85
  - me@onuruyar.com
@@ -105,6 +105,7 @@ files:
105
105
  - lib/euca/version.rb
106
106
  - lib/euca/wrapper.rb
107
107
  - spec/address_spec.rb
108
+ - spec/euca_spec.rb
108
109
  - spec/fixtures/address.yml
109
110
  - spec/fixtures/images.yml
110
111
  - spec/fixtures/instance.yml
@@ -114,9 +115,9 @@ files:
114
115
  - spec/model_spec.rb
115
116
  - spec/support/minitest_helper.rb
116
117
  - spec/wrapper_spec.rb
117
- homepage: ''
118
+ homepage: https://github.com/lemmycaution/euca
118
119
  licenses:
119
- - MIT
120
+ - Unlicense
120
121
  metadata: {}
121
122
  post_install_message:
122
123
  rdoc_options: []
@@ -140,6 +141,7 @@ specification_version: 4
140
141
  summary: Ultra thin Ruby wrapper for euca2ools command line tools
141
142
  test_files:
142
143
  - spec/address_spec.rb
144
+ - spec/euca_spec.rb
143
145
  - spec/fixtures/address.yml
144
146
  - spec/fixtures/images.yml
145
147
  - spec/fixtures/instance.yml