learn-co 1.0.3 → 1.0.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: 34448b9d97446002e6fbc78655f02f5efe881a5f
4
- data.tar.gz: 0651b33c999c105f72f7b0cfb064a3fc806a6e47
3
+ metadata.gz: cc8b9c2023ac3e8a100f64fe06afaefc9f76c993
4
+ data.tar.gz: 22e8f9e293483fae528242e0b959ef2738e31ebc
5
5
  SHA512:
6
- metadata.gz: 4cd341a55af8084d4525baf09728ce50e8659b69169bb261da21b7b2c31945339723b1033ef79a0a35fbc21e4bf4e39d20a9464e9f6cb53a7e6c21c79b5b27f9
7
- data.tar.gz: e468526d0e4b35d129a5ac21984099e199a34a22e96fd8d69ec81ec86d5af985ef757a0c2671a3d40d759cf132b7544fbf81619121f5a921b035a8e85028dc53
6
+ metadata.gz: 67ac18038bfb615cf0a7984684d0570c4eff0f76b63ce4a2c0fa4ba7dae098269699740bb55f934396aa1aa8616c946eadd9e8c2aefc75166ff0bd1ed6f8f909
7
+ data.tar.gz: 8eb3e6460c650ce66ee5cfbc50a84507329236bb7c1d4a20edbc4eb52de6fa1cc06388b011087ca24763755a7dc0f243214ee4966140e802420eb96d3f1103b1
@@ -6,12 +6,18 @@ module Learn
6
6
  end
7
7
 
8
8
  def check_installation
9
- if !brew_installed?
10
- puts "You must have Homebrew installed."
11
- exit
9
+ if running_on_mac?
10
+ if !brew_installed?
11
+ puts "You must have Homebrew installed."
12
+ exit
13
+ else
14
+ if !phantom_installed_on_mac?
15
+ install_phantomjs
16
+ end
17
+ end
12
18
  else
13
- if !phantom_installed?
14
- install_phantomjs
19
+ if !phantom_installed_on_linux?
20
+ puts "You must have PhantomJS installed: http://phantomjs.org/download.html"
15
21
  end
16
22
  end
17
23
  end
@@ -20,13 +26,29 @@ module Learn
20
26
  !`which brew`.empty?
21
27
  end
22
28
 
23
- def phantom_installed?
29
+ def phantom_installed_on_mac?
30
+ phantom_installed_by_brew? || phantom_installed?
31
+ end
32
+
33
+ def phantom_installed_on_linux?
34
+ phantom_installed?
35
+ end
36
+
37
+ def phantom_installed_by_brew?
24
38
  !`brew ls --versions phantomjs`.empty?
25
39
  end
26
40
 
41
+ def phantom_installed?
42
+ !`which phantomjs`.empty?
43
+ end
44
+
27
45
  def install_phantomjs
28
46
  `brew install phantomjs`
29
47
  end
48
+
49
+ def running_on_mac?
50
+ !!RUBY_PLATFORM.match(/darwin/)
51
+ end
30
52
  end
31
53
  end
32
54
  end
@@ -1,3 +1,3 @@
1
1
  module Learn
2
- VERSION = "1.0.3"
2
+ VERSION = "1.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: learn-co
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flatiron School
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-06 00:00:00.000000000 Z
11
+ date: 2015-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler