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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 03103c7de7428f2c8c92aabd221463bed7ec8f5017f119feeb9204673afec788
4
- data.tar.gz: 30ac40f3e940ef3599a14bf5b27ef1973221955b8bf2d2c0a351da197af40374
3
+ metadata.gz: d84d71d3bcf5e7e79a41197911ac54faf9af6dbda23ccedc35975efbb7e6a58b
4
+ data.tar.gz: 210058e9076ada3295ce82f03b0194c42539d12ae6bc231c004d9d2dbbf94e2d
5
5
  SHA512:
6
- metadata.gz: 4bf0ffcd4cf070c467363b510cf9239653582e433ce8f2e17d155f226615097520839ed99ab91afd316bb5f3b5c73f73d2219decaf40e923df96f59c6dcfc376
7
- data.tar.gz: 35015b260bd3721b8d5e2b26541498c7d3e91ea09b970c3140cc8f3c26f1424a53bdf0510cedea325a062f504c94023b3f695b42f1a512dfec79c9dba841f731
6
+ metadata.gz: 5f4c9d3ba339adb0c6be98c276eb78e41648735035cf817b02986d8aa1c8c2b5829c3bbbc0bdb716f2cbfae7e25a311282a2af1c52af5990b5876baf91077c7b
7
+ data.tar.gz: 0352bcc42d5561ca37d6a20554138d1cfffe744adb06700c5443f6068efa5b2a3d77db00c319b147b78f7939e829f51501e86d80b4790ce89e30628a6808a225
data/.gitignore CHANGED
@@ -6,3 +6,4 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ procon_bypass_man-*
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## [0.1.9] - 2022-02-18
2
+ - Pbmenv.installにenable_pbm_cloudオプションを追加しました
3
+ - Pbmenv.installにuse_optionオプションを追加しました
4
+ - また、 `pbmenv intall xxx --use` が使えるようになりました
5
+
1
6
  ## [0.1.8] - 2022-02-08
2
7
  - 不具合修正
3
8
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pbmenv (0.1.8)
4
+ pbmenv (0.1.9)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -17,6 +17,8 @@ gem 'pbmenv'
17
17
  * pbmenv available_versions
18
18
  * pbmenv versions
19
19
  * pbmenv install $version
20
+ * --use
21
+ * そのまま/usr/share/pbm/currentディレクトリへのシンボリックリンクを貼ります
20
22
  * pbmenv use $version
21
23
  * pbmenv uninstall $version
22
24
  * API
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
- Pbmenv.install(sub_command_arg)
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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pbmenv
4
- VERSION = "0.1.8"
4
+ VERSION = "0.1.9"
5
5
  end
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 not File.exists?("#{PBM_DIR}/current")
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.8
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-08 00:00:00.000000000 Z
11
+ date: 2022-02-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A package manager of PBM
14
14
  email: