namo.rb 0.32.0 → 0.32.2
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/CHANGELOG +22 -0
- data/README.md +6 -0
- data/bin/namo +0 -3
- data/lib/Namo/VERSION.rb +1 -1
- data/test/namo_command_test.rb +28 -6
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2cdcd36cc0d3b94a3d75d935ec816993f2b11946b53934f93225ec24f38b9567
|
|
4
|
+
data.tar.gz: 3f6359e0309eadfe76a206e4324918567b3b097704dba6a502d1e20eacd36e6f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8218b30ec72a118656fcadd27af5a9213b2785d62642712a7c5bcc5cddc4195c01983a0477326a582d4657fe7f1c3b3a4842534121407d53a2183de41b661f58
|
|
7
|
+
data.tar.gz: 2ed7ed7d9ca94c3cba1c878c56c4319cad59c04e2d1d7f50f82e78174bbc2cb3c8a826098d3e3fb509b7584b8efba2471b942b145390b1d6c0d868b5545ce866
|
data/CHANGELOG
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 20260828
|
|
4
|
+
|
|
5
|
+
0.32.2: ~ install.sh: the one command ends with namo runnable from anywhere.
|
|
6
|
+
|
|
7
|
+
1. ~ install.sh: + add_to_path, + gem_bin_directory, + shell_configuration_file. gem puts the command in a directory which is on the PATH on some machines and not on others — Homebrew's ruby puts it somewhere which is not — so the run ended by naming the directory and stopping. It now offers to add it to the shell's configuration file, and adds it to the PATH of the run itself so that `namo setup` happens rather than being left as a further instruction.
|
|
8
|
+
2. ~ install.sh: the file is chosen by the login shell rather than by which file exists, a stock macOS account running zsh and possibly carrying a .bashrc which nothing reads. The directory comes from gem's own EXECUTABLE DIRECTORY rather than from gemdir with bin appended.
|
|
9
|
+
3. ~ install.sh: writing to a shell configuration outlives an uninstall, so it is asked for as Homebrew is — -y answers in advance, no terminal answers no, and a refusal prints the line to add by hand.
|
|
10
|
+
4. ~ install.sh: + apt-get, dnf, pacman and zypper alongside Homebrew and MacPorts, so the script reaches a Ruby on Linux rather than offering to install Homebrew on a machine which has apt. + install_with_sudo, every package manager but Homebrew installing as root, so the password is asked for by name rather than arriving unannounced.
|
|
11
|
+
5. ~ Namo::VERSION: /0.32.1/0.32.2/
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 20260828
|
|
15
|
+
|
|
16
|
+
0.32.1: ~ install.sh: it runs the same piped from curl as from a clone, and forces no package manager; ~ README.md: + the one-line install.
|
|
17
|
+
|
|
18
|
+
1. ~ install.sh: the handover is to `namo setup` on the PATH rather than to bin/namo beside the script. It had found bin/namo by its own path, so piped from curl it looked in the working directory and failed there. It now finds nothing by its path and so runs from anywhere. The check is for the namo command rather than for the gem, that being what the next step needs: an older namo installs no executable.
|
|
19
|
+
2. ~ install.sh: + agreed, + parse_arguments, + usage, and install_homebrew is reached only where Ruby is missing and neither Homebrew nor MacPorts is present — a package manager already installed being used before one is installed, so a MacPorts machine is never asked about Homebrew. Homebrew is used where it is already installed, and installed only on a yes — -y answers in advance, and a script piped into a shell, having nobody able to refuse, is taken to have refused. Where Ruby is missing and Homebrew is declined, + ruby_routes names the ways to get Ruby — Homebrew as the command it is, MacPorts and ruby-install as pages, and a distribution's own package manager on Linux — rather than reporting only that no package manager was found.
|
|
20
|
+
3. ~ install.sh: + report_path. gem puts the command in its own directory, which is on the PATH on some machines and not on others; where it is not, the directory is named rather than somebody's shell configuration being written to.
|
|
21
|
+
4. ~ README.md: + the one-line install, for a machine with neither Ruby nor the gem.
|
|
22
|
+
5. ~ Namo::VERSION: /0.32.0/0.32.1/
|
|
23
|
+
|
|
24
|
+
|
|
3
25
|
## 20260828
|
|
4
26
|
|
|
5
27
|
0.32.0: + bin/namo, the gem's first executable, and the gems it installs.
|
data/README.md
CHANGED
|
@@ -18,6 +18,12 @@ Or in your Gemfile:
|
|
|
18
18
|
gem 'namo'
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
+
Or from nothing at all — Ruby, the gem, and the gems its scripts want, each step skipped where it is already there. Where Ruby is missing, whichever package manager is already installed supplies it — Homebrew, MacPorts, apt, dnf, pacman or zypper; where none is, you are asked before Homebrew is installed; `-y` answers yes in advance, and a machine with nobody at the keyboard is taken to have said no. Where the gem's own directory is not on the PATH, it offers to add it to your shell's configuration, so that a new shell has `namo` in it:
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
sh -c "$(curl -fsSL https://raw.githubusercontent.com/thoran/namo/master/install.sh)"
|
|
25
|
+
```
|
|
26
|
+
|
|
21
27
|
## Usage
|
|
22
28
|
|
|
23
29
|
Create a Namo instance from an array of hashes:
|
data/bin/namo
CHANGED
data/lib/Namo/VERSION.rb
CHANGED
data/test/namo_command_test.rb
CHANGED
|
@@ -29,17 +29,39 @@ describe 'bin/namo' do
|
|
|
29
29
|
_(output).must_match(/measurand is already installed!/)
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
-
# install.sh is the
|
|
33
|
-
#
|
|
34
|
-
# a test which executed it on a
|
|
35
|
-
|
|
32
|
+
# install.sh is the part a Ruby script cannot do — the Ruby the script would be
|
|
33
|
+
# running on, and the gem which carries the command it hands over to. Its
|
|
34
|
+
# syntax is asserted and its body is not run: a test which executed it on a
|
|
35
|
+
# machine without Ruby would install Ruby.
|
|
36
|
+
#
|
|
37
|
+
# It hands over by name rather than by path, which is what lets it run piped
|
|
38
|
+
# from curl — an assertion that it finds nothing by SCRIPT_DIR.
|
|
39
|
+
#
|
|
40
|
+
# It installs Homebrew only through `agreed`, which answers no unless -y was
|
|
41
|
+
# given or somebody is there to say yes. What is asserted is that the curl of
|
|
42
|
+
# Homebrew's installer sits behind that gate: an unguarded call is the failure
|
|
43
|
+
# this is written against.
|
|
44
|
+
it "has a shell bootstrap which parses, hands over by name, and gates the one install it forces" do
|
|
36
45
|
root = File.expand_path('..', __dir__)
|
|
37
46
|
system("sh -n #{File.join(root, 'install.sh')}")
|
|
38
47
|
_($?.success?).must_equal true
|
|
39
48
|
body = File.read(File.join(root, 'install.sh'))
|
|
40
|
-
_(body).must_match(/install_homebrew/)
|
|
41
49
|
_(body).must_match(/install_ruby/)
|
|
42
|
-
_(body).must_match(
|
|
50
|
+
_(body).must_match(/install_namo/)
|
|
51
|
+
%w{brew port apt-get dnf pacman zypper}.each do |manager|
|
|
52
|
+
_(body).must_match(/command -v #{manager}/)
|
|
53
|
+
end
|
|
54
|
+
_(body).must_match(/ruby_routes/)
|
|
55
|
+
_(body).must_match(/namo setup/)
|
|
56
|
+
_(body).wont_match(/SCRIPT_DIR/)
|
|
57
|
+
_(body).must_match(/elif agreed .*Install Homebrew\?.*; then\n\s+\/bin\/bash -c/)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
it "declines to install anything where nothing can answer" do
|
|
61
|
+
root = File.expand_path('..', __dir__)
|
|
62
|
+
output = IO.popen([File.join(root, 'install.sh'), '--help'], chdir: root, err: [:child, :out]){|io| io.read}
|
|
63
|
+
_($?.success?).must_equal true
|
|
64
|
+
_(output).must_match(/-y, --yes/)
|
|
43
65
|
end
|
|
44
66
|
|
|
45
67
|
it "refuses a subcommand it does not have" do
|