fastlane-plugin-json 1.0.0 → 1.1.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
  SHA256:
3
- metadata.gz: 0e3e4f9fabac49b37c5b1f74f2c13a5437fea429e87d719d8ab7485ab65b62c3
4
- data.tar.gz: fa1d7b43aa5e7d2a1a78cc7af77e3298a359a0ac4e52d18150fa2d53f7252956
3
+ metadata.gz: 171f876162ae4aa8045970d6375243fcb2a4f05c8effb677806ca5634e3ca359
4
+ data.tar.gz: 499dea3eb82ee7cd6390260d13d0218eb347c467f9c6f0544b36aa5b8a12e0be
5
5
  SHA512:
6
- metadata.gz: 8a84bd2ddd28c7585de28581904c4329c3102e837c9bf52f03cdf696dbac501151f62a8e47232e65922c65addb8cb03891e0e2cfdb6facbe4e612fba8b697eb9
7
- data.tar.gz: ed7d46a059efea8ea5b3a0325a4d29f9054a732f4697a73c5f873896940bf8aa257c18a165a06384989a932e28099a737da4e2dd36d37cda9ad581316beb3d05
6
+ metadata.gz: bc2c2ac056904781c571dbdd3f5c92bc0d50d0f6d46556efd3e8d4491b5fb86148debee6400fbd7df3c9a26e1d8250e15588d193054e0cc0bba04e757b209ba9
7
+ data.tar.gz: 84c7f37783ee3933209c546ff64df6e08df0517879813c199895899fbb93a30d48c9067edfcb252fbad74ef7aa19cd0b7eb9ed61ed1e3b18d4826361386b52fe
@@ -7,16 +7,27 @@ module Fastlane
7
7
  class ReadJsonAction < Action
8
8
  def self.run(params)
9
9
  json_path = params[:json_path]
10
+ json_string = params[:json_string]
10
11
  @is_verbose = params[:verbose]
11
12
 
13
+ if json_path.nil? && json_string.nil?
14
+ put_error!("You need to provide a json_path (file to path) or json_string (json as string) ❌")
15
+ return nil
16
+ end
17
+
12
18
  print_params(params) if @is_verbose
13
19
 
14
- unless File.file?(json_path)
15
- put_error!("File at path #{json_path} does not exist. Verify that the path is correct ❌")
16
- return nil
20
+ json_content = json_string
21
+
22
+ unless json_path.nil?
23
+ unless File.file?(json_path)
24
+ put_error!("File at path #{json_path} does not exist. Verify that the path is correct ❌")
25
+ return nil
26
+ end
27
+
28
+ json_content = File.read(json_path)
17
29
  end
18
30
 
19
- json_content = File.read(json_path)
20
31
  begin
21
32
  JSON.parse(json_content, symbolize_names: true)
22
33
  rescue
@@ -42,10 +53,11 @@ module Fastlane
42
53
  FastlaneCore::ConfigItem.new(key: :json_path,
43
54
  description: "Path to json file",
44
55
  is_string: true,
45
- optional: false,
46
- verify_block: proc do |value|
47
- UI.user_error!("You must set json_path pointing to a json file") unless value && !value.empty?
48
- end),
56
+ optional: true),
57
+ FastlaneCore::ConfigItem.new(key: :json_string,
58
+ description: "A json as string",
59
+ is_string: true,
60
+ optional: true),
49
61
  FastlaneCore::ConfigItem.new(key: :verbose,
50
62
  description: "verbose",
51
63
  optional: true,
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Json
3
- VERSION = "1.0.0"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-json
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Gonzalez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-27 00:00:00.000000000 Z
11
+ date: 2022-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -170,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
170
170
  - !ruby/object:Gem::Version
171
171
  version: '0'
172
172
  requirements: []
173
- rubygems_version: 3.0.3
173
+ rubygems_version: 3.0.3.1
174
174
  signing_key:
175
175
  specification_version: 4
176
176
  summary: actions related to json files