metabase 0.2.1 → 0.3.0

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
2
  SHA256:
3
- metadata.gz: 7b6f8d748749abe8603172d7ed0a2380f81c9df61cc8389a11aa821c68e97109
4
- data.tar.gz: 845adef4776a28caf3bb90b9eb5668c19599361ef429945d627dee2b2eb8b3d5
3
+ metadata.gz: 944b418f74875fc59219308f4bf26e457099de6ff69d4454720912843ca56166
4
+ data.tar.gz: cfe79b0776cc7ecba0805524b3ff876331cb50d404972d73486157947b755e27
5
5
  SHA512:
6
- metadata.gz: d164ecf4947626f07468f1e1e0433a29682719be9c27056d96fd265a2a79dc1ebc2d7a47686ce0827daeb3ad0ee6c542ef769863f6745a5111e2a42a09ef5210
7
- data.tar.gz: 57c338c8f05ca02bdf9069b987bd54038119bf6c3d9b761b1a175162a8b26a789efe1f28c5121e3c9be3460c2c0f4c2893d7b8ff10cea9dae4a15ace9b12cc9e
6
+ metadata.gz: d2a864f72838616b9350acc8bbec0656a6ff7c14fbdb8e699bdd7246619de67c6f6a69dd67e3b1a854c96218a92755e4398e4049a9fc3da9ac03f447d937f468
7
+ data.tar.gz: b731670ff711e4c6791f142a061c59883049e570954a6d94640b06cd81919842a8348394590bd418c5a39eba524ddbdba1116ea9016a020755581ad0cbea8129
@@ -1,5 +1,6 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.3
2
+ TargetRubyVersion: 2.5
3
+ NewCops: enable
3
4
 
4
5
  Style/Documentation:
5
6
  Enabled: false
@@ -1,8 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - 2.7
4
+ - 2.6
3
5
  - 2.5
4
- - 2.4
5
- - 2.3
6
6
 
7
7
  script:
8
8
  - bundle exec rubocop
@@ -1,81 +1,84 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- metabase (0.2.1)
4
+ metabase (0.3.0)
5
5
  faraday (~> 0.8)
6
6
  faraday_middleware
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- addressable (2.5.2)
12
- public_suffix (>= 2.0.2, < 4.0)
11
+ addressable (2.7.0)
12
+ public_suffix (>= 2.0.2, < 5.0)
13
+ amazing_print (1.1.0)
13
14
  ast (2.4.0)
14
- awesome_print (1.8.0)
15
- bump (0.6.0)
16
- coderay (1.1.2)
15
+ bump (0.9.0)
16
+ coderay (1.1.3)
17
17
  crack (0.4.3)
18
18
  safe_yaml (~> 1.0.0)
19
19
  diff-lcs (1.3)
20
- docile (1.3.1)
21
- faraday (0.15.2)
20
+ docile (1.3.2)
21
+ faraday (0.17.3)
22
22
  multipart-post (>= 1.2, < 3)
23
- faraday_middleware (0.12.2)
23
+ faraday_middleware (0.14.0)
24
24
  faraday (>= 0.7.4, < 1.0)
25
- hashdiff (0.3.7)
26
- json (2.1.0)
27
- method_source (0.9.0)
28
- multipart-post (2.0.0)
29
- parallel (1.12.1)
30
- parser (2.5.1.0)
25
+ hashdiff (1.0.1)
26
+ method_source (1.0.0)
27
+ multipart-post (2.1.1)
28
+ parallel (1.19.1)
29
+ parser (2.7.1.3)
31
30
  ast (~> 2.4.0)
32
- powerpack (0.1.1)
33
- pry (0.11.3)
34
- coderay (~> 1.1.0)
35
- method_source (~> 0.9.0)
36
- public_suffix (3.0.2)
31
+ pry (0.13.1)
32
+ coderay (~> 1.1)
33
+ method_source (~> 1.0)
34
+ public_suffix (4.0.5)
37
35
  rainbow (3.0.0)
