mineshaft 2.1.0 → 3.0.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 +4 -4
- data/bin/ms +6 -0
- data/lib/mineshaft.rb +0 -1
- data/lib/mineshaft/constants.rb +1 -1
- data/lib/mineshaft/environment.rb +26 -4
- data/lib/mineshaft/installer.rb +2 -2
- data/lib/mineshaft/shell.rb +1 -1
- data/lib/mineshaft/version.rb +1 -1
- metadata +2 -4
- data/environment/activate.sh.erb +0 -15
- data/lib/mineshaft/activate.rb +0 -50
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62f522f830f314227af21ede58ce1acbdcf8b76a713787749cf50715a912f01a
|
4
|
+
data.tar.gz: 2fb777669454a23f05e6b6c2de6880739361b1cf738cdb923775bb33a9278b33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d44e9d24c486982c95838dda20137fa03243eccd3dcc26bb60409a821afea1d7a9c80b919b60cd2b186b3d5f070149031f5a8c74c4e7e0d50d0e6c5199572e0
|
7
|
+
data.tar.gz: 22a6abd87f3eccdab50c5bcc7a55c1ae9c050426ae9d7276259d0474b060ddd52db8fa704d5c3524ec00dd662f0a6bcedfd03ff02a51c9c86a56ee6b0b572cc9
|
data/bin/ms
CHANGED
@@ -67,6 +67,12 @@ parser = OptionParser.new do |opts|
|
|
67
67
|
options[:version] = new_arg
|
68
68
|
end
|
69
69
|
|
70
|
+
opts.on("-n",
|
71
|
+
"--no-openssl-dir",
|
72
|
+
"do not set the OpenSSL directory - otherwise this defaults to /usr/local/opt/openssl") do |no_openssl|
|
73
|
+
options[:no_openssl_dir] = true
|
74
|
+
end
|
75
|
+
|
70
76
|
opts.on("-i",
|
71
77
|
"--installed",
|
72
78
|
"lists the globally installed and available Rubies") do |installed|
|
data/lib/mineshaft.rb
CHANGED
data/lib/mineshaft/constants.rb
CHANGED
@@ -8,6 +8,7 @@
|
|
8
8
|
|
9
9
|
require 'fileutils'
|
10
10
|
require 'yaml'
|
11
|
+
require 'mineshaft/reload'
|
11
12
|
|
12
13
|
module Mineshaft
|
13
14
|
class Environment
|
@@ -29,8 +30,10 @@ module Mineshaft
|
|
29
30
|
install_ruby
|
30
31
|
if @options[:global]
|
31
32
|
set_new_global
|
33
|
+
`gem install mineshaft`
|
34
|
+
Mineshaft.reload_binaries
|
32
35
|
else
|
33
|
-
|
36
|
+
create_activate_script
|
34
37
|
end
|
35
38
|
end
|
36
39
|
|
@@ -51,9 +54,28 @@ module Mineshaft
|
|
51
54
|
end.run
|
52
55
|
end
|
53
56
|
|
54
|
-
def
|
55
|
-
|
56
|
-
|
57
|
+
def install_mineshaft
|
58
|
+
end
|
59
|
+
|
60
|
+
def create_activate_script
|
61
|
+
open("#{@dir}/bin/activate.sh", 'w') do |f|
|
62
|
+
f << "#!/bin/bash\n"
|
63
|
+
f << "#\n"
|
64
|
+
f << "# activate.sh\n"
|
65
|
+
f << "\n"
|
66
|
+
f << "OLDPS1=$PS1\n"
|
67
|
+
f << "ENV=#{@dir}\n"
|
68
|
+
f << 'PS1="($ENV)${OLDPS1}"'
|
69
|
+
f << "\n"
|
70
|
+
f << "\n"
|
71
|
+
f << "OLDPATH=$PATH\n"
|
72
|
+
f << "PATH=#{File.expand_path("#{@dir}/bin")}:$OLDPATH\n"
|
73
|
+
f << "\n"
|
74
|
+
f << "deactivate() {\n"
|
75
|
+
f << " PS1=$OLDPS1\n"
|
76
|
+
f << " PATH=$OLDPATH\n"
|
77
|
+
f << "}\n\n"
|
78
|
+
end
|
57
79
|
end
|
58
80
|
|
59
81
|
def set_new_global
|
data/lib/mineshaft/installer.rb
CHANGED
@@ -86,11 +86,12 @@ module Mineshaft
|
|
86
86
|
|
87
87
|
def configure_options(prefix)
|
88
88
|
config = @global ? "./configure --prefix #{@directory}" : "./configure --prefix #{File.expand_path(@directory)}"
|
89
|
-
config << " --with-openssl-dir=#{@options[:openssl_dir]}"
|
89
|
+
config << " --with-openssl-dir=#{@options[:openssl_dir]}" unless @options[:no_openssl_dir]
|
90
90
|
end
|
91
91
|
|
92
92
|
def build(prefix)
|
93
93
|
puts "Building environment in #{prefix}"
|
94
|
+
puts "Directory is #{@directory}"
|
94
95
|
dir = "#{@directory}/ruby-#@version"
|
95
96
|
commands = [
|
96
97
|
"chmod +x configure tool/ifchange",
|
@@ -99,7 +100,6 @@ module Mineshaft
|
|
99
100
|
"make install"
|
100
101
|
]
|
101
102
|
commands.each { |command| shell(dir, command) }
|
102
|
-
shell dir, 'bin/gem install mineshaft'
|
103
103
|
end
|
104
104
|
end
|
105
105
|
end
|
data/lib/mineshaft/shell.rb
CHANGED
data/lib/mineshaft/version.rb
CHANGED
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:
|
4
|
+
version: 3.0.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-
|
11
|
+
date: 2018-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -32,9 +32,7 @@ extensions: []
|
|
32
32
|
extra_rdoc_files: []
|
33
33
|
files:
|
34
34
|
- bin/ms
|
35
|
-
- environment/activate.sh.erb
|
36
35
|
- lib/mineshaft.rb
|
37
|
-
- lib/mineshaft/activate.rb
|
38
36
|
- lib/mineshaft/constants.rb
|
39
37
|
- lib/mineshaft/date.rb
|
40
38
|
- lib/mineshaft/env_list.rb
|
data/environment/activate.sh.erb
DELETED
data/lib/mineshaft/activate.rb
DELETED
@@ -1,50 +0,0 @@
|
|
1
|
-
# mineshaft
|
2
|
-
#
|
3
|
-
# author:: Cameron Testerman
|
4
|
-
# email:: cameronbtesterman@gmail.com
|
5
|
-
# created:: 2017-10-26 8:46PM
|
6
|
-
#
|
7
|
-
# Copyright (c) 2017-2018 Cameron Testerman
|
8
|
-
|
9
|
-
require 'erb'
|
10
|
-
|
11
|
-
module Mineshaft
|
12
|
-
class ActivateTemplate
|
13
|
-
attr_reader :result, :ENVDIR
|
14
|
-
|
15
|
-
def initialize(dir, template_file)
|
16
|
-
@dir = dir
|
17
|
-
@template_file = read(template_file)
|
18
|
-
$ENVDIR = dir
|
19
|
-
end
|
20
|
-
|
21
|
-
def create
|
22
|
-
script_path = File.join(@dir, "bin/activate.sh")
|
23
|
-
|
24
|
-
if File.exist?(script_path)
|
25
|
-
File.truncate(script_path, 0)
|
26
|
-
mode = 'w'
|
27
|
-
end
|
28
|
-
|
29
|
-
mode ||= 'a'
|
30
|
-
|
31
|
-
@template_file.each do |line|
|
32
|
-
File.open(script_path, mode) do |file|
|
33
|
-
file.write(render(line))
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
File.chmod(0755, script_path)
|
38
|
-
end
|
39
|
-
|
40
|
-
private
|
41
|
-
|
42
|
-
def render(line)
|
43
|
-
ERB.new(line).result
|
44
|
-
end
|
45
|
-
|
46
|
-
def read(file)
|
47
|
-
File.open(file).readlines
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|