marshmallow 0.1.3 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 447943b36336a0873bdd0d15e51b47f488a96086
4
- data.tar.gz: 8ff2a3653d9d37386721bbc25a4f0a69e5d46070
2
+ SHA256:
3
+ metadata.gz: 6ebcc0fbca49e9713ca78444c0de0b35ac7c0da04afc0112973e0dcd6aa1e69e
4
+ data.tar.gz: 1da698b641df229ba31d03c4666f681d5ddddb09b4c5dc16738abebe84ba8cda
5
5
  SHA512:
6
- metadata.gz: 216e331f1ac32456b5e3d6925ca05248cd0abfe85265303abe97ccb124399df0689f14ca535ad935a31edf59247924f44e1054a23ad81cc0d950199eac89fa97
7
- data.tar.gz: 19af7d5042c1285aef5a77aeec6cf9511e764a9ae0cfae0a33fd5d9b9669327c1c6b528d67c3e85dd8369b9413410063dec2aa19ceaece0496b4d77b4d56593f
6
+ metadata.gz: 4945f5f300e9a07035bfaa8ad20359e5f12d986babb3e5fdd22ff16414fc7aa998201ee58a66103858fbf2ebdb9c3c7f198f907e7d5dba734221a529bec8ae43
7
+ data.tar.gz: 76bdf5adff76f2ba7419a0ee04ab5ce489f01012122be7dd6ed782a0dc1d580870b76f7fef21aabc53976c68ad1ae39e1f2564f467c09f3f1c7cdd71685685ce
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 0.3.0 (6.28.2023)
2
+ - updated outdated dependencies fixing CVE-2016-7954
3
+
4
+ ## 0.2.0 (5.20.2019)
5
+ - fixed issues with the return values for memory, smc, and uuid
6
+ - provided better error messages if no values existed in ard info fields
7
+
1
8
  ## 0.1.3 (2.8.2017)
2
9
  - added options for: profiles_installed, profiles_all, domain_check, firewall_check, fastuserswitch_check, loginwindow_check, user_launchagents, userlaunchdaemons, and options
3
10
  - fixed code for ardinfo's to use 'CFPropertyList'
data/README.md CHANGED
@@ -1,57 +1,58 @@
1
1
  # Marshmallow
2
- This gem is a collction of macOS specfic facts and actions that may be helpful for macadmins.
3
- Tested on macOS 10.12.
2
+ > **Note:** This has not been fully tested since macOS 10.14 but is working as of Ventura 13.4.1
3
+
4
+ This gem is a collection of macOS specific facts and actions that may be helpful for macadmins.
4
5
 
5
6
 
6
7
  ## Usage
7
- To see a list of availible options for Marshmallow, require 'Marshmallow' in file then type:
8
+ To see a list of available options for Marshmallow, require 'Marshmallow' in the file then type:
8
9
  `puts Marshmallow.options`
9
10
 
10
11
 
11
- output should be similar to this:
12
+ the output should be similar to this:
12
13
  ***
13
- apps_installed
14
- ard_info1
15
- ard_info2
16
- ard_info3
17
- ard_info4
18
- boot_rom
19
- boot_volume
20
- build
21
- computer_name
22
- cores
23
- domain_check
24
- fastuserswitch_check
25
- firewall_check
26
- free_space
27
- graphics
28
- hd_size
29
- listoflocaladmins
30
- loginwindow_check
31
- memory
32
- model
33
- model_id
34
- options
35
- os_version
36
- processor_name
37
- processor_number
38
- processor_speed
39
- profiles_all
40
- profiles_installed
41
- serial
42
- smc
43
- system_launchagents
44
- system_launchdaemons
45
- user_launchagents
46
- user_launchdaemons
47
- users
48
- uuid
14
+ - apps_installed
15
+ - ard_info1
16
+ - ard_info2
17
+ - ard_info3
18
+ - ard_info4
19
+ - boot_rom
20
+ - boot_volume
21
+ - build
22
+ - computer_name
23
+ - cores
24
+ - domain_check
25
+ - fastuserswitch_check
26
+ - firewall_check
27
+ - free_space
28
+ - graphics
29
+ - hd_size
30
+ - listoflocaladmins
31
+ - loginwindow_check
32
+ - memory
33
+ - model
34
+ - model_id
35
+ - options
36
+ - os_version
37
+ - processor_name
38
+ - processor_number
39
+ - processor_speed
40
+ - profiles_all
41
+ - profiles_installed
42
+ - serial
43
+ - smc
44
+ - system_launchagents
45
+ - system_launchdaemons
46
+ - user_launchagents
47
+ - user_launchdaemons
48
+ - users
49
+ - uuid
49
50
 
