pbmenv 0.1.11 → 0.1.13

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: 71360d9bbca44d55f4ca11d3740f66de12ed58fc4b019c1aec14c9aecdd3967f
4
- data.tar.gz: 14c5ffc901de8531836215cb17b82c8774d5610ace13c8ba735d3870bb2bfbc6
3
+ metadata.gz: 3f35552c2117ced3c7790caeea1c4e588e062752629b5cdcd8fde239cb09d86a
4
+ data.tar.gz: b1d3093ba6707e79d9a5a557060a5c5be92b2b59131b452f48b920d445675db9
5
5
  SHA512:
6
- metadata.gz: bc45a25392580bd34838839dc657bda34eddf9e879c3e8b7bcc1cc530a8f0ed0c9d13392051c3abf6d42688d0264f03126ed3aab6f929be2fac4c4eb564c4ba8
7
- data.tar.gz: 410f0cd1b91575f880263f27411e8047a4d8a47c05570fe9b8276eb55f94dc1b291da0b2a662761a99845f535e7aaf1155630d22f5aedf80708dc29de47df732
6
+ metadata.gz: 5e4e5410b064dfe5f1cc9dcb7aae805d30d8df71d2921f46583705251fd2b7fd677627781098e097ddffe71c84944dbf509bc948a08c465fe5fec244149ba5fa
7
+ data.tar.gz: 121d0ae161dc0d6ad9146e6fccc8c92a5fbcc3f17a2f1a2ef0ef89e0c9096c84f09686354a87769496b2635cd2603995f18f2ed361163521e7f1021b34fc2f65
@@ -1,7 +1,7 @@
1
1
  name: Publish to RubyGems
2
2
 
3
3
  on:
4
- [workflow_dispatch]
4
+ workflow_dispatch:
5
5
 
6
6
  jobs:
7
7
  release:
@@ -14,10 +14,10 @@ jobs:
14
14
  - uses: actions/checkout@v2
15
15
  with:
16
16
  token: ${{ secrets.GITHUB_TOKEN }}
17
- - name: Set up Ruby 2.6
17
+ - name: Set up Ruby
18
18
  uses: ruby/setup-ruby@v1
19
19
  with:
20
- ruby-version: 2.6
20
+ ruby-version: 3.1
21
21
  bundler-cache: true
22
22
  - name: Publish to RubyGems
23
23
  run: |
@@ -8,15 +8,20 @@
8
8
  name: Ruby
9
9
 
10
10
  on:
11
- [push, workflow_dispatch]
11
+ schedule:
12
+ - cron: '0 0 */1 * *' # runs daily
13
+ push:
12
14
 
13
15
  jobs:
14
16
  test:
17
+ env:
18
+ BUNDLE_WITHOUT: :typecheck
15
19
  runs-on: ubuntu-latest
16
20
  timeout-minutes: 5
17
21
  strategy:
22
+ max-parallel: 2
18
23
  matrix:
19
- ruby-version: ['2.5', '3.0', '3.1']
24
+ ruby-version: ['2.5', '2.7', '3.0', '3.1', '3.2']
20
25
  steps:
21
26
  - uses: actions/checkout@v3
22
27
  - name: Set up Ruby
@@ -26,3 +31,18 @@ jobs:
26
31
  bundler-cache: true
27
32
  - name: Run tests
28
33
  run: bundle exec rake
34
+ typecheck:
35
+ runs-on: ubuntu-latest
36
+ timeout-minutes: 5
37
+ strategy:
38
+ matrix:
39
+ ruby-version: ['3.0', '3.1', '3.2']
40
+ steps:
41
+ - uses: actions/checkout@v3
42
+ - name: Set up Ruby
43
+ uses: ruby/setup-ruby@v1
44
+ with:
45
+ ruby-version: ${{ matrix.ruby-version }}
46
+ bundler-cache: true
47
+ - name: typecheck
48
+ run: bundle exec steep check
data/CHANGELOG.md CHANGED
@@ -1,4 +1,10 @@
1
- ## [0.1.11] - 2023-02-
1
+ ## [0.1.13] - 2023-07-16
2
+ - listコマンドの出力でactiveなバージョンがわかるようになりました
3
+
4
+ ## [0.1.12] - 2023-04-16
5
+ - Support ruby3.2
6
+
7
+ ## [0.1.11] - 2023-02-5
2
8
  - ダウンロードしたソースコードを/tmpに展開するようにしました
3
9
  - 古いバージョンディレクトリを削除するcleanコマンドを実装しました
4
10
 
data/Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM ruby:3.0
1
+ FROM ruby:3.2
2
2
 
3
3
  WORKDIR /pbmenv
4
4
 
data/Gemfile CHANGED
@@ -8,3 +8,9 @@ gemspec
8
8
  gem "rake"
9
9
  gem "rspec"
10
10
  gem "pry"
11
+
12
+
13
+ group :typecheck do
14
+ gem 'rbs', require: false
15
+ gem "steep", require: false
16
+ end
data/Gemfile.lock CHANGED
@@ -1,18 +1,44 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pbmenv (0.1.11)
4
+ pbmenv (0.1.13)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
+ activesupport (7.0.4.3)
10
+ concurrent-ruby (~> 1.0, >= 1.0.2)
11
+ i18n (>= 1.6, < 2)
12
+ minitest (>= 5.1)
13
+ tzinfo (~> 2.0)
14
+ ast (2.4.2)
9
15
  coderay (1.1.3)
16
+ concurrent-ruby (1.2.2)
17
+ csv (3.2.6)
10
18
  diff-lcs (1.4.4)
19
+ ffi (1.15.5)
20
+ fileutils (1.7.1)
21
+ i18n (1.13.0)
22
+ concurrent-ruby (~> 1.0)
23
+ json (2.6.3)
24
+ language_server-protocol (3.17.0.3)
25
+ listen (3.8.0)
26
+ rb-fsevent (~> 0.10, >= 0.10.3)
27
+ rb-inotify (~> 0.9, >= 0.9.10)
28
+ logger (1.5.3)
11
29
  method_source (1.0.0)
30
+ minitest (5.18.0)
31
+ parser (3.2.2.1)
32
+ ast (~> 2.4.1)
12
33
  pry (0.14.1)
13
34
  coderay (~> 1.1)
14
35
  method_source (~> 1.0)
36
+ rainbow (3.1.1)
15
37
  rake (13.0.6)
38
+ rb-fsevent (0.11.2)
39
+ rb-inotify (0.10.1)
40
+ ffi (~> 1.0)
41
+ rbs (3.1.0)
16
42
  rspec (3.10.0)
17
43
  rspec-core (~> 3.10.0)
18
44
  rspec-expectations (~> 3.10.0)
@@ -26,6 +52,28 @@ GEM
26
52
  diff-lcs (>= 1.2.0, < 2.0)
27
53
  rspec-support (~> 3.10.0)
28
54
  rspec-support (3.10.3)
55
+ securerandom (0.2.2)
56
+ steep (1.4.0)
57
+ activesupport (>= 5.1)
58
+ concurrent-ruby (>= 1.2.2)
59
+ csv (>= 3.0.9)
60
+ fileutils (>= 1.1.0)
61
+ json (>= 2.1.0)
62
+ language_server-protocol (>= 3.15, < 4.0)
63
+ listen (~> 3.0)
64
+ logger (>= 1.3.0)
65
+ parser (>= 3.1)
66
+ rainbow (>= 2.2.2, < 4.0)
67
+ rbs (>= 2.8.0)
68
+ securerandom (>= 0.1)
69
+ strscan (>= 1.0.0)
70
+ terminal-table (>= 2, < 4)
71
+ strscan (3.0.6)
72
+ terminal-table (3.0.2)
73
+ unicode-display_width (>= 1.1.1, < 3)
74
+ tzinfo (2.0.6)
75
+ concurrent-ruby (~> 1.0)
76
+ unicode-display_width (2.4.2)
29
77
 
30
78
  PLATFORMS
31
79
  aarch64-linux
@@ -37,7 +85,6 @@ DEPENDENCIES
37
85
  pbmenv!
38
86
  pry
39
87
  rake
88
+ rbs
40
89
  rspec
