slapshot 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/slapshot +2 -2
- data/lib/slapshot/main.rb +4 -3
- data/lib/slapshot/version.rb +1 -1
- metadata +3 -3
data/bin/slapshot
CHANGED
@@ -7,7 +7,7 @@ include GLI::App
|
|
7
7
|
|
8
8
|
program_desc 'A command line interface to the Appshot API'
|
9
9
|
|
10
|
-
|
10
|
+
version Slapshot::VERSION
|
11
11
|
|
12
12
|
desc 'Your Appshot url'
|
13
13
|
flag [:url]
|
@@ -101,7 +101,7 @@ command :logout do |c|
|
|
101
101
|
if File.exists? get_token_file
|
102
102
|
|
103
103
|
token = remove_token(url)
|
104
|
-
puts "
|
104
|
+
puts "Deauthorized token: #{token} and removed #{get_token_file}"
|
105
105
|
|
106
106
|
else
|
107
107
|
puts "You are not logged in."
|
data/lib/slapshot/main.rb
CHANGED
@@ -12,7 +12,7 @@ end
|
|
12
12
|
def create_token(url, username, password)
|
13
13
|
|
14
14
|
begin
|
15
|
-
token = RestClient.get url + '/
|
15
|
+
token = RestClient.get url + '/token/auth', :params => { :u => username, :p => password }
|
16
16
|
rescue RestClient::BadRequest => e
|
17
17
|
return nil
|
18
18
|
end
|
@@ -28,7 +28,8 @@ def remove_token(url)
|
|
28
28
|
|
29
29
|
token = get_token
|
30
30
|
|
31
|
-
RestClient.get url + '/
|
31
|
+
res = RestClient.get url + '/token/deauth', :params => { :t => token }
|
32
|
+
raise "Token de-authorization failed" if res != "success"
|
32
33
|
|
33
34
|
File.delete(get_token_file)
|
34
35
|
|
@@ -54,7 +55,7 @@ class Appshot
|
|
54
55
|
|
55
56
|
def search(query, count, full)
|
56
57
|
|
57
|
-
response = @api["
|
58
|
+
response = @api["service/api/search"].get :params => { :i => @instance, :q => query, :c => count, :f => full }, :content_type => :json, :accept => :json
|
58
59
|
|
59
60
|
json_response = JSON.parse(response.body)
|
60
61
|
|
data/lib/slapshot/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slapshot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -183,7 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
183
183
|
version: '0'
|
184
184
|
requirements: []
|
185
185
|
rubyforge_project:
|
186
|
-
rubygems_version: 1.8.
|
186
|
+
rubygems_version: 1.8.23
|
187
187
|
signing_key:
|
188
188
|
specification_version: 3
|
189
189
|
summary: A command line interface to the Appshot API
|