shotgun_api_ruby 0.0.7 → 0.1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 331b2df4f527205c4803c47cb3a80373578aa740d56fe79c092930881afb9a01
4
- data.tar.gz: '09a83792f0f2b93d3b877cb10501d27c0049ef23c928e34ec65b90b9db956900'
3
+ metadata.gz: ebb179d1404b03fd02a47b587b48e8a3cbbdfa69aa56141f2c4b3a9d73819eaf
4
+ data.tar.gz: ce95e7a5d7e7567ada62ac2604a6fc6f639cdacc3c61804fdd171a04de8309f1
5
5
  SHA512:
6
- metadata.gz: f47383023c6a67909c1eb1a54c8acc55880ba978bd20292633fb77362fdfd2e216d5b70869e1da88f1286a8640cec180fa12ef8b7d67351d8815b6b86d3d0e2e
7
- data.tar.gz: db5f9915dd9d40558d627efc6ed1860d254ef0f324e40a30aaa4f2e1cf8d78ea10baab866572a82444e40f4b12c3d18da537474fecd7e1a3c839ce0faa4900e9
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
- test-2_5:
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
- - uses: actions/checkout@v2
14
- - name: Set up Ruby
15
- uses: ruby/setup-ruby@v1
16
- with:
17
- ruby-version: 2.5
18
- - name: Install dependencies
19
- run: bundle install
20
- - name: Run linter
21
- run: bundle exec rubocop
22
- - name: Run tests
23
- run: bundle exec rspec
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
- - uses: actions/checkout@v2
44
- - name: Set up Ruby
45
- uses: ruby/setup-ruby@v1
46
- with:
47
- ruby-version: 2.7
48
- - name: Install dependencies
49
- run: bundle install
50
- - name: Run linter
51
- run: bundle exec rubocop
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: [test-2_5, test-2_6, test-2_7]
39
+ needs: [tests, prettier]
56
40
  runs-on: ubuntu-latest
57
41
 
58
42
  steps:
59
- - uses: actions/checkout@v2
60
- - name: Set up Ruby
61
- uses: ruby/setup-ruby@v1
62
- with:
63
- ruby-version: 2.7
64
- - name: Install dependencies
65
- run: bundle install
66
- - name: Prepare credentials
67
- env:
68
- RUBYGEM_KEY: ${{ secrets.RUBYGEM_KEY }}
69
- run: "echo -e \"---\\r\\n:rubygems_api_key: $RUBYGEM_KEY\" > ~/.gem/credentials && chmod 0600 ~/.gem/credentials"
70
- - name: Setup username/email
71
- run: "git config --global user.email zaratan@hey.com && git config --global user.name \"Denis <Zaratan> Pasin\""
72
- - name: Publish
73
- run: rake release
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
- test-2_5:
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
- - uses: actions/checkout@v2
14
- - name: Set up Ruby
15
- uses: ruby/setup-ruby@v1
16
- with:
17
- ruby-version: 2.5
18
- - name: Install dependencies
19
- run: bundle install
20
- - name: Run linter
21
- run: bundle exec rubocop
22
- - name: Run tests
23
- run: bundle exec rspec
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
- - uses: actions/checkout@v2
44
- - name: Set up Ruby
45
- uses: ruby/setup-ruby@v1
46
- with:
47
- ruby-version: 2.7
48
- - name: Install dependencies
49
- run: bundle install
50
- - name: Run linter
51
- run: bundle exec rubocop
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,8 +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]+)?") ]]'
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
@@ -11,3 +11,4 @@
11
11
  .rspec_status
12
12
  .env
13
13
  Gemfile.lock
14
+ Gemfile.lock
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
@@ -0,0 +1,4 @@
1
+ module.exports = {
2
+ trailingComma: "es5",
3
+ singleQuote: true,
4
+ };
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
- - 'db/schema.rb'
13
-
14
- Style/GlobalVars:
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 ADDED
@@ -0,0 +1,51 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
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
+
25
+ ## [0.0.8.4] - 2021-01-07
26
+ ### Changed
27
+ - Safer eager_load
28
+
29
+ ## [0.0.8.3] - 2021-01-07
30
+ ### Added
31
+ - eager_load files to fix weird bugs in rspec
32
+
33
+ ## [0.0.8] - 2020-12-16
34
+ ### Added
35
+ - Schema: read
36
+ - Schema: read fields
37
+
38
+ ## [0.0.7] - 2020-12-16
39
+ ### Added
40
+ - Entities: update
41
+ - Entities: create
42
+ - Entities: delete
43
+ - Entities: revive
44
+
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
48
+ [0.0.8.4]: https://github.com/shotgunsoftware/shotgun_api_ruby/releases/tag/v0.0.8.4
49
+ [0.0.8.3]: https://github.com/shotgunsoftware/shotgun_api_ruby/releases/tag/v0.0.8.3
50
+ [0.0.8]: https://github.com/shotgunsoftware/shotgun_api_ruby/releases/tag/v0.0.8
51
+ [0.0.7]: https://github.com/shotgunsoftware/shotgun_api_ruby/releases/tag/v0.0.7
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/README.md CHANGED
@@ -340,6 +340,26 @@ Will try to revive the entity referenced by the id. Will return true if successf
340
340
  client.assets.revive(1226)
341
341
  ```
342
342
 
343
+ ### Schema
344
+
345
+ Those calls allow to inspect the schema for a shotgun site.
346
+
347
+ #### Entity
348
+
349
+ ```ruby
350
+ client.assets.schema
351
+ ```
352
+
353
+ #### Entity fields
354
+
355
+ Fetch the different fields available on an entity type and their definition.
356
+
357
+ ```ruby
358
+ fields = client.assets.fields
359
+ fields.code.name # => "Asset Name"
360
+ fields.code.properties.summary_default # => "none"
361
+ ```
362
+
343
363
  ### Non implemented calls
344
364
 
345
365
  All calls which are not yet implemented can be done through the `connection` method. This method will still take care of the authentication for you.