boxen 3.1.0 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +3 -1
- data/boxen.gemspec +1 -1
- data/lib/boxen/config.rb +10 -4
- data/lib/boxen/util.rb +5 -3
- data/test/boxen_keychain_test.rb +6 -9
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8d63fa60357ab349b4e445f31dfef7dc52f440d9
|
|
4
|
+
data.tar.gz: 0e2fb4630cfd1636058d571b679cd091ac3ad37d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f79dbdce5b15b2a7ef1824e369f7fd4a2918fc10c34635d59c9a9c2474a383f5f45246c065ba4072281ea57d313c1d806b9f28b3de2dfd42c5595ac46f4d2b70
|
|
7
|
+
data.tar.gz: 2cdfdbdba0516d76b642df8057283f768dc9e021081039853f69d680ccb0f4ff0bf4d1574bf3c31bb3f06c78450824ea6f86e0f684b43a378982a01aed44ea5c
|
data/.travis.yml
CHANGED
data/boxen.gemspec
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Gem::Specification.new do |gem|
|
|
4
4
|
gem.name = "boxen"
|
|
5
|
-
gem.version = "3.1.
|
|
5
|
+
gem.version = "3.1.1"
|
|
6
6
|
# Thanks go out to the previous maintainers John Barnette, Will
|
|
7
7
|
# Farrington, David Goodlad and Mike McQuaid for getting this project
|
|
8
8
|
# to where it is today.
|
data/lib/boxen/config.rb
CHANGED
|
@@ -25,8 +25,12 @@ module Boxen
|
|
|
25
25
|
end
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
if Boxen::Util.osx?
|
|
29
|
+
keychain = Boxen::Keychain.new config.user
|
|
30
|
+
config.token = keychain.token
|
|
31
|
+
else
|
|
32
|
+
config.token = ''
|
|
33
|
+
end
|
|
30
34
|
|
|
31
35
|
if config.enterprise?
|
|
32
36
|
# configure to talk to GitHub Enterprise
|
|
@@ -69,8 +73,10 @@ module Boxen
|
|
|
69
73
|
f.write JSON.generate Hash[attrs.reject { |k, v| v.nil? }]
|
|
70
74
|
end
|
|
71
75
|
|
|
72
|
-
|
|
73
|
-
|
|
76
|
+
if Boxen::Util.osx?
|
|
77
|
+
keychain = Boxen::Keychain.new config.user
|
|
78
|
+
keychain.token = config.token
|
|
79
|
+
end
|
|
74
80
|
|
|
75
81
|
config
|
|
76
82
|
end
|
data/lib/boxen/util.rb
CHANGED
|
@@ -2,16 +2,18 @@ module Boxen
|
|
|
2
2
|
module Util
|
|
3
3
|
|
|
4
4
|
# Is Boxen active?
|
|
5
|
-
|
|
6
5
|
def self.active?
|
|
7
6
|
ENV.include? "BOXEN_HOME"
|
|
8
7
|
end
|
|
9
8
|
|
|
10
|
-
|
|
11
9
|
# Run `args` as a system command with sudo if necessary.
|
|
12
|
-
|
|
13
10
|
def self.sudo *args
|
|
14
11
|
system "sudo", "-p", "Password for sudo: ", *args
|
|
15
12
|
end
|
|
13
|
+
|
|
14
|
+
# Run on macos?
|
|
15
|
+
def self.osx?
|
|
16
|
+
RUBY_PLATFORM.downcase.include?('darwin')
|
|
17
|
+
end
|
|
16
18
|
end
|
|
17
19
|
end
|
data/test/boxen_keychain_test.rb
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
require
|
|
2
|
-
require "boxen/
|
|
1
|
+
require 'boxen/test'
|
|
2
|
+
require "boxen/util"
|
|
3
|
+
require 'boxen/keychain'
|
|
3
4
|
|
|
4
5
|
class BoxenKeychainTest < Boxen::Test
|
|
5
6
|
def setup
|
|
6
|
-
@keychain = Boxen::Keychain.new('test') if osx?
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
def osx?
|
|
10
|
-
RUBY_PLATFORM.downcase.include?("darwin")
|
|
7
|
+
@keychain = Boxen::Keychain.new('test') if Boxen::Util.osx?
|
|
11
8
|
end
|
|
12
9
|
|
|
13
10
|
def test_get_token
|
|
14
|
-
return skip(
|
|
11
|
+
return skip('Keychain helper is OSX only') unless Boxen::Util.osx?
|
|
15
12
|
@keychain.expects(:get).with('GitHub API Token').returns('foobar')
|
|
16
13
|
assert_equal 'foobar', @keychain.token
|
|
17
14
|
end
|
|
18
15
|
|
|
19
16
|
def test_set_token
|
|
20
|
-
return skip(
|
|
17
|
+
return skip('Keychain helper is OSX only') unless Boxen::Util.osx?
|
|
21
18
|
@keychain.expects(:set).with('GitHub API Token', 'foobar').returns('foobar')
|
|
22
19
|
assert_equal 'foobar', @keychain.token=('foobar')
|
|
23
20
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: boxen
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.1.
|
|
4
|
+
version: 3.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jacob Bednarz
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-
|
|
11
|
+
date: 2017-12-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: ansi
|
|
@@ -236,7 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
236
236
|
version: '0'
|
|
237
237
|
requirements: []
|
|
238
238
|
rubyforge_project:
|
|
239
|
-
rubygems_version: 2.
|
|
239
|
+
rubygems_version: 2.6.14
|
|
240
240
|
signing_key:
|
|
241
241
|
specification_version: 4
|
|
242
242
|
summary: You know, for laptops and stuff.
|