alm 0.3.7 → 0.4.0

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: 16a4a23b078a8354e9c1b5e98ed1c5fdfb74d1c6a6a00b5e8fe9174d6598a03f
4
- data.tar.gz: fdcc222c330e6c32439b13030e0b2ac96ee1c6b43ee87a8c3450f183d3194464
3
+ metadata.gz: 8337f31b68a5463669e828e49b6482c7ee93cc38f3c7416038d1ee9264540345
4
+ data.tar.gz: 36f086e0dc41039beb2e14d39e46373f4b51a32dc1d4b3cfc00583cada972f5f
5
5
  SHA512:
6
- metadata.gz: f5e485d9bc90f44c2c2cd2adc9075ae16bade59fedb04a195af295e5728429541975284e18a4e79642524c3fee89c3c584b44aaa7f7ef7e8e73b55263a64bc89
7
- data.tar.gz: abec2ed11bb6f40e0ac3069edad30d69be18e9de59ba3a1eebe7cc5fc9a2fa994bc9333a735ad6fbba0062426f64e3561c9268d67a7d32e2a4f2868dd1875354
6
+ metadata.gz: 5552441af2fea26b5f1a019de25fc53e0d469a158967659e64087781209c3e931bf687c16cff126efc36124abdaa960ff188a7b3fced7e2062c2e7e1387f88f9
7
+ data.tar.gz: 68bfab78dab387b562ef3a01574b533d5910230e756e6cf1a8bef4f3c3c337b81cd75718746e71dbf6ab3e0b0bf8fd2e8e3a2bec587d2b3565997386634b87c1
data/exe/alm CHANGED
@@ -39,14 +39,13 @@ unless options[:file]
39
39
  end
40
40
 
41
41
  file = options[:file]
42
- file_path = File.expand_path(file, Dir.pwd)
43
-
44
- appimg_dir = File.expand_path(file, "#{Dir.home}/.local/appimage")
42
+ appimg_dir = File.join(Dir.home, ".local", "appimage")
43
+ file_path = File.join(appimg_dir, File.basename(file))
45
44
 
46
45
  case options[:action]
47
46
  when :add
48
47
  # ADD VERIFICATION PROCESS
49
- avp_verification = Verifications::AVP.process(appimg_dir)
48
+ avp_verification = Verifications::AVP.process(file)
50
49
  case avp_verification
51
50
  when :AVP_PPR
52
51
  Modules::ADD.start([file])
@@ -64,7 +63,7 @@ when :remove
64
63
  when :RVP_PPR
65
64
  Modules::REMOVE.start([file])
66
65
  when :RVP_NEXIST
67
- puts "\e[31m[ERROR | RVP_NEXIST ] - alm: File #{file} not found in the AppImage directory\e[0m"
66
+ puts "\e[31m[ERROR | RVP_NEXIST ] - alm: File #{file} not found in #{appimg_dir}\e[0m"
68
67
  else
69
68
  puts "\e[31m[ERROR | RVP_FAILED ] - alm: RVP Verification failed unexpectedly\e[0m"
70
69
  end
data/lib/alm/modules.rb CHANGED
@@ -31,7 +31,7 @@ module Modules
31
31
  end
32
32
 
33
33
  if system("mv '#{file_path}' '#{appimg_path}'")
34
- puts ">>> - alm: #{file_arg} successfully added to #{appimg_path}\n"
34
+ puts ">>> - alm: #{file_arg} successfully added to #{appimg_path} \n\n"
35
35
  else
36
36
  puts "\e[31m[ERROR | RUNTIME_ERROR] - alm: Failed to move #{file_arg} to #{appimg_path}\e[0m"
37
37
  end
@@ -53,7 +53,7 @@ module Modules
53
53
 
54
54
  begin
55
55
  File.delete(file_path)
56
- puts "\n>>> - alm: #{File.basename(file_arg)} successfully removed from #{appimg_path}\n"
56
+ puts "\n>>> - alm: #{File.basename(file_arg)} successfully removed from #{appimg_path} \n\n"
57
57
  rescue Errno::EACCES
58
58
  puts "\e[31m[ERROR | PERMISSION] - alm: Permission denied while trying to delete #{file_path}\e[0m"
59
59
  rescue => e
@@ -3,6 +3,7 @@ module Verifications
3
3
  class AVP
4
4
  def self.process(path)
5
5
  return :AVP_NEXIST unless File.exist?(path)
6
+ return :AVP_NAPPIMG unless File.file?(path)
6
7
  return :AVP_NAPPIMG unless path.downcase.end_with?(".appimage") || File.read(path, 4)&.start_with?("\x7FELF")
7
8
  :AVP_PPR # Add Verification Process (Positive Process Return)
8
9
  end
data/lib/alm/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alm
4
- VERSION = "0.3.7"
4
+ VERSION = "0.4.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - mvguest