lib/gooddata/models/process.rb in gooddata-0.6.43 vs lib/gooddata/models/process.rb in gooddata-0.6.44
- old
+ new
@@ -92,11 +92,11 @@
# @option options [String] :process_id ID of a process to be redeployed (do not set if you want to create a new process)
# @option options [Boolean] :verbose (false) Switch on verbose mode for detailed logging
def deploy(path, options = { :client => GoodData.client, :project => GoodData.project })
return deploy_brick(path, options) if path.to_s.start_with?(APP_STORE_URL)
- return deploy_from_appstore(path.to_s, options) if (path.to_s =~ /\${.*}:(.*)\/(.*):\//) == 0
+ return deploy_from_appstore(path.to_s, options) if (path.to_s =~ %r{\${.*}:(.*)\/(.*):\/}) == 0 # rubocop:disable Style/NumericPredicate
client, project = GoodData.get_client_and_project(options)
path = Pathname(path) || fail('Path is not specified')
files_to_exclude = options[:files_to_exclude].nil? ? [] : options[:files_to_exclude].map { |pname| Pathname(pname) }
@@ -144,11 +144,11 @@
Dir.chdir(File.join(dir, 'app_store')) do
if ref
`git checkout #{ref}`
- fail 'Wrong branch or tag specified!' if $CHILD_STATUS.to_i != 0
+ fail 'Wrong branch or tag specified!' if $CHILD_STATUS.to_i.nonzero?
end
opts = {
:client => client,
:project => project,
@@ -165,11 +165,11 @@
return deploy(full_brick_path, opts)
end
end
end
- def deploy_from_appstore(path, options = {:client => GoodData.client, :project => GoodData.project})
+ def deploy_from_appstore(path, options = { :client => GoodData.client, :project => GoodData.project })
client, project = GoodData.get_client_and_project(options)
deploy_name = options[:name]
fail ArgumentError, 'options[:name] can not be nil or empty!' if deploy_name.nil? || deploy_name.empty?
@@ -201,11 +201,9 @@
process = client.create(Process, res, project: project)
puts HighLine.color("Deploy DONE #{path}", HighLine::GREEN) if verbose
process
end
-
- # ----------------------------- Private Stuff
private
def with_zip(opts = {})
client = opts[:client]