rover 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/bin/rover +3 -1
  2. data/lib/rover.rb +29 -4
  3. metadata +1 -1
data/bin/rover CHANGED
@@ -8,12 +8,14 @@ if ARGV.size <= 0
8
8
  puts "You need at least one argument:\nrover install\nrover run"
9
9
  else
10
10
  rover = Rover.new
11
- puts ARGV.first.downcase
11
+
12
12
  case ARGV.first.downcase
13
13
  when "install"
14
14
  rover.install_configs
15
15
  when "run"
16
16
  rover.run_servers
17
+ when "configs"
18
+ rover.pretty_print_configs
17
19
  else
18
20
  puts "Unknown arguments: #{ARGV.inspect}"
19
21
  end
@@ -67,6 +67,24 @@ class Rover
67
67
  discover_config_files
68
68
  end
69
69
 
70
+ def pretty_print_configs
71
+ configs = discover_config_files
72
+
73
+ out = "Rover found #{configs.size} dependency configurations\n"
74
+
75
+ index_count = 1
76
+ discover_config_files.each do |config,config_parts|
77
+ out += "--\n"
78
+ out += "#{index_count}: #{config}\n"
79
+ out += "#{index_count}: Type: #{config_parts['config_type']}\n"
80
+ out += "#{index_count}: File: #{config_parts['config_file']}\n"
81
+ out += "#{index_count}: Path: #{config_parts['config_path']}\n"
82
+ index_count+=1
83
+ end
84
+
85
+ puts out.colorize(:color => :blue)
86
+ end
87
+
70
88
  def config_env config_type
71
89
  return nil unless config_type
72
90
  self.send("config_env_#{config_type}")
@@ -74,8 +92,11 @@ class Rover
74
92
 
75
93
  def config_env_npm
76
94
  unless which('npm')
77
- raise "you are fucked. go install npm"
95
+ puts "Please install npm to continue installing dependencies"
96
+ return false
78
97
  end
98
+
99
+ true
79
100
  end
80
101
 
81
102
  def config_env_bundle
@@ -83,12 +104,14 @@ class Rover
83
104
  unless which('bundle')
84
105
  exec_cmd "gem install bundler"
85
106
  unless which('bundle')
86
- raise "you're fucked. go install bundler"
107
+ puts "Please install Bundler (gem install bundler) to continue installing dependencies"
108
+ return false
87
109
  end
88
110
  end
111
+
112
+ true
89
113
  end
90
114
 
91
- # TODO BROKEN
92
115
  def config_env_pip
93
116
  ['virtualenv','pip'].each do |exe|
94
117
  unless which(exe)
@@ -101,6 +124,8 @@ class Rover
101
124
  exec_cmd "virtualenv #{python_dir}"
102
125
  ENV['PATH'] = "#{python_dir}/bin:#{ENV['PATH']}"
103
126
  ENV['PYTHONPATH'] = ""
127
+
128
+ true
104
129
  end
105
130
 
106
131
  def install_configs
@@ -115,7 +140,7 @@ class Rover
115
140
  discovered_config_files.each do |config_file_name,config_parts|
116
141
  puts "Installing Config: #{config_file_name}".colorize( :color => :white, :background => :blue )
117
142
 
118
- config_env(config_parts['config_type'])
143
+ next unless config_env(config_parts['config_type'])
119
144
 
120
145
  cmd = "#{config_parts['config_type']} "
121
146
  case config_parts['config_type']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rover
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: