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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e7a3339260b37468e6af0c079c153090e77f85f4
4
- data.tar.gz: 0e7c93459307e1f5740fe209006ecf0a09149ebb
3
+ metadata.gz: 2b7df0ede6283b8b8e0ebc598025a037c05ecd41
4
+ data.tar.gz: 27023e4feaf5d029f4502f75af5391692832fc7d
5
5
  SHA512:
6
- metadata.gz: d1ad1be36bbad563c4834f75bf02500dd4a27e19a43b5cff298a439af9e03b51914c7c13cc316236d80780b31e283132f1918986530146750e12bda2f65cb282
7
- data.tar.gz: afc41dfa8d39247646da91239371c1225808338d0f718d27c056c53607b4232a371d2c8e0985f379b0874dbc625407cebe46cc75a9a8731e357cfcbdcb266c77
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
@@ -9,3 +9,4 @@ require 'rocket_fuel/fix/rvm_fix'
9
9
  require 'rocket_fuel/fix/rbenv_fix'
10
10
  require 'rocket_fuel/fix/macports_fix'
11
11
  require 'rocket_fuel/fix/curl_fix'
12
+ require 'rocket_fuel/fix/brew_fix'
@@ -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
@@ -7,6 +7,7 @@ require 'rocket_fuel/precheck/rvm_check'
7
7
  require 'rocket_fuel/precheck/rbenv_check'
8
8
  require 'rocket_fuel/precheck/macports_check'
9
9
  require 'rocket_fuel/precheck/curl_check'
10
+ require 'rocket_fuel/precheck/brew_check'
10
11
 
11
12
  require 'rocket_fuel/fix'
12
13
 
@@ -1,3 +1,3 @@
1
1
  module RocketFuel
2
- VERSION = '0.0.7'
2
+ VERSION = '0.0.8'
3
3
  end
@@ -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.7
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