urturn-cli 0.6.6 → 0.6.7
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/lib/webdoc-cli/expression_rest_client.rb +24 -18
- data/lib/webdoc-cli/version.rb +1 -1
- metadata +2 -2
@@ -43,25 +43,31 @@ module Webdoc
|
|
43
43
|
|
44
44
|
# Bundle and deploy the expression in the current directory
|
45
45
|
def deploy(path='.')
|
46
|
-
|
46
|
+
if(path =~ /\.(expression|zip)$/)
|
47
|
+
File.open(path) {|file| send_bundle(file)}
|
48
|
+
else
|
47
49
|
Webdoc::Cli.cmd.say "==> create bundle"
|
48
|
-
bundle(path)
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
50
|
+
bundle(path) {|file| send_bundle(file) }
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def send_bundle(file)
|
55
|
+
Webdoc::Cli.authenticate_then do |headers|
|
56
|
+
request = RestClient::Request.new(
|
57
|
+
:method => :post,
|
58
|
+
:url => url('/expressions.json'),
|
59
|
+
:cookies => headers[:cookies],
|
60
|
+
:payload => {
|
61
|
+
:multipart => true,
|
62
|
+
:bundle => file
|
63
|
+
}
|
64
|
+
)
|
65
|
+
Webdoc::Cli.cmd.say "==> send bundle to #{Webdoc::Cli.host}"
|
66
|
+
response = handle_request_error { request.execute }
|
67
|
+
json = JSON.parse(response.strip)
|
68
|
+
system_name = json['expression']['system_name']
|
69
|
+
Webdoc::Cli.cmd.say "Expression #{@system_name} has been deployed on #{Webdoc::Cli.host}"
|
70
|
+
Webdoc::Cli.cmd.say "http://#{Webdoc::Cli.host}/#{username}/#{system_name}"
|
65
71
|
end
|
66
72
|
end
|
67
73
|
|
data/lib/webdoc-cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: urturn-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-01-
|
13
|
+
date: 2013-01-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: gli
|