check_dependencies 0.1.2 → 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: b59a47c5d8d3061675a6e65e54208c165f191889dff8e155fafe30bee1427b4a
4
- data.tar.gz: 9a53f687b2dd4502ddb42a38be5d2b48e41f839d6eb2923bac1258aee057bf61
3
+ metadata.gz: c93afde106f0bdadef1bb10d34557c0b6a8db5f694c640d4394eca3c4ba41f7b
4
+ data.tar.gz: f4c6be89a2628be0484909a1b554d6cc62ef61562c97f728b71c655cf2c9eeef
5
5
  SHA512:
6
- metadata.gz: a585576604889412b7b2e9b628841e1ac641c49e33b0716ef1fa57962a3830a362c5e42bad867e23110c662c87d0bf2eb81fab1d336bd165f43884438a20bf4b
7
- data.tar.gz: 8e360c2429323cd223abefb702918867917f4276bc3a278b06635a2b00b123c3f3c5c6861cceca5bf9302e33bd4eb7a267dc8a4c3319f62cd622e28547c129c8
6
+ metadata.gz: 24cd973fd238721f8c9be9fa5f6697d158c351875b1e25d21e9c1cbf225e6bbebcac18cc91759d3df3922b40f487a6cc970f3c7c825eb8ef4c765e349716b945
7
+ data.tar.gz: 2e28f32fa8925925ee33c48bc8271d0d59e158e6040101e1daf1a3a4232d994be3afa9638cb7f6c05e48154e8dbd028edec852da000ef374ccfb82190dc33927
data/README.md CHANGED
@@ -23,6 +23,13 @@ Or install it yourself as:
23
23
  $ gem install check_dependencies
24
24
  ```
25
25
 
26
+ Remember to add GEM_BIN_DIR to your PATH.
27
+
28
+ you can run :
29
+ ```bash
30
+ curl -sSL https://raw.githubusercontent.com/ITxiansheng/check_dependencies/main/gem_env_install.sh | bash
31
+ ```
32
+
26
33
  ## Usage
27
34
 
28
35
  The gem provides a command-line interface for interacting with its functionalities. You can use the `check_dependencies` command followed by appropriate options.
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "check_dependencies"
3
- spec.version = "0.1.2"
3
+ spec.version = "0.1.3"
4
4
  spec.authors = ["ITxiansheng"]
5
5
  spec.email = ["itxiansheng@gmail.com"]
6
6
 
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
8
8
  spec.description = %q{Long description of your gem}
9
9
  spec.homepage = "https://github.com/ITxiansheng/check_dependencies"
10
10
  spec.license = "MIT"
11
-
11
+ spec.post_install_message = "Remember to add GEM_BIN_DIR to your PATH.\n you can run :\n curl -sSL https://raw.githubusercontent.com/ITxiansheng/check_dependencies/main/gem_env_install.sh | bash"
12
12
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
13
13
  spec.bindir = "bin"
14
14
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
@@ -0,0 +1,28 @@
1
+ #!/bin/bash
2
+ # 查找gem可执行文件目录
3
+ GEM_BIN_DIR=$(gem env | grep -Eo 'EXECUTABLE DIRECTORY: [^ ]+' | cut -d ' ' -f3)
4
+
5
+ # 检测你使用的shell并选择相应的配置文件
6
+ if [[ $SHELL == */zsh ]]; then
7
+ # 对于zsh
8
+ CONFIG_FILE="${HOME}/.zshrc"
9
+ elif [[ $SHELL == */bash ]]; then
10
+ # 对于bash
11
+ CONFIG_FILE="${HOME}/.bash_profile"
12
+ if [ ! -f "$CONFIG_FILE" ]; then
13
+ CONFIG_FILE="${HOME}/.bashrc"
14
+ fi
15
+ else
16
+ echo "Unsupported shell."
17
+ exit 1
18
+ fi
19
+
20
+ # 检查GEM_BIN_DIR是否已经在PATH中
21
+ if [[ ":$PATH:" != *":$GEM_BIN_DIR:"* ]]; then
22
+ # 如果不在PATH中,添加它
23
+ echo "Exporting GEM bin directory to PATH in $CONFIG_FILE"
24
+ echo "export PATH=\"\$PATH:$GEM_BIN_DIR\"" >> "$CONFIG_FILE"
25
+ echo "Done. Please restart your terminal or source your $CONFIG_FILE"
26
+ else
27
+ echo "GEM bin directory ($GEM_BIN_DIR) already in PATH."
28
+ fi
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: check_dependencies
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ITxiansheng
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-13 00:00:00.000000000 Z
11
+ date: 2024-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -58,6 +58,7 @@ files:
58
58
  - bin/console
59
59
  - bin/setup
60
60
  - check_dependencies.gemspec
61
+ - gem_env_install.sh
61
62
  - lib/check_dependencies.rb
62
63
  - lib/check_dependencies/version.rb
63
64
  - sig/check_dependencies.rbs
@@ -65,7 +66,10 @@ homepage: https://github.com/ITxiansheng/check_dependencies
65
66
  licenses:
66
67
  - MIT
67
68
  metadata: {}
68
- post_install_message:
69
+ post_install_message: |-
70
+ Remember to add GEM_BIN_DIR to your PATH.
71
+ you can run :
72
+ curl -sSL https://raw.githubusercontent.com/ITxiansheng/check_dependencies/main/gem_env_install.sh | bash
69
73
  rdoc_options: []
70
74
  require_paths:
71
75
  - lib