pbmenv 0.1.1 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.circleci/config.yml +0 -1
- data/.github/workflows/release.yml +33 -0
- data/.github/workflows/ruby.yml +32 -0
- data/.rspec +1 -0
- data/CHANGELOG.md +16 -1
- data/Dockerfile +2 -1
- data/Gemfile.lock +2 -1
- data/README.md +2 -0
- data/Rakefile +10 -1
- data/bin/rspec +29 -0
- data/lib/pbmenv/cli.rb +7 -0
- data/lib/pbmenv/version.rb +1 -1
- data/lib/pbmenv.rb +28 -8
- metadata +9 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9a7bfc60b36d4c37090e73b0b8ce6e2c0bba454bc15d1eb868a7c79bdbe1bf4
|
4
|
+
data.tar.gz: 7ab067f69450da109588bb69f4fbb5ab4cb928f77335b312988db6bc261aac62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d8d3cccb07cbaca61a8e677ff49d03ec30025db9855bed03277e0ce7ddb18b15216978250fa6f15503bdff1cb08988eaec84ab15f9d1ad886e047e05f9da0ef
|
7
|
+
data.tar.gz: 4f3d85457dc011d46f05b820b2f145c34e02b5fbe75b9cf6fa91a4c11300e39179d343b5f3a0bb269bd9232713fa0ffaf39d8bbede5d68280799741aecc15fcc
|
data/.circleci/config.yml
CHANGED
@@ -0,0 +1,33 @@
|
|
1
|
+
name: Publish to RubyGems
|
2
|
+
|
3
|
+
on:
|
4
|
+
[workflow_dispatch]
|
5
|
+
|
6
|
+
jobs:
|
7
|
+
release:
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
permissions:
|
10
|
+
contents: write
|
11
|
+
|
12
|
+
steps:
|
13
|
+
- uses: actions/checkout@v2
|
14
|
+
with:
|
15
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
16
|
+
- name: Set up Ruby 2.6
|
17
|
+
uses: ruby/setup-ruby@v1
|
18
|
+
with:
|
19
|
+
ruby-version: 2.6
|
20
|
+
bundler-cache: true
|
21
|
+
- name: Publish to RubyGems
|
22
|
+
run: |
|
23
|
+
git config --local user.email "action@github.com"
|
24
|
+
git config --local user.name "GitHub Action"
|
25
|
+
|
26
|
+
mkdir -p $HOME/.gem
|
27
|
+
touch $HOME/.gem/credentials
|
28
|
+
chmod 0600 $HOME/.gem/credentials
|
29
|
+
printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_TOKEN}\n" > $HOME/.gem/credentials
|
30
|
+
bundle exec rake release
|
31
|
+
env:
|
32
|
+
RUBYGEMS_API_TOKEN: "${{secrets.RUBYGEMS_API_TOKEN}}"
|
33
|
+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
+
|
8
|
+
name: Ruby
|
9
|
+
|
10
|
+
on:
|
11
|
+
[push, workflow_dispatch]
|
12
|
+
|
13
|
+
jobs:
|
14
|
+
test:
|
15
|
+
|
16
|
+
runs-on: ubuntu-latest
|
17
|
+
strategy:
|
18
|
+
matrix:
|
19
|
+
ruby-version: ['2.5', '2.7', '3.0']
|
20
|
+
|
21
|
+
steps:
|
22
|
+
- uses: actions/checkout@v2
|
23
|
+
- name: Set up Ruby
|
24
|
+
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
25
|
+
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
26
|
+
# uses: ruby/setup-ruby@v1
|
27
|
+
uses: ruby/setup-ruby@v1
|
28
|
+
with:
|
29
|
+
ruby-version: ${{ matrix.ruby-version }}
|
30
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
31
|
+
- name: Run tests
|
32
|
+
run: bundle exec rake
|
data/.rspec
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,19 @@
|
|
1
|
-
## [0.1.
|
1
|
+
## [0.1.5] - 2021-11-16
|
2
|
+
|
3
|
+
- `/usr/share/pbm/shared/device_id` を作成するようにしました
|
4
|
+
## [0.1.4] - 2021-11-15
|
5
|
+
|
6
|
+
- `/usr/share/pbm/current/device_id` にシムリンクを作成するようにしました
|
7
|
+
|
8
|
+
## [0.1.3] - 2021-10-22
|
9
|
+
|
10
|
+
- help的な出力をする
|
11
|
+
|
12
|
+
## [0.1.2] - 2021-09-19
|
13
|
+
|
14
|
+
- Github Actionsを使う
|
15
|
+
|
16
|
+
## [0.1.1] - 2021-09-18
|
2
17
|
|
3
18
|
- installの引数にlatestという値を渡せるようにしました
|
4
19
|
|
data/Dockerfile
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# Pbmenv
|
2
|
+
[](https://github.com/splaplapla/pbmenv/actions/workflows/ruby.yml)
|
2
3
|
|
3
4
|
* https://github.com/splaplapla/procon_bypass_man のバージョンマネージャー
|
4
5
|
* Raspberry Pi OSでの実行を想定しています
|
@@ -41,3 +42,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
41
42
|
## Development
|
42
43
|
* docker-compose build --no-cache
|
43
44
|
* docker-compose run app bash
|
45
|
+
* bin/rspec
|
data/Rakefile
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/cli.rb
CHANGED
@@ -13,6 +13,13 @@ module Pbmenv
|
|
13
13
|
when 'uninstall'
|
14
14
|
sub_command_arg = argv[1]
|
15
15
|
Pbmenv.uninstall(sub_command_arg)
|
16
|
+
when '--version'
|
17
|
+
puts Pbmenv::VERSION
|
18
|
+
else
|
19
|
+
puts <<~EOH
|
20
|
+
Unknown command:
|
21
|
+
available commands: available_versions, versions, install, uninstall
|
22
|
+
EOH
|
16
23
|
end
|
17
24
|
end
|
18
25
|
end
|
data/lib/pbmenv/version.rb
CHANGED
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"
|
@@ -26,15 +28,32 @@ module Pbmenv
|
|
26
28
|
end
|
27
29
|
|
28
30
|
download_src(version)
|
29
|
-
|
31
|
+
system_and_puts <<~SHELL
|
30
32
|
mkdir -p #{PBM_DIR}/v#{version} && cp -r procon_bypass_man-#{version}/project_template/* #{PBM_DIR}/v#{version}/
|
31
33
|
SHELL
|
34
|
+
|
35
|
+
unless File.exists?("#{PBM_DIR}/shared")
|
36
|
+
system_and_puts <<~SHELL
|
37
|
+
mkdir -p #{PBM_DIR}/shared
|
38
|
+
SHELL
|
39
|
+
end
|
40
|
+
|
41
|
+
unless File.exists?("#{PBM_DIR}/shared/device_id")
|
42
|
+
File.write("#{PBM_DIR}/shared/device_id", "d_#{SecureRandom.uuid}")
|
43
|
+
end
|
44
|
+
|
45
|
+
system_and_puts <<~SHELL
|
46
|
+
ln -s #{PBM_DIR}/shared/device_id #{PBM_DIR}/v#{version}/device_id
|
47
|
+
SHELL
|
48
|
+
|
32
49
|
use version
|
33
50
|
rescue => e
|
34
|
-
|
51
|
+
system_and_puts "rm -rf #{PBM_DIR}/v#{version}"
|
35
52
|
raise
|
36
53
|
ensure
|
37
|
-
|
54
|
+
if Dir.exists?("./procon_bypass_man-#{version}")
|
55
|
+
system_and_puts "rm -rf ./procon_bypass_man-#{version}"
|
56
|
+
end
|
38
57
|
end
|
39
58
|
|
40
59
|
# TODO currentが挿しているバージョンはどうする?
|
@@ -44,7 +63,7 @@ module Pbmenv
|
|
44
63
|
unless File.exists?("/usr/share/pbm/v#{version}")
|
45
64
|
return false
|
46
65
|
end
|
47
|
-
|
66
|
+
system_and_puts "rm -rf #{PBM_DIR}/v#{version}"
|
48
67
|
end
|
49
68
|
|
50
69
|
def self.use(version)
|
@@ -55,9 +74,9 @@ module Pbmenv
|
|
55
74
|
end
|
56
75
|
|
57
76
|
if File.exists?("#{PBM_DIR}/current")
|
58
|
-
|
77
|
+
system_and_puts "unlink #{PBM_DIR}/current"
|
59
78
|
end
|
60
|
-
|
79
|
+
system_and_puts "ln -s #{PBM_DIR}/v#{version} #{PBM_DIR}/current"
|
61
80
|
end
|
62
81
|
|
63
82
|
def self.download_src(version)
|
@@ -66,17 +85,18 @@ module Pbmenv
|
|
66
85
|
git clone https://github.com/splaplapla/procon_bypass_man.git procon_bypass_man-#{version}
|
67
86
|
SHELL
|
68
87
|
else
|
88
|
+
# TODO cache for testing
|
69
89
|
shell = <<~SHELL
|
70
90
|
curl -L https://github.com/splaplapla/procon_bypass_man/archive/refs/tags/v#{version}.tar.gz | tar xvz
|
71
91
|
SHELL
|
72
92
|
end
|
73
|
-
|
93
|
+
system_and_puts(shell)
|
74
94
|
unless File.exists?("procon_bypass_man-#{version}/project_template")
|
75
95
|
raise "This version is not support by pbmenv"
|
76
96
|
end
|
77
97
|
end
|
78
98
|
|
79
|
-
def self.
|
99
|
+
def self.system_and_puts(shell)
|
80
100
|
puts "[SHELL] #{shell}"
|
81
101
|
system(shell)
|
82
102
|
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.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jiikko
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A package manager of PBM
|
14
14
|
email:
|
@@ -19,6 +19,8 @@ extensions: []
|
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
21
|
- ".circleci/config.yml"
|
22
|
+
- ".github/workflows/release.yml"
|
23
|
+
- ".github/workflows/ruby.yml"
|
22
24
|
- ".gitignore"
|
23
25
|
- ".rspec"
|
24
26
|
- CHANGELOG.md
|
@@ -30,6 +32,7 @@ files:
|
|
30
32
|
- README.md
|
31
33
|
- Rakefile
|
32
34
|
- bin/console
|
35
|
+
- bin/rspec
|
33
36
|
- bin/setup
|
34
37
|
- docker-compose.yml
|
35
38
|
- docker/Gemfile
|
@@ -44,7 +47,7 @@ licenses:
|
|
44
47
|
- MIT
|
45
48
|
metadata:
|
46
49
|
homepage_uri: https://github.com/splaplapla/pbmenv
|
47
|
-
post_install_message:
|
50
|
+
post_install_message:
|
48
51
|
rdoc_options: []
|
49
52
|
require_paths:
|
50
53
|
- lib
|
@@ -59,8 +62,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
59
62
|
- !ruby/object:Gem::Version
|
60
63
|
version: '0'
|
61
64
|
requirements: []
|
62
|
-
rubygems_version: 3.
|
63
|
-
signing_key:
|
65
|
+
rubygems_version: 3.0.3.1
|
66
|
+
signing_key:
|
64
67
|
specification_version: 4
|
65
68
|
summary: A package manager of PBM
|
66
69
|
test_files: []
|