fastlane-plugin-json 0.1.0 → 0.1.2

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: 323cfd72fd33cce1d3b951791dea2d295d409973be79a47cce17edbd5b1359a8
4
- data.tar.gz: 4f09f1851f2aa9a822ed25591ea2f968407fe0de35f7d7a3cdcf97ae406ecddb
3
+ metadata.gz: 7a322af1714b480f2e163f6b1fbd7cc1ed54e07852e0db684abffb526a888cdc
4
+ data.tar.gz: bff1e8ed76220e6a7e4ce6ae5eedaf91973ac8d52d5dbe6b42f787184b29e25c
5
5
  SHA512:
6
- metadata.gz: c7d8ef2e4b3bfe1eb1754b82c61657c84a65119e0a8b1a2bcdd58aa36b1f7bf6feded0ec44f6b36eb5b0a50d4230b32649c70f9aa664196c1a6a726ac396bf89
7
- data.tar.gz: 49ed4ce1b6225d8ab188dcbdd6a228adec63931fbcfda6a2d8b5c7dd33c93035cf2e16a61fa21fb415434764b6e5684dffebeba4b4073e5bd5237acacb449b59
6
+ metadata.gz: 65df970c792ec75c1e41baaa9a3f3a815e6138c96e2ad8dd0f9f79d690c8473b40967f5b112bd337cebc0ff5164f4452e9a19b9f5912a7b5ba2b0dab613a3017
7
+ data.tar.gz: 33b204d134516933c17c1318ebcb9bc32938933b92b2c066e78d18876c1d2757c3e92097ad65b1fe2eb77ce3bad3f156cbdf4d7479a3eef8b062682503daf338
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # json plugin
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 related to json files
15
+ This plugin provide several actions that will allow you to manipulate and create json files.
16
16
 
17
- **Note to author:** Add a more detailed description about this plugin here. If your plugin contains multiple actions, make sure to mention them here.
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
 
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Json
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
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.0
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.1.2
172
+ rubygems_version: 3.0.3
173
173
  signing_key:
174
174
  specification_version: 4
175
175
  summary: actions related to json files