Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fastlane-plugin-json_auth

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastlane-plugin-json_auth

  • 1.3.0
  • Rubygems
  • Socket score

Version published
Maintainers
2
Created
Source

Fastlane Json plugin

fastlane Plugin Badge Gem Version CircleCI

Getting Started

This project is a fastlane plugin. To get started with fastlane-plugin-json, add it to your project by running:

fastlane add_plugin json

Actions

This plugin provide several actions that will allow you to manipulate and create json files.

read_json

KeyDescriptionEnv VarDefault
json_pathPath to json file
verboseverbosefalse

Read a json file at specific path as a hash object.

Having a json file at path/to/my.json with the following content:

{
  "name": "Martin",
  "age": 30
}
my_json = read_json(
  json_path: "path/to/my.json"
)

puts my_json[:name]
# "Martin"
puts my_json[:age]
# 30

download_json

KeyDescriptionEnv VarDefault
json_urlUrl to json file
usernameBasic auth username to download
passwordBasic auth password to download
verboseverbosefalse

Downloads a json file from server and convert it to a hash object.

my_json = download_json(
  json_url: "https://gist.githubusercontent.com/MartinGonzalez/77b28af666fc2ee844c96cf6c8c221a2/raw/d23feabf25abe39c9c7243fd23f92efa7f50a3fd/someExample.json",
  username: "admin",
  password: "admin123"
)

puts my_json[:name]
# "Martin Gonzalez"
puts my_json[:gender]
# "male"
puts my_json[:isDev]
# true

write_json

KeyDescriptionEnv VarDefault
hashHash that you want to save as a json file
file_pathPath where you want to save your json
verboseverbosefalse

Creates a json file from a hash.

hash_value = {
  name: "Martin",
  age: 30,
  languages: [
    "English",
    "Spanish"
  ]
}

write_json(
  file_path: "#{__dir__}/my_json.json",
  hash: hash_value
)

Will create a my_json.json file with the following content:

{
  "name": "Martin",
  "age": 30,
  "languages": [
    "English",
    "Spanish"
  ]
}

merge_jsons

KeyDescriptionEnv VarDefault
jsons_pathsArray of json files paths
output_pathOutput path where result will be saved
verboseverbosefalse

Merges several json files into one hash as output. Also you can set the output_path to save the merged hash into a json file.

Having this files:

example.json

{
  "name": "Martin",
  "age": 30
}

example2.json

{
  "lastName": "Gonzalez",
  "age": 40,
  "isDev": true
}
output_path = "#{__dir__}/tmp/merged.json"

merged_hash = merge_jsons(
  jsons_paths: [
    "path/to/example.json",
    "path/to/example2.json"
  ],
  output_path: output_path
)

# {:name=>"Martin", :age=>40, :lastName=>"Gonzalez", :isDev=>true}

Example

Check out the example Fastfile to see how to use this plugin. Try it by cloning the repo, running fastlane install_plugins and bundle exec fastlane all.

Run tests for this plugin

To run both the tests, and code style validation, run

rake

To automatically fix many of the styling issues, use

rubocop -a

Issues and Feedback

For any other issues and feedback about this plugin, please submit it to this repository.

Troubleshooting

If you have trouble using plugins, check out the Plugins Troubleshooting guide.

Using fastlane Plugins

For more information about how the fastlane plugin system works, check out the Plugins documentation.

About fastlane

fastlane is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out fastlane.tools.

FAQs

Package last updated on 11 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc