cloudkick 0.2.8 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.8
1
+ 0.2.9
data/cloudkick.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{cloudkick}
8
- s.version = "0.2.8"
8
+ s.version = "0.2.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Cloudkick"]
12
- s.date = %q{2010-03-31}
12
+ s.date = %q{2010-04-02}
13
13
  s.default_executable = %q{cloudkick}
14
14
  s.description = %q{Ruby interface to the Cloudkick API}
15
15
  s.email = %q{support@cloudkick.com}
@@ -34,6 +34,7 @@ Gem::Specification.new do |s|
34
34
  "lib/cloudkick/commands/base.rb",
35
35
  "lib/cloudkick/commands/help.rb",
36
36
  "lib/cloudkick/commands/parallel.rb",
37
+ "lib/cloudkick/commands/version.rb",
37
38
  "lib/cloudkick/node.rb",
38
39
  "test/helper.rb",
39
40
  "test/test_cloudkick-gem.rb"
@@ -31,11 +31,10 @@ module Cloudkick::Command
31
31
  def self.create_default_groups!
32
32
  group 'Commands' do |group|
33
33
  group.command 'help', 'show this usage'
34
- group.command 'version', 'show the gem version'
35
34
  group.space
36
35
  group.command 'pssh --query <query> ' \
37
- '--username <username> ' \
38
- '--command <command>',
36
+ '--command <command>' \
37
+ '[--username <username>] ',
39
38
  'parallel ssh your nodes'
40
39
  end
41
40
  end
@@ -44,10 +43,6 @@ module Cloudkick::Command
44
43
  display usage
45
44
  end
46
45
 
47
- def version
48
- display Cloudkick::Client.version
49
- end
50
-
51
46
  def usage
52
47
  longest_command_length = self.class.groups.map do |group|
53
48
  group.map { |g| g.first.length }
@@ -3,7 +3,7 @@ require 'tempfile'
3
3
  module Cloudkick::Command
4
4
  class Pssh < Base
5
5
  def index
6
- unless args.size == 6 or args.size == 8
6
+ unless args.size == 4 or args.size == 6
7
7
  raise CommandFailed, 'usage: cloudkick pssh --query <query> ' \
8
8
  '--username <username> ' \
9
9
  '--command <command>'
@@ -27,7 +27,11 @@ module Cloudkick::Command
27
27
 
28
28
  file.flush
29
29
  begin
30
- system("pssh -i -h #{file.path} -l #{username} '#{command}'")
30
+ if username
31
+ system("pssh -i -h #{file.path} -l #{username} '#{command}'")
32
+ else
33
+ system("pssh -i -h #{file.path} '#{command}'")
34
+ end
31
35
  rescue
32
36
  raise CommandFailed, 'cloudkick: command not found: pssh'
33
37
  end
@@ -0,0 +1,6 @@
1
+ module Cloudkick::Command
2
+ class Version < Base
3
+ def index
4
+ end
5
+ end
6
+ end
@@ -12,6 +12,7 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
  require 'crack'
15
+ require 'uri'
15
16
 
16
17
  module Cloudkick
17
18
  class Node < Base
@@ -54,7 +55,8 @@ module Cloudkick
54
55
 
55
56
  def get
56
57
  if @query
57
- resp, data = access_token.get("/1.0/query/nodes?query=#{query}")
58
+ escaped = URI.escape(@query)
59
+ resp, data = access_token.get("/1.0/query/nodes?query=#{escaped}")
58
60
  else
59
61
  resp, data = access_token.get("/1.0/query/nodes")
60
62
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudkick
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cloudkick
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-03-31 00:00:00 -07:00
12
+ date: 2010-04-02 00:00:00 -07:00
13
13
  default_executable: cloudkick
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -57,6 +57,7 @@ files:
57
57
  - lib/cloudkick/commands/base.rb
58
58
  - lib/cloudkick/commands/help.rb
59
59
  - lib/cloudkick/commands/parallel.rb
60
+ - lib/cloudkick/commands/version.rb
60
61
  - lib/cloudkick/node.rb
61
62
  - test/helper.rb
62
63
  - test/test_cloudkick-gem.rb