app_store_connect 0.12.2 → 0.13.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: 9499934e8493a769728ef37fab3f74b6a8954e9cb6638212e727c921d2f7dd58
4
- data.tar.gz: 17101045bf2ea8150aee7d4fe9be93105e87463c5c74e246fce5e2e127495f2d
3
+ metadata.gz: 4dce1e8e34f1223902d271ca579ae0ecef46b49e1be8a782561412bcb97f26ff
4
+ data.tar.gz: c8d4ac03735552d4a61dd458132adf3c611b25c40a7a99acf7d9d26c1e73eb5f
5
5
  SHA512:
6
- metadata.gz: eafea111e2f8847c4734ea312dfc669623db019c8d70543f78b54840efe21cf26dccd6b1283538c66f22c6db70d76aebd9779be1ccb801257fcef9bce5963ece
7
- data.tar.gz: 742789eda52758521bd5195123a54807c49f6f38e7533006607af588dc7c4f4167632cadd600e827e9b0e377e2e06eb6097801d5625d3406582eb57ffe398a9e
6
+ metadata.gz: 9e4d24c27e4f26074ae86e55dddd5ab57e196ac8a098cfdb39f63c7f6d1b64b73a30d5e9ad73cc03a3fdf4d6d03eb287b5ad143ab1f26a358706ef1c78bd0924
7
+ data.tar.gz: 595f99a72d4997abe9bc01dae7d2bcff8b4c3d6629823eefa73d19f31841f526efacc605b0d18d06a856f9bd39d76a1df3a038b04b4b8e8c282d47f9edee3429
@@ -0,0 +1,22 @@
1
+ name: Lint
2
+
3
+ on:
4
+ push:
5
+
6
+ jobs:
7
+ build:
8
+ name: Rubocop
9
+ runs-on: ubuntu-latest
10
+
11
+ steps:
12
+ - uses: actions/checkout@master
13
+ - name: Set up Ruby 2.6
14
+ uses: actions/setup-ruby@v1
15
+ with:
16
+ version: 2.6.x
17
+ - name: Install dependencies
18
+ run: |
19
+ gem install bundler
20
+ bundle install --jobs=3 --retry=3
21
+ - name: Run rubocop
22
+ run: rubocop
@@ -1,4 +1,4 @@
1
- name: Ruby Gem
1
+ name: Publish
2
2
 
3
3
  on:
4
4
  push:
@@ -0,0 +1,31 @@
1
+ name: Test
2
+
3
+ on:
4
+ push:
5
+ schedule:
6
+ - cron: 0 2 * * 1-5
7
+
8
+ jobs:
9
+ rspec:
10
+ name: RSpec
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - uses: actions/checkout@master
15
+ - name: Set up Ruby 2.6
16
+ uses: actions/setup-ruby@v1
17
+ with:
18
+ version: 2.6.x
19
+ - name: Install dependencies
20
+ run: |
21
+ gem install bundler
22
+ bundle install --jobs=3 --retry=3
23
+ curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
24
+ chmod +x ./cc-test-reporter
25
+ ./cc-test-reporter before-build
26
+ - name: Run rspec
27
+ run: |
28
+ rspec
29
+ ./cc-test-reporter after-build --exit-code $? -t simplecov
30
+ env:
31
+ CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- app_store_connect (0.12.2)
4
+ app_store_connect (0.13.0)
5
5
  activesupport (>= 5.1.7, <= 5.2.3)
6
6
  jwt (>= 1.4, <= 2.2.1)
7
7
  mixpanel-ruby (<= 2.2.0)
data/README.md CHANGED
@@ -1,6 +1,5 @@
1
1
  # App Store Connect
2
-
3
- [![Build Status](https://travis-ci.com/kyledecot/app_store_connect.svg?branch=master)](https://travis-ci.com/kyledecot/app_store_connect) [![Gem Version](https://badge.fury.io/rb/app_store_connect.svg)](https://badge.fury.io/rb/app_store_connect) [![Maintainability](https://api.codeclimate.com/v1/badges/eb09ffa68f84f8da0b6d/maintainability)](https://codeclimate.com/github/kyledecot/app_store_connect/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/eb09ffa68f84f8da0b6d/test_coverage)](https://codeclimate.com/github/kyledecot/app_store_connect/test_coverage)
2
+ [![Test](https://github.com/kyledecot/app_store_connect/workflows/Test/badge.svg)](https://github.com/kyledecot/app_store_connect/actions) [![Gem Version](https://badge.fury.io/rb/app_store_connect.svg)](https://badge.fury.io/rb/app_store_connect) [![Maintainability](https://api.codeclimate.com/v1/badges/eb09ffa68f84f8da0b6d/maintainability)](https://codeclimate.com/github/kyledecot/app_store_connect/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/eb09ffa68f84f8da0b6d/test_coverage)](https://codeclimate.com/github/kyledecot/app_store_connect/test_coverage)
4
3
 
5
4
  A Ruby interface to the [App Store Connect API](https://developer.apple.com/app-store-connect/api/)
6
5
 
@@ -1,13 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'app_store_connect/client'
4
- require 'app_store_connect/factory'
5
4
  require 'app_store_connect/object/type'
6
5
  require 'app_store_connect/object/attributes'
7
6
  require 'app_store_connect/object/properties'
8
7
  require 'app_store_connect/object/data'
9
- require 'app_store_connect/schema'
10
- require 'app_store_connect/type'
11
8
  require 'app_store_connect/version'
12
9
 
13
10
  require 'app_store_connect/bundle_id_create_request'
@@ -19,21 +16,7 @@ require 'app_store_connect/profile_create_request'
19
16
  module AppStoreConnect
20
17
  @config = {}
21
18
 
22
- SCHEMA = Schema.new(File.join(__dir__, './config/schema.json'))
23
-
24
19
  class << self
25
20
  attr_accessor :config
26
-
27
- def load!
28
- SCHEMA.types.each do |type_schema|
29
- options = type_schema.options
30
- klass = Factory.type(type_schema)
31
- name = options[:type]
32
-
33
- AppStoreConnect::Type.const_set(name, klass)
34
- end
35
- end
36
21
  end
37
-
38
- load!
39
22
  end
@@ -6,6 +6,7 @@ require 'securerandom'
6
6
 
7
7
  require 'app_store_connect/request'
8
8
  require 'app_store_connect/authorization'
9
+ require 'app_store_connect/schema'
9
10
 
10
11
  module AppStoreConnect
11
12
  class Client
@@ -17,7 +18,8 @@ module AppStoreConnect
17
18
  key_id: @options[:key_id],
18
19
  issuer_id: @options[:issuer_id]
19
20
  )
20
- @web_service_endpoints_by_alias ||= AppStoreConnect::SCHEMA
21
+ @web_service_endpoints_by_alias ||= @options
22
+ .fetch(:schema)
21
23
  .web_service_endpoints
22
24
  .map { |s| [s.alias, s] }
23
25
  .to_h
@@ -37,12 +39,12 @@ module AppStoreConnect
37
39
  call(web_service_endpoint, *kwargs)
38
40
  end
39
41
 
40
- private
41
-
42
42
  def web_service_endpoint_aliases
43
43
  @web_service_endpoints_by_alias.keys
44
44
  end
45
45
 
46
+ private
47
+
46
48
  def call(web_service_endpoint, **kwargs)
47
49
  raise "invalid http method: #{web_service_endpoint.http_method}" unless %i[get delete post].include?(web_service_endpoint.http_method)
48
50
 
@@ -78,7 +80,8 @@ module AppStoreConnect
78
80
 
79
81
  def options(**kwargs)
80
82
  defaults = {
81
- analytics_enabled: true
83
+ analytics_enabled: true,
84
+ schema: Schema.new(File.join(__dir__, '../config/schema.json'))
82
85
  }
83
86
  AppStoreConnect.config.merge(kwargs.merge(env_options.merge(defaults))).tap do |options|
84
87
  %i[key_id issuer_id private_key].each do |key|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AppStoreConnect
4
- VERSION = '0.12.2'
4
+ VERSION = '0.13.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_store_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.2
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Decot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-04 00:00:00.000000000 Z
11
+ date: 2019-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -213,12 +213,13 @@ extra_rdoc_files: []
213
213
  files:
214
214
  - ".github/ISSUE_TEMPLATE/bug_report.md"
215
215
  - ".github/ISSUE_TEMPLATE/feature_request.md"
216
- - ".github/workflows/gempush.yml"
216
+ - ".github/workflows/lint.yml"
217
+ - ".github/workflows/publish.yml"
218
+ - ".github/workflows/test.yml"
217
219
  - ".gitignore"
218
220
  - ".rspec"
219
221
  - ".rubocop.yml"
220
222
  - ".ruby-version"
221
- - ".travis.yml"
222
223
  - CODE_OF_CONDUCT.md
223
224
  - Gemfile
224
225
  - Gemfile.lock
@@ -236,7 +237,6 @@ files:
236
237
  - lib/app_store_connect/client.rb
237
238
  - lib/app_store_connect/create_request.rb
238
239
  - lib/app_store_connect/device_create_request.rb
239
- - lib/app_store_connect/factory.rb
240
240
  - lib/app_store_connect/object/attributes.rb
241
241
  - lib/app_store_connect/object/data.rb
242
242
  - lib/app_store_connect/object/properties.rb
@@ -246,8 +246,6 @@ files:
246
246
  - lib/app_store_connect/schema.rb
247
247
  - lib/app_store_connect/schema/type.rb
248
248
  - lib/app_store_connect/schema/web_service_endpoint.rb
249
- - lib/app_store_connect/type.rb
250
- - lib/app_store_connect/type/enum.rb
251
249
  - lib/app_store_connect/user_invitation_create_request.rb
252
250
  - lib/app_store_connect/version.rb
253
251
  - lib/config/schema.json
data/.travis.yml DELETED
@@ -1,14 +0,0 @@
1
- ---
2
- language: ruby
3
- before_install:
4
- - gem update --system --no-document
5
- - gem install bundler --no-document
6
- before_script:
7
- - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
8
- - chmod +x ./cc-test-reporter
9
- - ./cc-test-reporter before-build
10
- script:
11
- - bundle exec rspec
12
- - bundle exec rubocop
13
- after_script:
14
- - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT -t simplecov
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module AppStoreConnect
4
- class Factory
5
- def self.type(schema)
6
- Class.new(Type::Enum) do |base|
7
- base.const_set('VALUES', schema.values)
8
- end
9
- end
10
- end
11
- end
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'app_store_connect/type/enum'
4
-
5
- module AppStoreConnect
6
- module Type
7
- end
8
- end
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module AppStoreConnect
4
- module Type
5
- class Enum
6
- attr_reader :value
7
-
8
- def initialize(value:)
9
- @value = value
10
- end
11
-
12
- def self.const_missing(const)
13
- return const_set(const, new(value: const.to_s)) if const.to_s.in?(const_get('VALUES'))
14
-
15
- super(const)
16
- end
17
- end
18
- end
19
- end