shellboxCLI 0.3.0 → 0.3.2

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: 6422f42a703688cff944c128fd7a18d5a07e27ab0051a9f2c05379b59d8e00b8
4
- data.tar.gz: b822c5224dfb80276b1fb543d3f49b207f6f4f6e0ea23970eb20b5a601eea31c
3
+ metadata.gz: 0115d18d5955542b6991dd526f9c52ed920b66ab7b7c919638b8fc309525e608
4
+ data.tar.gz: 1bcda27f04d2492817d9216fd3bbfd50297b7bf663aa5b15cc6c20091278c54a
5
5
  SHA512:
6
- metadata.gz: 6f4dbc686cbadf93623dd01dfd136813c6998a85cc2a863bc5c284303866c1fdd5b5ad27bcb5d5a1b50b47f59e198fabed98b9eec084aed01544892bfd3865d1
7
- data.tar.gz: c14bc172936c4afa3547c3d80e636f94d92b706b8459d7517b72cc73a7c6d5518d1acbbdb8e9815499124ff5ea3500d45d4afdbf83a3f13eacb84bd7b0ea60c8
6
+ metadata.gz: bf40422d3f42f1e43fb3d37efd9acad8e6c7e3e6318de917963962b8b621a0070d2081af89084eae1963212a6300306ea8daa9ba9656c9279f1bc16a9b93736e
7
+ data.tar.gz: 7d5526eee08f10f6a26c96aae823585bf74eabf7bf9dc28de306f53a961d39442bda0bf2476c7cdf355be8cff6ad9356a08f81f831d0674e90a9b4704a467195
@@ -16,15 +16,18 @@ files=$(git diff --cached --name-only --diff-filter=ACM | grep "\.swift$")
16
16
  if [ -n "$files" ]; then
17
17
  echo "Executando Swiftlint nos arquivos alterados..."
18
18
 
19
- # Executa o Swiftlint nos arquivos em diff
20
- lint_output=$($SWIFTLINT_PATH lint --path $files)
19
+ lint_output=$($SWIFTLINT_PATH lint $files)
21
20
 
22
- if [ -n "$lint_output" ]; then
23
- echo "Erros ou avisos do Swiftlint encontrados:"
24
- echo "$lint_output"
21
+ lint_errors=$(echo "$lint_output" | grep "error:")
22
+ if [ -n "$lint_errors" ]; then
23
+ echo "Erros do Swiftlint encontrados:"
24
+ echo "$lint_errors"
25
25
  echo "Corrija os problemas de lint antes de commitar."
26
26
  exit 1
27
+ else
28
+ echo "Swiftlint warnings:"
29
+ echo "$lint_output"
27
30
  fi
28
31
  fi
29
32
 
30
- exit 0
33
+ exit 0
@@ -1,28 +1,26 @@
1
- #!/usr/bin/env ruby
2
-
3
1
  require 'bundler/setup'
4
- require 'rugged'
2
+ require 'forwardable'
3
+ require 'git'
5
4
  require 'fileutils'
6
5
 
7
6
  def install_pre_commit_hook(repository)
8
- hooks_path = File.join(repository.workdir, '.git', 'hooks')
7
+ hooks_path = File.join(repository.repo.path, 'hooks')
9
8
  hook_type = 'pre-commit'
10
9
  hook_path = File.join(hooks_path, hook_type)
11
10
  source_hook_path = File.join(File.dirname(File.expand_path(__FILE__)), 'hooks', hook_type)
12
-
13
11
  unless File.directory?(hooks_path)
14
12
  puts "Pasta .git/hooks não encontrada. Certifique-se de estar no diretório raiz do seu repositório Git."
15
13
  exit 1
16
14
  end
17
-
18
- # Copia o script do hook para o diretório .git/hooks
19
15
  FileUtils.cp(source_hook_path, hook_path)
20
16
  File.chmod(0755, hook_path)
21
17
  end
22
18
 
23
- repo_path = Dir.pwd
24
- repo = Rugged::Repository.new(repo_path)
25
-
19
+ if ARGV.empty?
20
+ puts "Forneça o caminho do repositório."
21
+ exit 1
22
+ end
23
+ repo_path = ARGV[0]
24
+ repo = Git.open(repo_path)
26
25
  install_pre_commit_hook(repo)
