Sha256: ee7dcdc0b370c9c0edd53027119c6c51ead95640ca1c4d266b86ff49626a59e7

Contents?: true

Size: 496 Bytes

Versions: 4

Compression:

Stored size: 496 Bytes

Contents

require 'fastlane/server/action_command.rb'
require 'fastlane/server/control_command.rb'
require 'json'

module Fastlane
  class CommandParser
    def self.parse(json: nil)
      command_json = JSON.parse(json)
      command_type = command_json['commandType'].to_sym
      command = command_json['command']

      case command_type
      when :action
        return ActionCommand.new(json: command)
      when :control
        return ControlCommand.new(json: command)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fastlane-2.74.0 fastlane/lib/fastlane/server/command_parser.rb
fastlane-2.74.0.beta.20180108010004 fastlane/lib/fastlane/server/command_parser.rb
fastlane-2.74.0.beta.20180107010004 fastlane/lib/fastlane/server/command_parser.rb
fastlane-2.74.0.beta.20180106010004 fastlane/lib/fastlane/server/command_parser.rb