Class: GitIssues
- Inherits:
-
Object
- Object
- GitIssues
- Defined in:
- lib/git-issues.rb,
lib/git-issues/version.rb
Constant Summary collapse
- Log =
Logging.logger[self]
Instance Attribute Summary collapse
-
#providers ⇒ Object
readonly
Returns the value of attribute providers.
Class Method Summary collapse
Instance Method Summary collapse
- #gitReposFor(path) ⇒ Object
-
#initialize ⇒ GitIssues
constructor
A new instance of GitIssues.
Constructor Details
#initialize ⇒ GitIssues
Returns a new instance of GitIssues.
11 12 13 |
# File 'lib/git-issues.rb', line 11 def initialize @providers = RepoProviders.new end |
Instance Attribute Details
#providers ⇒ Object (readonly)
Returns the value of attribute providers.
10 11 12 |
# File 'lib/git-issues.rb', line 10 def providers @providers end |
Class Method Details
.version ⇒ Object
2 3 4 |
# File 'lib/git-issues/version.rb', line 2 def self.version '0.1.5' end |
Instance Method Details
#gitReposFor(path) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/git-issues.rb', line 15 def gitReposFor path p = File::(path) git_path = File::join(p, '.git') git_conf = File::join(git_path, 'config') if not File::directory?(git_path) Log.error "This is not a git repository (path: #{p})" return [] end if not File::file?(git_conf) Log.error "Missing git configuration file (missing: #{git_conf})" return [] end config = ParseConfig.new(git_conf) remotes = config.params.keys.find_all{|i|i.start_with?('remote ')} remote_repos = remotes.map{|r| config.params[r]['url']} @providers.map_urls_to_provider( remote_repos ) end |