holistics 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 1bba5c00d378d880776abee2c49de89169d805c446eb568cdd53dd06230875c3
4
- data.tar.gz: de6a9892e7731010c961783945cda2ea86ba26bcbda8492ddf53bbf57016029e
2
+ SHA1:
3
+ metadata.gz: ffce28cb403ef54cf6156f4a12a34e706af7c577
4
+ data.tar.gz: 65625fde7662ae2eddedc3b755be7032d4f630c9
5
5
  SHA512:
6
- metadata.gz: 16de9d14ab01ab1c6a187ce74ddf00f3c366b026c227b5c3fd0e619084fc4d201063e136a677f59ce64a6dc3cef1db8eda1a60d01418cc8020280ebaf32d7c4b
7
- data.tar.gz: 73657415d7f7f527153f34440a01fbf0831505e11e242d0ff589590bed3551638db95167d4eb6002c66eba45963e7c1ff0e6fc87012908f2734d5982416bfdc5
6
+ metadata.gz: 14645938e81efebebb908a9de57524f375cd8284f696e24af01909104d66b60ea6f201be903f5a9b90791caebbcc97d28b159a85e207b2395e09e897f42721fb
7
+ data.tar.gz: 6557d616892de1f276dd33231c817cd8c5e836063cf22cc534d3cc0c9db34cbae2540844b8676b18f769d3859e0958f1bca381d581b63d33302135199c71b18e
data/CHANGELOG.md CHANGED
@@ -2,32 +2,37 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
- ## v0.0.11
6
- * Support invocation of transform from CLI: `holistics transform -j <id>`
5
+ ## v0.3.3
6
+ * Add "transform list" and "import list" commands
7
+ * Add "version" command
7
8
 
8
- ## v0.0.12
9
- * Support generation of transport config files from CLI: `holistics generate_configs -s <src_ds_id> -d <dest_ds_id> -t <tables> [-o <output>]`
9
+ ## v0.3.2
10
+ * Add 'colorize' to gemspec dependencies
10
11
 
11
- ## v0.1.0
12
- * Modularized transport and data_sources commands. Rename existing transport command to transport_old.
12
+ ## v0.3.1
13
+ * Add option to split a custom range Data Import execution into smaller ones
13
14
 
14
- ## v0.2.0
15
- * Support command to import csv into table
15
+ ## v0.3.0
16
+ * Add option to execute Data Imports in custom range mode
16
17
 
17
- ## v0.2.1
18
- * Fix dependency error
18
+ ## v0.2.6
19
+ * Add error handling and retry mechanism for `fetch_job_details`
19
20
 
20
21
  ## v0.2.5
21
22
  * Support invoking email schedule with `holistics email_schedule trigger <id>`
22
23
 
23
- ## v0.2.6
24
- * Add error handling and retry mechanism for `fetch_job_details`
24
+ ## v0.2.1
25
+ * Fix dependency error
25
26
 
26
- ## v0.3.0
27
- * Add option to execute Data Imports in custom range mode
27
+ ## v0.2.0
28
+ * Support command to import csv into table
28
29
 
29
- ## v0.3.1
30
- * Add option to split a custom range Data Import execution into smaller ones
30
+ ## v0.1.0
31
+ * Modularized transport and data_sources commands. Rename existing transport command to transport_old.
32
+
33
+ ## v0.0.12
34
+ * Support generation of transport config files from CLI: `holistics generate_configs -s <src_ds_id> -d <dest_ds_id> -t <tables> [-o <output>]`
35
+
36
+ ## v0.0.11
37
+ * Support invocation of transform from CLI: `holistics transform -j <id>`
31
38
 
32
- ## v0.3.2
33
- * Add 'colorize' to gemspec dependencies
data/README.md CHANGED
@@ -8,6 +8,7 @@ Command-line interface to Holistics API
8
8
  First, open `version.rb` and increase the version number. Please also update the changelog too.
9
9
 
10
10
  Then run the following:
11
+ $ git tag -a v0.0.3 && git push --tags
11
12
 
12
13
  $ gem build holistics.gemspec
13
14
  WARNING: description and summary are identical
@@ -49,6 +49,26 @@ module Holistics
49
49
  puts TabularFormatter.new(table).to_pretty_table
50
50
  end
51
51
 
52
+ def import_list
53
+ result = http_request.get 'data_imports.json', 'Error retrieving list of data imports'
54
+
55
+ table = [%w(ID Name)]
56
+ rows = result.map {|record| [record['id'], record['title']]}
57
+ table.concat(rows)
58
+
59
+ puts TabularFormatter.new(table).to_pretty_table
60
+ end
61
+
62
+ def transform_list
63
+ result = http_request.get 'data_transforms.json', 'Error retrieving list of data transports'
64
+
65
+ table = [%w(ID Name)]
66
+ rows = result.map {|record| [record['id'], record['title']]}
67
+ table.concat(rows)
68
+
69
+ puts TabularFormatter.new(table).to_pretty_table
70
+ end
71
+
52
72
  def send_transport(options)
