startor 0.6.1 → 0.6.2

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/startor +17 -5
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b5d7e2a33c90c19f03a85d1ae3e5fca2384a62d4c648372446cc62fb53b8a395
4
- data.tar.gz: 1fcfcd988e63d90c4e8618d3aaf5347338a643dcdfa60cf26ee2d2bc3cf240cc
3
+ metadata.gz: e1664fc2c72796a1421de0cd3a2ef46c770d5eb51f1027cc77b723492c8d76bd
4
+ data.tar.gz: 0471f2f135dd8d55bd510c9b0316d846471f583208ac46c4ff2531696133d376
5
5
  SHA512:
6
- metadata.gz: 71723ec70040110524db9f82bf5a15c4c87294ec6c210509d41a0e15895c53f7ec3d2f38b60178e94202db0b645d10f5389b7feab40607216cc0038d0b0b6bda
7
- data.tar.gz: 323d3f17bbafa7bb06eb1e208c8c616a8a997c9cdf1d721a613e63cd8d11ca7edd4d42f778fc80c0176aacc4e88bbe69506c45d77f3885e2488970de69093b0d
6
+ metadata.gz: d20f0881fc5e5a4394a2c65e90dac099c2223f88bfb02d579633416b6da304ff071c3a598db7fc9f10566ca74709b5939c024c703cd94ebb31efc00e6094eac3
7
+ data.tar.gz: d0c6f0ac45641c0cc81f9bbeed6dfe98c716046008871761e5c5060354ee6db4fec7c62367c152bc45f9480a04d6b72dd673c0c13a0f3226cf92d0a49a67ffb9
data/bin/startor CHANGED
@@ -2,7 +2,7 @@
2
2
  # startor
3
3
 
4
4
  # 20181107
5
- # 0.6.1
5
+ # 0.6.2
6
6
 
7
7
  # History: Derived from https://kremalicious.com/simple-tor-setup-on-mac-os-x/...
8
8
 
@@ -48,6 +48,12 @@
48
48
  # 7. Updated lib/Version.rb, so that: /require 'String/capture'/require 'Thoran/String/Capture/capture'/, which I should have done as of startor 0.3.0 when gathering the libraries, since that post-dates the change to Version.rb.
49
49
  # 8. - lib/String/capture.rb
50
50
  # 9. ~ .gitignore: + *.gem, so that gem builds don't go in the repo without me having to remove them manually when I do `git add .`.
51
+ # 2/3
52
+ # Don't install homebrew or tor needlessly if issuing `startor setup`...
53
+ # 10. + homebrew_installed?()
54
+ # 11. ~ install_homebrew() to make use of homebrew_installed?().
55
+ # 12. ~ install_tor() to make use of tor_installed?(), though this is a bit redundant, since setup() should control whether install_tor() is run anyway.
56
+ # 13. ~ setup(), so that it doesn't needlessly install brew, because tor is already installed.
51
57
 
52
58
  require 'FileUtils/which'
53
59
  require 'Kernel/run'
@@ -55,7 +61,7 @@ require 'OSX/HardwarePort'
55
61
  require 'OSX/IfConfig'
56
62
 
57
63
  def install_homebrew
58
- if FileUtils.which('brew')
64
+ if homebrew_installed?
59
65
  puts 'Homebrew is already installed!'
60
66
  else
61
67
  run('/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"', show: true)
@@ -63,7 +69,7 @@ def install_homebrew
63
69
  end
64
70
 
65
71
  def install_tor
66
- if FileUtils.which('tor')
72
+ if tor_installed?
67
73
  puts 'tor is already installed!'
68
74
  else
69
75
  run('brew install tor', show: true)
@@ -71,14 +77,20 @@ def install_tor
71
77
  end
72
78
 
73
79
  def setup
74
- install_homebrew
75
- install_tor
80
+ unless tor_installed?
81
+ install_homebrew
82
+ install_tor
83
+ end
76
84
  end
77
85
 
78
86
  def tor_installed?
79
87
  FileUtils.which('tor')
80
88
  end
81
89
 
90
+ def homebrew_installed?
91
+ FileUtils.which('brew')
92
+ end
93
+
82
94
  def check_for_tor_program
83
95
  unless tor_installed?
84
96
  puts "tor was not found. You must install tor first."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: startor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - thoran