idrac 0.1.8 → 0.1.9

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: 5a94bc677f6ec7117c98a52a48462be78e1433d445a630369353d86ece9e6c39
4
- data.tar.gz: f6453f23e3ddd78332adaca17132446baa94953e9346d7644c3c66903106b013
3
+ metadata.gz: ad668d80e3824d65d43da614767040617ee8e606c613105aa56f6949d8fb5e00
4
+ data.tar.gz: 62d065f745bc38db6e508bccb79ebecefceb92dfadad409c89b6086b23ba2ca0
5
5
  SHA512:
6
- metadata.gz: 916af1bff71865d7cca2e195a47d2725911aebeda2f408dbc05a769d0b874365bdd9d29d15b31de50d46cd4c1e9ffd0a0790e04e08d2c13fb2a0aea8b6f7f655
7
- data.tar.gz: c7367f3b45afee92a4d9fd54e0f4a4091f54378797e93ed3d73e5143127a764a9e53ab1388ef3c5a212334ac20ab68eba1aaecd73e56b68bb51dc85509d28c58
6
+ metadata.gz: e4e6b60bb9a25dad0e85de333297df4cd7708591dc86b79afae0beacad4f016ee6d70395279d57635eeada4eaf604dbfdcf091fe195becf6242275067017cfa3
7
+ data.tar.gz: ce9a0577803fced25c6f89c77d451ac9776f9ce15bd840f48184a3ea4f0b810151ff6e8863468b5cac5f0e4401534033314839fa0cd35075202fd08488de2168
data/bin/idrac CHANGED
@@ -75,9 +75,12 @@ module IDRAC
75
75
  puts " #{fw[:name]}: #{fw[:version]} (#{fw[:updateable] ? 'Updateable' : 'Not Updateable'})"
76
76
  end
77
77
 
78
+ # Default catalog location is now ~/.idrac/Catalog.xml
79
+ default_catalog = File.expand_path("~/.idrac/Catalog.xml")
80
+
78
81
  # Check for updates if catalog is available
79
- if options[:catalog] || File.exist?(File.join(Dir.pwd, "Catalog.xml"))
80
- catalog_path = options[:catalog] || File.join(Dir.pwd, "Catalog.xml")
82
+ if options[:catalog] || File.exist?(default_catalog)
83
+ catalog_path = options[:catalog] || default_catalog
81
84
  puts "\nChecking for updates using catalog: #{catalog_path}"
82
85
 
83
86
  updates = firmware.check_updates(catalog_path)
@@ -110,9 +113,12 @@ module IDRAC
110
113
  begin
111
114
  catalog_path = options[:catalog]
112
115
 
113
- # If no catalog specified, check if one exists in current directory
114
- if catalog_path.nil? && File.exist?(File.join(Dir.pwd, "Catalog.xml"))
115
- catalog_path = File.join(Dir.pwd, "Catalog.xml")
116
+ # Default catalog location is now ~/.idrac/Catalog.xml
117
+ default_catalog = File.expand_path("~/.idrac/Catalog.xml")
118
+
119
+ # If no catalog specified, check if one exists in the default location
120
+ if catalog_path.nil? && File.exist?(default_catalog)
121
+ catalog_path = default_catalog
116
122
  end
117
123
 
118
124
  # If still no catalog, download it
@@ -37,7 +37,8 @@ module IDRAC
37
37
  end
38
38
 
39
39
  def download_catalog(output_dir = nil)
40
- output_dir ||= Dir.pwd
40
+ # Use ~/.idrac as the default directory
41
+ output_dir ||= File.expand_path("~/.idrac")
41
42
  FileUtils.mkdir_p(output_dir) unless Dir.exist?(output_dir)
42
43
 
43
44
  catalog_gz_path = File.join(output_dir, "Catalog.xml.gz")
data/lib/idrac/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IDRAC
4
- VERSION = "0.1.8"
4
+ VERSION = "0.1.9"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: idrac
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Siegel