27
-
28
26
  puts "Hook pre-commit configurado com sucesso!"
data/lib/ios/iosOption.rb CHANGED
@@ -42,7 +42,6 @@ module App
42
42
  puts "✅ Swiftgen instalado com sucesso"
43
43
 
44
44
  install_tuist
45
-
46
45
  install_hooks
47
46
  end
48
47
 
@@ -53,20 +52,18 @@ module App
53
52
  install_hooks_path = File.join(hooks_directory, 'install-hooks.rb')
54
53
 
55
54
  unless File.exist?(install_hooks_path)
56
- puts "O arquivo install-hooks.rb não foi encontrado em #{hooks_directory}."
57
- return
55
+ puts "O arquivo install-hooks.rb não foi encontrado em #{hooks_directory}."
56
+ return
58
57
  end
59
-
60
58
  puts "Executando install_hooks..."
61
-
59
+ repo_path = Dir.pwd
62
60
  Dir.chdir(hooks_directory) do
63
- success = system('ruby install-hooks.rb')
64
-
65
- if success
66
- puts "✅ Hooks instalados com sucesso!"
67
- else
68
- puts "❌ Erro ao executar pre-hook"
69
- end
61
+ success = system("ruby install-hooks.rb #{repo_path}")
62
+ if success
63
+ puts "✅ Hooks instalados com sucesso!"
64
+ else
65
+ puts "❌ Erro ao executar pre-hook"
66
+ end
70
67
  end
71
68
  end
72
69
 
@@ -33,7 +33,7 @@ module IOS
33
33
  puts ""
34
34
  puts "Projeto criado com " + "Sucesso".green
35
35
  puts Dir.pwd
36
- if Dir.exists? "Example"
36
+ if Dir.exist? "Example"
37
37
  Dir.chdir "Example" do
38
38
  puts "Caso deseja abrir o projeto de Exemplo, digite " + "[" + "Y".underlined.yellow + "es]".yellow
39
39
 
@@ -49,4 +49,4 @@ module IOS
49
49
  end
50
50
 
51
51
  end
52
- end
52
+ end
@@ -83,7 +83,7 @@ module IOS
83
83
  end
84
84
 
85
85
  def run
86
- raise "Para rodar a rotina, você deve estar na raiz do projeto" if not File.exists?(@project_filename)
86
+ raise "Para rodar a rotina, você deve estar na raiz do projeto" if not File.exist?(@project_filename)
87
87
 
88
88
  @pod_name = ask("Qual o nome do módulo?")
89
89
  ConfigureSwift.perform(configurator: self)
@@ -108,7 +108,7 @@ module IOS
108
108
  end
109
109
 
110
110
  def run_tuist_generate
111
- if Dir.exists? "Example"
111
+ if Dir.exist? "Example"
112
112
  Dir.chdir "Example" do
113
113
  @tuist_commands.generateExample(false)
114
114
  printDone
@@ -117,7 +117,7 @@ module IOS
117
117
  end
118
118
 
119
119
  def run_swiftgen
120
- if File.exists? "swiftgen.yml"
120
+ if File.exist? "swiftgen.yml"
121
121
  printMessage("Rodando " + "swiftgen".magenta + " no módulo")
122
122
  @message_bank.run_command "swiftgen"
123
123
  printDone
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.3.0
4
+ version: 0.3.2
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-09-16 00:00:00.000000000 Z
11
+ date: 2024-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -25,47 +25,47 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.2'
27
27
  - !ruby/object:Gem::Dependency
28
- name: bundler
28
+ name: git
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.17'
34
- type: :development
33
+ version: '2.3'
34
+ type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.17'
40
+ version: '2.3'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rake
42
+ name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '10.0'
47
+ version: '1.17'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '10.0'
54
+ version: '1.17'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rugged
56
+ name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.7'
61
+ version: '10.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1.7'
68
+ version: '10.0'
69
69
  description: A ShellBox CLI to generate some patterns and templates
70
70
  email:
71
71
  - rodrigo.martins@raizen.com