53
73
  puts 'Submitting transport job ...'
54
74
 
@@ -1,4 +1,4 @@
1
1
  module Holistics
2
- VERSION = '0.3.2'
2
+ VERSION = '0.3.3'
3
3
  DATE = '2018-08-24'
4
4
  end
data/lib/holistics.rb CHANGED
@@ -1,12 +1,14 @@
1
1
  require 'thor'
2
2
  require 'vcr_helper'
3
3
 
4
+ require 'holistics/version'
4
5
  require 'holistics/api_client'
5
6
  require 'holistics/custom_logger'
6
7
  require 'holistics/auth_api_client'
7
8
 
8
9
  require 'import'
9
10
  require 'transport'
11
+ require 'transform'
10
12
  require 'data_sources'
11
13
  require 'email_schedule'
12
14
 
@@ -43,6 +45,7 @@ module Holistics
43
45
 
44
46
  register(Holistics::Import, 'import', 'import <command>', "Execute import commands")
45
47
  register(Holistics::Transport, 'transport', 'transport <command>', "Execute transport module's commands")
48
+ register(Holistics::Transform, 'transform', 'transform <command>', "Execute transform module's commands")
46
49
  register(Holistics::DataSources, 'data_sources', 'data_sources <command>', "Execute data_sources module's commands")
47
50
  register(Holistics::EmailSchedule, 'email_schedule', 'email_schedule <command>', "Execute email schedule's commands")
48
51
 
@@ -69,13 +72,6 @@ module Holistics
69
72
  api_client.ds_list
70
73
  end
71
74
 
72
- method_option :transform_id, aliases: '-j', type: :string, required: true, desc: 'ID of transform job to be executed'
73
- desc 'transform', 'Invoke a transform'
74
-
75
- def transform
76
- api_client.send_transform(options.dup)
77
- end
78
-
79
75
  method_option :job_id, aliases: '-j', type: :string, required: true, desc: 'Job ID'
80
76
  desc 'job_show', 'Show job log'
81
77
 
@@ -83,5 +79,9 @@ module Holistics
83
79
  api_client.job_show(options.dup)
84
80
  end
85
81
 
82
+ desc 'version', "Show current Holistics gem's version"
83
+ def version
84
+ puts Holistics::VERSION
85
+ end
86
86
  end
87
87
  end
data/lib/import.rb CHANGED
@@ -42,6 +42,11 @@ module Holistics
42
42
  exit 1
43
43
  end
44
44
 
45
+ desc 'list', 'List all data imports'
46
+ def list
47
+ api_client.import_list
48
+ end
49
+
45
50
  no_commands do
46
51
  def api_client
47
52
  @api_client ||= ApiClient.new
@@ -79,4 +84,4 @@ module Holistics
79
84
  raise
80
85
  end
81
86
  end
82
- end
87
+ end
data/lib/transform.rb ADDED
@@ -0,0 +1,29 @@
1
+ require 'thor'
2
+
3
+ module Holistics
4
+ class Transform < Thor
5
+
6
+ no_commands do
7
+ def api_client
8
+ @api_client ||= ApiClient.new
9
+ end
10
+ end
11
+
12
+ method_option :transform_id, aliases: '-j', type: :string, desc: 'ID of transform job to be executed'
13
+ desc 'transform', 'Invoke a transform'
14
+
15
+ def transform
16
+ unless options['transform_id']
17
+ puts "Please include a tranform job ID to execute. Usage: 'holistics transform --transform-id <id>'."
18
+ exit 1
19
+ end
20
+ api_client.send_transform(options.dup)
21
+ end
22
+ default_task :transform
23
+
24
+ desc 'list', 'List all data transforms'
25
+ def list
26
+ api_client.transform_list
27
+ end
28
+ end
29
+ end
data/lib/transport.rb CHANGED
@@ -30,4 +30,4 @@ module Holistics
30
30
  api_client.generate_configs(options.dup)
31
31
  end
32
32
  end
33
- end
33
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: holistics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thanh Dinh Khac
@@ -119,6 +119,7 @@ files:
119
119
  - lib/holistics/version.rb
120
120
  - lib/import.rb
121
121
  - lib/tabular_formatter.rb
122
+ - lib/transform.rb
122
123
  - lib/transport.rb
123
124
  - lib/vcr_helper.rb
124
125
  homepage: http://rubygems.org/gems/holistics-cli
@@ -142,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
143
  version: '0'
143
144
  requirements: []
144
145
  rubyforge_project:
145
- rubygems_version: 2.7.7
146
+ rubygems_version: 2.5.1
146
147
  signing_key:
147
148
  specification_version: 4
148
149
  summary: CLI interface for Holistics