Class: Jeweler::JewelerGit
- Inherits:
-
Object
- Object
- Jeweler::JewelerGit
- Defined in:
- lib/jeweler_rails/jeweler_git.rb
Constant Summary collapse
- @@git_conf =
lambda do output = {} filepath = File.( "~/.gitconfig", __FILE__) return output unless FileTest.exists?( filepath ) File.open( filepath, "r" ) do |f| header_key = nil while line = f.gets if line =~ /^\[\w+\]$/x header_key = line[/\w+/] output[header_key] = {} elsif line =~ /^.+=.+$/x item = line.split("=") key = item[0].strip val = item[1].strip output[header_key][key] = val end # if header line end # while end # File.open return output end.call
Class Method Summary collapse
-
.configuration ⇒ Object
git_conf.
-
.github_user ⇒ Object
self.user_email.
-
.user_email ⇒ Object
self.user_name.
-
.user_name ⇒ Object
self.configuration.
Class Method Details
.configuration ⇒ Object
git_conf
25 26 27 |
# File 'lib/jeweler_rails/jeweler_git.rb', line 25 def self.configuration @@git_conf end |
.github_user ⇒ Object
self.user_email
37 38 39 |
# File 'lib/jeweler_rails/jeweler_git.rb', line 37 def self.github_user @@git_conf["github"]["user"] end |
.user_email ⇒ Object
self.user_name
33 34 35 |
# File 'lib/jeweler_rails/jeweler_git.rb', line 33 def self.user_email @@git_conf["user"]["email"] end |
.user_name ⇒ Object
self.configuration
29 30 31 |
# File 'lib/jeweler_rails/jeweler_git.rb', line 29 def self.user_name @@git_conf["user"]["name"] end |