looker-sdk 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/scripts/wait_for_looker.sh +35 -0
- data/.github/workflows/release.yml +47 -0
- data/.github/workflows/ruby-ci.yml +60 -0
- data/CHANGELOG.md +13 -0
- data/CODE_OF_CONDUCT.md +73 -26
- data/CONTRIBUTING.md +29 -0
- data/lib/looker-sdk/version.rb +1 -1
- data/looker-sdk.gemspec +2 -2
- data/readme.md +3 -2
- data/shell/Gemfile +1 -1
- data/test/helper.rb +30 -4
- data/test/looker/test_client.rb +35 -13
- metadata +9 -5
- data/.travis.yml +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1cc7e235cdbbb66fc48144899702643ac22bffcb5b9a9308aff125da08094b3b
|
4
|
+
data.tar.gz: 8517bfd25b5330d27486b579c4d8c113786c72553256582f0b4fd7d7ddd1e2f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e189a7bbfc601e3ba9cbd11826fd80494e6218caf68f2a12d1ba2d281dd66f8995eadf04397d1d814a22c0e5eafdf5045e9dd4064f92b2b0bb3064d7122d0ef
|
7
|
+
data.tar.gz: 4e17c8adec821082d10556b2d4122f17c21cbc5db58b3d4f5b4cefdb9022542eab77428256793180d5ab1dda6dccf6dc4604f803a50fa6a8e2c95f9dee698c24
|
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
check_looker() {
|
4
|
+
status=$(curl --silent --insecure --write "%{http_code}" \
|
5
|
+
--data "client_id=$LOOKERSDK_CLIENT_ID&client_secret=$LOOKERSDK_CLIENT_SECRET"\
|
6
|
+
$LOOKERSDK_BASE_URL/api/${LOOKERSDK_API_VERSION:-4.0}/login\
|
7
|
+
-o /dev/null)
|
8
|
+
}
|
9
|
+
|
10
|
+
MAX_RETRIES=160
|
11
|
+
ATTEMPTS=1
|
12
|
+
status=0
|
13
|
+
check_looker
|
14
|
+
while [ $status -ne 200 ];
|
15
|
+
do
|
16
|
+
RETRY_MSG="after $ATTEMPTS attempts: $MAX_RETRIES retries remaining."
|
17
|
+
if [ $ATTEMPTS -ge $MAX_RETRIES ];
|
18
|
+
then
|
19
|
+
echo 'Looker took too long to start'
|
20
|
+
exit 1
|
21
|
+
else
|
22
|
+
if [ $status -ne 0 ];
|
23
|
+
then
|
24
|
+
echo "Received status($status) from Looker $RETRY_MSG"
|
25
|
+
else
|
26
|
+
echo "Looker server connection rejected $RETRY_MSG"
|
27
|
+
fi
|
28
|
+
fi
|
29
|
+
|
30
|
+
sleep 2
|
31
|
+
ATTEMPTS=$(( $ATTEMPTS + 1 ))
|
32
|
+
check_looker
|
33
|
+
done
|
34
|
+
echo "Looker ready after $ATTEMPTS attempts"
|
35
|
+
exit 0
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# .github/workflows/release.yml
|
2
|
+
|
3
|
+
name: release
|
4
|
+
|
5
|
+
on:
|
6
|
+
push:
|
7
|
+
branches:
|
8
|
+
- main
|
9
|
+
|
10
|
+
jobs:
|
11
|
+
release-please:
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
steps:
|
14
|
+
- uses: GoogleCloudPlatform/release-please-action@v2
|
15
|
+
id: release
|
16
|
+
with:
|
17
|
+
release-type: ruby
|
18
|
+
package-name: looker-sdk
|
19
|
+
bump-minor-pre-major: true
|
20
|
+
bump-patch-for-minor-pre-major: true
|
21
|
+
version-file: "lib/looker-sdk/version.rb"
|
22
|
+
token: ${{ secrets.LOS_AUTO_BOT_RP_TOKEN }}
|
23
|
+
# Checkout code if release was created
|
24
|
+
- uses: actions/checkout@v2
|
25
|
+
if: ${{ steps.release.outputs.release_created }}
|
26
|
+
# Setup ruby if a release was created
|
27
|
+
- uses: ruby/setup-ruby@v1
|
28
|
+
with:
|
29
|
+
ruby-version: 2.5.8
|
30
|
+
if: ${{ steps.release.outputs.release_created }}
|
31
|
+
# Bundle install
|
32
|
+
- run: bundle install
|
33
|
+
if: ${{ steps.release.outputs.release_created }}
|
34
|
+
# Publish
|
35
|
+
- name: publish gem
|
36
|
+
run: |
|
37
|
+
mkdir -p $HOME/.gem
|
38
|
+
touch $HOME/.gem/credentials
|
39
|
+
chmod 0600 $HOME/.gem/credentials
|
40
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
41
|
+
gem build *.gemspec
|
42
|
+
gem push *.gem
|
43
|
+
env:
|
44
|
+
# Make sure to update the secret name
|
45
|
+
# if yours isn't named RUBYGEMS_AUTH_TOKEN
|
46
|
+
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
|
47
|
+
if: ${{ steps.release.outputs.release_created }}
|
@@ -0,0 +1,60 @@
|
|
1
|
+
name: Ruby-CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ main ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ main ]
|
8
|
+
|
9
|
+
env:
|
10
|
+
LOOKERSDK_BASE_URL: https://localhost:20000
|
11
|
+
LOOKERSDK_VERIFY_SSL: false
|
12
|
+
LOOKERSDK_API_VERSION: "4.0"
|
13
|
+
LOOKERSDK_CLIENT_ID: ${{ secrets.LOOKERSDK_CLIENT_ID__21_20 }}
|
14
|
+
LOOKERSDK_CLIENT_SECRET: ${{ secrets.LOOKERSDK_CLIENT_SECRET__21_20 }}
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
test:
|
18
|
+
|
19
|
+
runs-on: ubuntu-latest
|
20
|
+
strategy:
|
21
|
+
matrix:
|
22
|
+
ruby-version: [2.5.8]
|
23
|
+
|
24
|
+
steps:
|
25
|
+
- uses: actions/checkout@v2
|
26
|
+
|
27
|
+
- name: Set up Cloud SDK
|
28
|
+
uses: google-github-actions/setup-gcloud@v0.2.0
|
29
|
+
with:
|
30
|
+
project_id: ${{ secrets.GCP_PROJECT_ID }}
|
31
|
+
service_account_key: ${{ secrets.GCP_AR_READER_SA_KEY }}
|
32
|
+
export_default_credentials: true
|
33
|
+
|
34
|
+
- name: Authenticate Artifact Repository
|
35
|
+
run: gcloud auth configure-docker us-west1-docker.pkg.dev --quiet
|
36
|
+
|
37
|
+
- name: Pull and run Looker docker image
|
38
|
+
# TODO: can we cache some layers of the image for faster download?
|
39
|
+
# we probably don't want to cache the final image for IP security...
|
40
|
+
run: |
|
41
|
+
docker pull --quiet us-west1-docker.pkg.dev/cloud-looker-sdk-codegen-cicd/looker/21_20
|
42
|
+
# set $LOOKER_OPTS to --no-ssl if we want to turn off ssl
|
43
|
+
docker run --name looker-sdk-codegen-ci -d -p 10000:9999 -p 20000:19999 us-west1-docker.pkg.dev/cloud-looker-sdk-codegen-cicd/looker/21_20
|
44
|
+
docker logs -f looker-sdk-codegen-ci --until=30s &
|
45
|
+
|
46
|
+
- name: Set up Ruby ${{ matrix.ruby-version }}
|
47
|
+
uses: ruby/setup-ruby@v1
|
48
|
+
with:
|
49
|
+
ruby-version: ${{ matrix.ruby-version }}
|
50
|
+
bundler-cache: true
|
51
|
+
|
52
|
+
- name: Install dependencies
|
53
|
+
run: bundle install
|
54
|
+
|
55
|
+
- name: Check that Looker is ready
|
56
|
+
run: |
|
57
|
+
${{ github.workspace }}/.github/scripts/wait_for_looker.sh
|
58
|
+
|
59
|
+
- name: Run tests
|
60
|
+
run: bundle exec rake test
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
### [0.1.2](https://www.github.com/looker-open-source/looker-sdk-ruby/compare/v0.1.1...v0.1.2) (2021-11-19)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* Add release-please workflow ([8e8de5b](https://www.github.com/looker-open-source/looker-sdk-ruby/commit/8e8de5b9cb0063047a0f92511ce3f5e93237d109))
|
9
|
+
* change references from old location github.com/looker to new location github.com/looker-open-source ([baf0f31](https://www.github.com/looker-open-source/looker-sdk-ruby/commit/baf0f315deec45d04d53ca2ba08ad7139beed884))
|
10
|
+
* fix api version in CI workflow ([158334b](https://www.github.com/looker-open-source/looker-sdk-ruby/commit/158334bf7675ebbc3293f8fc06b028e0039eddf7))
|
11
|
+
* initial implementation of CI ([241b28e](https://www.github.com/looker-open-source/looker-sdk-ruby/commit/241b28ef9569fc4c7b940803537d49c48a4b3224))
|
12
|
+
* minor typo in release.yml ([44ea762](https://www.github.com/looker-open-source/looker-sdk-ruby/commit/44ea76282eade774b82750ee2dfa98c603a60733))
|
13
|
+
* set proper version of looker in CI workflow ([a452c91](https://www.github.com/looker-open-source/looker-sdk-ruby/commit/a452c91a364ebecd420bf1a110f9b497b3fb0349))
|
data/CODE_OF_CONDUCT.md
CHANGED
@@ -1,46 +1,93 @@
|
|
1
|
-
#
|
1
|
+
# Code of Conduct
|
2
2
|
|
3
3
|
## Our Pledge
|
4
4
|
|
5
|
-
In the interest of fostering an open and welcoming environment, we as
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of
|
9
|
+
experience, education, socio-economic status, nationality, personal appearance,
|
10
|
+
race, religion, or sexual identity and orientation.
|
6
11
|
|
7
12
|
## Our Standards
|
8
13
|
|
9
|
-
Examples of behavior that contributes to creating a positive environment
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
10
16
|
|
11
|
-
*
|
12
|
-
*
|
13
|
-
*
|
14
|
-
*
|
15
|
-
*
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
16
22
|
|
17
23
|
Examples of unacceptable behavior by participants include:
|
18
24
|
|
19
|
-
*
|
20
|
-
|
21
|
-
*
|
22
|
-
*
|
23
|
-
*
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
24
33
|
|
25
34
|
## Our Responsibilities
|
26
35
|
|
27
|
-
Project maintainers are responsible for clarifying the standards of acceptable
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
28
39
|
|
29
|
-
Project maintainers have the right and responsibility to remove, edit, or reject
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or reject
|
41
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
42
|
+
not aligned to this Code of Conduct, or to ban temporarily or permanently any
|
43
|
+
contributor for other behaviors that they deem inappropriate, threatening,
|
44
|
+
offensive, or harmful.
|
30
45
|
|
31
46
|
## Scope
|
32
47
|
|
33
|
-
This Code of Conduct applies both within project spaces and in public spaces
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
This Code of Conduct also applies outside the project spaces when the Project
|
56
|
+
Steward has a reasonable belief that an individual's behavior may have a
|
57
|
+
negative impact on the project or its community.
|
58
|
+
|
59
|
+
## Conflict Resolution
|
60
|
+
|
61
|
+
We do not believe that all conflict is bad; healthy debate and disagreement
|
62
|
+
often yield positive results. However, it is never okay to be disrespectful or
|
63
|
+
to engage in behavior that violates the project’s code of conduct.
|
64
|
+
|
65
|
+
If you see someone violating the code of conduct, you are encouraged to address
|
66
|
+
the behavior directly with those involved. Many issues can be resolved quickly
|
67
|
+
and easily, and this gives people more control over the outcome of their
|
68
|
+
dispute. If you are unable to resolve the matter for any reason, or if the
|
69
|
+
behavior is threatening or harassing, report it. We are dedicated to providing
|
70
|
+
an environment where participants feel welcome and safe.
|
71
|
+
|
72
|
+
Reports should be directed to *Mike DeAngelo* drstrangelove@google.com, the
|
73
|
+
Project Steward(s) for *looker-sdk-ruby*. It is the Project Steward’s duty to
|
74
|
+
receive and address reported violations of the code of conduct. They will then
|
75
|
+
work with a committee consisting of representatives from the Open Source
|
76
|
+
Programs Office and the Google Open Source Strategy team. If for any reason you
|
77
|
+
are uncomfortable reaching out to the Project Steward, please email
|
78
|
+
opensource@google.com.
|
79
|
+
|
80
|
+
We will investigate every complaint, but you may not receive a direct response.
|
81
|
+
We will use our discretion in determining when and how to follow up on reported
|
82
|
+
incidents, which may range from not taking action to permanent expulsion from
|
83
|
+
the project and project-sponsored spaces. We will notify the accused of the
|
84
|
+
report and provide them an opportunity to discuss it before any action is taken.
|
85
|
+
The identity of the reporter will be omitted from the details of the report
|
86
|
+
supplied to the accused. In potentially harmful situations, such as ongoing
|
87
|
+
harassment or threats to anyone's safety, we may take action without notice.
|
40
88
|
|
41
89
|
## Attribution
|
42
90
|
|
43
|
-
This Code of Conduct is adapted from the
|
44
|
-
|
45
|
-
|
46
|
-
[version]: http://contributor-covenant.org/version/1/4/
|
91
|
+
This Code of Conduct is adapted from the Contributor Covenant, version 1.4,
|
92
|
+
available at
|
93
|
+
https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# How to Contribute
|
2
|
+
|
3
|
+
We'd love to accept your patches and contributions to this project. There are
|
4
|
+
just a few small guidelines you need to follow.
|
5
|
+
|
6
|
+
## Contributor License Agreement
|
7
|
+
|
8
|
+
Contributions to this project must be accompanied by a Contributor License
|
9
|
+
Agreement (CLA). You (or your employer) retain the copyright to your
|
10
|
+
contribution; this simply gives us permission to use and redistribute your
|
11
|
+
contributions as part of the project. Head over to
|
12
|
+
<https://cla.developers.google.com/> to see your current agreements on file or
|
13
|
+
to sign a new one.
|
14
|
+
|
15
|
+
You generally only need to submit a CLA once, so if you've already submitted one
|
16
|
+
(even if it was for a different project), you probably don't need to do it
|
17
|
+
again.
|
18
|
+
|
19
|
+
## Code Reviews
|
20
|
+
|
21
|
+
All submissions, including submissions by project members, require review. We
|
22
|
+
use GitHub pull requests for this purpose. Consult
|
23
|
+
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
|
24
|
+
information on using pull requests.
|
25
|
+
|
26
|
+
## Community Guidelines
|
27
|
+
|
28
|
+
This project follows
|
29
|
+
[Google's Open Source Community Guidelines](https://opensource.google/conduct/).
|
data/lib/looker-sdk/version.rb
CHANGED
data/looker-sdk.gemspec
CHANGED
@@ -7,8 +7,8 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.version = LookerSDK::VERSION
|
8
8
|
s.date = "#{Time.now.strftime('%F')}"
|
9
9
|
s.authors = ['Looker']
|
10
|
-
s.email = '
|
11
|
-
s.homepage = 'https://github.com/looker/looker-sdk-ruby'
|
10
|
+
s.email = 'drstrangelove@google.com'
|
11
|
+
s.homepage = 'https://github.com/looker-open-source/looker-sdk-ruby'
|
12
12
|
s.summary = %q{Looker Ruby SDK}
|
13
13
|
s.description = 'Use this SDK to access the Looker API. The Looker API provides functions to perform administrative '+
|
14
14
|
'tasks such as provisioning users, configuring database connections, and so on. It also enables you to leverage '+
|
data/readme.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
[![Ruby-CI](https://github.com/looker-open-source/looker-sdk-ruby/actions/workflows/ruby-ci.yml/badge.svg?branch=main)](https://github.com/looker-open-source/looker-sdk-ruby/actions/workflows/ruby-ci.yml)
|
2
|
+
# [Looker](http://looker.com/) SDK for Ruby
|
2
3
|
### Overview
|
3
4
|
This SDK supports secure/authenticated access to the Looker RESTful API. The SDK binds dynamically to the Looker API and builds mappings for the sets of API methods that the Looker instance exposes. This allows for writing straightforward Ruby scripts to interact with the Looker API. And, it allows the SDK to provide access to new Looker API features in each Looker release without requiring an update to the SDK each time.
|
4
5
|
|
@@ -14,7 +15,7 @@ When trying to access a resource with the API that the current user is not allow
|
|
14
15
|
|
15
16
|
### Installation
|
16
17
|
```bash
|
17
|
-
$ git clone git@github.com:looker/looker-sdk-ruby.git looker-sdk
|
18
|
+
$ git clone git@github.com:looker-open-source/looker-sdk-ruby.git looker-sdk
|
18
19
|
$ cd looker-sdk
|
19
20
|
$ gem install bundle
|
20
21
|
$ bundle install
|
data/shell/Gemfile
CHANGED
@@ -2,5 +2,5 @@ source 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
gem 'pry', '~> 0.10.1'
|
4
4
|
gem 'netrc', '~> 0.7.7'
|
5
|
-
# gem 'looker-sdk', :git => 'git@github.com:looker/looker-sdk-ruby.git'
|
5
|
+
# gem 'looker-sdk', :git => 'git@github.com:looker-open-source/looker-sdk-ruby.git'
|
6
6
|
gem 'looker-sdk', :path => '../'
|
data/test/helper.rb
CHANGED
@@ -52,15 +52,41 @@ def fix_netrc_permissions(path)
|
|
52
52
|
File.chmod(0600, path) unless s.mode.to_s(8)[3..5] == "0600"
|
53
53
|
end
|
54
54
|
|
55
|
-
|
55
|
+
begin
|
56
|
+
fix_netrc_permissions(File.join(fixture_path, '.netrc'))
|
57
|
+
rescue => e
|
58
|
+
puts e
|
59
|
+
end
|
56
60
|
|
57
61
|
def setup_sdk
|
58
62
|
LookerSDK.reset!
|
63
|
+
|
64
|
+
base_url = ENV['LOOKERSDK_BASE_URL'] || 'https://localhost:20000'
|
65
|
+
verify_ssl = case ENV['LOOKERSDK_VERIFY_SSL']
|
66
|
+
when /false/i
|
67
|
+
false
|
68
|
+
when /f/i
|
69
|
+
false
|
70
|
+
when '0'
|
71
|
+
false
|
72
|
+
else
|
73
|
+
true
|
74
|
+
end
|
75
|
+
api_version = ENV['LOOKERSDK_API_VERSION'] || '4.0'
|
76
|
+
client_id = ENV['LOOKERSDK_CLIENT_ID']
|
77
|
+
client_secret = ENV['LOOKERSDK_CLIENT_SECRET']
|
78
|
+
|
59
79
|
LookerSDK.configure do |c|
|
60
80
|
c.lazy_swagger = true
|
61
|
-
c.connection_options = {:ssl => {:verify => false}}
|
62
|
-
|
63
|
-
|
81
|
+
c.connection_options = {:ssl => {:verify => false}} unless verify_ssl
|
82
|
+
if (client_id && client_secret) then
|
83
|
+
c.client_id = client_id
|
84
|
+
c.client_secret = client_secret
|
85
|
+
c.api_endpoint = "#{base_url}/api/#{api_version}"
|
86
|
+
else
|
87
|
+
c.netrc = true
|
88
|
+
c.netrc_file = File.join(fixture_path, '.netrc')
|
89
|
+
end
|
64
90
|
end
|
65
91
|
end
|
66
92
|
|
data/test/looker/test_client.rb
CHANGED
@@ -30,16 +30,42 @@ describe LookerSDK::Client do
|
|
30
30
|
setup_sdk
|
31
31
|
end
|
32
32
|
|
33
|
-
|
33
|
+
base_url = ENV['LOOKERSDK_BASE_URL'] || 'https://localhost:20000'
|
34
|
+
verify_ssl = case ENV['LOOKERSDK_VERIFY_SSL']
|
35
|
+
when /false/i
|
36
|
+
false
|
37
|
+
when /f/i
|
38
|
+
false
|
39
|
+
when '0'
|
40
|
+
false
|
41
|
+
else
|
42
|
+
true
|
43
|
+
end
|
44
|
+
api_version = ENV['LOOKERSDK_API_VERSION'] || '4.0'
|
45
|
+
client_id = ENV['LOOKERSDK_CLIENT_ID']
|
46
|
+
client_secret = ENV['LOOKERSDK_CLIENT_SECRET']
|
47
|
+
|
48
|
+
opts = {}
|
49
|
+
if (client_id && client_secret) then
|
50
|
+
opts.merge!({
|
51
|
+
:client_id => client_id,
|
52
|
+
:client_secret => client_secret,
|
53
|
+
:api_endpoint => "#{base_url}/api/#{api_version}",
|
54
|
+
})
|
55
|
+
opts[:connection_options] = {:ssl => {:verify => false}} unless verify_ssl
|
56
|
+
else
|
57
|
+
opts.merge!({
|
58
|
+
:netrc => true,
|
59
|
+
:netrc_file => File.join(fixture_path, '.netrc'),
|
60
|
+
:connection_options => {:ssl => {:verify => false}},
|
61
|
+
})
|
62
|
+
|
63
|
+
end
|
34
64
|
|
65
|
+
describe "lazy load swagger" do
|
35
66
|
it "lazy loads swagger" do
|
36
67
|
LookerSDK.reset!
|
37
|
-
client = LookerSDK::Client.new(
|
38
|
-
:lazy_swagger => true,
|
39
|
-
:netrc => true,
|
40
|
-
:netrc_file => File.join(fixture_path, '.netrc'),
|
41
|
-
:connection_options => {:ssl => {:verify => false}},
|
42
|
-
)
|
68
|
+
client = LookerSDK::Client.new(opts.merge({:lazy_swagger => true}))
|
43
69
|
assert_nil client.swagger
|
44
70
|
client.me()
|
45
71
|
assert client.swagger
|
@@ -47,12 +73,7 @@ describe LookerSDK::Client do
|
|
47
73
|
|
48
74
|
it "loads swagger initially" do
|
49
75
|
LookerSDK.reset!
|
50
|
-
client = LookerSDK::Client.new(
|
51
|
-
:lazy_swagger => false,
|
52
|
-
:netrc => true,
|
53
|
-
:netrc_file => File.join(fixture_path, '.netrc'),
|
54
|
-
:connection_options => {:ssl => {:verify => false}},
|
55
|
-
)
|
76
|
+
client = LookerSDK::Client.new(opts.merge({:lazy_swagger => false}))
|
56
77
|
assert client.swagger
|
57
78
|
end
|
58
79
|
end
|
@@ -135,6 +156,7 @@ describe LookerSDK::Client do
|
|
135
156
|
|
136
157
|
describe "with .netrc" do
|
137
158
|
it "can read .netrc files" do
|
159
|
+
skip unless File.exist?(File.join(fixture_path, '.netrc'))
|
138
160
|
LookerSDK.reset!
|
139
161
|
client = LookerSDK::Client.new(
|
140
162
|
:lazy_swagger => true,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: looker-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Looker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sawyer
|
@@ -49,15 +49,19 @@ description: Use this SDK to access the Looker API. The Looker API provides func
|
|
49
49
|
connections, and so on. It also enables you to leverage the Looker data analytics
|
50
50
|
engine to fetch data or render visualizations defined in your Looker data models.
|
51
51
|
For more information, see https://looker.com.
|
52
|
-
email:
|
52
|
+
email: drstrangelove@google.com
|
53
53
|
executables: []
|
54
54
|
extensions: []
|
55
55
|
extra_rdoc_files: []
|
56
56
|
files:
|
57
|
+
- ".github/scripts/wait_for_looker.sh"
|
58
|
+
- ".github/workflows/release.yml"
|
59
|
+
- ".github/workflows/ruby-ci.yml"
|
57
60
|
- ".gitignore"
|
58
61
|
- ".ruby-gemset"
|
59
|
-
-
|
62
|
+
- CHANGELOG.md
|
60
63
|
- CODE_OF_CONDUCT.md
|
64
|
+
- CONTRIBUTING.md
|
61
65
|
- Gemfile
|
62
66
|
- LICENSE.md
|
63
67
|
- Makefile
|
@@ -107,7 +111,7 @@ files:
|
|
107
111
|
- test/looker/test_dynamic_client.rb
|
108
112
|
- test/looker/test_dynamic_client_agent.rb
|
109
113
|
- test/looker/user.json
|
110
|
-
homepage: https://github.com/looker/looker-sdk-ruby
|
114
|
+
homepage: https://github.com/looker-open-source/looker-sdk-ruby
|
111
115
|
licenses:
|
112
116
|
- MIT
|
113
117
|
metadata: {}
|