hiroto_create 0.1.1 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1b1872c151ce5362f438f1e11934ce8182897cf9699beccc04cb1696f942e63a
4
- data.tar.gz: 435a889de17097772d36040233e17c8579f627e136743d5fcb0f3d22b464ebde
3
+ metadata.gz: 485427c3cc2f945b3457a26ddb109ae6b7fc1e1a1dd6dce0121ea9bc7c0a095b
4
+ data.tar.gz: 538b5516505f04c9005a4339c59204971a7880135a8d2d668cacd45dd816c73e
5
5
  SHA512:
6
- metadata.gz: 82cd49781cb50b28ecb15b0013209b17b5a68447078e0f6ed95ad865bc1cba45a3637079ab02b1caeb71c96207034cdbb73eee5c433112c92f1f67ec20c01e24
7
- data.tar.gz: 7c261f2a231ca6733f10f4af8b6c3782551b9acf6b9314c55a641f7cdce03ecda2d39bebef610cab4121b49809907339530a2df6fb692e002f3e8b3b2ecff889
6
+ metadata.gz: 9dceaeda46e05c2f95b93fcf7d4241ff56e22315baf9813bba0fb901ed8efc588d1d491695f1fb4baf85bb54b64e57e8c70e8d1cd4c0162309f295306483284f
7
+ data.tar.gz: ddfc39c7149c8696f051010e309920dec87ea73128c8d98060415aa93880056cd56b9914b31ff858583b44258fe8f0c9e53313c5f0266d359fd0f3a34a6765dc
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HirotoCreate
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.3"
5
5
  end
data/lib/hiroto_create.rb CHANGED
@@ -5,7 +5,8 @@ require_relative "hiroto_create/version"
5
5
  module HirotoCreate
6
6
  class Error < StandardError; end
7
7
  def self.hiroto_create
8
- # .git ファイルを作る
8
+
9
+ # .gitファイルを作る
9
10
  system("git init")
10
11
 
11
12
  # リポジトリ名の入力
@@ -20,6 +21,52 @@ module HirotoCreate
20
21
  print 'Enter public or private: '
21
22
  flag = gets.chomp.strip
22
23
 
24
+ # ghコマンドがインストールされているか確認
25
+ gh_installed = system('which gh > /dev/null')
26
+
27
+ unless gh_installed
28
+ puts "ghコマンドが見つかりません。"
29
+
30
+ # インストール確認
31
+ print "ghコマンドをインストールしますか? (yes/no): "
32
+ user_input = gets.chomp.strip.downcase
33
+
34
+ case user_input
35
+ when 'yes'
36
+ # macOSの場合
37
+ if RUBY_PLATFORM.include?('darwin')
38
+ puts "GitHub CLI (gh)のインストール中..."
39
+ system('brew install gh')
40
+ # インストールの完了を待機する
41
+ end
42
+
43
+ # Linuxの場合 (ここではUbuntu)
44
+ if RUBY_PLATFORM.include?('linux')
45
+ puts "GitHub CLI (gh)のインストール中..."
46
+ system('sudo apt install gh')
47
+ # インストールの完了を待機する
48
+ end
49
+
50
+ # インストールが成功したか再度確認
51
+ gh_installed_after_install = system('which gh > /dev/null')
52
+ if gh_installed_after_install
53
+ puts "GitHub CLI (gh)のインストールが完了しました。"
54
+ else
55
+ puts "GitHub CLI (gh)のインストールに失敗しました。手動でインストールしてください。"
56
+ exit(1)
57
+ end
58
+
59
+ when 'いいえ', 'no'
60
+ puts "インストールを中止しました。hiroto_createを使用するには手動でghコマンドをインストールしてください。"
61
+ exit(1)
62
+
63
+ else
64
+ puts "無効な入力です。yesかnoで答えてください。"
65
+ exit(1)
66
+ end
67
+ end
68
+
69
+
23
70
  # リモートリポジトリのSSH
24
71
  remote_repo_url = "git@github.com:#{username}/#{repo_name}.git"
25
72
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hiroto_create
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - SuzukiHiroto08
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-23 00:00:00.000000000 Z
11
+ date: 2024-01-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: gem to create and connect remote repository to github on local PC
14
14
  email: