fastlane-plugin-playship 0.1.0 → 0.2.0

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
  SHA1:
3
- metadata.gz: 6ad970d70ac2bb8e0c3123c47a3282264dc695b8
4
- data.tar.gz: 0abbb85e86ffa24b001536041d299278a32cbb6d
3
+ metadata.gz: ff9837e386ed26ae3317e6600af362c70048038a
4
+ data.tar.gz: a3e073cf3135fb393f6f955151918853a3e921e0
5
5
  SHA512:
6
- metadata.gz: 07277afdf00ef33586903e9abbb77107b27a53e6154da02aa36f84b7263f9a10848a2f4ed129ba73d0e24b8e99457a1c987ae554ceb83830d618d3296b6529df
7
- data.tar.gz: a5d32320aa2ca527a45def4b311cfbfe4cf38197dce18051414e5e1e55081e01e32b0ecebb30616e38ad8129b3d840c6b860a4a68dbb4627ae0d434b69e5924d
6
+ metadata.gz: 855729dbe10b1b9ab353ebe443159681d84496520be82163972a1030c8a51c681acba6a28c4bdd38f9eb8fe39f881b3695ab44648f5e9a81c178adc5f02786c3
7
+ data.tar.gz: e223eb3da0644d7998f76a1c4fbf7c8bc4958ef85c2b761852f457c629833c20c88823607d8ce16bdeff480bcf8069a8ed5cc903ca1d21616ea5a5ef5c7a9773
data/README.md CHANGED
@@ -17,14 +17,14 @@ Exposes a initialized AndroidpublisherV2 instance
17
17
  ## Example
18
18
 
19
19
  ```ruby
20
- client = playship(key: "~/Desktop/CLOUD_DRIVE_OLD/FXF/FXF-ANDROID/fastlane/google_play_key.json")
20
+ client = playship(key: "~/Desktop/CLOUD_DRIVE_OLD/FXF/FXF-ANDROID/fastlane/google_play_key.json").client
21
21
  ```
22
22
 
23
23
  ### List in-app-purchases
24
24
 
25
25
  ```ruby
26
26
  lane :list_iaps do
27
- client = playship(key: "~/Desktop/CLOUD_DRIVE_OLD/FXF/FXF-ANDROID/fastlane/google_play_key.json")
27
+ client = playship(key: "~/Desktop/CLOUD_DRIVE_OLD/FXF/FXF-ANDROID/fastlane/google_play_key.json").client
28
28
  iaps = client.list_in_app_products("at.krone.epaper", token: nil)
29
29
 
30
30
  next_page = nil
@@ -1,24 +1,8 @@
1
1
  module Fastlane
2
2
  module Actions
3
3
  class PlayshipAction < Action
4
- Androidpublisher = Google::Apis::AndroidpublisherV2
5
- CredentialsLoader = Google::Auth::CredentialsLoader
6
4
  def self.run(params)
7
- scope = Androidpublisher::AUTH_ANDROIDPUBLISHER
8
- # requires valid play store json key
9
- service_account_json = File.open(File.expand_path(params[:key]))
10
- auth_client = Google::Auth::ServiceAccountCredentials.make_creds(json_key_io: service_account_json, scope: scope)
11
- auth_client.fetch_access_token!
12
-
13
- Google::Apis::ClientOptions.default.application_name = "fastlane-playship"
14
- Google::Apis::ClientOptions.default.application_version = "1.0"
15
- Google::Apis::RequestOptions.default.timeout_sec = 300
16
- Google::Apis::RequestOptions.default.open_timeout_sec = 300
17
- Google::Apis::RequestOptions.default.retries = 5
18
-
19
- android_publisher = Androidpublisher::AndroidPublisherService.new
20
- android_publisher.authorization = auth_client
21
- android_publisher
5
+ Fastlane::Playship::Client.new(params[:key])
22
6
  end
23
7
 
24
8
  def self.description
@@ -0,0 +1,29 @@
1
+ module Fastlane
2
+ module Playship
3
+ class Client
4
+ Androidpublisher = Google::Apis::AndroidpublisherV2
5
+ CredentialsLoader = Google::Auth::CredentialsLoader
6
+ # Raw Client access
7
+ attr_accessor :client
8
+ def initialize(key)
9
+ scope = Androidpublisher::AUTH_ANDROIDPUBLISHER
10
+ # requires valid play store json key
11
+ service_account_json = File.open(File.expand_path(key))
12
+ auth_client = Google::Auth::ServiceAccountCredentials.make_creds(json_key_io: service_account_json, scope: scope)
13
+ auth_client.fetch_access_token!
14
+
15
+ Google::Apis::ClientOptions.default.application_name = "fastlane-playship"
16
+ Google::Apis::ClientOptions.default.application_version = "1.0"
17
+ Google::Apis::RequestOptions.default.timeout_sec = 300
18
+ Google::Apis::RequestOptions.default.open_timeout_sec = 300
19
+ Google::Apis::RequestOptions.default.retries = 5
20
+
21
+ android_publisher = Androidpublisher::AndroidPublisherService.new
22
+ android_publisher.authorization = auth_client
23
+ @client = android_publisher
24
+ android_publisher
25
+ end
26
+ # TODO: add convienent methods :)
27
+ end
28
+ end
29
+ end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Playship
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -1,6 +1,7 @@
1
1
  require 'fastlane/plugin/playship/version'
2
2
  require 'googleauth'
3
3
  require 'google/apis/androidpublisher_v2'
4
+ require 'fastlane/plugin/playship/client'
4
5
 
5
6
  module Fastlane
6
7
  module Playship
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-playship
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Helmut Januschka
@@ -118,6 +118,7 @@ files:
118
118
  - README.md
119
119
  - lib/fastlane/plugin/playship.rb
120
120
  - lib/fastlane/plugin/playship/actions/playship_action.rb
121
+ - lib/fastlane/plugin/playship/client.rb
121
122
  - lib/fastlane/plugin/playship/version.rb
122
123
  homepage:
123
124
  licenses: