turbot 0.0.46 → 0.0.47
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/lib/turbot/command/bots.rb +23 -7
- data/lib/turbot/version.rb +1 -1
- data/spec/turbot/command/bots_spec.rb +19 -0
- metadata +31 -30
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
YjBhMjQ0ZGJlMWE3MmUzM2RmYWQyN2YyNjkzMGU5M2YyNzhhNjE1Zg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
Y2ExZmNmYjliYWRiOGZhNjE5NGMxZTJkYjQ0ODM2NTM2YjAzNmQ3NA==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZTE5OWMyODM0NjNkNGI1Y2U3MzU2MTQwZDZiZWFhY2ViMDI1NjRlNTk2NTky
|
10
|
+
MDIyNDc3Y2I1YzZjNTAxMWY2NzdjN2RkOWZhNzYwZmZmYTIzYWM3YmQwOTVj
|
11
|
+
YTBiNmI5ODk0MzM0MGNhZGNkM2U0Y2VkMjEzNWM3NTVlNjIxOWE=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
M2Y3Njk0ZDhjNTFkYjBlODA3MDYzMjgwMWVkZTliOWQ3ZTI0MDY0NDU3OWUx
|
14
|
+
NDU4Nzg5MjljM2EzZTFhMzY5YjZlNTAyNjY3OWU3NjE3MGViMzgwMzQxZGVk
|
15
|
+
Yzc5OTAyMjExYTgwZTViMmZmNmU3ZmQyMTg4N2FkOTI3YzQwM2E=
|
data/lib/turbot/command/bots.rb
CHANGED
@@ -172,15 +172,9 @@ class Turbot::Command::Bots < Turbot::Command::Base
|
|
172
172
|
error("Aborting push") if !confirmed.downcase.empty? && confirmed.downcase != "y"
|
173
173
|
working_dir = Dir.pwd
|
174
174
|
manifest = parsed_manifest(working_dir)
|
175
|
-
#archive_file = File.join(working_dir, 'tmp', "#{manifest['bot_id']}.zip")
|
176
175
|
archive = Tempfile.new(bot)
|
177
176
|
archive_path = "#{archive.path}.zip"
|
178
|
-
|
179
|
-
Zip.continue_on_exists_proc = true
|
180
|
-
Zip::File.open(archive_path, Zip::File::CREATE) do |zipfile|
|
181
|
-
zipfile.add("manifest.json", manifest_path)
|
182
|
-
manifest['files'].each { |f| zipfile.add(f, File.join(working_dir,f)) }
|
183
|
-
end
|
177
|
+
create_zip_archive(archive_path, working_dir, manifest['files'] + ['manifest.json'])
|
184
178
|
|
185
179
|
response = File.open(archive_path) {|file| api.update_code(bot, file)}
|
186
180
|
case response
|
@@ -273,6 +267,10 @@ class Turbot::Command::Bots < Turbot::Command::Base
|
|
273
267
|
puts "Sending to turbot... "
|
274
268
|
|
275
269
|
runner = PreviewRunner.new(bot, api)
|
270
|
+
Signal.trap("INT") do
|
271
|
+
Process.kill("ABRT", runner.wait_thread[:pid])
|
272
|
+
runner.interrupt
|
273
|
+
end
|
276
274
|
runner.run
|
277
275
|
end
|
278
276
|
|
@@ -302,6 +300,24 @@ class Turbot::Command::Bots < Turbot::Command::Base
|
|
302
300
|
hyphenated_name = type.to_s.gsub("_", "-").gsub(" ", "-")
|
303
301
|
File.expand_path("../../../../schema/schemas/#{hyphenated_name}-schema.json", __FILE__)
|
304
302
|
end
|
303
|
+
|
304
|
+
def create_zip_archive(archive_path, basepath, subpaths)
|
305
|
+
Zip.continue_on_exists_proc = true
|
306
|
+
Zip::File.open(archive_path, Zip::File::CREATE) do |zipfile|
|
307
|
+
subpaths.each do |subpath|
|
308
|
+
path = File.join(basepath, subpath)
|
309
|
+
|
310
|
+
if File.directory?(path)
|
311
|
+
Dir["#{path}/**/*"].each do |path1|
|
312
|
+
subpath1 = Pathname.new(path1).relative_path_from(Pathname.new(basepath))
|
313
|
+
zipfile.add(subpath1, path1)
|
314
|
+
end
|
315
|
+
else
|
316
|
+
zipfile.add(subpath, path)
|
317
|
+
end
|
318
|
+
end
|
319
|
+
end
|
320
|
+
end
|
305
321
|
end
|
306
322
|
|
307
323
|
class PreviewRunner < TurbotRunner::BaseRunner
|
data/lib/turbot/version.rb
CHANGED
@@ -86,4 +86,23 @@ describe Turbot::Command::Bots do
|
|
86
86
|
end
|
87
87
|
end
|
88
88
|
end
|
89
|
+
|
90
|
+
describe '#create_zip_archive' do
|
91
|
+
it 'adds all given files to archive' do
|
92
|
+
dirs = ['a', 'b', 'a/p', 'b/p']
|
93
|
+
paths = ['a/p/x', 'a/y', 'b/p/x', 'b/y', 'z']
|
94
|
+
|
95
|
+
base_dir = Dir.mktmpdir
|
96
|
+
dirs.each {|dir| Dir.mkdir(File.join(base_dir, dir))}
|
97
|
+
paths.each {|path| FileUtils.touch(File.join(base_dir, path))}
|
98
|
+
|
99
|
+
command = Turbot::Command::Bots.new
|
100
|
+
archive_path = Tempfile.new('test').path
|
101
|
+
command.send(:create_zip_archive, archive_path, base_dir, ['a', 'b/p/x', 'b/y', 'z'])
|
102
|
+
|
103
|
+
Zip::File.open(archive_path) do |zipfile|
|
104
|
+
expect(zipfile.map {|entry| entry.to_s}).to match_array(paths + ['a/p/'])
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
89
108
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: turbot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.47
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Turbot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: netrc
|
@@ -42,42 +42,42 @@ dependencies:
|
|
42
42
|
name: launchy
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - '>='
|
45
|
+
- - ! '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 0.3.2
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - '>='
|
52
|
+
- - ! '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 0.3.2
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rubyzip
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - '>='
|
59
|
+
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 1.0.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - '>='
|
66
|
+
- - ! '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 1.0.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: json-schema
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - '>='
|
73
|
+
- - ! '>='
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - '>='
|
80
|
+
- - ! '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
@@ -126,14 +126,14 @@ dependencies:
|
|
126
126
|
name: excon
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- - '>='
|
129
|
+
- - ! '>='
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '0'
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- - '>='
|
136
|
+
- - ! '>='
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
description: Client library and command-line tool to deploy and manage apps on Turbot.
|
@@ -175,6 +175,23 @@ files:
|
|
175
175
|
- lib/turbot/updater.rb
|
176
176
|
- lib/turbot/version.rb
|
177
177
|
- lib/vendor/turbot/okjson.rb
|
178
|
+
- schema/schemas/company-schema.json
|
179
|
+
- schema/schemas/includes/address.json
|
180
|
+
- schema/schemas/includes/base-statement.json
|
181
|
+
- schema/schemas/includes/company.json
|
182
|
+
- schema/schemas/includes/filing.json
|
183
|
+
- schema/schemas/includes/licence-data.json
|
184
|
+
- schema/schemas/includes/officer.json
|
185
|
+
- schema/schemas/includes/previous_name.json
|
186
|
+
- schema/schemas/includes/share-parcel-data.json
|
187
|
+
- schema/schemas/includes/share-parcel.json
|
188
|
+
- schema/schemas/includes/subsidiary-relationship-data.json
|
189
|
+
- schema/schemas/includes/total-shares.json
|
190
|
+
- schema/schemas/licence-schema.json
|
191
|
+
- schema/schemas/primary-data-schema.json
|
192
|
+
- schema/schemas/share-parcel-schema.json
|
193
|
+
- schema/schemas/simple-licence-schema.json
|
194
|
+
- schema/schemas/subsidiary-relationship-schema.json
|
178
195
|
- spec/helper/legacy_help.rb
|
179
196
|
- spec/helper/pg_dump_restore_spec.rb
|
180
197
|
- spec/schemas/dummy_schema.json
|
@@ -208,23 +225,6 @@ files:
|
|
208
225
|
- templates/manifest.json
|
209
226
|
- templates/python/scraper.py
|
210
227
|
- templates/ruby/scraper.rb
|
211
|
-
- schema/schemas/company-schema.json
|
212
|
-
- schema/schemas/includes/address.json
|
213
|
-
- schema/schemas/includes/base-statement.json
|
214
|
-
- schema/schemas/includes/company.json
|
215
|
-
- schema/schemas/includes/filing.json
|
216
|
-
- schema/schemas/includes/licence-data.json
|
217
|
-
- schema/schemas/includes/officer.json
|
218
|
-
- schema/schemas/includes/previous_name.json
|
219
|
-
- schema/schemas/includes/share-parcel-data.json
|
220
|
-
- schema/schemas/includes/share-parcel.json
|
221
|
-
- schema/schemas/includes/subsidiary-relationship-data.json
|
222
|
-
- schema/schemas/includes/total-shares.json
|
223
|
-
- schema/schemas/licence-schema.json
|
224
|
-
- schema/schemas/primary-data-schema.json
|
225
|
-
- schema/schemas/share-parcel-schema.json
|
226
|
-
- schema/schemas/simple-licence-schema.json
|
227
|
-
- schema/schemas/subsidiary-relationship-schema.json
|
228
228
|
homepage: http://turbot.com/
|
229
229
|
licenses:
|
230
230
|
- MIT
|
@@ -235,18 +235,19 @@ require_paths:
|
|
235
235
|
- lib
|
236
236
|
required_ruby_version: !ruby/object:Gem::Requirement
|
237
237
|
requirements:
|
238
|
-
- - '>='
|
238
|
+
- - ! '>='
|
239
239
|
- !ruby/object:Gem::Version
|
240
240
|
version: 1.9.2
|
241
241
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
242
242
|
requirements:
|
243
|
-
- - '>='
|
243
|
+
- - ! '>='
|
244
244
|
- !ruby/object:Gem::Version
|
245
245
|
version: '0'
|
246
246
|
requirements: []
|
247
247
|
rubyforge_project:
|
248
|
-
rubygems_version: 2.
|
248
|
+
rubygems_version: 2.2.2
|
249
249
|
signing_key:
|
250
250
|
specification_version: 4
|
251
251
|
summary: Client library and CLI to deploy apps on Turbot.
|
252
252
|
test_files: []
|
253
|
+
has_rdoc:
|