ubalo 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/ubalo +28 -2
- data/lib/ubalo.rb +10 -2
- metadata +7 -7
data/bin/ubalo
CHANGED
@@ -384,7 +384,7 @@ command :login do |c|
|
|
384
384
|
ubalo.token = response['api_token']
|
385
385
|
username = response['username']
|
386
386
|
|
387
|
-
Ubalo.write_config(
|
387
|
+
Ubalo.write_config(ubalo.base_url => {'token' => ubalo.token})
|
388
388
|
puts "Success! Ready to use as #{username}."
|
389
389
|
end
|
390
390
|
end
|
@@ -397,9 +397,35 @@ command :logout do |c|
|
|
397
397
|
end
|
398
398
|
end
|
399
399
|
|
400
|
+
desc 'Publish a pod'
|
401
|
+
arg_name '<pod name>'
|
402
|
+
command :publish do |c|
|
403
|
+
c.action do |global_options,options,args|
|
404
|
+
pod_name = args.shift
|
405
|
+
|
406
|
+
$stderr.print "Publishing #{pod_name}..."
|
407
|
+
response = ubalo.publish(pod_name)
|
408
|
+
$stderr.puts " done."
|
409
|
+
$stderr.puts "Your pod is now available at #{response['pod_url']}."
|
410
|
+
end
|
411
|
+
end
|
412
|
+
|
413
|
+
desc 'Unpublish a pod'
|
414
|
+
arg_name '<pod name>'
|
415
|
+
command :unpublish do |c|
|
416
|
+
c.action do |global_options,options,args|
|
417
|
+
pod_name = args.shift
|
418
|
+
|
419
|
+
$stderr.print "Unpublishing #{pod_name}..."
|
420
|
+
response = ubalo.unpublish(pod_name)
|
421
|
+
$stderr.puts " done."
|
422
|
+
$stderr.puts "Your pod is now private."
|
423
|
+
end
|
424
|
+
end
|
425
|
+
|
400
426
|
pre do |global,command,options,args|
|
401
427
|
config = Ubalo.config
|
402
|
-
connect_url = global['connect-url'] || config['connect-url']
|
428
|
+
connect_url = global['connect-url'] || config['connect-url'] || "https://ubalo.com/api"
|
403
429
|
|
404
430
|
# When logging in, don't use the token:
|
405
431
|
unless command && command.name == :login
|
data/lib/ubalo.rb
CHANGED
@@ -64,13 +64,13 @@ class Ubalo
|
|
64
64
|
attr_reader :base_url
|
65
65
|
attr_accessor :token
|
66
66
|
|
67
|
-
def self.login token, base_url
|
67
|
+
def self.login token, base_url
|
68
68
|
new(token, base_url)
|
69
69
|
end
|
70
70
|
|
71
71
|
def initialize token, base_url
|
72
72
|
@token = token
|
73
|
-
@base_url = base_url
|
73
|
+
@base_url = base_url
|
74
74
|
end
|
75
75
|
|
76
76
|
def get(action, params={})
|
@@ -220,6 +220,14 @@ class Ubalo
|
|
220
220
|
get(:check_task, hash)
|
221
221
|
end
|
222
222
|
|
223
|
+
def publish pod_name
|
224
|
+
post(:publish, pod_name: pod_name)
|
225
|
+
end
|
226
|
+
|
227
|
+
def unpublish pod_name
|
228
|
+
post(:unpublish, pod_name: pod_name)
|
229
|
+
end
|
230
|
+
|
223
231
|
private
|
224
232
|
def parse(result)
|
225
233
|
JSON.load(result)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ubalo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-12-06 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: gli
|
16
|
-
requirement: &
|
16
|
+
requirement: &2152383460 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2152383460
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: highline
|
27
|
-
requirement: &
|
27
|
+
requirement: &2152382720 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2152382720
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rest-client
|
38
|
-
requirement: &
|
38
|
+
requirement: &2152381580 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: 1.6.3
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2152381580
|
47
47
|
description: CLI and API client for Ubalo
|
48
48
|
email: dev@ubalo.com
|
49
49
|
executables:
|