Class: Fastlane::Actions::LoadJsonAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::LoadJsonAction
- Defined in:
- lib/fastlane/plugin/load_json/actions/load_json_action.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .return_value ⇒ Object
- .run(params) ⇒ Object
Class Method Details
.authors ⇒ Object
15 16 17 |
# File 'lib/fastlane/plugin/load_json/actions/load_json_action.rb', line 15 def self. ["KrauseFx"] end |
.available_options ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/fastlane/plugin/load_json/actions/load_json_action.rb', line 23 def self. [ FastlaneCore::ConfigItem.new(key: :json_path, env_name: "LOAD_JSON_JSON_PATH", description: "The relative path to the JSON file", optional: false, type: String, verify_block: proc do |value| value = File.(value) UI.user_error!("Couldn't find JSON at path '#{value}'") unless File.exist?(value) end) ] end |
.description ⇒ Object
11 12 13 |
# File 'lib/fastlane/plugin/load_json/actions/load_json_action.rb', line 11 def self.description "Loads a local JSON file and parses it" end |
.is_supported?(platform) ⇒ Boolean
37 38 39 |
# File 'lib/fastlane/plugin/load_json/actions/load_json_action.rb', line 37 def self.is_supported?(platform) true end |
.return_value ⇒ Object
19 20 21 |
# File 'lib/fastlane/plugin/load_json/actions/load_json_action.rb', line 19 def self.return_value "Content of the JSON file to load" end |
.run(params) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/fastlane/plugin/load_json/actions/load_json_action.rb', line 4 def self.run(params) require 'json' data = File.read(params[:json_path]) return JSON.parse(data) end |