pbmenv 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/README.md +2 -0
- data/lib/pbmenv/cli.rb +12 -1
- data/lib/pbmenv/version.rb +1 -1
- data/lib/pbmenv.rb +10 -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: d84d71d3bcf5e7e79a41197911ac54faf9af6dbda23ccedc35975efbb7e6a58b
|
4
|
+
data.tar.gz: 210058e9076ada3295ce82f03b0194c42539d12ae6bc231c004d9d2dbbf94e2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f4c9d3ba339adb0c6be98c276eb78e41648735035cf817b02986d8aa1c8c2b5829c3bbbc0bdb716f2cbfae7e25a311282a2af1c52af5990b5876baf91077c7b
|
7
|
+
data.tar.gz: 0352bcc42d5561ca37d6a20554138d1cfffe744adb06700c5443f6068efa5b2a3d77db00c319b147b78f7939e829f51501e86d80b4790ce89e30628a6808a225
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/lib/pbmenv/cli.rb
CHANGED
@@ -9,7 +9,18 @@ module Pbmenv
|
|
9
9
|
Pbmenv.versions.each { |x| puts x }
|
10
10
|
when 'install', 'i'
|
11
11
|
sub_command_arg = argv[1]
|
12
|
-
|
12
|
+
case argv[2]
|
13
|
+
when "--use"
|
14
|
+
use_option = true
|
15
|
+
when nil
|
16
|
+
use_option = false
|
17
|
+
else
|
18
|
+
puts <<~EOH
|
19
|
+
Unknown option:
|
20
|
+
available options: --use
|
21
|
+
EOH
|
22
|
+
end
|
23
|
+
Pbmenv.install(sub_command_arg, use_option: use_option)
|
13
24
|
when 'use', 'u'
|
14
25
|
sub_command_arg = argv[1]
|
15
26
|
Pbmenv.use(sub_command_arg)
|
data/lib/pbmenv/version.rb
CHANGED
data/lib/pbmenv.rb
CHANGED
@@ -18,7 +18,7 @@ module Pbmenv
|
|
18
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
|
19
19
|
end
|
20
20
|
|
21
|
-
def self.install(version)
|
21
|
+
def self.install(version, use_option: false, enable_pbm_cloud: false)
|
22
22
|
raise "Need a version" if version.nil?
|
23
23
|
if version == 'latest'
|
24
24
|
version = available_versions.first
|
@@ -33,6 +33,14 @@ module Pbmenv
|
|
33
33
|
mkdir -p #{PBM_DIR}/v#{version} && cp -r procon_bypass_man-#{version}/project_template/* #{PBM_DIR}/v#{version}/
|
34
34
|
SHELL
|
35
35
|
|
36
|
+
if enable_pbm_cloud
|
37
|
+
text = File.read("#{PBM_DIR}/v#{version}/app.rb")
|
38
|
+
if text =~ /config\.api_servers\s+=\s+\['(https:\/\/.+)'\]/ && (url = $1)
|
39
|
+
text.gsub!(/#\s+config\.api_servers\s+=\s+.+$/, "config.api_servers = '#{url}'")
|
40
|
+
end
|
41
|
+
File.write("#{PBM_DIR}/v#{version}/app.rb", text)
|
42
|
+
end
|
43
|
+
|
36
44
|
unless File.exists?("#{PBM_DIR}/shared")
|
37
45
|
system_and_puts <<~SHELL
|
38
46
|
mkdir -p #{PBM_DIR}/shared
|
@@ -48,7 +56,7 @@ module Pbmenv
|
|
48
56
|
SHELL
|
49
57
|
|
50
58
|
# 初回だけinstall時にcurrentを作成する
|
51
|
-
if
|
59
|
+
if !File.exists?("#{PBM_DIR}/current") || use_option
|
52
60
|
use(version)
|
53
61
|
end
|
54
62
|
rescue => e
|
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.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jiikko
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02-
|
11
|
+
date: 2022-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A package manager of PBM
|
14
14
|
email:
|