pbmenv 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +2 -1
- data/lib/pbmenv/version.rb +1 -1
- data/lib/pbmenv.rb +9 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f3ac7d44e0f095598e3a3a80728d61cf0fc8f8bd363c50a37beaa1bc08537bc
|
4
|
+
data.tar.gz: 929ccd1944970ee956efe39855a17aa4c488462725ab7cf7c7f5b89dcca014bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af65fec992aeaaff02bf3ca0abc7f3f2c92f0deb5f065e4bce53b0169d1030f2f5f39cd0758bb630c016c0d66a53f6174ab1cd85b8017b7522d621c174493048
|
7
|
+
data.tar.gz: 9716ea9f4f06624680d5169bf7f2f36a36957fbf960966dfbab279708006f40ac6855ccaa8df93abd27bfa67b077c4c4ffb766eefee9a3b11816ae38ff29746a
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/pbmenv/version.rb
CHANGED
data/lib/pbmenv.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "securerandom"
|
4
|
+
require "pathname"
|
4
5
|
|
5
6
|
require_relative "pbmenv/version"
|
6
7
|
require_relative "pbmenv/cli"
|
@@ -14,7 +15,7 @@ module Pbmenv
|
|
14
15
|
end
|
15
16
|
|
16
17
|
def self.versions
|
17
|
-
Pbmenv::PBM.new.versions.map { |name| Pathname.new(name).basename.to_s =~ /^v([\d.]+)/ && $1 }.compact
|
18
|
+
Pbmenv::PBM.new.versions.map { |name| Pathname.new(name).basename.to_s =~ /^v([\d.]+)/ && $1 }.compact.sort_by {|x| Gem::Version.new(x) }.compact
|
18
19
|
end
|
19
20
|
|
20
21
|
def self.install(version)
|
@@ -45,6 +46,11 @@ module Pbmenv
|
|
45
46
|
system_and_puts <<~SHELL
|
46
47
|
ln -s #{PBM_DIR}/shared/device_id #{PBM_DIR}/v#{version}/device_id
|
47
48
|
SHELL
|
49
|
+
|
50
|
+
# 初回だけinstall時にcurrentを作成する
|
51
|
+
if not File.exists?("#{PBM_DIR}/current")
|
52
|
+
use(version)
|
53
|
+
end
|
48
54
|
rescue => e
|
49
55
|
system_and_puts "rm -rf #{PBM_DIR}/v#{version}"
|
50
56
|
raise
|
@@ -66,8 +72,9 @@ module Pbmenv
|
|
66
72
|
|
67
73
|
def self.use(version)
|
68
74
|
raise "Need a version" if version.nil?
|
75
|
+
version = versions.last if version == "latest"
|
69
76
|
|
70
|
-
|
77
|
+
if !File.exists?("/usr/share/pbm/#{version}") && !File.exists?("/usr/share/pbm/v#{version}")
|
71
78
|
return false
|
72
79
|
end
|
73
80
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pbmenv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jiikko
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A package manager of PBM
|
14
14
|
email:
|