Class: MrGithub::MrConfig
- Inherits:
-
Object
- Object
- MrGithub::MrConfig
- Defined in:
- lib/mr_github.rb
Instance Method Summary collapse
- #config ⇒ Object
-
#initialize(github_user, github_password) ⇒ MrConfig
constructor
A new instance of MrConfig.
- #to_s ⇒ Object
Constructor Details
#initialize(github_user, github_password) ⇒ MrConfig
Returns a new instance of MrConfig.
14 15 16 |
# File 'lib/mr_github.rb', line 14 def initialize(github_user, github_password) @gh = Ghee.basic_auth(github_user, github_password) end |
Instance Method Details
#config ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/mr_github.rb', line 18 def config @config ||= begin @config = StringIO.new user = @gh.user @config.puts "# That #{user.login} has access to directly" @gh.user.repos.all.each do |repo| @config.puts "[src/#{repo.owner.login.to_s}/#{repo.name.to_s}]" @config.puts "checkout = git clone #{repo.ssh_url.to_s}" @config.puts "" end @gh.orgs.each do |org| @config.puts "# That #{user.login} has access to via #{org.login}" @gh.orgs(org.login).repos.all.each do |repo| next if repo == ["message", "Not Found"] next if repo.name == 'rails' # don't need people's forks of rails @config.puts "[src/#{repo.owner.login.to_s}/#{repo.name.to_s}]" @config.puts "checkout = git clone #{repo.ssh_url.to_s}" @config.puts "" end end @config.string end end |
#to_s ⇒ Object
47 48 49 |
# File 'lib/mr_github.rb', line 47 def to_s config.to_s end |