marshmallow 0.1.2 → 0.1.3
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 +4 -4
- data/CHANGELOG.md +7 -1
- data/README.md +37 -30
- data/lib/marshmallow.rb +127 -22
- data/lib/marshmallow/version.rb +1 -1
- data/marshmallow-0.1.2.gem +0 -0
- data/marshmallow.gemspec +1 -0
- metadata +17 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 447943b36336a0873bdd0d15e51b47f488a96086
         | 
| 4 | 
            +
              data.tar.gz: 8ff2a3653d9d37386721bbc25a4f0a69e5d46070
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 216e331f1ac32456b5e3d6925ca05248cd0abfe85265303abe97ccb124399df0689f14ca535ad935a31edf59247924f44e1054a23ad81cc0d950199eac89fa97
         | 
| 7 | 
            +
              data.tar.gz: 19af7d5042c1285aef5a77aeec6cf9511e764a9ae0cfae0a33fd5d9b9669327c1c6b528d67c3e85dd8369b9413410063dec2aa19ceaece0496b4d77b4d56593f
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -1,3 +1,10 @@ | |
| 1 | 
            +
            ## 0.1.3 (2.8.2017)
         | 
| 2 | 
            +
            - added options for: profiles_installed, profiles_all, domain_check, firewall_check, fastuserswitch_check, loginwindow_check, user_launchagents, userlaunchdaemons, and options
         | 
| 3 | 
            +
            - fixed code for ardinfo's to use 'CFPropertyList'
         | 
| 4 | 
            +
            - renamed sys_launchagents to system_launchagents
         | 
| 5 | 
            +
            - renamed sys_launchdaemons to system_launchdaemons
         | 
| 6 | 
            +
             | 
| 7 | 
            +
             | 
| 1 8 | 
             
            ## 0.1.2 (1.27.2017)
         | 
| 2 9 | 
             
            Fixed gem build errors
         | 
| 3 10 |  | 
| @@ -7,4 +14,3 @@ Fixed and updates some issues in README and gemspec files | |
| 7 14 | 
             
            ## 0.1.0 (1.26.2017)
         | 
| 8 15 | 
             
            Original Build
         | 
| 9 16 |  | 
| 10 | 
            -
            - first commit
         | 
    
        data/README.md
    CHANGED
    
    | @@ -5,40 +5,47 @@ Tested on macOS 10.12. | |
| 5 5 |  | 
| 6 6 | 
             
            ## Usage
         | 
| 7 7 | 
             
            To see a list of availible options for Marshmallow, require 'Marshmallow' in file then type:  
         | 