38
- rake (12.3.1)
39
- rspec (3.7.0)
40
- rspec-core (~> 3.7.0)
41
- rspec-expectations (~> 3.7.0)
42
- rspec-mocks (~> 3.7.0)
43
- rspec-core (3.7.1)
44
- rspec-support (~> 3.7.0)
45
- rspec-expectations (3.7.0)
36
+ rake (13.0.1)
37
+ regexp_parser (1.7.0)
38
+ rexml (3.2.4)
39
+ rspec (3.9.0)
40
+ rspec-core (~> 3.9.0)
41
+ rspec-expectations (~> 3.9.0)
42
+ rspec-mocks (~> 3.9.0)
43
+ rspec-core (3.9.2)
44
+ rspec-support (~> 3.9.3)
45
+ rspec-expectations (3.9.2)
46
46
  diff-lcs (>= 1.2.0, < 2.0)
47
- rspec-support (~> 3.7.0)
48
- rspec-mocks (3.7.0)
47
+ rspec-support (~> 3.9.0)
48
+ rspec-mocks (3.9.1)
49
49
  diff-lcs (>= 1.2.0, < 2.0)
50
- rspec-support (~> 3.7.0)
51
- rspec-support (3.7.1)
52
- rubocop (0.56.0)
50
+ rspec-support (~> 3.9.0)
51
+ rspec-support (3.9.3)
52
+ rubocop (0.85.0)
53
53
  parallel (~> 1.10)
54
- parser (>= 2.5)
55
- powerpack (~> 0.1)
54
+ parser (>= 2.7.0.1)
56
55
  rainbow (>= 2.2.2, < 4.0)
56
+ regexp_parser (>= 1.7)
57
+ rexml
58
+ rubocop-ast (>= 0.0.3)
57
59
  ruby-progressbar (~> 1.7)
58
- unicode-display_width (~> 1.0, >= 1.0.1)
59
- ruby-progressbar (1.9.0)
60
- safe_yaml (1.0.4)
61
- simplecov (0.16.1)
60
+ unicode-display_width (>= 1.4.0, < 2.0)
61
+ rubocop-ast (0.0.3)
62
+ parser (>= 2.7.0.1)
63
+ ruby-progressbar (1.10.1)
64
+ safe_yaml (1.0.5)
65
+ simplecov (0.18.5)
62
66
  docile (~> 1.1)
63
- json (>= 1.8, < 3)
64
- simplecov-html (~> 0.10.0)
65
- simplecov-html (0.10.2)
66
- unicode-display_width (1.3.2)
67
- vcr (4.0.0)
68
- webmock (3.4.1)
67
+ simplecov-html (~> 0.11)
68
+ simplecov-html (0.12.2)
69
+ unicode-display_width (1.7.0)
70
+ vcr (6.0.0)
71
+ webmock (3.8.3)
69
72
  addressable (>= 2.3.6)
70
73
  crack (>= 0.3.2)
71
- hashdiff
72
- yard (0.9.12)
74
+ hashdiff (>= 0.4.0, < 2.0.0)
75
+ yard (0.9.25)
73
76
 
74
77
  PLATFORMS
75
78
  ruby
76
79
 
77
80
  DEPENDENCIES
78
- awesome_print
81
+ amazing_print
79
82
  bump
80
83
  bundler
81
84
  metabase!
@@ -89,4 +92,4 @@ DEPENDENCIES
89
92
  yard
90
93
 
91
94
  BUNDLED WITH
92
- 1.16.2
95
+ 2.1.4
@@ -3,6 +3,7 @@
3
3
 
4
4
  require 'bundler/setup'
5
5
  require 'metabase'
6
+ require 'amazing_print'
6
7
  require 'pry'
7
8
 
8
9
  Pry.start
@@ -1,7 +1,7 @@
1
1
  version: '3'
2
2
  services:
3
3
  metabase:
4
- image: metabase/metabase:v0.29.3
4
+ image: metabase/metabase:v0.30.3
5
5
  environment:
6
6
  MB_DB_TYPE: postgres
7
7
  MB_DB_DBNAME: metabase
@@ -35,6 +35,7 @@ module Metabase
35
35
 
