pbmenv 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +1 -0
- data/CHANGELOG.md +5 -1
- data/Dockerfile +2 -1
- data/Gemfile.lock +1 -1
- data/README.md +1 -0
- data/bin/rspec +29 -0
- data/lib/pbmenv/version.rb +1 -1
- data/lib/pbmenv.rb +19 -8
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf5ef3a99a0d05aefe181d42dacabc84929a659205d2af7e315c0deea135fac9
|
4
|
+
data.tar.gz: 63992a7e432f7c185b06dd2d5346bdc0e33500bd167b7b121a99c3b9681c9474
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6de90267f2b5501986d8325ef530a943a19933c85c8e28eba7eed879177e479999e65ba2bcddab73d59f61f78397d65bf72e92a256a24e357b7ce1880a0f4777
|
7
|
+
data.tar.gz: 56487c5af4ce175ec4cda01ca46800ec5b5d586fab88793f37d506a6ed818ce50e67f78952efd12a60d929c573a3ad57178d8e41618c207fe854907bcea9844d
|
data/.rspec
CHANGED
data/CHANGELOG.md
CHANGED
data/Dockerfile
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/bin/rspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'rspec' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("rspec-core", "rspec")
|
data/lib/pbmenv/version.rb
CHANGED
data/lib/pbmenv.rb
CHANGED
@@ -26,15 +26,26 @@ module Pbmenv
|
|
26
26
|
end
|
27
27
|
|
28
28
|
download_src(version)
|
29
|
-
|
29
|
+
system_and_puts <<~SHELL
|
30
30
|
mkdir -p #{PBM_DIR}/v#{version} && cp -r procon_bypass_man-#{version}/project_template/* #{PBM_DIR}/v#{version}/
|
31
31
|
SHELL
|
32
|
+
|
33
|
+
# sharedディレクトリを作成して、device_idへのシムリンクを作成する. device_idの中身はpbmで行う
|
34
|
+
unless File.exists?("#{PBM_DIR}/shared")
|
35
|
+
system_and_puts <<~SHELL
|
36
|
+
mkdir -p #{PBM_DIR}/shared
|
37
|
+
SHELL
|
38
|
+
end
|
39
|
+
|
40
|
+
system_and_puts <<~SHELL
|
41
|
+
ln -s #{PBM_DIR}/shared/device_id #{PBM_DIR}/v#{version}/device_id
|
42
|
+
SHELL
|
32
43
|
use version
|
33
44
|
rescue => e
|
34
|
-
|
45
|
+
system_and_puts "rm -rf #{PBM_DIR}/v#{version}"
|
35
46
|
raise
|
36
47
|
ensure
|
37
|
-
|
48
|
+
system_and_puts "rm -rf ./procon_bypass_man-#{version}"
|
38
49
|
end
|
39
50
|
|
40
51
|
# TODO currentが挿しているバージョンはどうする?
|
@@ -44,7 +55,7 @@ module Pbmenv
|
|
44
55
|
unless File.exists?("/usr/share/pbm/v#{version}")
|
45
56
|
return false
|
46
57
|
end
|
47
|
-
|
58
|
+
system_and_puts "rm -rf #{PBM_DIR}/v#{version}"
|
48
59
|
end
|
49
60
|
|
50
61
|
def self.use(version)
|
@@ -55,9 +66,9 @@ module Pbmenv
|
|
55
66
|
end
|
56
67
|
|
57
68
|
if File.exists?("#{PBM_DIR}/current")
|
58
|
-
|
69
|
+
system_and_puts "unlink #{PBM_DIR}/current"
|
59
70
|
end
|
60
|
-
|
71
|
+
system_and_puts "ln -s #{PBM_DIR}/v#{version} #{PBM_DIR}/current"
|
61
72
|
end
|
62
73
|
|
63
74
|
def self.download_src(version)
|
@@ -70,13 +81,13 @@ module Pbmenv
|
|
70
81
|
curl -L https://github.com/splaplapla/procon_bypass_man/archive/refs/tags/v#{version}.tar.gz | tar xvz
|
71
82
|
SHELL
|
72
83
|
end
|
73
|
-
|
84
|
+
system_and_puts(shell)
|
74
85
|
unless File.exists?("procon_bypass_man-#{version}/project_template")
|
75
86
|
raise "This version is not support by pbmenv"
|
76
87
|
end
|
77
88
|
end
|
78
89
|
|
79
|
-
def self.
|
90
|
+
def self.system_and_puts(shell)
|
80
91
|
puts "[SHELL] #{shell}"
|
81
92
|
system(shell)
|
82
93
|
end
|
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.4
|
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
|
+
date: 2021-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A package manager of PBM
|
14
14
|
email:
|
@@ -32,6 +32,7 @@ files:
|
|
32
32
|
- README.md
|
33
33
|
- Rakefile
|
34
34
|
- bin/console
|
35
|
+
- bin/rspec
|
35
36
|
- bin/setup
|
36
37
|
- docker-compose.yml
|
37
38
|
- docker/Gemfile
|