mineshaft 2.0.0 → 2.1.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b23a2ae6e0f8435da0caedcb27d25588cc065d678c7636e17ec43750c6843d9a
4
- data.tar.gz: 13d214f6d57f426193bfd4b00396a4c92df9626b2f6e6097983a36654bd56be9
3
+ metadata.gz: 329013af9e0a1586742f426e5078b098c94ae4d301670716b6b9a4e4eccb342c
4
+ data.tar.gz: 5bd6fb460979c690dab830107b99cd1e3dcdb827e458725a1ff5dcb37309ad8a
5
5
  SHA512:
6
- metadata.gz: 68aa2bc42b6eca2f91f6789b53dd5ffa22405b127d9df72bb40c2ff4dd9be198642371ea7dcb7aacaf52bd17f732b3a70ac39a20e62a96c8c91c18776edd948c
7
- data.tar.gz: 6539a46e36dc707838b7f15ed3933f4d0b5b4503058b417352b9463b26757ffc3db3aecfab1a7b16e9b2759481ff9e148f08eb2159a3d0b4073a83cfc5d8df21
6
+ metadata.gz: e9d5e5f4fce2cd3a6aec076830449a3422fc81735b24a2afb32c43b022d28292a3fd5e37a08894a4e11abc2377c91fc3525d5f0b733631349c76eac39cfbb8ed
7
+ data.tar.gz: 9455d6fb499cb6a3732c2595045e191cd50cd752ad92917620419a9faef32abd6a76da1e6c3afe5b3cdfc256b174bf0a60947d4bd7699ad3768d228b6e8178c5
data/bin/ms CHANGED
@@ -37,6 +37,7 @@ parser = OptionParser.new do |opts|
37
37
  opts.separator " new creates new environment"
38
38
  opts.separator " list lists the ten latest versions of Ruby available to install"
39
39
  opts.separator " reload reloads binaries using the current global Ruby version"
40
+ opts.separator " use selects an installed global Ruby environment to use"
40
41
  opts.separator ""
41
42
  opts.separator "Options"
42
43
 
@@ -65,11 +66,18 @@ parser = OptionParser.new do |opts|
65
66
  options[:global] = true
66
67
  options[:version] = new_arg
67
68
  end
69
+
70
+ opts.on("-i",
71
+ "--installed",
72
+ "lists the globally installed and available Rubies") do |installed|
73
+ options[:installed] = true
74
+ end
68
75
  end
69
76
 
70
77
  parser.parse!
71
78
 
72
79
  Mineshaft.reload_binaries if reload
80
+ Mineshaft.list_globals if options[:installed]
73
81
 
74
82
  if use_environment
75
83
  options[:global] = true
@@ -8,6 +8,7 @@
8
8
 
9
9
  require "mineshaft/constants"
10
10
  require "mineshaft/list"
11
+ require "mineshaft/list_globals"
11
12
  require "mineshaft/reload"
12
13
  require "mineshaft/environment"
13
14
  require "mineshaft/installer"
@@ -20,10 +20,16 @@ module Mineshaft
20
20
 
21
21
  def create
22
22
  script_path = File.join(@dir, "bin/activate.sh")
23
- File.truncate(script_path, 0) if File.exist?(script_path)
23
+
24
+ if File.exist?(script_path)
25
+ File.truncate(script_path, 0)
26
+ mode = 'w'
27
+ end
28
+
29
+ mode ||= 'a'
24
30
 
25
31
  @template_file.each do |line|
26
- File.open(script_path, "a") do |file|
32
+ File.open(script_path, mode) do |file|
27
33
  file.write(render(line))
28
34
  end
29
35
  end
@@ -9,5 +9,7 @@
9
9
  module Mineshaft
10
10
  module Constants
11
11
  RUBY_VERSION_STABLE = '2.5.1'
12
+ GLOBAL_DIR = "#{Dir.home}/.mineshaft"
13
+ GLOBAL_BIN = "#{GLOBAL_DIR}/bin"
12
14
  end
13
15
  end
@@ -0,0 +1,14 @@
1
+ # mineshaft
2
+ #
3
+ # author:: Cameron Testerman
4
+ # email:: cameronbtesterman@gmail.com
5
+ # created:: 2018-09-20 10:23PM
6
+ #
7
+ # Copyright (c) 2017-2018 Cameron Testerman
8
+
9
+ module Mineshaft
10
+ def Mineshaft.env_list
11
+ # This should output a list of globally installed Rubies.
12
+ # The currently used environment should be highlighted.
13
+ end
14
+ end
@@ -28,7 +28,7 @@ module Mineshaft
28
28
  FileUtils::mkdir_p(@dir)
29
29
  install_ruby
30
30
  if @options[:global]
31
- set_new_global @dir
31
+ set_new_global
32
32
  else
33
33
  create_template
34
34
  end
@@ -99,6 +99,7 @@ module Mineshaft
99
99
  "make install"
100
100
  ]
101
101
  commands.each { |command| shell(dir, command) }
102
+ shell dir, 'bin/gem install mineshaft'
102
103
  end
103
104
  end
104
105
  end
@@ -0,0 +1,18 @@
1
+ # mineshaft
2
+ #
3
+ # author:: Cameron Testerman
4
+ # email:: cameronbtesterman@gmail.com
5
+ # created:: 2018-08-04 11:42PM
6
+ #
7
+ # Copyright (c) 2017-2018 Cameron Testerman
8
+
9
+ module Mineshaft
10
+ def Mineshaft.list_globals
11
+ rubies = Dir["#{Mineshaft::Constants::GLOBAL_DIR}/*"]
12
+ rubies.delete Mineshaft::Constants::GLOBAL_BIN
13
+
14
+ puts "Globally installed Ruby versions"
15
+ puts "--------------------------------"
16
+ rubies.each { |ruby| puts ruby.split("/").last }
17
+ end
18
+ end
@@ -7,5 +7,5 @@
7
7
  # Copyright (c) 2017-2018 Cameron Testerman
8
8
 
9
9
  module Mineshaft
10
- VERSION = "2.0.0"
10
+ VERSION = "2.1.0"
11
11
  end
@@ -324,5 +324,7 @@
324
324
  2.5.0-rc1: https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.0-rc1.tar.gz
325
325
  2.5.0: https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.0.tar.gz
326
326
  2.5.1: https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.1.tar.gz
327
+ 2.5.2: https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.2.tar.gz
328
+ 2.5.3: https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.3.tar.gz
327
329
  2.6.0-preview1: https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.0-preview1.tar.gz
328
330
  2.6.0-preview2: https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.0-preview2.tar.gz
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mineshaft
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Testerman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-06 00:00:00.000000000 Z
11
+ date: 2018-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -37,9 +37,11 @@ files:
37
37
  - lib/mineshaft/activate.rb
38
38
  - lib/mineshaft/constants.rb
39
39
  - lib/mineshaft/date.rb
40
+ - lib/mineshaft/env_list.rb
40
41
  - lib/mineshaft/environment.rb
41
42
  - lib/mineshaft/installer.rb
42
43
  - lib/mineshaft/list.rb
44
+ - lib/mineshaft/list_globals.rb
43
45
  - lib/mineshaft/reload.rb
44
46
  - lib/mineshaft/shell.rb
45
47
  - lib/mineshaft/version.rb