fastlane-plugin-json 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +75 -3
- data/lib/fastlane/plugin/json/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a322af1714b480f2e163f6b1fbd7cc1ed54e07852e0db684abffb526a888cdc
|
4
|
+
data.tar.gz: bff1e8ed76220e6a7e4ce6ae5eedaf91973ac8d52d5dbe6b42f787184b29e25c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65df970c792ec75c1e41baaa9a3f3a815e6138c96e2ad8dd0f9f79d690c8473b40967f5b112bd337cebc0ff5164f4452e9a19b9f5912a7b5ba2b0dab613a3017
|
7
|
+
data.tar.gz: 33b204d134516933c17c1318ebcb9bc32938933b92b2c066e78d18876c1d2757c3e92097ad65b1fe2eb77ce3bad3f156cbdf4d7479a3eef8b062682503daf338
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# Fastlane Json plugin
|
2
2
|
|
3
3
|
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-json)
|
4
4
|
|
@@ -12,9 +12,81 @@ fastlane add_plugin json
|
|
12
12
|
|
13
13
|
## About json
|
14
14
|
|
15
|
-
actions
|
15
|
+
This plugin provide several actions that will allow you to manipulate and create json files.
|
16
16
|
|
17
|
-
|
17
|
+
### read_json
|
18
|
+
|
19
|
+
Read a json file at specific path as a hash object.
|
20
|
+
|
21
|
+
_Having a json file at `path/to/my.json` with the following content:_
|
22
|
+
|
23
|
+
```json
|
24
|
+
{
|
25
|
+
"name": "Martin",
|
26
|
+
"age": 30
|
27
|
+
}
|
28
|
+
```
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
my_json = read_json(
|
32
|
+
json_path: "path/to/my.json"
|
33
|
+
)
|
34
|
+
|
35
|
+
puts my_json[:name]
|
36
|
+
# "Martin"
|
37
|
+
puts my_json[:age]
|
38
|
+
# 30
|
39
|
+
```
|
40
|
+
|
41
|
+
### download_json
|
42
|
+
|
43
|
+
Downloads a json file from server and convert it to a hash object.
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
my_json = download_json(
|
47
|
+
json_url: "https://gist.githubusercontent.com/MartinGonzalez/77b28af666fc2ee844c96cf6c8c221a2/raw/d23feabf25abe39c9c7243fd23f92efa7f50a3fd/someExample.json"
|
48
|
+
)
|
49
|
+
|
50
|
+
puts my_json[:name]
|
51
|
+
# "Martin Gonzalez"
|
52
|
+
puts my_json[:gender]
|
53
|
+
# "male"
|
54
|
+
puts my_json[:isDev]
|
55
|
+
# true
|
56
|
+
```
|
57
|
+
|
58
|
+
### write_json
|
59
|
+
|
60
|
+
Creates a json file from a hash.
|
61
|
+
|
62
|
+
```ruby
|
63
|
+
hash_value = {
|
64
|
+
name: "Martin",
|
65
|
+
age: 30,
|
66
|
+
languages: [
|
67
|
+
"English",
|
68
|
+
"Spanish"
|
69
|
+
]
|
70
|
+
}
|
71
|
+
|
72
|
+
write_json(
|
73
|
+
file_path: "#{__dir__}/my_json.json",
|
74
|
+
hash: hash_value
|
75
|
+
)
|
76
|
+
```
|
77
|
+
|
78
|
+
Will create a my_json.json file with the following content:
|
79
|
+
|
80
|
+
```json
|
81
|
+
{
|
82
|
+
"name": "Martin",
|
83
|
+
"age": 30,
|
84
|
+
"languages": [
|
85
|
+
"English",
|
86
|
+
"Spanish"
|
87
|
+
]
|
88
|
+
}
|
89
|
+
```
|
18
90
|
|
19
91
|
## Example
|
20
92
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-json
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Gonzalez
|
@@ -169,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
169
169
|
- !ruby/object:Gem::Version
|
170
170
|
version: '0'
|
171
171
|
requirements: []
|
172
|
-
rubygems_version: 3.
|
172
|
+
rubygems_version: 3.0.3
|
173
173
|
signing_key:
|
174
174
|
specification_version: 4
|
175
175
|
summary: actions related to json files
|