ghi 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/ghi.rb +7 -4
  2. metadata +4 -4
data/lib/ghi.rb CHANGED
@@ -3,16 +3,17 @@ require "yaml"
3
3
  YAML::ENGINE.yamler = "syck" if YAML.const_defined? :ENGINE
4
4
 
5
5
  module GHI
6
- VERSION = "0.3.0"
6
+ VERSION = "0.3.1"
7
7
 
8
8
  class << self
9
9
  def login
10
10
  return @login if defined? @login
11
- @login = `git config --get github.user`.chomp
11
+ @login = ENV["GITHUB_USER"] || `git config --get github.user`.chomp
12
12
  if @login.empty?
13
13
  warn "Please configure your GitHub username."
14
14
  puts
15
15
  puts "E.g., git config --global github.user [your username]"
16
+ puts "Or set the environment variable GITHUB_USER"
16
17
  abort
17
18
  end
18
19
  @login
@@ -20,11 +21,13 @@ module GHI
20
21
 
21
22
  def token
22
23
  return @token if defined? @token
23
- @token = `git config --get github.token`.chomp
24
+ # env values are frozen
25
+ @token = (ENV["GITHUB_TOKEN"] || `git config --get github.token`.chomp).dup
24
26
  if @token.empty?
25
27
  warn "Please configure your GitHub token."
26
28
  puts
27
- puts "E.g., git config --global github.user [your token]"
29
+ puts "E.g., git config --global github.token [your token]"
30
+ puts "Or set the environment variable GITHUB_TOKEN"
28
31
  puts
29
32
  puts "Find your token here: https://github.com/account/admin"
30
33
  abort
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ghi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-09 00:00:00.000000000 Z
12
+ date: 2012-01-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70226629529100 !ruby/object:Gem::Requirement
16
+ requirement: &70100746900540 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - <
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '2.0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70226629529100
24
+ version_requirements: *70100746900540
25
25
  description: GitHub Issues on the command line. Use your `$EDITOR`, not your browser.
26
26
  email: stephen@stephencelis.com
27
27
  executables: