Use the new #node_properties method, convery from .rvmrc
authorMahlon E. Smith <mahlon@martini.nu>
Wed, 30 Aug 2017 13:55:02 -0700
changeset 7 4548e58c8c66
parent 6 71578fe8e9ec
child 8 e0b7c95a154f
Use the new #node_properties method, convery from .rvmrc
.ruby-gemset
.ruby-version
.rvmrc
Rakefile
lib/arborist/monitor/snmp.rb
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.ruby-gemset	Wed Aug 30 13:55:02 2017 -0700
@@ -0,0 +1,1 @@
+arborist-snmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.ruby-version	Wed Aug 30 13:55:02 2017 -0700
@@ -0,0 +1,1 @@
+2.4
--- a/.rvmrc	Wed Sep 07 15:25:50 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-
-environment_id="ruby-2.3@arborist-snmp"
-
-if [[ -d "${rvm_path:-$HOME/.rvm}/environments"
-  && -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
-then
-  \. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
-  for __hook in "${rvm_path:-$HOME/.rvm}/hooks/after_use"*
-  do
-    if [[ -f "${__hook}" && -x "${__hook}" && -s "${__hook}" ]]
-    then \. "${__hook}" || true
-    fi
-  done
-  unset __hook
-  if (( ${rvm_use_flag:=1} >= 2 )) # display only when forced
-  then
-    if [[ $- == *i* ]] # check for interactive shells
-    then printf "%b" "Using: $(tput setaf 2 2>/dev/null)$GEM_HOME$(tput sgr0 2>/dev/null)\n" # show the user the ruby and gemset they are using in green
-    else printf "%b" "Using: $GEM_HOME\n" # don't use colors in non-interactive shells
-    fi
-  fi
-else
-  # If the environment file has not yet been created, use the RVM CLI to select.
-  rvm --create  "$environment_id" || {
-    echo "Failed to create RVM environment '${environment_id}'."
-    return 1
-  }
-fi
--- a/Rakefile	Wed Sep 07 15:25:50 2016 -0700
+++ b/Rakefile	Wed Aug 30 13:55:02 2017 -0700
@@ -44,7 +44,7 @@
 	EOF
 	s.required_ruby_version = '>= 2'
 
-	s.add_dependency 'arborist', "~> 1.0"
+	s.add_dependency 'arborist', "~> 0.1"
 	s.add_dependency 'snmp', "~> 1.2"
 end
 
--- a/lib/arborist/monitor/snmp.rb	Wed Sep 07 15:25:50 2016 -0700
+++ b/lib/arborist/monitor/snmp.rb	Wed Aug 30 13:55:02 2017 -0700
@@ -23,7 +23,7 @@
 	log_to :arborist
 
 	# The version of this library.
-	VERSION = '0.3.0'
+	VERSION = '0.3.1'
 
 	# Global defaults for instances of this monitor
 	#
@@ -34,6 +34,14 @@
 		port:      161
 	}
 
+	# Always request the node addresses and any config.
+	USED_PROPERTIES = [ :addresses, :config ].freeze
+
+	### Return the properties used by this monitor.
+	def self::node_properties
+		return USED_PROPERTIES
+	end
+
 
 	### Connect to the SNMP daemon and yield.
 	###