pbmenv 0.1.4 → 0.1.5

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: bf5ef3a99a0d05aefe181d42dacabc84929a659205d2af7e315c0deea135fac9
4
- data.tar.gz: 63992a7e432f7c185b06dd2d5346bdc0e33500bd167b7b121a99c3b9681c9474
3
+ metadata.gz: a9a7bfc60b36d4c37090e73b0b8ce6e2c0bba454bc15d1eb868a7c79bdbe1bf4
4
+ data.tar.gz: 7ab067f69450da109588bb69f4fbb5ab4cb928f77335b312988db6bc261aac62
5
5
  SHA512:
6
- metadata.gz: 6de90267f2b5501986d8325ef530a943a19933c85c8e28eba7eed879177e479999e65ba2bcddab73d59f61f78397d65bf72e92a256a24e357b7ce1880a0f4777
7
- data.tar.gz: 56487c5af4ce175ec4cda01ca46800ec5b5d586fab88793f37d506a6ed818ce50e67f78952efd12a60d929c573a3ad57178d8e41618c207fe854907bcea9844d
6
+ metadata.gz: 6d8d3cccb07cbaca61a8e677ff49d03ec30025db9855bed03277e0ce7ddb18b15216978250fa6f15503bdff1cb08988eaec84ab15f9d1ad886e047e05f9da0ef
7
+ data.tar.gz: 4f3d85457dc011d46f05b820b2f145c34e02b5fbe75b9cf6fa91a4c11300e39179d343b5f3a0bb269bd9232713fa0ffaf39d8bbede5d68280799741aecc15fcc
data/CHANGELOG.md CHANGED
@@ -1,6 +1,9 @@
1
+ ## [0.1.5] - 2021-11-16
2
+
3
+ - `/usr/share/pbm/shared/device_id` を作成するようにしました
1
4
  ## [0.1.4] - 2021-11-15
2
5
 
3
- - `/usr/share/pbm/shared/device_id` へのシムリンクを作成するようにしました
6
+ - `/usr/share/pbm/current/device_id` にシムリンクを作成するようにしました
4
7
 
5
8
  ## [0.1.3] - 2021-10-22
6
9
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pbmenv (0.1.4)
4
+ pbmenv (0.1.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pbmenv
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.5"
5
5
  end
data/lib/pbmenv.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "securerandom"
4
+
3
5
  require_relative "pbmenv/version"
4
6
  require_relative "pbmenv/cli"
5
7
  require_relative "pbmenv/pbm"
@@ -30,22 +32,28 @@ module Pbmenv
30
32
  mkdir -p #{PBM_DIR}/v#{version} && cp -r procon_bypass_man-#{version}/project_template/* #{PBM_DIR}/v#{version}/
31
33
  SHELL
32
34
 
33
- # sharedディレクトリを作成して、device_idへのシムリンクを作成する. device_idの中身はpbmで行う
34
35
  unless File.exists?("#{PBM_DIR}/shared")
35
36
  system_and_puts <<~SHELL
36
37
  mkdir -p #{PBM_DIR}/shared
37
38
  SHELL
38
39
  end
39
40
 
41
+ unless File.exists?("#{PBM_DIR}/shared/device_id")
42
+ File.write("#{PBM_DIR}/shared/device_id", "d_#{SecureRandom.uuid}")
43
+ end
44
+
40
45
  system_and_puts <<~SHELL
41
46
  ln -s #{PBM_DIR}/shared/device_id #{PBM_DIR}/v#{version}/device_id
42
47
  SHELL
48
+
43
49
  use version
44
50
  rescue => e
45
51
  system_and_puts "rm -rf #{PBM_DIR}/v#{version}"
46
52
  raise
47
53
  ensure
48
- system_and_puts "rm -rf ./procon_bypass_man-#{version}"
54
+ if Dir.exists?("./procon_bypass_man-#{version}")
55
+ system_and_puts "rm -rf ./procon_bypass_man-#{version}"
56
+ end
49
57
  end
50
58
 
51
59
  # TODO currentが挿しているバージョンはどうする?
@@ -77,6 +85,7 @@ module Pbmenv
77
85
  git clone https://github.com/splaplapla/procon_bypass_man.git procon_bypass_man-#{version}
78
86
  SHELL
79
87
  else
88
+ # TODO cache for testing
80
89
  shell = <<~SHELL
81
90
  curl -L https://github.com/splaplapla/procon_bypass_man/archive/refs/tags/v#{version}.tar.gz | tar xvz
82
91
  SHELL
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
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - jiikko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-15 00:00:00.000000000 Z
11
+ date: 2021-11-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A package manager of PBM
14
14
  email: