rocket_fuel 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rocket_fuel/fix/brew_fix.rb +25 -0
- data/lib/rocket_fuel/fix.rb +1 -0
- data/lib/rocket_fuel/precheck/brew_check.rb +29 -0
- data/lib/rocket_fuel/precheck/run.rb +1 -0
- data/lib/rocket_fuel/version.rb +1 -1
- data/spec/rocket_fuel/precheck/brew_check_spec.rb +35 -0
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b7df0ede6283b8b8e0ebc598025a037c05ecd41
|
4
|
+
data.tar.gz: 27023e4feaf5d029f4502f75af5391692832fc7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67a617a74a3c7267359935edea80dc07826eb18a314972f305e40dee4e13b13c55d8e290aa1fb8497448379de016f46c2a1c44d2cc35073ee1d512ee6c1e234c
|
7
|
+
data.tar.gz: 6ecebc07100a2c5aa88c008bb33fb964a356bb9f3f7ed3f7698251a40e73979b79ceb42032c64a29cac6ba18e2b0c2d667fb01c267733e9a3d6494452c093ecd
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module RocketFuel
|
2
|
+
module Fix
|
3
|
+
class BrewFix < AbstractFix
|
4
|
+
fix_name :brew
|
5
|
+
register!
|
6
|
+
|
7
|
+
include Thor::Base
|
8
|
+
|
9
|
+
FIX_CMD = 'sudo mkdir -p /usr/local && sudo chown -R $(whoami):admin /usr/local'
|
10
|
+
def run
|
11
|
+
system(FIX_CMD)
|
12
|
+
end
|
13
|
+
|
14
|
+
def title
|
15
|
+
'Homebrew requires a writable /usr/local path.'
|
16
|
+
end
|
17
|
+
|
18
|
+
def message
|
19
|
+
'An important package manager for OS X, named homebrew, requires ' +
|
20
|
+
'a writeable directory that is protected by the operating system ' +
|
21
|
+
"running `#{FIX_CMD}` will get the job done."
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/rocket_fuel/fix.rb
CHANGED
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'rocket_fuel/precheck/check'
|
2
|
+
|
3
|
+
module RocketFuel
|
4
|
+
module Precheck
|
5
|
+
class BrewCheck < Check
|
6
|
+
BREW_PATH = '/usr/local'
|
7
|
+
|
8
|
+
check_name :brew
|
9
|
+
register!
|
10
|
+
|
11
|
+
def ok?
|
12
|
+
FileTest.exist?(BREW_PATH)
|
13
|
+
end
|
14
|
+
|
15
|
+
def check?
|
16
|
+
RocketFuel::SystemDetails.platform_family?(:mac)
|
17
|
+
end
|
18
|
+
|
19
|
+
protected
|
20
|
+
def success_message
|
21
|
+
"brew path found."
|
22
|
+
end
|
23
|
+
|
24
|
+
def failure_message
|
25
|
+
"brew path NOT found!"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/rocket_fuel/version.rb
CHANGED
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
require 'rocket_fuel/precheck/brew_check'
|
4
|
+
|
5
|
+
describe RocketFuel::Precheck::BrewCheck do
|
6
|
+
include FakeFS::SpecHelpers
|
7
|
+
|
8
|
+
let(:path) { RocketFuel::Precheck::BrewCheck::BREW_PATH }
|
9
|
+
let(:check) { RocketFuel::Precheck::BrewCheck.new }
|
10
|
+
|
11
|
+
it 'is ok if the path exists and is writeable' do
|
12
|
+
FileUtils.mkdir_p(path)
|
13
|
+
expect(check).to be_ok
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'is not ok if the path does not exist' do
|
17
|
+
FileUtils.rm_rf(path)
|
18
|
+
expect(check).to_not be_ok
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'has a success message if macports is not found' do
|
22
|
+
expect(check.message).to match(/not found/i)
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'has a failure message if macports is found' do
|
26
|
+
FileUtils.mkdir_p(path)
|
27
|
+
expect(check.message).to match(/found/i)
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'does not check if not run on a Mac' do
|
31
|
+
os = RocketFuel::OperatingSystem.new('linux', '2.6')
|
32
|
+
RocketFuel::SystemDetails.stubs(:os).returns(os)
|
33
|
+
expect(check).to_not be_check
|
34
|
+
end
|
35
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rocket_fuel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Pickett
|
@@ -114,6 +114,7 @@ files:
|
|
114
114
|
- lib/rocket_fuel/command_line_interface.rb
|
115
115
|
- lib/rocket_fuel/fix.rb
|
116
116
|
- lib/rocket_fuel/fix/abstract_fix.rb
|
117
|
+
- lib/rocket_fuel/fix/brew_fix.rb
|
117
118
|
- lib/rocket_fuel/fix/command_line_tool_fix.rb
|
118
119
|
- lib/rocket_fuel/fix/curl_fix.rb
|
119
120
|
- lib/rocket_fuel/fix/file_sanitizer_fix.rb
|
@@ -127,6 +128,7 @@ files:
|
|
127
128
|
- lib/rocket_fuel/install/run.rb
|
128
129
|
- lib/rocket_fuel/operating_system.rb
|
129
130
|
- lib/rocket_fuel/precheck.rb
|
131
|
+
- lib/rocket_fuel/precheck/brew_check.rb
|
130
132
|
- lib/rocket_fuel/precheck/check.rb
|
131
133
|
- lib/rocket_fuel/precheck/check_result.rb
|
132
134
|
- lib/rocket_fuel/precheck/command_line_result_presenter.rb
|
@@ -144,6 +146,7 @@ files:
|
|
144
146
|
- spec/rocket_fuel/fix/rbenv_fix_spec.rb
|
145
147
|
- spec/rocket_fuel/fix/rvm_fix_spec.rb
|
146
148
|
- spec/rocket_fuel/operating_system_spec.rb
|
149
|
+
- spec/rocket_fuel/precheck/brew_check_spec.rb
|
147
150
|
- spec/rocket_fuel/precheck/check_result_spec.rb
|
148
151
|
- spec/rocket_fuel/precheck/check_spec.rb
|
149
152
|
- spec/rocket_fuel/precheck/command_line_result_presenter_spec.rb
|
@@ -185,6 +188,7 @@ test_files:
|
|
185
188
|
- spec/rocket_fuel/fix/rbenv_fix_spec.rb
|
186
189
|
- spec/rocket_fuel/fix/rvm_fix_spec.rb
|
187
190
|
- spec/rocket_fuel/operating_system_spec.rb
|
191
|
+
- spec/rocket_fuel/precheck/brew_check_spec.rb
|
188
192
|
- spec/rocket_fuel/precheck/check_result_spec.rb
|
189
193
|
- spec/rocket_fuel/precheck/check_spec.rb
|
190
194
|
- spec/rocket_fuel/precheck/command_line_result_presenter_spec.rb
|