shotgun_api_ruby 0.0.8.4 → 0.1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test_and_publish.yml +42 -57
- data/.github/workflows/test_only.yml +25 -41
- data/.github/workflows/verify_version_change.yml +3 -5
- data/.gitignore +1 -0
- data/.overcommit.yml +9 -0
- data/.prettierrc.js +4 -0
- data/.rubocop.yml +14 -49
- data/CHANGELOG.md +19 -1
- data/Guardfile +47 -0
- data/Rakefile +1 -6
- data/bin/console +16 -7
- data/bin/prettirun +1 -0
- data/bin/ruborun +1 -0
- data/lib/shotgun_api_ruby/auth.rb +41 -20
- data/lib/shotgun_api_ruby/client.rb +21 -11
- data/lib/shotgun_api_ruby/entities.rb +54 -93
- data/lib/shotgun_api_ruby/entities/params.rb +83 -10
- data/lib/shotgun_api_ruby/entities/schema.rb +11 -10
- data/lib/shotgun_api_ruby/entity.rb +2 -3
- data/lib/shotgun_api_ruby/preferences.rb +1 -1
- data/lib/shotgun_api_ruby/server_info.rb +1 -1
- data/lib/shotgun_api_ruby/version.rb +1 -1
- data/package.json +12 -0
- data/shotgun_api_ruby.gemspec +9 -2
- data/yarn.lock +15 -0
- metadata +136 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebb179d1404b03fd02a47b587b48e8a3cbbdfa69aa56141f2c4b3a9d73819eaf
|
4
|
+
data.tar.gz: ce95e7a5d7e7567ada62ac2604a6fc6f639cdacc3c61804fdd171a04de8309f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03fb2158143962471d55adc758434ed2817e6d04989d00694025bb2f876d6d7f2bc44525c5eb16832fe55f6dd87e9bb9335a7bbf55d9af5be011bcf9ffb29b55
|
7
|
+
data.tar.gz: 9d7d48612614d7db28ad1c10342dc604a6bd19638c019fcc6c5599da93623c65414be561c8855ff63e8bd97de3ed745c81f39f9fe8666914e1d6e0eab438917a
|
@@ -2,72 +2,57 @@ name: Test and Release
|
|
2
2
|
|
3
3
|
on:
|
4
4
|
push:
|
5
|
-
branches:
|
5
|
+
branches:
|
6
6
|
- main
|
7
7
|
|
8
8
|
jobs:
|
9
|
-
|
9
|
+
tests:
|
10
|
+
strategy:
|
11
|
+
matrix:
|
12
|
+
ruby: [2.6, 2.7, 3.0]
|
10
13
|
runs-on: ubuntu-latest
|
11
14
|
|
12
15
|
steps:
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
test-2_6:
|
16
|
+
- uses: actions/checkout@v2
|
17
|
+
- name: Set up Ruby
|
18
|
+
uses: ruby/setup-ruby@v1
|
19
|
+
with:
|
20
|
+
ruby-version: ${{ matrix.ruby }}
|
21
|
+
bundler-cache: true
|
22
|
+
- name: Run linter
|
23
|
+
run: bundle exec rubocop
|
24
|
+
- name: Run tests
|
25
|
+
run: bundle exec rspec
|
26
|
+
prettier:
|
25
27
|
runs-on: ubuntu-latest
|
26
|
-
|
27
|
-
steps:
|
28
|
-
- uses: actions/checkout@v2
|
29
|
-
- name: Set up Ruby
|
30
|
-
uses: ruby/setup-ruby@v1
|
31
|
-
with:
|
32
|
-
ruby-version: 2.6
|
33
|
-
- name: Install dependencies
|
34
|
-
run: bundle install
|
35
|
-
- name: Run linter
|
36
|
-
run: bundle exec rubocop
|
37
|
-
- name: Run tests
|
38
|
-
run: bundle exec rspec
|
39
|
-
test-2_7:
|
40
|
-
runs-on: ubuntu-latest
|
41
|
-
|
42
28
|
steps:
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
- name: Run tests
|
53
|
-
run: bundle exec rspec
|
29
|
+
- uses: actions/checkout@v2
|
30
|
+
- name: Set up Node
|
31
|
+
uses: actions/setup-node@v2
|
32
|
+
with:
|
33
|
+
node-version: '14'
|
34
|
+
- name: Install yarn dep
|
35
|
+
run: yarn install
|
36
|
+
- name: Check prettier
|
37
|
+
run: yarn prettier -c '**/*.rb'
|
54
38
|
release:
|
55
|
-
needs: [
|
39
|
+
needs: [tests, prettier]
|
56
40
|
runs-on: ubuntu-latest
|
57
41
|
|
58
42
|
steps:
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
43
|
+
- uses: actions/checkout@v2
|
44
|
+
- name: Set up Ruby
|
45
|
+
uses: ruby/setup-ruby@v1
|
46
|
+
with:
|
47
|
+
ruby-version: 3.0
|
48
|
+
bundler-cache: true
|
49
|
+
- name: Prepare credentials
|
50
|
+
env:
|
51
|
+
RUBYGEM_KEY: ${{ secrets.RUBYGEM_KEY }}
|
52
|
+
run: "mkdir -p ~/.gem && echo -e \"---\\r\\n:rubygems_api_key: $RUBYGEM_KEY\" > ~/.gem/credentials && chmod 0600 ~/.gem/credentials"
|
53
|
+
- name: Setup username/email
|
54
|
+
run: 'git config --global user.email zaratan@hey.com && git config --global user.name "Denis <Zaratan> Pasin"'
|
55
|
+
- name: Fetch tags from remote
|
56
|
+
run: 'git fetch -t'
|
57
|
+
- name: Publish if version change
|
58
|
+
run: 'git diff `git tag | tail -1` -- lib/shotgun_api_ruby/version.rb | grep -E "^\+.*VERSION" && rake release || echo "No release for now"'
|
@@ -2,52 +2,36 @@ name: Tests
|
|
2
2
|
|
3
3
|
on:
|
4
4
|
push:
|
5
|
-
branches-ignore:
|
5
|
+
branches-ignore:
|
6
6
|
- main
|
7
7
|
|
8
8
|
jobs:
|
9
|
-
|
9
|
+
tests:
|
10
|
+
strategy:
|
11
|
+
matrix:
|
12
|
+
ruby: [2.6, 2.7, 3.0]
|
10
13
|
runs-on: ubuntu-latest
|
11
14
|
|
12
15
|
steps:
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
test-2_6:
|
16
|
+
- uses: actions/checkout@v2
|
17
|
+
- name: Set up Ruby
|
18
|
+
uses: ruby/setup-ruby@v1
|
19
|
+
with:
|
20
|
+
ruby-version: ${{ matrix.ruby }}
|
21
|
+
bundler-cache: true
|
22
|
+
- name: Run linter
|
23
|
+
run: bundle exec rubocop
|
24
|
+
- name: Run tests
|
25
|
+
run: bundle exec rspec
|
26
|
+
prettier:
|
25
27
|
runs-on: ubuntu-latest
|
26
|
-
|
27
|
-
steps:
|
28
|
-
- uses: actions/checkout@v2
|
29
|
-
- name: Set up Ruby
|
30
|
-
uses: ruby/setup-ruby@v1
|
31
|
-
with:
|
32
|
-
ruby-version: 2.6
|
33
|
-
- name: Install dependencies
|
34
|
-
run: bundle install
|
35
|
-
- name: Run linter
|
36
|
-
run: bundle exec rubocop
|
37
|
-
- name: Run tests
|
38
|
-
run: bundle exec rspec
|
39
|
-
test-2_7:
|
40
|
-
runs-on: ubuntu-latest
|
41
|
-
|
42
28
|
steps:
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
- name: Run tests
|
53
|
-
run: bundle exec rspec
|
29
|
+
- uses: actions/checkout@v2
|
30
|
+
- name: Set up Node
|
31
|
+
uses: actions/setup-node@v2
|
32
|
+
with:
|
33
|
+
node-version: '14'
|
34
|
+
- name: Install yarn dep
|
35
|
+
run: yarn install
|
36
|
+
- name: Check prettier
|
37
|
+
run: yarn prettier -c '**/*.rb'
|
@@ -14,10 +14,8 @@ jobs:
|
|
14
14
|
- name: Fetch main branch
|
15
15
|
run: git fetch origin main:main
|
16
16
|
- name: Verify if there's a change in version
|
17
|
-
run: "git diff main lib/shotgun_api_ruby/version.rb | grep VERSION"
|
17
|
+
run: "git diff main -- lib/shotgun_api_ruby/version.rb | grep VERSION"
|
18
18
|
- name: Print new version
|
19
|
-
run: 'git diff main lib/shotgun_api_ruby/version.rb | grep -E "^\+.*VERSION" | grep -E -o "[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?"'
|
19
|
+
run: 'git diff main -- lib/shotgun_api_ruby/version.rb | grep -E "^\+.*VERSION" | grep -E -o "[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?"'
|
20
20
|
- name: Verify if higher version
|
21
|
-
run: '[[ $(git diff main lib/shotgun_api_ruby/version.rb | grep -E "^\+.*VERSION" | grep -E -o "[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?") > $(git diff main lib/shotgun_api_ruby/version.rb | grep -E "^-.*VERSION" | grep -E -o "[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?") ]]'
|
22
|
-
- name: Verify if version is updated in Gemfile.lock
|
23
|
-
run: '[[ $(cat Gemfile.lock | grep "$(git diff main lib/shotgun_api_ruby/version.rb | grep -E "^\+.*VERSION" | grep -E -o "[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?")") ]]'
|
21
|
+
run: '[[ $(git diff main -- lib/shotgun_api_ruby/version.rb | grep -E "^\+.*VERSION" | grep -E -o "[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?") > $(git diff main -- lib/shotgun_api_ruby/version.rb | grep -E "^-.*VERSION" | grep -E -o "[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?") ]]'
|
data/.gitignore
CHANGED
data/.overcommit.yml
CHANGED
@@ -6,7 +6,16 @@ PreCommit:
|
|
6
6
|
enabled: true
|
7
7
|
BundleAudit:
|
8
8
|
enabled: true
|
9
|
+
Prettier:
|
10
|
+
enabled: true
|
11
|
+
required_executable: './bin/prettirun'
|
9
12
|
PrePush:
|
10
13
|
RSpec:
|
11
14
|
enabled: true
|
12
15
|
command: ['bundle', 'exec', 'rspec', '-f', 'p'] # Invoke within Bundler context
|
16
|
+
Prettier:
|
17
|
+
enabled: true
|
18
|
+
required_executable: './bin/prettirun'
|
19
|
+
Rubocop:
|
20
|
+
enabled: true
|
21
|
+
required_executable: './bin/ruborun'
|
data/.prettierrc.js
ADDED
data/.rubocop.yml
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
inherit_from:
|
2
2
|
- http://relaxed.ruby.style/rubocop.yml
|
3
3
|
|
4
|
+
inherit_gem:
|
5
|
+
prettier: rubocop.yml
|
6
|
+
|
4
7
|
require:
|
5
8
|
- rubocop-performance
|
6
9
|
|
@@ -8,56 +11,11 @@ AllCops:
|
|
8
11
|
NewCops: enable
|
9
12
|
DisplayStyleGuide: true
|
10
13
|
DisplayCopNames: true
|
14
|
+
SuggestExtensions: false
|
11
15
|
Exclude:
|
12
|
-
- '
|
13
|
-
|
14
|
-
|
15
|
-
Enabled: false
|
16
|
-
|
17
|
-
Gemspec/RequiredRubyVersion:
|
18
|
-
Enabled: false
|
19
|
-
|
20
|
-
Layout/DotPosition:
|
21
|
-
Enabled: true
|
22
|
-
EnforcedStyle: trailing
|
23
|
-
|
24
|
-
Style/TrailingCommaInArrayLiteral:
|
25
|
-
Enabled: true
|
26
|
-
EnforcedStyleForMultiline: comma
|
27
|
-
|
28
|
-
Style/TrailingCommaInHashLiteral:
|
29
|
-
Enabled: true
|
30
|
-
EnforcedStyleForMultiline: comma
|
31
|
-
|
32
|
-
Layout/MultilineArrayLineBreaks:
|
33
|
-
Enabled: true
|
34
|
-
|
35
|
-
Layout/MultilineHashKeyLineBreaks:
|
36
|
-
Enabled: true
|
37
|
-
|
38
|
-
Layout/MultilineMethodArgumentLineBreaks:
|
39
|
-
Enabled: true
|
40
|
-
|
41
|
-
Layout/FirstArrayElementLineBreak:
|
42
|
-
Enabled: true
|
43
|
-
|
44
|
-
Layout/FirstHashElementLineBreak:
|
45
|
-
Enabled: true
|
46
|
-
|
47
|
-
Layout/FirstMethodArgumentLineBreak:
|
48
|
-
Enabled: true
|
49
|
-
|
50
|
-
Layout/MultilineAssignmentLayout:
|
51
|
-
Enabled: true
|
52
|
-
|
53
|
-
Layout/LineLength:
|
54
|
-
Enabled: true
|
55
|
-
Max: 120
|
56
|
-
AutoCorrect: true
|
57
|
-
Exclude:
|
58
|
-
- Gemfile
|
59
|
-
- Guardfile
|
60
|
-
- spec/interactors/send_gdpr_response_spec.rb
|
16
|
+
- 'bin/*'
|
17
|
+
- 'vendor/**/*'
|
18
|
+
- 'node_modules/**/*'
|
61
19
|
|
62
20
|
Metrics/BlockLength:
|
63
21
|
Exclude:
|
@@ -66,3 +24,10 @@ Metrics/BlockLength:
|
|
66
24
|
- 'config/environments/*.rb'
|
67
25
|
- 'lib/tasks/*.rake'
|
68
26
|
- 'shotgun_api_ruby.gemspec'
|
27
|
+
|
28
|
+
### Prettier
|
29
|
+
Style:
|
30
|
+
Enabled: false
|
31
|
+
|
32
|
+
Gemspec/RequiredRubyVersion:
|
33
|
+
Enabled: false
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [0.1.0] - 2021-06-14
|
10
|
+
### Added
|
11
|
+
- Complete test coverage (Unit + Integration tests)
|
12
|
+
- Adding minimum coverage for tests
|
13
|
+
- Adding Guard
|
14
|
+
|
15
|
+
### Changed
|
16
|
+
- Fixed many edge-case bugs
|
17
|
+
|
18
|
+
### Removed
|
19
|
+
- Removed the `Gemfile.lock` since it shouldn't be commited in gems
|
20
|
+
|
21
|
+
## [0.0.8.5] - 2021-01-15
|
22
|
+
### Added
|
23
|
+
- Added prettier for ruby style
|
24
|
+
|
9
25
|
## [0.0.8.4] - 2021-01-07
|
10
26
|
### Changed
|
11
27
|
- Safer eager_load
|
@@ -26,7 +42,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
26
42
|
- Entities: delete
|
27
43
|
- Entities: revive
|
28
44
|
|
29
|
-
[Unreleased]: https://github.com/shotgunsoftware/shotgun_api_ruby/compare/v0.0
|
45
|
+
[Unreleased]: https://github.com/shotgunsoftware/shotgun_api_ruby/compare/v0.1.0...HEAD
|
46
|
+
[0.1.0]: https://github.com/shotgunsoftware/shotgun_api_ruby/releases/tag/v0.1.0
|
47
|
+
[0.0.8.5]: https://github.com/shotgunsoftware/shotgun_api_ruby/releases/tag/v0.0.8.5
|
30
48
|
[0.0.8.4]: https://github.com/shotgunsoftware/shotgun_api_ruby/releases/tag/v0.0.8.4
|
31
49
|
[0.0.8.3]: https://github.com/shotgunsoftware/shotgun_api_ruby/releases/tag/v0.0.8.3
|
32
50
|
[0.0.8]: https://github.com/shotgunsoftware/shotgun_api_ruby/releases/tag/v0.0.8
|
data/Guardfile
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# A sample Guardfile
|
4
|
+
# More info at https://github.com/guard/guard#readme
|
5
|
+
|
6
|
+
## Uncomment and set this to only include directories you want to watch
|
7
|
+
# directories %w(app lib config test spec features) \
|
8
|
+
# .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
|
9
|
+
|
10
|
+
## Note: if you are using the `directories` clause above and you are not
|
11
|
+
## watching the project directory ('.'), then you will want to move
|
12
|
+
## the Guardfile to a watched dir and symlink it back, e.g.
|
13
|
+
#
|
14
|
+
# $ mkdir config
|
15
|
+
# $ mv Guardfile config/
|
16
|
+
# $ ln -s config/Guardfile .
|
17
|
+
#
|
18
|
+
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"
|
19
|
+
|
20
|
+
# Note: The cmd option is now required due to the increasing number of ways
|
21
|
+
# rspec may be run, below are examples of the most common uses.
|
22
|
+
# * bundler: 'bundle exec rspec'
|
23
|
+
# * bundler binstubs: 'bin/rspec'
|
24
|
+
# * spring: 'bin/rspec' (This will use spring if running and you have
|
25
|
+
# installed the spring binstubs per the docs)
|
26
|
+
# * zeus: 'zeus rspec' (requires the server to be started separately)
|
27
|
+
# * 'just' rspec: 'rspec'
|
28
|
+
|
29
|
+
guard :rspec, cmd: "bundle exec rspec" do
|
30
|
+
require "guard/rspec/dsl"
|
31
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
32
|
+
|
33
|
+
# Feel free to open issues for suggestions and improvements
|
34
|
+
|
35
|
+
# RSpec files
|
36
|
+
rspec = dsl.rspec
|
37
|
+
watch(rspec.spec_helper) { rspec.spec_dir }
|
38
|
+
watch(rspec.spec_support) { rspec.spec_dir }
|
39
|
+
watch(rspec.spec_files)
|
40
|
+
|
41
|
+
# map lib files to corresponding file
|
42
|
+
watch(%r{lib/(.*)/([^/]*).rb}) { |m| rspec.spec.call("#{m[1]}/#{m[2]}") }
|
43
|
+
|
44
|
+
# Ruby files
|
45
|
+
ruby = dsl.ruby
|
46
|
+
dsl.watch_spec_files_for(ruby.lib_files)
|
47
|
+
end
|
data/Rakefile
CHANGED
data/bin/console
CHANGED
@@ -1,17 +1,26 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
require
|
5
|
-
require
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'shotgun_api_ruby'
|
6
6
|
|
7
7
|
require 'dotenv/load'
|
8
8
|
|
9
9
|
if ENV['SITE_NAME'] && ENV['SCRIPT_NAME'] && ENV['SCRIPT_KEY']
|
10
|
-
$cl =
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
$cl =
|
11
|
+
ShotgunApiRuby.new(
|
12
|
+
shotgun_site: ENV['SITE_NAME'],
|
13
|
+
auth: { client_id: ENV['SCRIPT_NAME'], client_secret: ENV['SCRIPT_KEY'] },
|
14
|
+
)
|
14
15
|
end
|
16
|
+
if ENV['SITE_URL'] && ENV['SCRIPT_NAME'] && ENV['SCRIPT_KEY']
|
17
|
+
$cl =
|
18
|
+
ShotgunApiRuby.new(
|
19
|
+
site_url: ENV['SITE_URL'],
|
20
|
+
auth: { client_id: ENV['SCRIPT_NAME'], client_secret: ENV['SCRIPT_KEY'] },
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
15
24
|
# You can add fixtures and/or initialization code here to make experimenting
|
16
25
|
# with your gem easier. You can also use a different console, if you like.
|
17
26
|
|
@@ -19,5 +28,5 @@ end
|
|
19
28
|
# require "pry"
|
20
29
|
# Pry.start
|
21
30
|
|
22
|
-
require
|
31
|
+
require 'pry'
|
23
32
|
Pry.start(__FILE__)
|