| 8 | 
            -
            `puts Marshmallow. | 
| 8 | 
            +
            `puts Marshmallow.options`
         | 
| 9 9 |  | 
| 10 10 |  | 
| 11 11 | 
             
            output should be similar to this:
         | 
| 12 12 | 
             
            ***
         | 
| 13 | 
            -
             | 
| 14 | 
            -
             | 
| 15 | 
            -
             | 
| 16 | 
            -
             | 
| 17 | 
            -
             | 
| 18 | 
            -
             | 
| 19 | 
            -
             | 
| 20 | 
            -
             | 
| 21 | 
            -
             | 
| 22 | 
            -
             | 
| 23 | 
            -
             | 
| 24 | 
            -
             | 
| 25 | 
            -
             | 
| 26 | 
            -
             | 
| 27 | 
            -
             | 
| 28 | 
            -
             | 
| 29 | 
            -
             | 
| 30 | 
            -
             | 
| 31 | 
            -
             | 
| 32 | 
            -
             | 
| 33 | 
            -
             | 
| 34 | 
            -
             | 
| 35 | 
            -
             | 
| 36 | 
            -
             | 
| 37 | 
            -
             | 
| 38 | 
            -
             | 
| 39 | 
            -
             | 
| 40 | 
            -
             | 
| 41 | 
            -
             | 
| 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
         | 
| 42 49 |  | 
| 43 50 | 
             
            ##  Examples:
         | 
| 44 51 |  | 
    
        data/lib/marshmallow.rb
    CHANGED
    
    | @@ -1,5 +1,7 @@ | |
| 1 1 | 
             
            #require "marshmallow/version"
         | 
| 2 2 |  | 
| 3 | 
            +
            require "CFPropertyList"
         | 
| 4 | 
            +
             | 
| 3 5 | 
             
            module Marshmallow
         | 
| 4 6 | 
             
              def self.users
         | 
| 5 7 | 
             
            		users=[]
         | 
| @@ -13,10 +15,6 @@ module Marshmallow | |
| 13 15 | 
             
            		return users
         | 
| 14 16 | 
             
            	end
         | 
| 15 17 |  | 
| 16 | 
            -
            	def self.users_number
         | 
| 17 | 
            -
            		return Flock.users.length
         | 
| 18 | 
            -
            	end
         | 
| 19 | 
            -
             | 
| 20 18 | 
             
            	def self.listoflocaladmins
         | 
| 21 19 | 
             
            		listoflocaladmins =`dscacheutil -q group -a name admin`.split(":")
         | 
| 22 20 | 
             
            		listoflocaladmins=listoflocaladmins[4].strip.split(" ")
         | 
| @@ -33,10 +31,6 @@ module Marshmallow | |
| 33 31 | 
             
            		return apps
         | 
| 34 32 | 
             
            	end
         | 
| 35 33 |  | 
| 36 | 
            -
            	def self.apps_number
         | 
| 37 | 
            -
            		return Flock.apps_installed.length
         | 
| 38 | 
            -
            	end
         | 
| 39 | 
            -
             | 
| 40 34 | 
             
            	def self.serial
         | 
| 41 35 | 
             
            		serial = `system_profiler SPHardwareDataType | awk '/Serial/'`.split(":")
         | 
| 42 36 | 
             
            		serial = serial[1].strip!
         | 
| @@ -143,7 +137,7 @@ module Marshmallow | |
| 143 137 | 
             
            		return name[1].strip
         | 
| 144 138 | 
             
            	end
         | 
| 145 139 |  | 
| 146 | 
            -
            	def self. | 
| 140 | 
            +
            	def self.system_launchagents
         | 
| 147 141 | 
             
            		launchagents=[]
         | 
| 148 142 | 
             
            		for x in Dir.entries("/Library/LaunchAgents")
         | 
| 149 143 | 
             
            			if !x.start_with?(".")
         | 
| @@ -153,7 +147,7 @@ module Marshmallow | |
| 153 147 | 
             
            		return launchagents
         | 
| 154 148 | 
             
            	end
         | 
| 155 149 |  | 
| 156 | 
            -
            	def self. | 
| 150 | 
            +
            	def self.system_launchdaemons
         | 
| 157 151 | 
             
            		launchdaemons=[]
         | 
| 158 152 | 
             
            		for x in Dir.entries("/Library/LaunchDaemons")
         | 
| 159 153 | 
             
            			if !x.start_with?(".")
         | 
| @@ -163,37 +157,148 @@ module Marshmallow | |
| 163 157 | 
             
            		return launchdaemons
         | 
| 164 158 | 
             
            	end
         | 
| 165 159 |  | 
| 160 | 
            +
            	def self.user_launchagents
         | 
| 161 | 
            +
            		users.each do |username|
         | 
| 162 | 
            +
            			if File.exist?("/Users/#{username}/Library/LaunchAgents")
         | 
| 163 | 
            +
            				launchAgents=[]
         | 
| 164 | 
            +
            				for x in Dir.entries("/Users/#{username}/Library/LaunchAgents")
         | 
| 165 | 
            +
            					if !x.start_with?(".")
         | 
| 166 | 
            +
            						launchAgents.push(x)
         | 
| 167 | 
            +
            					end
         | 
| 168 | 
            +
            				end
         | 
| 169 | 
            +
            				puts"#{username} LaunchAgents: "
         | 
| 170 | 
            +
            				puts launchAgents
         | 
| 171 | 
            +
            				puts "\n"
         | 
| 172 | 
            +
            			else
         | 
| 173 | 
            +
            				puts "#{username} LaunchAgents does not exist "
         | 
| 174 | 
            +
            				puts "\n"
         | 
| 175 | 
            +
            			end
         | 
| 176 | 
            +
            		end
         | 
| 177 | 
            +
            	end
         | 
| 178 | 
            +
             | 
| 179 | 
            +
            	def self.user_launchdaemons
         | 
| 180 | 
            +
            		users.each do |username|
         | 
| 181 | 
            +
            			if File.exist?("/Users/#{username}/Library/LaunchDaemons")
         | 
| 182 | 
            +
            				launchdaemons=[]
         | 
| 183 | 
            +
            				for file in Dir.entries("/Users/#{username}/Library/LaunchDaemons")
         | 
| 184 | 
            +
            					if !file.start_with?(".")
         | 
| 185 | 
            +
            						launchdaemons.push(file)
         | 
| 186 | 
            +
            					end
         | 
| 187 | 
            +
            				end
         | 
| 188 | 
            +
            				puts "#{username} LaunchDaemons: "
         | 
| 189 | 
            +
            				puts launchdaemons
         | 
| 190 | 
            +
            				puts "\n"
         | 
| 191 | 
            +
            			else
         | 
| 192 | 
            +
            				puts "#{username} LaunchDaemons: does not exist"
         | 
| 193 | 
            +
            				puts "\n"
         | 
| 194 | 
            +
            			end
         | 
| 195 | 
            +
            		end
         | 
| 196 | 
            +
            	end
         | 
| 197 | 
            +
             | 
| 166 198 | 
             
            	def self.ard_info1
         | 
| 167 | 
            -
            		 | 
| 168 | 
            -
             | 
| 169 | 
            -
            		 | 
| 199 | 
            +
            		plist = CFPropertyList::List.new(:file => "/Library/Preferences/com.apple.RemoteDesktop.plist")
         | 
| 200 | 
            +
            		results = CFPropertyList.native_types(plist.value)
         | 
| 201 | 
            +
            		if results['Text1'].empty?
         | 
| 170 202 | 
             
            			return "null"
         | 
| 203 | 
            +
            		else
         | 
| 204 | 
            +
            			return results['Text1']
         | 
| 171 205 | 
             
            		end
         | 
| 172 206 | 
             
            	end
         | 
| 173 207 |  | 
| 174 208 | 
             
            	def self.ard_info2
         | 
| 175 | 
            -
            		 | 
| 176 | 
            -
             | 
| 177 | 
            -
            		 | 
| 209 | 
            +
            		plist = CFPropertyList::List.new(:file => "/Library/Preferences/com.apple.RemoteDesktop.plist")
         | 
| 210 | 
            +
            		results = CFPropertyList.native_types(plist.value)
         | 
| 211 | 
            +
            		if results['Text2'].empty?
         | 
| 178 212 | 
             
            			return "null"
         | 
| 213 | 
            +
            		else
         | 
| 214 | 
            +
            			return results['Text2']
         | 
| 179 215 | 
             
            		end
         | 
| 180 216 | 
             
            	end
         | 
| 181 217 |  | 
| 182 218 | 
             
            	def self.ard_info3
         | 
| 183 | 
            -
            		 | 
| 184 | 
            -
             | 
| 185 | 
            -
            		 | 
| 219 | 
            +
            		plist = CFPropertyList::List.new(:file => "/Library/Preferences/com.apple.RemoteDesktop.plist")
         | 
| 220 | 
            +
            		results = CFPropertyList.native_types(plist.value)
         | 
| 221 | 
            +
            		if results['Text3'].empty?
         | 
| 186 222 | 
             
            			return "null"
         | 
| 223 | 
            +
            		else
         | 
| 224 | 
            +
            			return results['Text3']
         | 
| 187 225 | 
             
            		end
         | 
| 188 226 | 
             
            	end
         | 
| 189 227 |  | 
| 190 228 | 
             
            	def self.ard_info4
         | 
| 191 | 
            -
            		 | 
| 192 | 
            -
             | 
| 193 | 
            -
            		 | 
| 229 | 
            +
            		plist = CFPropertyList::List.new(:file => "/Library/Preferences/com.apple.RemoteDesktop.plist")
         | 
| 230 | 
            +
            		results = CFPropertyList.native_types(plist.value)
         | 
| 231 | 
            +
            		if results['Text4'].empty?
         | 
| 194 232 | 
             
            			return "null"
         | 
| 233 | 
            +
            		else
         | 
| 234 | 
            +
            			return results['Text4']
         | 
| 235 | 
            +
            		end
         | 
| 236 | 
            +
            	end
         | 
| 237 | 
            +
             | 
| 238 | 
            +
            	def self.profiles_installed
         | 
| 239 | 
            +
            		if `profiles -C`.chomp == "There are no configuration profiles installed in the system domain"
         | 
| 240 | 
            +
            			puts "No profiles installed"
         | 
| 241 | 
            +
            		else
         | 
| 242 | 
            +
            			profiles=`profiles -C`.lines
         | 
| 243 | 
            +
             | 
| 244 | 
            +
            			installed=[]
         | 
| 245 | 
            +
            			for x in profiles
         | 
| 246 | 
            +
            			 	installed.push(x.split.last)
         | 
| 247 | 
            +
            			end
         | 
| 248 | 
            +
            			installed.delete("installed")
         | 
| 249 | 
            +
            			puts installed
         | 
| 250 | 
            +
            		end
         | 
| 251 | 
            +
            	end
         | 
| 252 | 
            +
             | 
| 253 | 
            +
            	def self.profiles_all
         | 
| 254 | 
            +
            		profiles="profiles -C"
         | 
| 255 | 
            +
            		system(profiles)
         | 
| 256 | 
            +
            	end
         | 
| 257 | 
            +
             | 
| 258 | 
            +
            	def self.domain_check
         | 
| 259 | 
            +
            		if `dsconfigad -show`.empty?
         | 
| 260 | 
            +
            			puts "no Domain Settings"
         | 
| 261 | 
            +
            		else
         | 
| 262 | 
            +
            			domain_check=`dsconfigad -show | grep "Active Directory Domain"`.split("=")
         | 
| 263 | 
            +
            			domain_check = domain_check[1].strip!
         | 
| 264 | 
            +
            			return domain_check
         | 
| 265 | 
            +
            		end
         | 
| 266 | 
            +
            	end
         | 
| 267 | 
            +
             | 
| 268 | 
            +
            	def self.firewall_check
         | 
| 269 | 
            +
            		plist = CFPropertyList::List.new(:file => "/Library/Preferences/com.apple.alf.plist")
         | 
| 270 | 
            +
            		firewall = CFPropertyList.native_types(plist.value)
         | 
| 271 | 
            +
            		if firewall['globalstate'] == 1
         | 
| 272 | 
            +
            			return "on"
         | 
| 273 | 
            +
            		else
         | 
| 274 | 
            +
            			return "off"
         | 
| 275 | 
            +
            		end
         | 
| 276 | 
            +
            	end
         | 
| 277 | 
            +
             | 
| 278 | 
            +
            	def self.fastuserswitch_check
         | 
| 279 | 
            +
            		plist = CFPropertyList::List.new(:file => "/Library/Preferences/.GlobalPreferences.plist")
         | 
| 280 | 
            +
            		results = CFPropertyList.native_types(plist.value)
         | 
| 281 | 
            +
            		if results['MultipleSessionEnabled'] == true
         | 
| 282 | 
            +
            			return "enabled"
         | 
| 283 | 
            +
            		else
         | 
| 284 | 
            +
            			return "disabled"
         | 
| 285 | 
            +
            		end
         | 
| 286 | 
            +
            	end
         | 
| 287 | 
            +
             | 
| 288 | 
            +
            	def self.loginwindow_check
         | 
| 289 | 
            +
            		plist = CFPropertyList::List.new(:file => "/Library/Preferences/com.apple.loginwindow.plist")
         | 
| 290 | 
            +
            		results = CFPropertyList.native_types(plist.value)
         | 
| 291 | 
            +
            		if results['SHOWFULLNAME'] == true
         | 
| 292 | 
            +
            			return "Name and Password"
         | 
| 293 | 
            +
            		else
         | 
| 294 | 
            +
            			return "List of users"
         | 
| 195 295 | 
             
            		end
         | 
| 196 296 | 
             
            	end
         | 
| 297 | 
            +
             | 
| 298 | 
            +
            	def self.options
         | 
| 299 | 
            +
            		return Marshmallow.methods(false).sort
         | 
| 300 | 
            +
            	end
         | 
| 197 301 | 
             
            end
         | 
| 198 302 |  | 
| 199 303 |  | 
| 304 | 
            +
             | 
    
        data/lib/marshmallow/version.rb
    CHANGED
    
    
| Binary file | 
    
        data/marshmallow.gemspec
    CHANGED
    
    | @@ -33,4 +33,5 @@ Gem::Specification.new do |spec| | |
| 33 33 | 
             
              spec.add_development_dependency "bundler", "~> 1.13"
         | 
| 34 34 | 
             
              spec.add_development_dependency "rake", "~> 10.0"
         | 
| 35 35 | 
             
              spec.add_development_dependency "minitest", "~> 5.0"
         | 
| 36 | 
            +
              spec.add_development_dependency "CFPropertyList", ">= 2.0.0"
         | 
| 36 37 | 
             
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: marshmallow
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.1. | 
| 4 | 
            +
              version: 0.1.3
         | 
| 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- | 
| 11 | 
            +
            date: 2017-02-08 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         | 
| @@ -52,6 +52,20 @@ dependencies: | |
| 52 52 | 
             
                - - ~>
         | 
| 53 53 | 
             
                  - !ruby/object:Gem::Version
         | 
| 54 54 | 
             
                    version: '5.0'
         | 
| 55 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 56 | 
            +
              name: CFPropertyList
         | 
| 57 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 58 | 
            +
                requirements:
         | 
| 59 | 
            +
                - - '>='
         | 
| 60 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 61 | 
            +
                    version: 2.0.0
         | 
| 62 | 
            +
              type: :development
         | 
| 63 | 
            +
              prerelease: false
         | 
| 64 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 65 | 
            +
                requirements:
         | 
| 66 | 
            +
                - - '>='
         | 
| 67 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 68 | 
            +
                    version: 2.0.0
         | 
| 55 69 | 
             
            description: 
         | 
| 56 70 | 
             
            email:
         | 
| 57 71 | 
             
            - scottnl@kenyon.edu
         | 
| @@ -70,6 +84,7 @@ files: | |
| 70 84 | 
             
            - bin/setup
         | 
| 71 85 | 
             
            - lib/marshmallow.rb
         | 
| 72 86 | 
             
            - lib/marshmallow/version.rb
         | 
| 87 | 
            +
            - marshmallow-0.1.2.gem
         | 
| 73 88 | 
             
            - marshmallow.gemspec
         | 
| 74 89 | 
             
            homepage: https://github.com/nlscott/marshmallow
         | 
| 75 90 | 
             
            licenses:
         |