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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6c1836c83f6b1324c9bfc14479d1a633cb9a61983bc63ac506a11317f7d30cd5
4
- data.tar.gz: 39256579dd73802f3ba9cbebc0c881ae3dd456ff18991385fc3cdc0af8472339
3
+ metadata.gz: bf5ef3a99a0d05aefe181d42dacabc84929a659205d2af7e315c0deea135fac9
4
+ data.tar.gz: 63992a7e432f7c185b06dd2d5346bdc0e33500bd167b7b121a99c3b9681c9474
5
5
  SHA512:
6
- metadata.gz: ba1130d7ed07a4ee7efe76620bcc8315526d207bf9ee1644ccede776f76236d9fd8a28e1dc4841ad73fdb70f470d1b8dfa82305ce34e672beea312cdcaf82701
7
- data.tar.gz: aa59fe03426ef508147376f3c32681d254824e18316fd7f5be784b360e0259dab493c47a45e3b308e7571d5033712f58a544280d34d0099ab087cb1913b611fa
6
+ metadata.gz: 6de90267f2b5501986d8325ef530a943a19933c85c8e28eba7eed879177e479999e65ba2bcddab73d59f61f78397d65bf72e92a256a24e357b7ce1880a0f4777
7
+ data.tar.gz: 56487c5af4ce175ec4cda01ca46800ec5b5d586fab88793f37d506a6ed818ce50e67f78952efd12a60d929c573a3ad57178d8e41618c207fe854907bcea9844d
data/.rspec CHANGED
@@ -1 +1,2 @@
1
1
  --require spec_helper
2
+ -f d
data/CHANGELOG.md CHANGED
@@ -1,4 +1,8 @@
1
- ## [0.1.3] - 2021-10:22
1
+ ## [0.1.4] - 2021-11-15
2
+
3
+ - `/usr/share/pbm/shared/device_id` へのシムリンクを作成するようにしました
4
+
5
+ ## [0.1.3] - 2021-10-22
2
6
 
3
7
  - help的な出力をする
4
8
 
data/Dockerfile CHANGED
@@ -2,5 +2,6 @@ FROM ruby:2.5
2
2
 
3
3
  WORKDIR /pbmenv
4
4
 
5
+ ENV CI=1
5
6
  ADD docker/Gemfile .
6
- RUN apt-get update && apt-get install vim && gem i bundler && bundle install
7
+ RUN apt-get update && apt-get install vim -y && gem i bundler && bundle install
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pbmenv (0.1.3)
4
+ pbmenv (0.1.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -42,3 +42,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
42
42
  ## Development
43
43
  * docker-compose build --no-cache
44
44
  * docker-compose run app bash
45
+ * bin/rspec
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")
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pbmenv
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  end
data/lib/pbmenv.rb CHANGED
@@ -26,15 +26,26 @@ module Pbmenv
26
26
  end
27
27
 
28
28
  download_src(version)
29
- system_with_puts <<~SHELL
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
- system_with_puts "rm -rf #{PBM_DIR}/v#{version}"
45
+ system_and_puts "rm -rf #{PBM_DIR}/v#{version}"
35
46
  raise
36
47
  ensure
37
- system_with_puts "rm -rf ./procon_bypass_man-#{version}"
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
- system_with_puts "rm -rf #{PBM_DIR}/v#{version}"
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
- system_with_puts "unlink #{PBM_DIR}/current"
69
+ system_and_puts "unlink #{PBM_DIR}/current"
59
70
  end
60
- system_with_puts "ln -s #{PBM_DIR}/v#{version} #{PBM_DIR}/current"
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
- system_with_puts(shell)
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.system_with_puts(shell)
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.3
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-10-22 00:00:00.000000000 Z
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