36
36
  error = Error.from_response(response)
37
37
  raise error if error
38
+
38
39
  response.body
39
40
  end
40
41
 
@@ -9,7 +9,7 @@ module Metabase
9
9
  # @return [Array<Hash>] Parsed response JSON
10
10
  # @see https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#get-apiactivity
11
11
  def activities(**params)
12
- get('/api/activity', params)
12
+ get('/api/activity', **params)
13
13
  end
14
14
  end
15
15
  end
@@ -9,7 +9,7 @@ module Metabase
9
9
  # @return [Array<Hash>] Parsed response JSON
10
10
  # @see https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#get-apialert
11
11
  def alerts(**params)
12
- get('/api/alert', params)
12
+ get('/api/alert', **params)
13
13
  end
14
14
  end
15
15
  end
@@ -9,7 +9,7 @@ module Metabase
9
9
  # @return [Array<Integer>] Parsed response JSON
10
10
  # @see https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#get-apiasyncrunning-jobs
11
11
  def running_jobs(**params)
12
- get('/api/async/running-jobs', params)
12
+ get('/api/async/running-jobs', **params)
13
13
  end
14
14
  end
15
15
  end
@@ -9,7 +9,7 @@ module Metabase
9
9
  # @return [Array<Hash>] Parsed response JSON
10
10
  # @see https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#get-apicard
11
11
  def cards(**params)
12
- get('/api/card', params)
12
+ get('/api/card', **params)
13
13
  end
14
14
 
15
15
  # Fetch the card.
@@ -19,7 +19,7 @@ module Metabase
19
19
  # @return [Hash] Parsed response JSON
20
20
  # @see https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#get-apicardid
21
21
  def card(card_id, **params)
22
- get("/api/card/#{card_id}", params)
22
+ get("/api/card/#{card_id}", **params)
23
23
  end
24
24
 
25
25
  # Fetch query results of the card with metadata.
@@ -29,7 +29,7 @@ module Metabase
29
29
  # @return [Hash] Parsed response JSON
30
30
  # @see https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#post-apicardcard-idquery
31
31
  def query_card_with_metadata(card_id, **params)
32
- post("/api/card/#{card_id}/query", params)
32
+ post("/api/card/#{card_id}/query", **params)
33
33
  end
34
34
 
35
35
  # Fetch query results of the card.
@@ -40,7 +40,7 @@ module Metabase
40
40
  # @return [Array<Hash>, String] Query results
41
41
  # @see https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#post-apicardcard-idqueryexport-format
42
42
  def query_card(card_id, format: :json, **params)
43
- post("/api/card/#{card_id}/query/#{format}", params)
43
+ post("/api/card/#{card_id}/query/#{format}", **params)
44
44
  end
45
45
  end
46
46
  end
@@ -9,7 +9,7 @@ module Metabase
9
9
  # @return [Array<Hash>] Parsed response JSON
10
10
  # @see https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#get-apicollection
11
11
  def collections(**params)
12
- get('/api/collection', params)
12
+ get('/api/collection', **params)
13
13
  end
14
14
  end
15
15
  end
@@ -9,7 +9,7 @@ module Metabase
9
9
  # @return [Array<Hash>] Parsed response JSON
10
10
  # @see https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#get-apidashboard
11
11
  def dashboards(**params)
12
- get('/api/dashboard', params)
12
+ get('/api/dashboard', **params)
13
13
  end
14
14
  end
15
15
  end
@@ -9,7 +9,7 @@ module Metabase
9
9
  # @return [Array<Hash>] Parsed response JSON
10
10
  # @see https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#get-apidatabase
11
11
  def databases(**params)
12
- get('/api/database', params)
12
+ get('/api/database', **params)
13
13
  end
14
14
  end
15
15
  end
@@ -9,7 +9,7 @@ module Metabase
9
9
  # @return [Array<Hash>] Parsed response JSON
10
10
  # @see https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#get-apimetric
11
11
  def metrics(**params)
12
- get('/api/metric', params)
12
+ get('/api/metric', **params)
13
13
  end
14
14
  end
15
15
  end
@@ -9,7 +9,7 @@ module Metabase
9
9
  # @return [Array<Hash>] Parsed response JSON
10
10
  # @see https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#get-apipermissionsgroup
11
11
  def groups(**params)
12
- get('/api/permissions/group', params)
12
+ get('/api/permissions/group', **params)
13
13
  end
14
14
  end
15
15
  end
@@ -10,7 +10,7 @@ module Metabase
10
10
  # @return [Hash] Parsed response JSON
11
11
  # @see https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#get-apipubliccarduuid
12
12
  def public_card(card_uuid, **params)
13
- get("/api/public/card/#{card_uuid}", params)
13
+ get("/api/public/card/#{card_uuid}", **params)
14
14
  end
15
15
 
16
16
  # Fetch query results of the public card with metadata.
@@ -20,7 +20,7 @@ module Metabase
20
20
  # @return [Hash] Parsed response JSON
21
21
  # @see https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#get-apipubliccarduuidquery
22
22
  def query_public_card_with_metadata(card_uuid, **params)
23
- get("/api/public/card/#{card_uuid}/query", params)
23
+ get("/api/public/card/#{card_uuid}/query", **params)
24
24
  end
25
25
 
26
26
  # Fetch query results of the public card.
@@ -31,7 +31,7 @@ module Metabase
31
31
  # @return [Array<Hash>, String] Query results
32
32
  # @see https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#get-apipubliccarduuidqueryexport-format
33
33
  def query_public_card(card_uuid, format: :json, **params)
34
- get("/api/public/card/#{card_uuid}/query/#{format}", params)
34
+ get("/api/public/card/#{card_uuid}/query/#{format}", **params)
35
35
  end
36
36
  end
37
37
  end
@@ -9,7 +9,7 @@ module Metabase
9
9
  # @return [Array<Hash>] Parsed response JSON
10
10
  # @see https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#get-apipulse
11
11
  def pulses(**params)
12
- get('/api/pulse', params)
12
+ get('/api/pulse', **params)
13
13
  end
14
14
  end
15
15
  end
@@ -9,7 +9,7 @@ module Metabase
9
9
  # @return [Array<Hash>] Parsed response JSON
10
10
  # @see https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#get-apirevision
11
11
  def revisions(**params)
12
- get('/api/revision', params)
12
+ get('/api/revision', **params)
13
13
  end
14
14
  end
15
15
  end
@@ -9,7 +9,7 @@ module Metabase
9
9
  # @return [Array<Hash>] Parsed response JSON
10
10
  # @see https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#get-apisegment
11
11
  def segments(**params)
12
- get('/api/segment', params)
12
+ get('/api/segment', **params)
13
13
  end
14
14
  end
15
15
  end
@@ -10,7 +10,7 @@ module Metabase
10
10
  # @see https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#post-apisession
11
11
  def login(**params)
12
12
  params = { username: @username, password: @password }.merge(params)
13
- response = post('/api/session', params)
13
+ response = post('/api/session', **params)
14
14
  @token = response['id']
15
15
  end
16
16
 
@@ -21,7 +21,7 @@ module Metabase
21
21
  # @see https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#delete-apisession
22
22
  def logout(**params)
23
23
  params = { session_id: @token }.merge(params)
24
- delete('/api/session', params)
24
+ delete('/api/session', **params)
25
25
  @token = nil
26
26
  true
27
27
  end
@@ -9,7 +9,7 @@ module Metabase
9
9
  # @return [Array<Hash>] Parsed response JSON
10
10
  # @see https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#get-apisetting
11
11
  def settings(**params)
12
- get('/api/setting', params)
12
+ get('/api/setting', **params)
13
13
  end
14
14
  end
15
15
  end
@@ -9,7 +9,7 @@ module Metabase
9
9
  # @return [Array<Hash>] Parsed response JSON
10
10
  # @see https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#get-apisetupadmin_checklist
11
11
  def admin_checklists(**params)
12
- get('/api/setup/admin_checklist', params)
12
+ get('/api/setup/admin_checklist', **params)
13
13
  end
14
14
  end
15
15
  end
@@ -9,7 +9,7 @@ module Metabase
9
9
  # @return [Array<Hash>] Parsed response JSON
10
10
  # @see https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#get-apitable
11
11
  def tables(**params)
12
- get('/api/table', params)
12
+ get('/api/table', **params)
13
13
  end
14
14
  end
15
15
  end
@@ -9,7 +9,7 @@ module Metabase
9
9
  # @return [Array<Hash>] Parsed response JSON
10
10
  # @see https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#get-apiuser
11
11
  def users(**params)
12
- get('/api/user', params)
12
+ get('/api/user', **params)
13
13
  end
14
14
 
15
15
  # Fetch the current user.
@@ -18,7 +18,11 @@ module Metabase
18
18
  # @return [Hash] Parsed response JSON
19
19
  # @see https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#get-apiusercurrent
20
20
  def current_user(**params)
21
- get('/api/user/current', params)
21
+ get('/api/user/current', **params)
22
+ end
23
+
24
+ def create_user(**params)
25
+ post('/api/user', **params)
22
26
  end
23
27
  end
24
28
  end
@@ -9,7 +9,7 @@ module Metabase
9
9
  # @return [Array<String>] Parsed response JSON
10
10
  # @see https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#get-apiutillogs
11
11
  def logs(**params)
12
- get('/api/util/logs', params)
12
+ get('/api/util/logs', **params)
13
13
  end
14
14
  end
15
15
  end
@@ -10,7 +10,7 @@ module Metabase
10
10
  # @return [Hash] Parsed response JSON
11
11
  # @see https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#get-apix-raycardid
12
12
  def x_ray_card(card_id, **params)
13
- get("/api/x-ray/card/#{card_id}", params)
13
+ get("/api/x-ray/card/#{card_id}", **params)
14
14
  end
15
15
  end
16
16
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Metabase
4
- VERSION = '0.2.1'
4
+ VERSION = '0.3.0'
5
5
  end
@@ -1,4 +1,3 @@
1
-
2
1
  # frozen_string_literal: true
3
2
 
4
3
  lib = File.expand_path('lib', __dir__)
@@ -23,12 +22,12 @@ Gem::Specification.new do |spec|
23
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
23
  spec.require_paths = ['lib']
25
24
 
26
- spec.required_ruby_version = '>= 2.3'
25
+ spec.required_ruby_version = '>= 2.5'
27
26
 
28
27
  spec.add_runtime_dependency 'faraday', '~> 0.8'
29
28
  spec.add_runtime_dependency 'faraday_middleware'
30
29
 
31
- spec.add_development_dependency 'awesome_print'
30
+ spec.add_development_dependency 'amazing_print'
32
31
  spec.add_development_dependency 'bump'
33
32
  spec.add_development_dependency 'bundler'
34
33
  spec.add_development_dependency 'pry'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metabase
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroshi Shimoju
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-28 00:00:00.000000000 Z
11
+ date: 2020-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -39,7 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: awesome_print
42
+ name: amazing_print
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
@@ -242,7 +242,7 @@ homepage: https://github.com/shimoju/metabase-ruby
242
242
  licenses:
243
243
  - MIT
244
244
  metadata: {}
245
- post_install_message:
245
+ post_install_message:
246
246
  rdoc_options: []
247
247
  require_paths:
248
248
  - lib
@@ -250,16 +250,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
250
250
  requirements:
251
251
  - - ">="
252
252
  - !ruby/object:Gem::Version
253
- version: '2.3'
253
+ version: '2.5'
254
254
  required_rubygems_version: !ruby/object:Gem::Requirement
255
255
  requirements:
256
256
  - - ">="
257
257
  - !ruby/object:Gem::Version
258
258
  version: '0'
259
259
  requirements: []
260
- rubyforge_project:
261
- rubygems_version: 2.7.7
262
- signing_key:
260
+ rubygems_version: 3.1.2
261
+ signing_key:
263
262
  specification_version: 4
264
263
  summary: Ruby client library for Metabase API
265
264
  test_files: []