td 0.16.10 → 0.17.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +19 -27
- data/.github/workflows/codeql-analysis.yml +72 -0
- data/.gitignore +2 -0
- data/ChangeLog +9 -0
- data/Rakefile +4 -1
- data/lib/td/command/account.rb +7 -3
- data/lib/td/command/job.rb +3 -1
- data/lib/td/command/workflow.rb +4 -4
- data/lib/td/helpers.rb +1 -1
- data/lib/td/updater.rb +8 -7
- data/lib/td/version.rb +1 -1
- data/spec/td/command/account_spec.rb +79 -0
- data/spec/td/command/job_spec.rb +7 -1
- data/spec/td/fixture/testRootCA.crt +19 -0
- data/spec/td/fixture/testServer.crt +23 -0
- data/spec/td/fixture/testServer.key +27 -0
- data/spec/td/updater_spec.rb +7 -7
- data/td.gemspec +1 -1
- metadata +23 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ed6a6e5934d927122c94bd28a5e356e6d422cacf182e97b30d83b9d453c1a29
|
4
|
+
data.tar.gz: eab2f179e910311ac9e0e45325cb366fadfb053268c7707cf4336b8f91e8150d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74843a395778c6fba9bf45d625ecdccbdaf956a7dabc08f4fe0fc1832e567fef60b6600c38aefcffddbd619cddaeb05a45ad71d457df9c31c02ee95ffa934fd5
|
7
|
+
data.tar.gz: 0f629764b2006b045235c7e836c0f51edceaa620679833182aba1ce2ce1538e27c6bae28804e913e51f805f1e535f27e6bb5e2eb24a2aade58dc450ad67b011b
|
data/.circleci/config.yml
CHANGED
@@ -2,8 +2,8 @@ version: 2.1
|
|
2
2
|
|
3
3
|
|
4
4
|
orbs:
|
5
|
-
ruby: circleci/ruby@
|
6
|
-
win: circleci/windows@
|
5
|
+
ruby: circleci/ruby@2.0.0
|
6
|
+
win: circleci/windows@5.0.0
|
7
7
|
|
8
8
|
|
9
9
|
commands:
|
@@ -12,7 +12,7 @@ commands:
|
|
12
12
|
steps:
|
13
13
|
- run:
|
14
14
|
name: "Install MSYS2"
|
15
|
-
command: choco install msys2
|
15
|
+
command: choco install msys2 -y
|
16
16
|
- run:
|
17
17
|
name: "Install Ruby devkit"
|
18
18
|
command: ridk install 2 3
|
@@ -21,7 +21,7 @@ commands:
|
|
21
21
|
steps:
|
22
22
|
- run:
|
23
23
|
name: Which bundler?
|
24
|
-
command: bundle -v
|
24
|
+
command: ruby -v; bundle -v
|
25
25
|
- run:
|
26
26
|
name: Bundle install
|
27
27
|
command: bundle install
|
@@ -41,36 +41,28 @@ commands:
|
|
41
41
|
|
42
42
|
jobs:
|
43
43
|
|
44
|
-
|
45
|
-
|
46
|
-
image:
|
44
|
+
ruby_27:
|
45
|
+
docker:
|
46
|
+
- image: cimg/ruby:2.7-browsers
|
47
47
|
steps:
|
48
|
-
- ruby/install:
|
49
|
-
version: '2.5'
|
50
48
|
- run-tests-flow
|
51
49
|
|
52
|
-
|
53
|
-
|
54
|
-
image:
|
50
|
+
ruby_30:
|
51
|
+
docker:
|
52
|
+
- image: cimg/ruby:3.0-browsers
|
55
53
|
steps:
|
56
|
-
- ruby/install:
|
57
|
-
version: '2.6'
|
58
54
|
- run-tests-flow
|
59
55
|
|
60
|
-
|
61
|
-
|
62
|
-
image:
|
56
|
+
ruby_31:
|
57
|
+
docker:
|
58
|
+
- image: cimg/ruby:3.1-browsers
|
63
59
|
steps:
|
64
|
-
- ruby/install:
|
65
|
-
version: '2.7'
|
66
60
|
- run-tests-flow
|
67
61
|
|
68
|
-
|
69
|
-
|
70
|
-
image:
|
62
|
+
ruby_32:
|
63
|
+
docker:
|
64
|
+
- image: cimg/ruby:3.2-browsers
|
71
65
|
steps:
|
72
|
-
- ruby/install:
|
73
|
-
version: '3.0'
|
74
66
|
- run-tests-flow
|
75
67
|
|
76
68
|
win_ruby:
|
@@ -89,8 +81,8 @@ jobs:
|
|
89
81
|
workflows:
|
90
82
|
tests:
|
91
83
|
jobs:
|
92
|
-
- ruby_25
|
93
|
-
- ruby_26
|
94
84
|
- ruby_27
|
95
85
|
- ruby_30
|
96
|
-
|
86
|
+
- ruby_31
|
87
|
+
- ruby_32
|
88
|
+
- win_ruby
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# For most projects, this workflow file will not need changing; you simply need
|
2
|
+
# to commit it to your repository.
|
3
|
+
#
|
4
|
+
# You may wish to alter this file to override the set of languages analyzed,
|
5
|
+
# or to provide custom queries or build logic.
|
6
|
+
#
|
7
|
+
# ******** NOTE ********
|
8
|
+
# We have attempted to detect the languages in your repository. Please check
|
9
|
+
# the `language` matrix defined below to confirm you have the correct set of
|
10
|
+
# supported CodeQL languages.
|
11
|
+
#
|
12
|
+
name: "CodeQL"
|
13
|
+
|
14
|
+
on:
|
15
|
+
push:
|
16
|
+
branches: [ master ]
|
17
|
+
pull_request:
|
18
|
+
# The branches below must be a subset of the branches above
|
19
|
+
branches: [ master ]
|
20
|
+
schedule:
|
21
|
+
- cron: '29 4 * * 5'
|
22
|
+
|
23
|
+
jobs:
|
24
|
+
analyze:
|
25
|
+
name: Analyze
|
26
|
+
runs-on: ubuntu-latest
|
27
|
+
permissions:
|
28
|
+
actions: read
|
29
|
+
contents: read
|
30
|
+
security-events: write
|
31
|
+
|
32
|
+
strategy:
|
33
|
+
fail-fast: false
|
34
|
+
matrix:
|
35
|
+
language: [ 'ruby' ]
|
36
|
+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
37
|
+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
|
38
|
+
|
39
|
+
steps:
|
40
|
+
- name: Checkout repository
|
41
|
+
uses: actions/checkout@v3
|
42
|
+
|
43
|
+
# Initializes the CodeQL tools for scanning.
|
44
|
+
- name: Initialize CodeQL
|
45
|
+
uses: github/codeql-action/init@v2
|
46
|
+
with:
|
47
|
+
languages: ${{ matrix.language }}
|
48
|
+
# If you wish to specify custom queries, you can do so here or in a config file.
|
49
|
+
# By default, queries listed here will override any specified in a config file.
|
50
|
+
# Prefix the list here with "+" to use these queries and those in the config file.
|
51
|
+
|
52
|
+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
53
|
+
# queries: security-extended,security-and-quality
|
54
|
+
|
55
|
+
|
56
|
+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
57
|
+
# If this step fails, then you should remove it and run the build manually (see below)
|
58
|
+
- name: Autobuild
|
59
|
+
uses: github/codeql-action/autobuild@v2
|
60
|
+
|
61
|
+
# ℹ️ Command-line programs to run using the OS shell.
|
62
|
+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
63
|
+
|
64
|
+
# If the Autobuild fails above, remove it and uncomment the following three lines.
|
65
|
+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
|
66
|
+
|
67
|
+
# - run: |
|
68
|
+
# echo "Run, Build Application using script"
|
69
|
+
# ./location_of_script_within_repo/buildscript.sh
|
70
|
+
|
71
|
+
- name: Perform CodeQL Analysis
|
72
|
+
uses: github/codeql-action/analyze@v2
|
data/.gitignore
CHANGED
data/ChangeLog
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
== 2023-03-18 version 0.17.1
|
2
|
+
|
3
|
+
* Fix account command error on windows (for Ruby 3) #262
|
4
|
+
|
5
|
+
== 2023-03-28 version 0.17.0
|
6
|
+
|
7
|
+
* Show job's start & end time for td job:show [job_id] #253
|
8
|
+
* Support Ruby 3.2 by updating deprecated File.exists? to File.exist? #260
|
9
|
+
|
1
10
|
== 2020-09-16 version 0.16.10
|
2
11
|
|
3
12
|
* Support proxy with username and password
|
data/Rakefile
CHANGED
@@ -50,9 +50,12 @@ def install_use_gems(target_dir)
|
|
50
50
|
puts "Copy local gem #{ENV['TD_TOOLBELT_LOCAL_CLIENT_GEM']} to #{Dir.pwd}"
|
51
51
|
FileUtils.cp File.expand_path(ENV['TD_TOOLBELT_LOCAL_CLIENT_GEM']), Dir.pwd
|
52
52
|
end
|
53
|
-
Gem::GemRunner.new.run ["install", gem, "--no-
|
53
|
+
Gem::GemRunner.new.run ["install", gem, "--no-document"] # Use one of two commands bellow. Gem::GemRunner on ruby 3.0.5 has some weird bug
|
54
|
+
# sh "gem install \"#{gem}" --no-document"
|
55
|
+
# sh "/usr/local/td/ruby/bin/gem install \"#{gem}\" --no-document" # On OSX
|
54
56
|
rescue Gem::SystemExitException => e
|
55
57
|
unless e.exit_code.zero?
|
58
|
+
puts e, e.backtrace.join("\n")
|
56
59
|
raise e
|
57
60
|
end
|
58
61
|
end
|
data/lib/td/command/account.rb
CHANGED
@@ -113,12 +113,16 @@ module Command
|
|
113
113
|
|
114
114
|
private
|
115
115
|
if Helpers.on_windows?
|
116
|
-
require '
|
116
|
+
require 'fiddle'
|
117
117
|
|
118
118
|
def get_char
|
119
|
-
|
119
|
+
msvcrt = Fiddle.dlopen('msvcrt')
|
120
|
+
getch = Fiddle::Function.new(msvcrt['_getch'], [], Fiddle::TYPE_CHAR)
|
121
|
+
getch.call()
|
120
122
|
rescue Exception
|
121
|
-
|
123
|
+
crtdll = Fiddle.dlopen('crtdll')
|
124
|
+
getch = Fiddle::Function.new(crtdll['_getch'], [], Fiddle::TYPE_CHAR)
|
125
|
+
getch.call()
|
122
126
|
end
|
123
127
|
|
124
128
|
def get_password
|
data/lib/td/command/job.rb
CHANGED
@@ -173,6 +173,8 @@ private
|
|
173
173
|
$stdout.puts "Status : #{job.status}"
|
174
174
|
$stdout.puts "Type : #{job.type}"
|
175
175
|
$stdout.puts "Database : #{job.db_name}"
|
176
|
+
$stdout.puts "Start At : #{job.start_at}"
|
177
|
+
$stdout.puts "End At : #{job.end_at}"
|
176
178
|
# exclude some fields from bulk_import_perform type jobs
|
177
179
|
if [:hive, :pig, :impala, :presto].include?(job.type)
|
178
180
|
$stdout.puts "Priority : #{job_priority_name_of(job.priority)}"
|
@@ -404,7 +406,7 @@ private
|
|
404
406
|
raise "Unknown format #{format.inspect}"
|
405
407
|
end
|
406
408
|
|
407
|
-
if tempfile && File.
|
409
|
+
if tempfile && File.exist?(tempfile)
|
408
410
|
FileUtils.mv(tempfile, output.respond_to?(:path) ? output.path : output)
|
409
411
|
end
|
410
412
|
end
|
data/lib/td/command/workflow.rb
CHANGED
@@ -96,7 +96,7 @@ module TreasureData
|
|
96
96
|
def workflow_version(op)
|
97
97
|
op.cmd_parse # to show help
|
98
98
|
|
99
|
-
unless File.
|
99
|
+
unless File.exist?(digdag_cli_path)
|
100
100
|
$stderr.puts('Workflow module not yet installed.')
|
101
101
|
return 1
|
102
102
|
end
|
@@ -246,7 +246,7 @@ EOF
|
|
246
246
|
return false
|
247
247
|
end
|
248
248
|
if output =~ /openjdk version/ or output =~ /java version/
|
249
|
-
m = output.match(/version "(\d+)\.(\d+)\.(\d+)(?:_(\d+))?"/)
|
249
|
+
m = output.match(/version "(\d+)\.(\d+)\.(\d+)(\.\d+)?(?:_(\d+))?"/)
|
250
250
|
if not m or m.size < 4
|
251
251
|
return false
|
252
252
|
end
|
@@ -309,7 +309,7 @@ EOF
|
|
309
309
|
|
310
310
|
private
|
311
311
|
def download_java
|
312
|
-
if File.
|
312
|
+
if File.exist?(digdag_jre_dir)
|
313
313
|
return
|
314
314
|
end
|
315
315
|
|
@@ -427,7 +427,7 @@ EOF
|
|
427
427
|
def check_digdag_cli
|
428
428
|
check_system_java unless bundled_java?
|
429
429
|
|
430
|
-
unless File.
|
430
|
+
unless File.exist?(digdag_cli_path)
|
431
431
|
$stderr.puts 'Workflow module not yet installed, download now? [Y/n]'
|
432
432
|
line = $stdin.gets
|
433
433
|
line.strip!
|
data/lib/td/helpers.rb
CHANGED
data/lib/td/updater.rb
CHANGED
@@ -21,7 +21,7 @@ module ModuleDefinition
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def on_windows?
|
24
|
-
RUBY_PLATFORM =~ /mswin32|mingw32/
|
24
|
+
RUBY_PLATFORM =~ /mswin32|mingw32|mingw-ucrt/
|
25
25
|
end
|
26
26
|
|
27
27
|
def on_mac?
|
@@ -82,7 +82,7 @@ module ModuleDefinition
|
|
82
82
|
|
83
83
|
def wait_for_lock(path, wait_for = 5, check_every = 0.5)
|
84
84
|
start = Time.now.to_i
|
85
|
-
while File.
|
85
|
+
while File.exist?(path)
|
86
86
|
sleep check_every
|
87
87
|
if (Time.now.to_i - start) > wait_for
|
88
88
|
raise_error "Unable to acquire update lock"
|
@@ -142,14 +142,15 @@ module ModuleDefinition
|
|
142
142
|
end
|
143
143
|
|
144
144
|
def version_endpoint
|
145
|
-
"#{endpoint_root}/
|
145
|
+
"#{endpoint_root}/latest_version_0_17.#{package_category}"
|
146
146
|
end
|
147
147
|
|
148
148
|
def update_package_endpoint
|
149
|
-
"#{endpoint_root}/td-update-#{package_category}-0-
|
149
|
+
"#{endpoint_root}/td-update-#{package_category}-0-17.zip"
|
150
150
|
end
|
151
151
|
|
152
152
|
def update(autoupdate = false)
|
153
|
+
FileUtils.mkdir_p File.dirname(updating_lock_path)
|
153
154
|
wait_for_lock(updating_lock_path, 5) do
|
154
155
|
require "td"
|
155
156
|
require 'open-uri'
|
@@ -305,7 +306,7 @@ end # module ModuleDefinition
|
|
305
306
|
last_updated = existent_jar_updated_time
|
306
307
|
|
307
308
|
if updated > last_updated
|
308
|
-
FileUtils.mkdir_p(Updater.jarfile_dest_path) unless File.
|
309
|
+
FileUtils.mkdir_p(Updater.jarfile_dest_path) unless File.exist?(Updater.jarfile_dest_path)
|
309
310
|
Dir.chdir(Updater.jarfile_dest_path) do
|
310
311
|
status = nil
|
311
312
|
indicator = Command::TimeBasedDownloadProgressIndicator.new(
|
@@ -334,7 +335,7 @@ end # module ModuleDefinition
|
|
334
335
|
else
|
335
336
|
$stdout.puts "Update of td-import.jar failed."
|
336
337
|
$stdout.puts "Please execute 'td import:jar_update' later to update td-import.jar correctly."
|
337
|
-
File.delete 'td-import.jar.new' if File.
|
338
|
+
File.delete 'td-import.jar.new' if File.exist? 'td-import.jar.new'
|
338
339
|
end
|
339
340
|
end
|
340
341
|
else
|
@@ -359,7 +360,7 @@ end # module ModuleDefinition
|
|
359
360
|
end
|
360
361
|
end
|
361
362
|
|
362
|
-
if File.
|
363
|
+
if File.exist?(last_jar_autoupdate_timestamp) && \
|
363
364
|
(Time.now - File.mtime(last_jar_autoupdate_timestamp)).to_i < (60 * 60 * 1) # every hour
|
364
365
|
return
|
365
366
|
end
|
data/lib/td/version.rb
CHANGED
@@ -0,0 +1,79 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
require "tempfile"
|
5
|
+
require 'td/command/common'
|
6
|
+
require 'td/command/account'
|
7
|
+
require 'td/command/list'
|
8
|
+
require 'td/helpers'
|
9
|
+
|
10
|
+
module TreasureData::Command
|
11
|
+
describe 'account command' do
|
12
|
+
let :command do
|
13
|
+
Class.new { include TreasureData::Command }.new
|
14
|
+
end
|
15
|
+
let(:client) { double(:client) }
|
16
|
+
let(:conf_file) { Tempfile.new("td.conf").tap {|s| s.close } }
|
17
|
+
let(:conf_expect) {
|
18
|
+
"""[account]
|
19
|
+
user = test@email.com
|
20
|
+
apikey = 1/xxx
|
21
|
+
"""
|
22
|
+
}
|
23
|
+
|
24
|
+
before do
|
25
|
+
TreasureData::Config.path = conf_file.path
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'is called without any option' do
|
29
|
+
expect(STDIN).to receive(:gets).and_return('test@email.com')
|
30
|
+
if TreasureData::Helpers.on_windows?
|
31
|
+
'password'.chars.each { |c| expect(command).to receive(:get_char).and_return(c) }
|
32
|
+
expect(command).to receive(:get_char).and_return(nil)
|
33
|
+
else
|
34
|
+
expect(STDIN).to receive(:gets).and_return('password')
|
35
|
+
end
|
36
|
+
expect(TreasureData::Client).to receive(:authenticate).and_return(client)
|
37
|
+
expect(client).to receive(:apikey).and_return("1/xxx")
|
38
|
+
|
39
|
+
op = List::CommandParser.new("account", %w[], %w[], false, [], true)
|
40
|
+
command.account(op)
|
41
|
+
|
42
|
+
expect(File.read(conf_file.path)).to eq(conf_expect)
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'is called with -f option' do
|
46
|
+
if TreasureData::Helpers.on_windows?
|
47
|
+
'password'.chars.each { |c| expect(command).to receive(:get_char).and_return(c) }
|
48
|
+
expect(command).to receive(:get_char).and_return(nil)
|
49
|
+
else
|
50
|
+
expect(STDIN).to receive(:gets).and_return('password')
|
51
|
+
end
|
52
|
+
expect(TreasureData::Client).to receive(:authenticate).and_return(client)
|
53
|
+
expect(client).to receive(:apikey).and_return("1/xxx")
|
54
|
+
|
55
|
+
op = List::CommandParser.new("account", %w[-f], %w[], false, ['test@email.com'], true)
|
56
|
+
command.account(op)
|
57
|
+
|
58
|
+
expect(File.read(conf_file.path)).to eq(conf_expect)
|
59
|
+
end
|
60
|
+
|
61
|
+
it 'is called with username password mismatched' do
|
62
|
+
if TreasureData::Helpers.on_windows?
|
63
|
+
3.times do
|
64
|
+
'password'.chars.each { |c| expect(command).to receive(:get_char).and_return(c) }
|
65
|
+
expect(command).to receive(:get_char).and_return(nil)
|
66
|
+
end
|
67
|
+
else
|
68
|
+
expect(STDIN).to receive(:gets).and_return('password').thrice
|
69
|
+
end
|
70
|
+
expect(TreasureData::Client).to receive(:authenticate).thrice.and_raise(TreasureData::AuthError)
|
71
|
+
expect(STDERR).to receive(:puts).with('User name or password mismatched.').thrice
|
72
|
+
|
73
|
+
op = List::CommandParser.new("account", %w[-f], %w[], false, ['test@email.com'], true)
|
74
|
+
command.account(op)
|
75
|
+
|
76
|
+
expect(File.read(conf_file.path)).to eq("")
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
data/spec/td/command/job_spec.rb
CHANGED
@@ -271,6 +271,8 @@ text
|
|
271
271
|
|
272
272
|
describe '#job_show' do
|
273
273
|
let(:job_id) { "12345" }
|
274
|
+
let(:start_at) { Time.now.strftime('%Y-%m-%d %H:%M:%S UTC') }
|
275
|
+
let(:end_at) { (Time.now + 60).strftime('%Y-%m-%d %H:%M:%S UTC') }
|
274
276
|
|
275
277
|
let :job_classs do
|
276
278
|
Struct.new(:job_id,
|
@@ -278,6 +280,8 @@ text
|
|
278
280
|
:type,
|
279
281
|
:db_name,
|
280
282
|
:priority,
|
283
|
+
:start_at,
|
284
|
+
:end_at,
|
281
285
|
:retry_limit,
|
282
286
|
:result_url,
|
283
287
|
:query,
|
@@ -292,6 +296,8 @@ text
|
|
292
296
|
:hive,
|
293
297
|
"db_name",
|
294
298
|
1,
|
299
|
+
start_at,
|
300
|
+
end_at,
|
295
301
|
1,
|
296
302
|
"test_url",
|
297
303
|
"test_qury",
|
@@ -410,7 +416,7 @@ ACTUAL
|
|
410
416
|
end
|
411
417
|
|
412
418
|
let(:line_separator) {
|
413
|
-
if RUBY_PLATFORM =~ /mswin32|mingw32/
|
419
|
+
if RUBY_PLATFORM =~ /mswin32|mingw32|mingw-ucrt/
|
414
420
|
"\r\n"
|
415
421
|
else
|
416
422
|
"\n"
|
@@ -0,0 +1,19 @@
|
|
1
|
+
-----BEGIN CERTIFICATE-----
|
2
|
+
MIIDBDCCAewCCQCQdq0wStTtITANBgkqhkiG9w0BAQsFADBEMR0wGwYDVQQDDBR3
|
3
|
+
d3cudHJlYXN1cmVkYXRhLmNvbTELMAkGA1UEBhMCVVMxFjAUBgNVBAcMDVNhbiBG
|
4
|
+
cmFuc2lzY28wHhcNMjIxMDE0MDQzNjA0WhcNMzIwNzEzMDQzNjA0WjBEMR0wGwYD
|
5
|
+
VQQDDBR3d3cudHJlYXN1cmVkYXRhLmNvbTELMAkGA1UEBhMCVVMxFjAUBgNVBAcM
|
6
|
+
DVNhbiBGcmFuc2lzY28wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCU
|
7
|
+
4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|
27
|
+
-----END RSA PRIVATE KEY-----
|
data/spec/td/updater_spec.rb
CHANGED
@@ -8,7 +8,7 @@ require 'logger'
|
|
8
8
|
|
9
9
|
module TreasureData::Updater
|
10
10
|
|
11
|
-
|
11
|
+
%w(x86_64-darwin14 x64-mingw32).each do |platform|
|
12
12
|
describe "RUBY_PLATFORM is '#{platform}'" do
|
13
13
|
before do
|
14
14
|
stub_const('RUBY_PLATFORM', platform)
|
@@ -128,7 +128,7 @@ module TreasureData::Updater
|
|
128
128
|
subject
|
129
129
|
end
|
130
130
|
tmpfile = File.join(TreasureData::Updater.jarfile_dest_path, 'td-import.jar.new')
|
131
|
-
expect(File.
|
131
|
+
expect(File.exist?(tmpfile)).to eq false
|
132
132
|
end
|
133
133
|
end
|
134
134
|
|
@@ -171,7 +171,7 @@ module TreasureData::Updater
|
|
171
171
|
@proxy_server = WEBrick::HTTPProxyServer.new(
|
172
172
|
:BindAddress => "localhost",
|
173
173
|
:Logger => logger,
|
174
|
-
:Port =>
|
174
|
+
:Port => 1000 + rand(1000),
|
175
175
|
:AccessLog => []
|
176
176
|
)
|
177
177
|
@proxy_server_thread = start_server_thread(@proxy_server)
|
@@ -185,13 +185,13 @@ module TreasureData::Updater
|
|
185
185
|
@server = WEBrick::HTTPServer.new(
|
186
186
|
:BindAddress => "localhost",
|
187
187
|
:Logger => logger,
|
188
|
-
:Port =>
|
188
|
+
:Port => 1000 + rand(1000),
|
189
189
|
:AccessLog => [],
|
190
190
|
:DocumentRoot => '.',
|
191
191
|
:SSLEnable => true,
|
192
|
-
:SSLCACertificateFile => fixture_file('
|
193
|
-
:SSLCertificate => cert('
|
194
|
-
:SSLPrivateKey => key('
|
192
|
+
:SSLCACertificateFile => fixture_file('testRootCA.crt'),
|
193
|
+
:SSLCertificate => cert('testServer.crt'),
|
194
|
+
:SSLPrivateKey => key('testServer.key')
|
195
195
|
)
|
196
196
|
@serverport = @server.config[:Port]
|
197
197
|
@server.mount(
|
data/td.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |gem|
|
|
19
19
|
|
20
20
|
gem.add_dependency "msgpack"
|
21
21
|
gem.add_dependency "rexml"
|
22
|
-
gem.add_dependency "yajl-ruby", "
|
22
|
+
gem.add_dependency "yajl-ruby", ">= 1.3.1", "< 2.0"
|
23
23
|
gem.add_dependency "hirb", ">= 0.4.5"
|
24
24
|
gem.add_dependency "parallel", "~> 1.20.0"
|
25
25
|
gem.add_dependency "td-client", ">= 1.0.8", "< 2"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: td
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.17.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Treasure Data, Inc.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: msgpack
|
@@ -42,16 +42,22 @@ dependencies:
|
|
42
42
|
name: yajl-ruby
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 1.3.1
|
48
|
+
- - "<"
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '2.0'
|
48
51
|
type: :runtime
|
49
52
|
prerelease: false
|
50
53
|
version_requirements: !ruby/object:Gem::Requirement
|
51
54
|
requirements:
|
52
|
-
- - "
|
55
|
+
- - ">="
|
53
56
|
- !ruby/object:Gem::Version
|
54
57
|
version: 1.3.1
|
58
|
+
- - "<"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '2.0'
|
55
61
|
- !ruby/object:Gem::Dependency
|
56
62
|
name: hirb
|
57
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -242,6 +248,7 @@ files:
|
|
242
248
|
- ".circleci/config.yml"
|
243
249
|
- ".coveralls.yml"
|
244
250
|
- ".github/CODEOWNERS"
|
251
|
+
- ".github/workflows/codeql-analysis.yml"
|
245
252
|
- ".gitignore"
|
246
253
|
- ChangeLog
|
247
254
|
- Gemfile
|
@@ -297,6 +304,7 @@ files:
|
|
297
304
|
- spec/file_reader/shared_context.rb
|
298
305
|
- spec/file_reader_spec.rb
|
299
306
|
- spec/spec_helper.rb
|
307
|
+
- spec/td/command/account_spec.rb
|
300
308
|
- spec/td/command/connector_spec.rb
|
301
309
|
- spec/td/command/export_spec.rb
|
302
310
|
- spec/td/command/import_spec.rb
|
@@ -314,6 +322,9 @@ files:
|
|
314
322
|
- spec/td/fixture/ca.cert
|
315
323
|
- spec/td/fixture/server.cert
|
316
324
|
- spec/td/fixture/server.key
|
325
|
+
- spec/td/fixture/testRootCA.crt
|
326
|
+
- spec/td/fixture/testServer.crt
|
327
|
+
- spec/td/fixture/testServer.key
|
317
328
|
- spec/td/fixture/tmp.zip
|
318
329
|
- spec/td/helpers_spec.rb
|
319
330
|
- spec/td/updater_spec.rb
|
@@ -323,7 +334,7 @@ homepage: http://treasure-data.com/
|
|
323
334
|
licenses:
|
324
335
|
- Apache-2.0
|
325
336
|
metadata: {}
|
326
|
-
post_install_message:
|
337
|
+
post_install_message:
|
327
338
|
rdoc_options: []
|
328
339
|
require_paths:
|
329
340
|
- lib
|
@@ -338,8 +349,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
338
349
|
- !ruby/object:Gem::Version
|
339
350
|
version: '0'
|
340
351
|
requirements: []
|
341
|
-
rubygems_version: 3.1.
|
342
|
-
signing_key:
|
352
|
+
rubygems_version: 3.1.6
|
353
|
+
signing_key:
|
343
354
|
specification_version: 4
|
344
355
|
summary: CLI to manage data on Treasure Data, the Hadoop-based cloud data warehousing
|
345
356
|
test_files:
|
@@ -350,6 +361,7 @@ test_files:
|
|
350
361
|
- spec/file_reader/shared_context.rb
|
351
362
|
- spec/file_reader_spec.rb
|
352
363
|
- spec/spec_helper.rb
|
364
|
+
- spec/td/command/account_spec.rb
|
353
365
|
- spec/td/command/connector_spec.rb
|
354
366
|
- spec/td/command/export_spec.rb
|
355
367
|
- spec/td/command/import_spec.rb
|
@@ -367,6 +379,9 @@ test_files:
|
|
367
379
|
- spec/td/fixture/ca.cert
|
368
380
|
- spec/td/fixture/server.cert
|
369
381
|
- spec/td/fixture/server.key
|
382
|
+
- spec/td/fixture/testRootCA.crt
|
383
|
+
- spec/td/fixture/testServer.crt
|
384
|
+
- spec/td/fixture/testServer.key
|
370
385
|
- spec/td/fixture/tmp.zip
|
371
386
|
- spec/td/helpers_spec.rb
|
372
387
|
- spec/td/updater_spec.rb
|