fastlane-plugin-json 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -0
- data/lib/fastlane/plugin/json/actions/download_json_action.rb +1 -1
- data/lib/fastlane/plugin/json/actions/read_json_action.rb +1 -1
- data/lib/fastlane/plugin/json/actions/write_json_action.rb +5 -4
- data/lib/fastlane/plugin/json/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2dfcdb6a3044272e9451d59fef9f49a0ee8120ee9c0f790d15b7c15ddccdc08b
|
4
|
+
data.tar.gz: c6576b58b55ba9c371355f78c7ed3c56bb2ce1f4502519c7d8dfe8064b36ea4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59fc9b843dbb0879a200c531aeac537d4c52277afa2b13b21653eb48c8d42dd8f18734c6ced32d9629cad4777df0b585ab0fa6b7b1b06f90c26331b8331ae748
|
7
|
+
data.tar.gz: 7f6a36f21aba3af6675a6b676b254165640db476a14625ade18ee594aaf701f0bdd62d97e8fa0851252ad7f2ad42c47fa5b2bf5201c118d55f375a8c1e8fd51c
|
data/README.md
CHANGED
@@ -16,6 +16,11 @@ This plugin provide several actions that will allow you to manipulate and create
|
|
16
16
|
|
17
17
|
### read_json
|
18
18
|
|
19
|
+
| Key | Description | Env Var | Default |
|
20
|
+
|-----------|-------------------|---------|---------|
|
21
|
+
| json_path | Path to json file | | |
|
22
|
+
| verbose | verbose | | false |
|
23
|
+
|
19
24
|
Read a json file at specific path as a hash object.
|
20
25
|
|
21
26
|
_Having a json file at `path/to/my.json` with the following content:_
|
@@ -40,6 +45,11 @@ puts my_json[:age]
|
|
40
45
|
|
41
46
|
### download_json
|
42
47
|
|
48
|
+
| Key | Description | Env Var | Default |
|
49
|
+
|-----------|-------------------|---------|---------|
|
50
|
+
| json_url | Url to json file | | |
|
51
|
+
| verbose | verbose | | false |
|
52
|
+
|
43
53
|
Downloads a json file from server and convert it to a hash object.
|
44
54
|
|
45
55
|
```ruby
|
@@ -57,6 +67,12 @@ puts my_json[:isDev]
|
|
57
67
|
|
58
68
|
### write_json
|
59
69
|
|
70
|
+
| Key | Description | Env Var | Default |
|
71
|
+
|-----------|-------------------------------------------|---------|---------|
|
72
|
+
| hash | Hash that you want to save as a json file | | |
|
73
|
+
| file_path | Path where you want to save your json | | |
|
74
|
+
| verbose | verbose | | false |
|
75
|
+
|
60
76
|
Creates a json file from a hash.
|
61
77
|
|
62
78
|
```ruby
|
@@ -21,7 +21,8 @@ module Fastlane
|
|
21
21
|
return
|
22
22
|
end
|
23
23
|
|
24
|
-
|
24
|
+
file_path_expanded = File.expand_path(file_path)
|
25
|
+
file_dir = File.dirname(file_path_expanded)
|
25
26
|
Dir.mkdir(file_dir) unless File.directory?(file_dir)
|
26
27
|
print_params(params) if @is_verbose
|
27
28
|
|
@@ -51,7 +52,7 @@ module Fastlane
|
|
51
52
|
FastlaneCore::ConfigItem.new(key: :hash,
|
52
53
|
description: "Hash that you want to save as a json file",
|
53
54
|
optional: false,
|
54
|
-
|
55
|
+
type: Hash,
|
55
56
|
verify_block: proc do |value|
|
56
57
|
UI.user_error!("You must set hash: parameter") unless value && !value.empty?
|
57
58
|
end),
|
@@ -60,12 +61,12 @@ module Fastlane
|
|
60
61
|
is_string: true,
|
61
62
|
optional: false,
|
62
63
|
verify_block: proc do |value|
|
63
|
-
UI.user_error!("You must set file_path: parameter") unless value.
|
64
|
+
UI.user_error!("You must set file_path: parameter") unless value && !value.empty?
|
64
65
|
end),
|
65
66
|
FastlaneCore::ConfigItem.new(key: :verbose,
|
66
67
|
description: "verbose",
|
67
68
|
optional: true,
|
68
|
-
|
69
|
+
type: Boolean)
|
69
70
|
]
|
70
71
|
end
|
71
72
|
|