summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Bellone <jbellone@bloomberg.net>2016-06-13 12:46:13 -0400
committerJohn Bellone <jbellone@bloomberg.net>2016-06-13 12:46:13 -0400
commita593b988f5696907b7dbe728853af805d68e45ec (patch)
tree196d19485b642071227f5ce3daa542f3e12abce2
parent17e5c748a70e5388a542a1cff5f86b630c5a629e (diff)
downloadohai-a593b988f5696907b7dbe728853af805d68e45ec.tar.gz
Add a simple plugin to get the local timezone.
-rw-r--r--lib/ohai/plugins/timezone.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/ohai/plugins/timezone.rb b/lib/ohai/plugins/timezone.rb
new file mode 100644
index 00000000..64c001c2
--- /dev/null
+++ b/lib/ohai/plugins/timezone.rb
@@ -0,0 +1,23 @@
+#
+# Author:: John Bellone (<jbellone@bloomberg.net>)
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+Ohai.plugin(:Timezone) do
+ provides 'timezone'
+
+ collect_data do
+ timezone = Time.now.getlocal.zone
+ end
+end