octoauth 1.4.0 → 1.4.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 27b2465bdc907163cb0003c07f71ef178e016ed2
4
- data.tar.gz: c5182621b49bc520706ad71130891c78e5b5f12a
3
+ metadata.gz: 3e8c86992bd5cef84c8d1a3462af909b7fd3695f
4
+ data.tar.gz: 6de6cc8b669f59fc2b341d130aa9ffe8bbe1482a
5
5
  SHA512:
6
- metadata.gz: 7148edd967b7efd2ad3b23f314f11bdd718bfc8ff313818a976b9a187ed457a0468fe17e2d57abab62bf4e29ec495ba740d5714f298c783ee1b69e3db2a2019c
7
- data.tar.gz: c99fef10764304d056aa90d8433c61e7fca9be46ad98d85df9d4b40eb5d7389e384ed35000689987bc8a16929c62f6ee06087c7380d78ecba1ea39081b99ac4a
6
+ metadata.gz: f43c355d4991c437689450490f5b5fd61a45b7de0ca3e010fa5794911fb55e77c3f09db0fca9dc31ae03f17ff7769e149bf287a67de0e4d29bdadf2a2c777a29
7
+ data.tar.gz: 04b06e93fa81a02cbf2a15f1b1c1302f60fecbe97194a73a1e4b9e095ba05f8a9082718b38375fbf853236a387379176ecfb0f77e49397a2cc79531b2e6fcf82
data/.prospectus ADDED
@@ -0,0 +1,11 @@
1
+ item do
2
+ expected do
3
+ static
4
+ set 'green'
5
+ end
6
+
7
+ actual do
8
+ gemnasium
9
+ slug 'akerl/octoauth'
10
+ end
11
+ end
data/lib/octoauth/auth.rb CHANGED
@@ -29,6 +29,7 @@ module Octoauth
29
29
  fail 'No token to save' unless token
30
30
  fail 'No file given for config' unless config.file
31
31
  config.token = token
32
+ return unless @token_changed
32
33
  config.write
33
34
  end
34
35
 
@@ -68,8 +69,9 @@ module Octoauth
68
69
 
69
70
  def hostname
70
71
  return @hostname if @hostname
71
- res = `hostname`.split.first
72
- @hostname = $CHILD_STATUS.exitstatus == 0 ? res : 'NULL'
72
+ @hostname ||= ENV['HOSTNAME'] || `hostname`.split.first || 'NULL'
73
+ rescue Errno::ENOENT
74
+ @hostname = 'NULL'
73
75
  end
74
76
 
75
77
  def prompt!(needs2fa = false)
@@ -83,6 +85,7 @@ module Octoauth
83
85
 
84
86
  def load_token(needs2fa = false)
85
87
  return config.token if config.token
88
+ @token_changed = true
86
89
  prompt!(needs2fa)
87
90
  authenticate(needs2fa)
88
91
  end
data/octoauth.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'octoauth'
3
- s.version = '1.4.0'
3
+ s.version = '1.4.4'
4
4
  s.date = Time.now.strftime("%Y-%m-%d")
5
5
 
6
6
  s.summary = 'Auth token helper for GitHub API'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octoauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Les Aker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-17 00:00:00.000000000 Z
11
+ date: 2016-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit
@@ -143,6 +143,7 @@ extensions: []
143
143
  extra_rdoc_files: []
144
144
  files:
145
145
  - ".gitignore"
146
+ - ".prospectus"
146
147
  - ".rspec"
147
148
  - ".rubocop.yml"
148
149
  - CHANGELOG.md
@@ -188,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
188
189
  version: '0'
189
190
  requirements: []
190
191
  rubyforge_project:
191
- rubygems_version: 2.4.5
192
+ rubygems_version: 2.5.1
192
193
  signing_key:
193
194
  specification_version: 4
194
195
  summary: Auth token helper for GitHub API