shellboxCLI 0.1.12 → 0.1.15

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: 7d99d4234bc0a385f6c2921347efa88de0606d5629a45fd9a70f1814984bf7ae
4
- data.tar.gz: 06b8197aedf4a1372821d0e53530149723f939041269fa110e30096888896ded
3
+ metadata.gz: 4772be003e9004d3904c69f55b4690bfb21a56c5997b2a9f17a187cd7e6843f2
4
+ data.tar.gz: 7991fa05001e8c960168674a3dcf0b53d4af9018c2544b5203a1624d657e74e2
5
5
  SHA512:
6
- metadata.gz: 6bf3cc12b28e385806ba029b7d8a0e57abb488b7484eb2953fe6d037345e94e59fc9334a5450e49056b4be3e5e7be143764e2e42a3202c3df1f00285bb790919
7
- data.tar.gz: be90a38500a2cc8e316967e2b1bd1524c22b5ac763afe30b83889cf20307f4aba449d4aa36f60a88034be415a23c6fd63c213cf6e66e900fa77ad9726b63ba4f
6
+ metadata.gz: c9e352a65539870e4bbcab7d254376baef946f7648c5352a76020b68c2438eaad890829592a4ed44fdf85b2c57dd1f5d474c967ab1a83144fc296883371688db
7
+ data.tar.gz: aab0b73d25500b55f21bf6be0467b1f7d47bdeaac54ba9f10e74dc7132cab54ec425d09308ba2a64aec28f9f059f298f67caf6036cf3d8b78c99ad3897d2cfe4
@@ -1,23 +1,28 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'bundler/setup'
4
+ require 'rugged'
4
5
  require 'fileutils'
5
6
 
6
- current_directory = Dir.pwd
7
- script_directory = File.dirname(File.expand_path(__FILE__))
7
+ def install_pre_commit_hook(repository)
8
+ hooks_path = File.join(repository.workdir, '.git', 'hooks')
9
+ hook_type = 'pre-commit'
10
+ hook_path = File.join(hooks_path, hook_type)
11
+ source_hook_path = File.join(File.dirname(File.expand_path(__FILE__)), 'hooks', hook_type)
8
12
 
9
- # Certifica-se de estar no diretório raiz do repositório Git
10
- git_directory = File.join(current_directory, ".git")
11
- unless File.directory?(git_directory)
12
- puts "Pasta .git não encontrada. Certifique-se de estar no diretório raiz do seu repositório Git."
13
- exit 1
13
+ unless File.directory?(hooks_path)
14
+ puts "Pasta .git/hooks não encontrada. Certifique-se de estar no diretório raiz do seu repositório Git."
15
+ exit 1
16
+ end
17
+
18
+ # Copia o script do hook para o diretório .git/hooks
19
+ FileUtils.cp(source_hook_path, hook_path)
20
+ File.chmod(0755, hook_path)
14
21
  end
15
22
 
16
- source_file = File.join(script_directory, "hooks", "pre-commit")
17
- destination_file = File.join(git_directory, "hooks", "pre-commit")
23
+ repo_path = Dir.pwd
24
+ repo = Rugged::Repository.new(repo_path)
18
25
 
19
- # Copia script pre-commit do CLI para a pasta .git/hooks do projeto
20
- FileUtils.cp(source_file, destination_file)
21
- File.chmod(0755, destination_file)
26
+ install_pre_commit_hook(repo)
22
27
 
23
28
  puts "Hook pre-commit configurado com sucesso!"
data/lib/ios/iosOption.rb CHANGED
@@ -31,7 +31,7 @@ module App
31
31
  private
32
32
 
33
33
  def install_hooks
34
- hooks_directory = File.expand_path(File.join(File.dirname(__FILE__), 'ios'))
34
+ hooks_directory = File.expand_path(File.join(File.dirname(__FILE__)))
35
35
  install_hooks_path = File.join(hooks_directory, 'install-hooks.rb')
36
36
 
37
37
  unless File.exist?(install_hooks_path)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shellboxCLI
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - ShellBox App
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-18 00:00:00.000000000 Z
11
+ date: 2024-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rugged
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.7'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.7'
55
69
  description: A ShellBox CLI to generate some patterns and templates
56
70
  email:
57
71
  - rodrigo.martins@raizen.com