41
-
42
- BUNDLED WITH
43
- 2.3.7
90
+ steep
data/Steepfile ADDED
@@ -0,0 +1,26 @@
1
+ # D = Steep::Diagnostic
2
+ #
3
+ target :lib do
4
+ signature "sig"
5
+
6
+ check "lib" # Directory name
7
+ # check "Gemfile" # File name
8
+ # check "app/models/**/*.rb" # Glob
9
+ # ignore "lib/templates/*.rb"
10
+
11
+ library "json", "uri", "pathname", "securerandom", "logger"
12
+
13
+ # library "strong_json" # Gems
14
+
15
+ # configure_code_diagnostics(D::Ruby.strict) # `strict` diagnostics setting
16
+ # configure_code_diagnostics(D::Ruby.lenient) # `lenient` diagnostics setting
17
+ # configure_code_diagnostics do |hash| # You can setup everything yourself
18
+ # hash[D::Ruby::NoMethod] = :information
19
+ # end
20
+ end
21
+
22
+ # target :test do
23
+ # signature "sig", "sig-private"
24
+ #
25
+ # check "test"
26
+ # end
data/docker-compose.yml CHANGED
@@ -8,7 +8,5 @@ services:
8
8
  volumes:
9
9
  - './:/pbmenv'
10
10
  - bundle_path:/bundle
11
- environment:
12
- - BUNDLE_PATH=/bundle
13
11
  volumes:
14
12
  bundle_path:
data/exe/pbmenv CHANGED
@@ -4,4 +4,8 @@
4
4
  require "bundler/setup"
5
5
  require "pbmenv"
6
6
 
7
- Pbmenv::CLI.run ARGV
7
+ begin
8
+ Pbmenv::CLI.run(ARGV)
9
+ rescue Pbmenv::CLI::CLIError
10
+ exit 1
11
+ end
data/lib/pbmenv/cli.rb CHANGED
@@ -1,25 +1,29 @@
1
1
  module Pbmenv
2
2
  class CLI
3
+ class CLIError < StandardError; end
4
+
3
5
  def self.run(argv)
4
6
  sub_command = argv[0]
5
7
  case sub_command
6
8
  when 'available_versions', 'av'
7
9
  Pbmenv.available_versions.each { |x| puts x }
8
10
  when 'versions', 'list'
9
- Pbmenv.versions.each { |x| puts x }
11
+ Pbmenv.command_versions.each { |x| puts x }
10
12
  when 'install', 'i'
11
13
  sub_command_arg = argv[1]
14
+ use_option = false
12
15
  case argv[2]
13
16
  when "--use"
14
17
  use_option = true
15
18
  when nil
16
- use_option = false
17
19
  else
18
20
  puts <<~EOH
19
21
  Unknown option:
20
22
  available options: --use
21
23
  EOH
24
+ raise CLIError
22
25
  end
26
+
23
27
  Pbmenv.install(sub_command_arg, use_option: use_option)
24
28
  when 'use', 'u'
25
29
  sub_command_arg = argv[1]
@@ -37,9 +41,17 @@ module Pbmenv
37
41
  puts Pbmenv::VERSION
38
42
  else
39
43
  puts <<~EOH
40
- Unknown command:
41
- available commands: available_versions, versions, install, use, uninstall, clean
44
+ Usage: pbmenv [command]
45
+
46
+ Available commands:
47
+ available_versions Display the available versions of pbmenv
48
+ versions List the installed versions of pbmenv
49
+ install Install a specific version of pbmenv
50
+ use Set a specific version of pbmenv as the active version
51
+ uninstall Uninstall a specific version of pbmenv
52
+ clean Remove old installed versions of pbmenv
42
53
  EOH
54
+ raise CLIError
43
55
  end
44
56
  end
45
57
  end
data/lib/pbmenv/helper.rb CHANGED
@@ -6,7 +6,7 @@ module Pbmenv
6
6
  end
7
7
 
8
8
  def self.to_stdout(text)
9
- puts text
9
+ Pbmenv.logger.info(text)
10
10
  end
11
11
 
12
12
  def self.normalize_version(version)
@@ -15,7 +15,7 @@ module Pbmenv
15
15
 
16
16
  def execute!
17
17
  pathname = VersionPathname.new(version)
18
- if File.exists?(pathname.version_path)
18
+ if File.exist?(pathname.version_path)
19
19
  raise AlreadyCreatedError
20
20
  end
21
21
 
@@ -33,7 +33,7 @@ module Pbmenv
33
33
  Helper.system_and_puts "rm -rf #{pathname.version_path}"
34
34
  raise
35
35
  ensure
36
- if Dir.exists?(pathname.src_pbm_path)
36
+ if Dir.exist?(pathname.src_pbm_path)
37
37
  Helper.system_and_puts "rm -rf #{pathname.src_pbm_path}"
38
38
  end
39
39
  end
@@ -50,10 +50,13 @@ module Pbmenv
50
50
 
51
51
  def build_app_file
52
52
  pathname = VersionPathname.new(version)
53
- Helper.system_and_puts "mkdir -p #{pathname.version_path}"
53
+ unless Helper.system_and_puts "mkdir -p #{pathname.version_path}"
54
+ raise "Insufficient permissions..."
55
+ end
56
+
54
57
  Helper.system_and_puts "cp -r #{pathname.src_project_template_systemd_units} #{pathname.version_path}/"
55
58
 
56
- if File.exists?(pathname.src_pbm_project_template_app_rb_erb_path)
59
+ if File.exist?(pathname.src_pbm_project_template_app_rb_erb_path)
57
60
  pathname.project_template_file_paths(include_app_erb: true).each do |project_template_file_path|
58
61
  Helper.system_and_puts "cp #{project_template_file_path} #{pathname.version_path}/"
59
62
  end
@@ -80,7 +83,7 @@ module Pbmenv
80
83
  end
81
84
 
82
85
  def create_if_miss_shared_dir
83
- return if File.exists?(VersionPathname.shared)
86
+ return if File.exist?(VersionPathname.shared)
84
87
 
85
88
  Helper.system_and_puts <<~SHELL
86
89
  mkdir -p #{VersionPathname.shared}
@@ -89,7 +92,7 @@ module Pbmenv
89
92
 
90
93
  def create_if_miss_device_id_file
91
94
  device_id_path_in_shared = VersionPathname.device_id_path_in_shared
92
- return if File.exists?(device_id_path_in_shared)
95
+ return if File.exist?(device_id_path_in_shared)
93
96
 
94
97
  File.write(device_id_path_in_shared, "d_#{SecureRandom.uuid}")
95
98
  end
@@ -103,7 +106,7 @@ module Pbmenv
103
106
 
104
107
  def create_if_miss_current_dir(version: )
105
108
  # 初回だけinstall時にcurrentを作成する
106
- if !File.exists?(VersionPathname.current) || use_option
109
+ if !File.exist?(VersionPathname.current) || use_option
107
110
  UseVersionService.new(version: version).execute!
108
111
  end
109
112
  end
@@ -13,7 +13,7 @@ module Pbmenv
13
13
  def execute!
14
14
  version_pathname = VersionPathname.new(version)
15
15
 
16
- unless File.exists?(version_pathname.version_path)
16
+ unless File.exist?(version_pathname.version_path)
17
17
  raise VersionNotFoundError
18
18
  end
19
19
  Helper.system_and_puts "rm -rf #{version_pathname.version_path}"
@@ -18,13 +18,13 @@ module Pbmenv
18
18
  else
19
19
  # TODO cache for testing
20
20
  shell = <<~SHELL
21
- curl -L https://github.com/splaplapla/procon_bypass_man/archive/refs/tags/v#{version}.tar.gz | tar xvz -C /tmp > /dev/null
21
+ curl -L https://github.com/splaplapla/procon_bypass_man/archive/refs/tags/v#{version}.tar.gz | tar xvz -C /tmp > /dev/null 2>&1
22
22
  SHELL
23
23
  end
24
24
 
25
25
  if Helper.system_and_puts(shell)
26
- unless File.exists?(pathname.src_pbm_project_template_path)
27
- raise NotSupportVersionError, "This version is not support by pbmenv"
26
+ unless File.exist?(pathname.src_pbm_project_template_path)
27
+ raise Pbmenv::CreateVersionService::NotSupportVersionError, "This version is not support by pbmenv"
28
28
  end
29
29
  else
30
30
  raise DownloadError
@@ -20,7 +20,7 @@ module Pbmenv
20
20
  def throw_error_if_has_not_version
21
21
  version_pathname = VersionPathname.new(version)
22
22
 
23
- if !File.exists?(version_pathname.version_path_without_v) && !File.exists?(version_pathname.version_path)
23
+ if !File.exist?(version_pathname.version_path_without_v) && !File.exist?(version_pathname.version_path)
24
24
  raise UseVersionService::VersionNotFoundError
25
25
  end
26
26
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pbmenv
4
- VERSION = "0.1.11"
4
+ VERSION = "0.1.13"
5
5
  end
@@ -7,11 +7,11 @@ module Pbmenv
7
7
  end
8
8
 
9
9
  def version_path
10
- File.join(PBM_DIR, "v#{version}")
10
+ File.join(Pbmenv.pbm_dir, "v#{version}")
11
11
  end
12
12
 
13
13
  def version_path_without_v
14
- File.join(PBM_DIR, "#{version}")
14
+ File.join(Pbmenv.pbm_dir, "#{version}")
15
15
  end
16
16
 
17
17
  def app_rb_path
@@ -65,11 +65,11 @@ module Pbmenv
65
65
  end
66
66
 
67
67
  def self.current
68
- File.join(PBM_DIR, "current")
68
+ File.join(Pbmenv.pbm_dir, "current")
69
69
  end
70
70
 
71
71
  def self.shared
72
- File.join(PBM_DIR, "shared")
72
+ File.join(Pbmenv.pbm_dir, "shared")
73
73
  end
74
74
  end
75
75
  end
data/lib/pbmenv.rb CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "securerandom"
4
4
  require "pathname"
5
+ require "logger"
5
6
 
6
7
  require_relative "pbmenv/version"
7
8
  require_relative "pbmenv/cli"
@@ -16,7 +17,40 @@ require_relative "pbmenv/services/use_version_service"
16
17
  require_relative "pbmenv/services/download_src_service"
17
18
 
18
19
  module Pbmenv
19
- PBM_DIR = "/usr/share/pbm"
20
+ PBM_DIR = "/usr/share/pbm" # NOTE: pbmから参照している
21
+ DEFAULT_PBM_DIR = PBM_DIR
22
+
23
+ class << self
24
+ attr_accessor :logger
25
+ end
26
+
27
+ @current_pbm_dir = DEFAULT_PBM_DIR
28
+
29
+ self.logger = Logger.new($stdout)
30
+ self.logger.formatter = proc do |severity, datetime, progname, message|
31
+ "#{message}\n"
32
+ end
33
+
34
+ # @param [String] to_dir
35
+ # @return [void]
36
+ # NOTE: テスト用
37
+ def self.chdir(to_dir)
38
+ raise(ArgumentError, 'テスト以外では実行できません') unless defined?(RSpec)
39
+ @current_pbm_dir = to_dir
40
+ end
41
+
42
+ # @return [String]
43
+ def self.pbm_dir
44
+ @current_pbm_dir
45
+ end
46
+
47
+ # @return [void]
48
+ def self.slice_logger
49
+ previous_logger = self.logger
50
+ self.logger = Logger.new(File.open(File::NULL, "w"))
51
+ yield
52
+ self.logger = previous_logger
53
+ end
20
54
 
21
55
  # @return [Pbmenv::DirectoryObject]
22
56
  def self.current_directory
@@ -29,7 +63,7 @@ module Pbmenv
29
63
 
30
64
  # @return [Array<Pbmenv::VersionObject>]
31
65
  def self.installed_versions
32
- unsorted_dirs = Dir.glob("#{Pbmenv::PBM_DIR}/v*")
66
+ unsorted_dirs = Dir.glob("#{Pbmenv.pbm_dir}/v*")
33
67
  sorted_version_names = unsorted_dirs.map { |name| Pathname.new(name).basename.to_s =~ /^v([\d.]+)/ && $1 }.compact.sort_by {|x| Gem::Version.new(x) }
34
68
  sorted_version_names.map do |version_name|