50
51
  ## Examples:
51
52
 
52
- To print serial number: `puts Marshmallow.serial`
53
+ To print the serial number: `puts Marshmallow.serial`
53
54
 
54
- To print computer name: `puts Marshmallow.computer_name`
55
+ To print the computer name: `puts Marshmallow.computer_name`
55
56
 
56
57
  ## License
57
58
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -1,3 +1,3 @@
1
1
  module Marshmallow
2
- VERSION = "0.1.3"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/marshmallow.rb CHANGED
@@ -83,8 +83,9 @@ module Marshmallow
83
83
 
84
84
  def self.memory
85
85
  memory = `system_profiler SPHardwareDataType`.split("\n")
86
- memory = memory[12].split(":")
87
- return memory[1].strip
86
+ memory = memory.grep(/Memory:/).join(":").strip.split(":")
87
+ memory = memory[1].strip
88
+ return memory
88
89
  end
89
90
 
90
91
  def self.boot_rom
@@ -95,16 +96,18 @@ module Marshmallow
95
96
 
96
97
  def self.smc
97
98
  smc = `system_profiler SPHardwareDataType`.split("\n")
98
- smc = smc[14].split(":")
99
- return smc[1].strip
99
+ smc = smc.grep(/SMC/).join(":").strip.split(":")
100
+ smc = smc[1].strip
101
+ return smc
100
102
  end
101
103
 
102
104
  def self.uuid
103
105
  uuid = `system_profiler SPHardwareDataType`.split("\n")
104
- uuid = uuid[16].split(":")
105
- return uuid[1].strip
106
- end
107
-
106
+ results = uuid.grep(/UUID:/).join(":").strip.split(":")
107
+ results = results[1].strip
108
+ return results
109
+ end
110
+
108
111
  def self.graphics
109
112
  graphics = `system_profiler SPDisplaysDataType`.split("\n")
110
113
  graphics = graphics[2].split(":")
@@ -198,41 +201,41 @@ module Marshmallow
198
201
  def self.ard_info1
199
202
  plist = CFPropertyList::List.new(:file => "/Library/Preferences/com.apple.RemoteDesktop.plist")
200
203
  results = CFPropertyList.native_types(plist.value)
201
- if results['Text1'].empty?
202
- return "null"
203
- else
204
- return results['Text1']
205
- end
204
+ if results.key?('Text1')
205
+ return results['Text1']
206
+ else
207
+ return "Error: plist does not contain key for 'Text1'"
208
+ end
206
209
  end
207
210
 
208
211
  def self.ard_info2
209
212
  plist = CFPropertyList::List.new(:file => "/Library/Preferences/com.apple.RemoteDesktop.plist")
210
213
  results = CFPropertyList.native_types(plist.value)
211
- if results['Text2'].empty?
212
- return "null"
213
- else
214
- return results['Text2']
215
- end
214
+ if results.key?('Text2')
215
+ return results['Text2']
216
+ else
217
+ return "Error: plist does not contain key for 'Text2'"
218
+ end
216
219
  end
217
220
 
218
221
  def self.ard_info3
219
222
  plist = CFPropertyList::List.new(:file => "/Library/Preferences/com.apple.RemoteDesktop.plist")
220
223
  results = CFPropertyList.native_types(plist.value)
221
- if results['Text3'].empty?
222
- return "null"
223
- else
224
- return results['Text3']
225
- end
224
+ if results.key?('Text3')
225
+ return results['Text3']
226
+ else
227
+ return "Error: plist does not contain key for 'Text3'"
228
+ end
226
229
  end
227
230
 
228
231
  def self.ard_info4
229
232
  plist = CFPropertyList::List.new(:file => "/Library/Preferences/com.apple.RemoteDesktop.plist")
230
233
  results = CFPropertyList.native_types(plist.value)
231
- if results['Text4'].empty?
232
- return "null"
233
- else
234
- return results['Text4']
235
- end
234
+ if results.key?('Text4')
235
+ return results['Text4']
236
+ else
237
+ return "Error: plist does not contain key for 'Text4'"
238
+ end
236
239
  end
237
240
 
238
241
  def self.profiles_installed
data/marshmallow.gemspec CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
7
7
  spec.name = "marshmallow"
8
8
  spec.version = Marshmallow::VERSION
9
9
  spec.authors = ["Nic Scott"]
10
- spec.email = ["scottnl@kenyon.edu"]
10
+ spec.email = ["nls.inbox@gmail.com"]
11
11
  spec.summary = %q{A collection of macOS facts and useful information for MacAdmins}
12
12
  spec.homepage = "https://github.com/nlscott/marshmallow"
13
13
  spec.license = "MIT"
@@ -30,8 +30,9 @@ Gem::Specification.new do |spec|
30
30
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
31
  spec.require_paths = ["lib"]
32
32
 
33
- spec.add_development_dependency "bundler", "~> 1.13"
34
- spec.add_development_dependency "rake", "~> 10.0"
35
- spec.add_development_dependency "minitest", "~> 5.0"
36
- spec.add_development_dependency "CFPropertyList", ">= 2.0.0"
33
+ spec.add_development_dependency "bundler", ">= 2.2.33"
34
+ spec.add_development_dependency "rake", ">= 11.2.2"
35
+ spec.add_development_dependency "minitest", "5.18.1"
36
+ spec.add_development_dependency "CFPropertyList", ">= 3.0.6"
37
+
37
38
  end
metadata CHANGED
@@ -1,80 +1,80 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marshmallow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nic Scott
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-08 00:00:00.000000000 Z
11
+ date: 2023-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.13'
19
+ version: 2.2.33
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.13'
26
+ version: 2.2.33
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: 11.2.2
34
34
  type: :development
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: '10.0'
40
+ version: 11.2.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: minitest
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: '5.0'
47
+ version: 5.18.1
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: '5.0'
54
+ version: 5.18.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: CFPropertyList
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 2.0.0
61
+ version: 3.0.6
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: 2.0.0
68
+ version: 3.0.6
69
69
  description:
70
70
  email:
71
- - scottnl@kenyon.edu
71
+ - nls.inbox@gmail.com
72
72
  executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
- - .gitignore
77
- - .travis.yml
76
+ - ".gitignore"
77
+ - ".travis.yml"
78
78
  - CHANGELOG.md
79
79
  - Gemfile
80
80
  - LICENSE.txt
@@ -84,7 +84,6 @@ files:
84
84
  - bin/setup
85
85
  - lib/marshmallow.rb
86
86
  - lib/marshmallow/version.rb
87
- - marshmallow-0.1.2.gem
88
87
  - marshmallow.gemspec
89
88
  homepage: https://github.com/nlscott/marshmallow
90
89
  licenses:
@@ -96,17 +95,16 @@ require_paths:
96
95
  - lib
97
96
  required_ruby_version: !ruby/object:Gem::Requirement
98
97
  requirements:
99
- - - '>='
98
+ - - ">="
100
99
  - !ruby/object:Gem::Version
101
100
  version: '0'
102
101
  required_rubygems_version: !ruby/object:Gem::Requirement
103
102
  requirements:
104
- - - '>='
103
+ - - ">="
105
104
  - !ruby/object:Gem::Version
106
105
  version: '0'
107
106
  requirements: []
108
- rubyforge_project:
109
- rubygems_version: 2.0.14.1
107
+ rubygems_version: 3.0.3.1
110
108
  signing_key:
111
109
  specification_version: 4
112
110
  summary: A collection of macOS facts and useful information for MacAdmins
Binary file