Skip to content

Commit 9ffc76c

Browse files
author
Flurin Egger
committed
Decrease complexity by using instance variables
1 parent 999b4fa commit 9ffc76c

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

lib/roger/release/finalizers/git_branch.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ def commit_and_push_release(clone_dir, branch)
5555
::Dir.chdir(clone_dir) do
5656
# 3. Copy changes
5757
FileUtils.rm_rf("*")
58-
FileUtils.cp_r release.build_path.to_s + "/.", clone_dir.to_s
58+
FileUtils.cp_r @release.build_path.to_s + "/.", clone_dir.to_s
5959

6060
commands = [
6161
%w(git add .), # 4. Add all files
62-
%w(git commit -a -m) << "Release #{release.scm.version}" # 5. Commit
62+
%w(git commit -a -m) << "Release #{@release.scm.version}" # 5. Commit
6363
]
6464

6565
# 6. Git push if in options
66-
commands << (%w(git push origin) << branch) if options[:push]
66+
commands << (%w(git push origin) << branch) if @options[:push]
6767

6868
commands.each do |command|
6969
`#{Shellwords.join(command)}`

lib/roger/release/finalizers/rsync.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ def check_rsync_command(command)
5454

5555
def rsync(command, local_path, remote_path)
5656
target_path = remote_path
57-
target_path = "#{options[:host]}:#{target_path}" if options[:host]
58-
target_path = "#{options[:username]}@#{target_path}" if options[:username]
57+
target_path = "#{@options[:host]}:#{target_path}" if @options[:host]
58+
target_path = "#{@options[:username]}@#{target_path}" if @options[:username]
5959

6060
command = [
6161
options[:rsync],
@@ -73,15 +73,15 @@ def rsync(command, local_path, remote_path)
7373

7474
def prompt_for_upload
7575
!options[:ask] ||
76-
(prompt("Do you wish to upload to #{options[:host]}? [y/N]: ")) =~ /\Ay(es)?\Z/
76+
prompt("Do you wish to upload to #{@options[:host]}? [y/N]: ") =~ /\Ay(es)?\Z/
7777
end
7878

7979
def validate_options!
8080
must_have_keys = [:remote_path]
81-
return if (options.keys & must_have_keys).size == must_have_keys.size
81+
return if (@options.keys & must_have_keys).size == must_have_keys.size
8282

83-
release.log(self, "Missing options: #{(must_have_keys - options.keys).inspect}")
84-
fail "Missing keys: #{(must_have_keys - options.keys).inspect}"
83+
release.log(self, "Missing options: #{(must_have_keys - @options.keys).inspect}")
84+
fail "Missing keys: #{(must_have_keys - @options.keys).inspect}"
8585
end
8686

8787
def prompt(question = "Do you wish to continue?")

lib/roger/release/processors/mockup.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ def target_path(path)
9595
def log_call
9696
release.log(self, "Processing mockup files")
9797

98-
release.log(self, " Matching: #{options[:match].inspect}", true)
99-
release.log(self, " Skiping : #{options[:skip].inspect}", true)
100-
release.log(self, " Env : #{options[:env].inspect}", true)
98+
release.log(self, " Matching: #{@options[:match].inspect}", true)
99+
release.log(self, " Skiping : #{@options[:skip].inspect}", true)
100+
release.log(self, " Env : #{@options[:env].inspect}", true)
101101
release.log(self, " Files :", true)
102102
end
103103
end

0 commit comments

Comments
 (0)