class ProjectGroup::Repo
Attributes
path[RW]
Public Instance Methods
changes?()
click to toggle source
# File lib/project_group/repo.rb, line 68 def changes? changed_files.values.any? { |x| x.size > 0 } end
cmd(str)
click to toggle source
# File lib/project_group/repo.rb, line 8 def cmd(str) c = "cd #{path} && #{str}" puts c res = ProjectGroup.ec(c) puts res res end
current?()
click to toggle source
# File lib/project_group/repo.rb, line 91 def current? !changes? && pushed? end
git(*args)
click to toggle source
# File lib/project_group/repo.rb, line 15 def git(*args) raise "no git repo for #{path}" unless FileTest.exist?("#{path}/.git") str = args.join(" ") cmd "git #{str}" end
name()
click to toggle source
# File lib/project_group/repo.rb, line 5 def name raise "name call" end
print!()
click to toggle source
# File lib/project_group/repo.rb, line 27 def print! puts "Gem: #{name}".color(:white) if !current? changed_files.each do |type,files| files.each do |f| puts "#{type}: #{f}" end end puts "Needs Push #{local_ref} -> #{remote_ref}" unless pushed? else puts "No Changes" end end
push_check!()
click to toggle source
# File lib/project_group/repo.rb, line 95 def push_check! repo!; local_ref! return if pushed? print "Push? " resp = STDIN.gets.to_s.strip.downcase if resp == 'y' git "push origin master" end end
pushed?()
click to toggle source
# File lib/project_group/repo.rb, line 87 def pushed? remote_ref == local_ref end
use_file?(f)
click to toggle source
# File lib/project_group/repo.rb, line 41 def use_file?(f) return false if %w(build tmp log pkg vendor junk).any? { |x| x == f.split("/").first } return false if f =~ /public\/assets/ return false if f.split(".").last == "log" return false if f =~ /testflight_launcher/ true end