shotgun_api_ruby 0.0.1 → 0.0.2
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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +42 -0
- data/lib/shotgun_api_ruby/client.rb +8 -0
- data/lib/shotgun_api_ruby/preferences.rb +24 -0
- data/lib/shotgun_api_ruby/server_info.rb +23 -0
- data/lib/shotgun_api_ruby/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 010e99c46e52c21872edf3bb9c2a431a5382dc3129f087b2d362dac09bc9e644
|
4
|
+
data.tar.gz: fe83680e545108fb0e2687880801fc3b72316d6388d9af84e5015aa21abc9fdf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c1f113a1fb94eed3b99bbfec633986f3e10208ae832b7756f825b2c3fce2163a255ab6747be704b8d2002dc980794028350c7d5176e34a30690be5d0f6596ef
|
7
|
+
data.tar.gz: 4cd377272e301f26ed52179bf6240ecdf74437d43c2461681053e67ee1f34899793ceef16adf029f2d4baad8490e4ef8ace9fcac8f379a4359fd29232bc7c560
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -67,6 +67,48 @@ client = ShotgunApiRuby.new(shotgun_site: 'xxx', auth: {session_token: 'session_
|
|
67
67
|
client = ShotgunApiRuby.new(shotgun_site: 'xxx', auth: {refresh_token: 'refresh_token'})
|
68
68
|
```
|
69
69
|
|
70
|
+
### Server Infos
|
71
|
+
|
72
|
+
Get general server infos:
|
73
|
+
|
74
|
+
```ruby
|
75
|
+
client.server_info.get
|
76
|
+
|
77
|
+
# #<OpenStruct
|
78
|
+
shotgun_version="v8.6.0.0-dev (build 12864de)",
|
79
|
+
api_version="v1",
|
80
|
+
shotgun_version_number="8.6.0.0-dev",
|
81
|
+
shotgun_build_number="12864de",
|
82
|
+
portfolio_version="UNKNOWN",
|
83
|
+
unified_login_flow_enabled=true,
|
84
|
+
user_authentication_method="default">
|
85
|
+
```
|
86
|
+
|
87
|
+
### Preferences
|
88
|
+
|
89
|
+
Get some preferences infos:
|
90
|
+
|
91
|
+
```ruby
|
92
|
+
prefs = client.preferences.get
|
93
|
+
prefs.to_h.keys
|
94
|
+
|
95
|
+
# [:format_date_fields,
|
96
|
+
# :date_component_order,
|
97
|
+
# :format_time_hour_fields,
|
98
|
+
# :format_currency_fields_display_dollar_sign,
|
99
|
+
# :format_currency_fields_decimal_options,
|
100
|
+
# :format_currency_fields_negative_options,
|
101
|
+
# :format_number_fields,
|
102
|
+
# :format_float_fields,
|
103
|
+
# :format_float_fields_rounding,
|
104
|
+
# :format_footage_fields,
|
105
|
+
# :support_local_storage,
|
106
|
+
# :view_master_settings,
|
107
|
+
# :duration_units,
|
108
|
+
# :hours_per_day,
|
109
|
+
# :last_day_work_week]
|
110
|
+
```
|
111
|
+
|
70
112
|
### Entities
|
71
113
|
|
72
114
|
Querying entities is done by accessing the named method
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ShotgunApiRuby
|
4
|
+
class Preferences
|
5
|
+
def initialize(connection)
|
6
|
+
@connection = connection.dup
|
7
|
+
@connection.url_prefix = "#{@connection.url_prefix}/preferences"
|
8
|
+
end
|
9
|
+
|
10
|
+
attr_reader :connection
|
11
|
+
|
12
|
+
def all
|
13
|
+
resp = @connection.get
|
14
|
+
resp_body = JSON.parse(resp.body)
|
15
|
+
|
16
|
+
if resp.status >= 300
|
17
|
+
raise "Error while getting server preferences: #{resp_body['errors']}"
|
18
|
+
end
|
19
|
+
|
20
|
+
data = resp_body["data"]
|
21
|
+
OpenStruct.new(data)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ShotgunApiRuby
|
4
|
+
class ServerInfo
|
5
|
+
def initialize(connection)
|
6
|
+
@connection = connection
|
7
|
+
end
|
8
|
+
|
9
|
+
attr_reader :connection
|
10
|
+
|
11
|
+
def get
|
12
|
+
resp = @connection.get
|
13
|
+
resp_body = JSON.parse(resp.body)
|
14
|
+
|
15
|
+
if resp.status >= 300
|
16
|
+
raise "Error while getting server infos: #{resp_body['errors']}"
|
17
|
+
end
|
18
|
+
|
19
|
+
data = resp_body["data"]
|
20
|
+
OpenStruct.new(data)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shotgun_api_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis <Zaratan> Pasin
|
@@ -191,6 +191,8 @@ files:
|
|
191
191
|
- lib/shotgun_api_ruby/client.rb
|
192
192
|
- lib/shotgun_api_ruby/entities.rb
|
193
193
|
- lib/shotgun_api_ruby/entity.rb
|
194
|
+
- lib/shotgun_api_ruby/preferences.rb
|
195
|
+
- lib/shotgun_api_ruby/server_info.rb
|
194
196
|
- lib/shotgun_api_ruby/version.rb
|
195
197
|
- shotgun_api_ruby.gemspec
|
196
198
|
homepage: https://github.com/shotgunsoftware/shotgun_api_ruby
|