Class: Pod::Command::RepoSvn::Push
- Inherits:
-
Pod::Command::RepoSvn
- Object
- Pod::Command
- Pod::Command::RepoSvn
- Pod::Command::RepoSvn::Push
- Defined in:
- lib/pod/command/repo_svn/push.rb
Class Method Summary collapse
Instance Method Summary collapse
- #add_specs_to_repo ⇒ Object
-
#initialize(argv) ⇒ Push
constructor
A new instance of Push.
- #run ⇒ Object
-
#update_repo ⇒ void
Updates the git repo against the remote.
- #validate! ⇒ Object
Methods inherited from Pod::Command::RepoSvn
Constructor Details
#initialize(argv) ⇒ Push
Returns a new instance of Push.
23 24 25 26 27 28 |
# File 'lib/pod/command/repo_svn/push.rb', line 23 def initialize(argv) @local_only = argv.flag?('local-only') @repo = argv.shift_argument @podspec = argv.shift_argument super end |
Class Method Details
.options ⇒ Object
19 20 21 |
# File 'lib/pod/command/repo_svn/push.rb', line 19 def self. [['--local-only', 'Does not perform the step of committing changes to REPO']].concat(super) end |
Instance Method Details
#add_specs_to_repo ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/pod/command/repo_svn/push.rb', line 49 def add_specs_to_repo UI.puts "\nAdding the #{'spec'.pluralize(podspec_files.count)} to the `#{@repo}' repo\n".yellow podspec_files.each do |spec_file| spec = Pod::Specification.from_file(spec_file) output_path = File.join(repo_dir, spec.name, spec.version.to_s) if Pathname.new(output_path).exist? = "[Fix] #{spec}" elsif Pathname.new(File.join(repo_dir, spec.name)).exist? = "[Update] #{spec}" else = "[Add] #{spec}" end FileUtils.mkdir_p(output_path) FileUtils.cp(spec_file, output_path) if !@local_only Dir.chdir(repo_dir) do # only commit if modified UI.puts "Committing changes" UI.puts `svn add #{spec.name} --force 2> /dev/null` UI.puts `svn commit -m "#{}"` end end end end |
#run ⇒ Object
35 36 37 38 |
# File 'lib/pod/command/repo_svn/push.rb', line 35 def run update_repo add_specs_to_repo end |
#update_repo ⇒ void
This method returns an undefined value.
Updates the git repo against the remote.
44 45 46 47 |
# File 'lib/pod/command/repo_svn/push.rb', line 44 def update_repo UI.puts "Updating the `#{@repo}' repo\n".yellow Dir.chdir(repo_dir) { UI.puts `svn update .` } end |
#validate! ⇒ Object
30 31 32 33 |
# File 'lib/pod/command/repo_svn/push.rb', line 30 def validate! super help! 'A spec-repo name is required.' unless @repo end |