summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorluke <luke@1f5c1d6a-bddf-0310-8f58-fc49e503516a>2006-05-23 20:56:36 +0000
committerluke <luke@1f5c1d6a-bddf-0310-8f58-fc49e503516a>2006-05-23 20:56:36 +0000
commitb208f47bfad865ca7d7a4df11fecd4b361d59259 (patch)
tree7bfce22bed84b30bfb5aa4746948eb43c8ab4983
parent999929e8d2e805dad0e7f2ecb70d17d60cd485de (diff)
downloadfacter-b208f47bfad865ca7d7a4df11fecd4b361d59259.tar.gz
facter-b208f47bfad865ca7d7a4df11fecd4b361d59259.tar.xz
facter-b208f47bfad865ca7d7a4df11fecd4b361d59259.zip
fixing small bug that only occurs with gems
git-svn-id: http://reductivelabs.com/svn/facter/trunk@109 1f5c1d6a-bddf-0310-8f58-fc49e503516a
-rw-r--r--CHANGELOG4
-rw-r--r--conf/redhat/facter.spec4
-rw-r--r--lib/facter.rb4
-rw-r--r--tests/tc_simple.rb19
4 files changed, 27 insertions, 4 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 0a58efb..6636a20 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,7 @@
+1.2.1:
+ Fixed a "bug" that occurs if there's a file named "facter" in your
+ ruby search path (as opposed to directory).
+
1.2.0:
Added RubyVersion, FacterVersion, and PuppetVersion facts.
diff --git a/conf/redhat/facter.spec b/conf/redhat/facter.spec
index 173efa3..9e48621 100644
--- a/conf/redhat/facter.spec
+++ b/conf/redhat/facter.spec
@@ -2,8 +2,8 @@
Summary: Ruby module for collecting simple facts about a host operating system
Name: facter
-Version: 1.1.4
-Release: 2%{?dist}
+Version: 1.2.0
+Release: 1%{?dist}
License: GPL
Group: System Environment/Base
URL: http://reductivelabs.com/projects/facter
diff --git a/lib/facter.rb b/lib/facter.rb
index 5111ddd..3337218 100644
--- a/lib/facter.rb
+++ b/lib/facter.rb
@@ -11,7 +11,7 @@ class Facter
include Comparable
include Enumerable
-FACTERVERSION = '1.2.0'
+FACTERVERSION = '1.1.4'
# = Facter 1.0
# Functions as a hash of 'facts' you might care about about your
# system, such as mac address, IP address, Video card, etc.
@@ -859,7 +859,7 @@ FACTERVERSION = '1.2.0'
# Now see if we can find any other facts
$:.each do |dir|
fdir = File.join(dir, "facter")
- if FileTest.exists?(fdir)
+ if FileTest.exists?(fdir) and FileTest.directory?(fdir)
Dir.chdir(fdir) do
Dir.glob("*.rb").each do |file|
if file == "local.rb"
diff --git a/tests/tc_simple.rb b/tests/tc_simple.rb
index 1e1ac6c..8f1819d 100644
--- a/tests/tc_simple.rb
+++ b/tests/tc_simple.rb
@@ -415,6 +415,25 @@ end
assert(hash.include?("localfact"), "Did not load fact at startup")
assert_equal(val, hash["localfact"], "Did not get correct value")
end
+
+ def test_stupidchdirring
+ dir = "/tmp/localloading"
+ @tmpfiles << dir
+ Dir.mkdir(dir)
+ $: << dir
+
+ # Make our file
+ val = "localness"
+ File.open(File.join(dir, "facter"), "w") do |file|
+ file.puts %{
+some random stuff
+}
+ end
+
+ assert_nothing_raised do
+ Facter.load
+ end
+ end
end
# $Id$