35
69
  VersionObject.new(
@@ -40,10 +74,10 @@ module Pbmenv
40
74
  end
41
75
  end
42
76
 
43
- # @deprecated
44
- def self.versions
45
- unsorted_dirs = Dir.glob("#{Pbmenv::PBM_DIR}/v*")
46
- unsorted_dirs.map { |name| Pathname.new(name).basename.to_s =~ /^v([\d.]+)/ && $1 }.compact.sort_by {|x| Gem::Version.new(x) }.compact
77
+ def self.command_versions
78
+ self.installed_versions.map do |version|
79
+ version.current_version? ? "* #{version.name}" : " #{version.name}"
80
+ end
47
81
  end
48
82
 
49
83
  def self.install(version, use_option: false, enable_pbm_cloud: false)
@@ -80,7 +114,7 @@ module Pbmenv
80
114
  raise "Need a version" if version.nil?
81
115
  version =
82
116
  if version == 'latest'
83
- self.versions.last
117
+ self.installed_versions.last.name
84
118
  else
85
119
  Helper.normalize_version(version) or raise "mismatch version number!"
86
120
  end
data/sig/main.rbs ADDED
@@ -0,0 +1,253 @@
1
+ module Pbmenv
2
+ PBM_DIR: "/usr/share/pbm"
3
+
4
+ DEFAULT_PBM_DIR: untyped
5
+
6
+ self.@current_pbm_dir: String
7
+
8
+ @logger: Logger
9
+
10
+ def self.logger: () -> Logger
11
+ def self.logger=: (Logger) -> void
12
+
13
+ # @param [String] to_dir
14
+ # @return [void]
15
+ # NOTE: テスト用
16
+ def self.chdir: (String to_dir) -> untyped
17
+
18
+ # @return [String]
19
+ def self.pbm_dir: () -> untyped
20
+
21
+ # @return [Pbmenv::DirectoryObject]
22
+ def self.current_directory: () -> untyped
23
+
24
+ def self.available_versions: () -> untyped
25
+
26
+ # @return [Array<Pbmenv::VersionObject>]
27
+ def self.installed_versions: () -> untyped
28
+
29
+ def self.command_versions: () -> untyped
30
+
31
+ def self.install: (untyped version, ?use_option: bool, ?enable_pbm_cloud: bool) -> (false | untyped)
32
+
33
+ # TODO: 引数がcurrentを指しているバージョンはどうする?
34
+ def self.uninstall: (untyped version) -> (false | untyped)
35
+
36
+ def self.use: (untyped version) -> (false | untyped)
37
+
38
+ # @param [Integer] keep_versions_size
39
+ # @return [void]
40
+ def self.clean: (untyped keep_versions_size) -> (nil | untyped)
41
+ end
42
+
43
+ module Pbmenv
44
+ class CLI
45
+ class CLIError < StandardError
46
+ end
47
+
48
+ def self.run: (untyped argv) -> untyped
49
+ end
50
+ end
51
+
52
+ module Pbmenv
53
+ class DirectoryObject
54
+ @path: String
55
+
56
+ class NonSymlinkError < StandardError
57
+ end
58
+
59
+ def initialize: (path: untyped) -> void
60
+
61
+ def path: () -> untyped
62
+
63
+ # @return [String]
64
+ def readlink!: () -> untyped
65
+
66
+ # @return [String, NilClass]
67
+ def readlink: () -> untyped
68
+
69
+ private
70
+
71
+ # @return [Boolean]
72
+ def symlink?: () -> untyped
73
+ end
74
+ end
75
+
76
+ module Pbmenv
77
+ class Helper
78
+ def self.system_and_puts: (untyped shell) -> untyped
79
+
80
+ def self.to_stdout: (untyped text) -> untyped
81
+
82
+ def self.normalize_version: (untyped version) -> untyped
83
+ end
84
+ end
85
+
86
+ module Pbmenv
87
+ class PBM
88
+ # @return [Array<String>] githubに問い合わせて、利用可能なバージョンのリストを返す
89
+ def available_versions: () -> untyped
90
+ end
91
+ end
92
+
93
+ module Pbmenv
94
+ class CreateVersionService
95
+ class AlreadyCreatedError < StandardError
96
+ end
97
+
98
+ class NotSupportVersionError < StandardError
99
+ end
100
+
101
+ attr_accessor version: untyped
102
+
103
+ attr_accessor use_option: untyped
104
+
105
+ attr_accessor enable_pbm_cloud: untyped
106
+
107
+ def initialize: (version: untyped, use_option: untyped, enable_pbm_cloud: untyped) -> void
108
+
109
+ def execute!: () -> true
110
+
111
+ private
112
+
113
+ # @return [String]
114
+ def download_src: (untyped version) -> untyped
115
+
116
+ def build_app_file: () -> untyped
117
+
118
+ def create_if_miss_shared_dir: () -> (nil | untyped)
119
+
120
+ def create_if_miss_device_id_file: () -> (nil | untyped)
121
+
122
+ def link_device_id_file: (version: untyped) -> untyped
123
+
124
+ def create_if_miss_current_dir: (version: untyped) -> (untyped | nil)
125
+ end
126
+ end
127
+
128
+ module Pbmenv
129
+ class DestroyVersionService
130
+ class VersionNotFoundError < StandardError
131
+ end
132
+
133
+ attr_accessor version: untyped
134
+
135
+ def initialize: (version: untyped) -> void
136
+
137
+ def execute!: () -> untyped
138
+ end
139
+ end
140
+
141
+ module Pbmenv
142
+ class DownloadSrcService
143
+ class DownloadError < StandardError
144
+ end
145
+
146
+ attr_accessor version: untyped
147
+
148
+ def initialize: (untyped version) -> void
149
+
150
+ def execute!: () -> untyped
151
+ end
152
+ end
153
+
154
+ module Pbmenv
155
+ class UseVersionService
156
+ class VersionNotFoundError < StandardError
157
+ end
158
+
159
+ attr_accessor version: String
160
+
161
+ def initialize: (version: String) -> void
162
+
163
+ def execute!: () -> void
164
+
165
+ private
166
+
167
+ def throw_error_if_has_not_version: () -> untyped
168
+
169
+ def relink_current_path: () -> String
170
+ end
171
+ end
172
+
173
+ module Pbmenv
174
+ VERSION: String
175
+ end
176
+
177
+ module Pbmenv
178
+ class VersionObject
179
+ @is_current: bool
180
+ @is_latest: bool
181
+ @version_name: String
182
+
183
+ # @param [String] version_name
184
+ # @param [Boolean] is_latest
185
+ # @param [Boolean] is_current
186
+ def initialize: (version_name: String, is_latest: bool, is_current: bool) -> void
187
+
188
+ # @return [String]
189
+ def version_name: () -> String
190
+
191
+ # alias
192
+ def name: () -> String
193
+
194
+ # @return [Boolean]
195
+ def current_version?: () -> bool
196
+
197
+ # @return [Boolean]
198
+ def latest_version?: () -> bool
199
+ end
200
+ end
201
+
202
+ module Pbmenv
203
+ class VersionPathname
204
+ attr_accessor version: untyped
205
+
206
+ def initialize: (String version) -> void
207
+
208
+ def version_path: () -> untyped
209
+
210
+ def version_path_without_v: () -> untyped
211
+
212
+ def app_rb_path: () -> untyped
213
+
214
+ def app_rb_erb_path: () -> untyped
215
+
216
+ def device_id_path_in_version: () -> untyped
217
+
218
+ def src_pbm_path: () -> untyped
219
+
220
+ def project_template_file_paths: (include_app_erb: untyped) -> untyped
221
+
222
+ def device_id_path_in_shared: () -> untyped
223
+
224
+ def src_pbm_project_template_path: () -> untyped
225
+
226
+ def src_pbm_project_template_app_rb_erb_path: () -> untyped
227
+
228
+ def lib_app_generator: () -> untyped
229
+
230
+ def src_project_template_systemd_units: () -> untyped
231
+
232
+ def self.device_id_path_in_shared: () -> String
233
+
234
+ def self.current: () -> String
235
+
236
+ def self.shared: () -> String
237
+ end
238
+ end
239
+
240
+
241
+ module URI
242
+ def self.open: (String url) -> untyped
243
+ end
244
+
245
+ module RSpec
246
+ end
247
+
248
+
249
+ class AppGenerator
250
+ def initialize: (prefix_path: String, enable_integration_with_pbm_cloud: bool) -> void
251
+
252
+ def generate: () -> void
253
+ 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.11
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - jiikko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-02-07 00:00:00.000000000 Z
11
+ date: 2023-07-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A package manager of PBM
14
14
  email:
@@ -31,6 +31,7 @@ files:
31
31
  - LICENSE.txt
32
32
  - README.md
33
33
  - Rakefile
34
+ - Steepfile
34
35
  - bin/console
35
36
  - bin/rspec
36
37
  - bin/setup
@@ -50,6 +51,7 @@ files:
50
51
  - lib/pbmenv/version_object.rb
51
52
  - lib/pbmenv/version_pathname.rb
52
53
  - pbmenv.gemspec
54
+ - sig/main.rbs
53
55
  homepage: https://github.com/splaplapla/pbmenv
54
56
  licenses:
55
57
  - MIT
@@ -70,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
70
72
  - !ruby/object:Gem::Version
71
73
  version: '0'
72
74
  requirements: []
73
- rubygems_version: 3.0.3.1
75
+ rubygems_version: 3.3.26
74
76
  signing_key:
75
77
  specification_version: 4
76
78
  summary: A package manager of PBM