fastlane/lib/fastlane/actions/hipchat.rb in fastlane_hotfix-2.165.1 vs fastlane/lib/fastlane/actions/hipchat.rb in fastlane_hotfix-2.187.0
- old
+ new
@@ -47,11 +47,12 @@
else
########## running on V2 ##########
# Escape channel's name to guarantee it is a valid URL resource.
# First of all we verify that the value is not already escaped,
# escaping an escaped value will produce a wrong channel name.
- escaped_channel = URI.unescape(channel) == channel ? URI.escape(channel) : channel
+ require 'addressable/uri'
+ escaped_channel = Addressable::URI.encode(channel) == channel ? Addressable::URI.encode(channel) : channel
if user?(channel)
params = { 'message' => message, 'message_format' => message_format }
json_headers = { 'Content-Type' => 'application/json',
'Accept' => 'application/json', 'Authorization' => "Bearer #{api_token}" }
@@ -114,18 +115,17 @@
end
end),
FastlaneCore::ConfigItem.new(key: :custom_color,
env_name: "FL_HIPCHAT_CUSTOM_COLOR",
description: "Specify a custom color, this overrides the success boolean. Can be one of 'yellow', 'red', 'green', 'purple', 'gray', or 'random'",
- optional: true,
- is_string: true),
+ optional: true),
FastlaneCore::ConfigItem.new(key: :success,
env_name: "FL_HIPCHAT_SUCCESS",
description: "Was this build successful? (true/false)",
optional: true,
default_value: true,
- is_string: false),
+ type: Boolean),
FastlaneCore::ConfigItem.new(key: :version,
env_name: "HIPCHAT_API_VERSION",
description: "Version of the Hipchat API. Must be 1 or 2",
verify_block: proc do |value|
if value.nil? || ![1, 2].include?(value.to_i)
@@ -136,11 +136,11 @@
FastlaneCore::ConfigItem.new(key: :notify_room,
env_name: "HIPCHAT_NOTIFY_ROOM",
description: "Should the people in the room be notified? (true/false)",
default_value: false,
optional: true,
- is_string: false),
+ type: Boolean),
FastlaneCore::ConfigItem.new(key: :api_host,
env_name: "HIPCHAT_API_HOST",
description: "The host of the HipChat-Server API",
default_value: "api.hipchat.com",
optional: true),
@@ -158,10 +158,10 @@
FastlaneCore::ConfigItem.new(key: :include_html_header,
env_name: "FL_HIPCHAT_INCLUDE_HTML_HEADER",
description: "Should html formatted messages include a preformatted header? (true/false)",
default_value: true,
optional: true,
- is_string: false),
+ type: Boolean),
FastlaneCore::ConfigItem.new(key: :from,
env_name: "FL_HIPCHAT_FROM",
description: "Name the message will appear to be sent from",
default_value: "fastlane",
optional: true)