blitz 0.1.18 → 0.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/blitz.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{blitz}
8
- s.version = "0.1.18"
8
+ s.version = "0.1.19"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["pcapr"]
12
- s.date = %q{2011-11-26}
12
+ s.date = %q{2011-11-29}
13
13
  s.default_executable = %q{blitz}
14
14
  s.description = %q{Make load and performance testing a fun sport}
15
15
  s.email = %q{support@blitz.io}
@@ -30,6 +30,7 @@ Gem::Specification.new do |s|
30
30
  "lib/blitz.rb",
31
31
  "lib/blitz/client.rb",
32
32
  "lib/blitz/command.rb",
33
+ "lib/blitz/command/account.rb",
33
34
  "lib/blitz/command/api.rb",
34
35
  "lib/blitz/command/couch.rb",
35
36
  "lib/blitz/command/curl.rb",
data/lib/blitz.rb CHANGED
@@ -6,7 +6,7 @@ require 'pp'
6
6
 
7
7
  class Blitz # :nodoc:
8
8
  require 'blitz/helper'
9
- Version = "0.1.18"
9
+ Version = "0.1.19"
10
10
 
11
11
  extend Blitz::Helper
12
12
 
data/lib/blitz/client.rb CHANGED
@@ -14,6 +14,14 @@ class Client # :nodoc:
14
14
  }
15
15
  end
16
16
 
17
+ def login
18
+ JSON.parse blitz['/login/api'].get
19
+ end
20
+
21
+ def account_about
22
+ JSON.parse blitz['/api/1/account/about'].get
23
+ end
24
+
17
25
  def curl_execute data
18
26
  JSON.parse blitz['/api/1/curl/execute'].post(data.to_json)
19
27
  end
@@ -22,10 +30,6 @@ class Client # :nodoc:
22
30
  JSON.parse blitz['/api/1/traceroute/execute'].post(data.to_json)
23
31
  end
24
32
 
25
- def login
26
- JSON.parse blitz['/login/api'].get
27
- end
28
-
29
33
  def job_status job_id
30
34
  JSON.parse blitz["/api/1/jobs/#{job_id}/status"].get
31
35
  end
@@ -0,0 +1,20 @@
1
+ require 'couchrest'
2
+
3
+ class Blitz
4
+ class Command
5
+ class Account < Command # :nodoc:
6
+ def cmd_about args
7
+ account = Command::API.client.account_about
8
+ if account['_id'] == 'anonymous'
9
+ error red('Invalid credentials. Use api:init to login first')
10
+ return
11
+ end
12
+
13
+ puts "email: #{green(account['profile']['email'])}"
14
+ puts "created_at: #{account['created_at']}"
15
+ puts "updated_at: #{account['created_at']}"
16
+ puts "uuid: #{yellow(account['uuid'])}"
17
+ end
18
+ end
19
+ end # Command
20
+ end # Blitz
@@ -6,7 +6,8 @@ class Help < Command # :nodoc:
6
6
  msg "Usage: blitz <command> <options>"
7
7
  helps = [
8
8
  { :cmd => 'help', :help => "Display this help" },
9
- { :cmd => 'api:init', :help => 'Validate your API key' },
9
+ { :cmd => 'account:about', :help => 'Show information about your account' },
10
+ { :cmd => 'api:init', :help => 'Validate and login with your API key' },
10
11
  { :cmd => 'couch:fuzz', :help => 'Auto generate blitz tests from CouchDB' },
11
12
  { :cmd => 'curl', :help => 'Run a sprint or a rush' },
12
13
  { :cmd => 'curl:help', :help => 'Show help on sprint and rushing' },
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: blitz
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.18
5
+ version: 0.1.19
6
6
  platform: ruby
7
7
  authors:
8
8
  - pcapr
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-11-26 00:00:00 -08:00
13
+ date: 2011-11-29 00:00:00 -08:00
14
14
  default_executable: blitz
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -144,6 +144,7 @@ files:
144
144
  - lib/blitz.rb
145
145
  - lib/blitz/client.rb
146
146
  - lib/blitz/command.rb
147
+ - lib/blitz/command/account.rb
147
148
  - lib/blitz/command/api.rb
148
149
  - lib/blitz/command/couch.rb
149
150
  - lib/blitz/command/curl.rb
@@ -173,7 +174,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
173
174
  requirements:
174
175
  - - ">="
175
176
  - !ruby/object:Gem::Version
176
- hash: -714289775
177
+ hash: -937826925
177
178
  segments:
178
179
  - 0
179
180
  version: "0"