diff options
author | James Turnbull <james@lovedthanlost.net> | 2008-05-17 00:32:34 +1000 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2008-05-17 00:32:34 +1000 |
commit | e02b0b386ed84384daeb2da0879bf215cfcfa2ef (patch) | |
tree | 36cdd5c3cc6143ce6faccb87ba6461bf5f481a29 /lib/facter/rubysitedir.rb | |
parent | 9c91a6d3fb9da933d8e1ba4149ee1b5587e6b007 (diff) | |
download | facter-e02b0b386ed84384daeb2da0879bf215cfcfa2ef.tar.gz facter-e02b0b386ed84384daeb2da0879bf215cfcfa2ef.tar.xz facter-e02b0b386ed84384daeb2da0879bf215cfcfa2ef.zip |
Updated version. Moved most facts to seperate files.
Diffstat (limited to 'lib/facter/rubysitedir.rb')
-rw-r--r-- | lib/facter/rubysitedir.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/facter/rubysitedir.rb b/lib/facter/rubysitedir.rb new file mode 100644 index 0000000..c205322 --- /dev/null +++ b/lib/facter/rubysitedir.rb @@ -0,0 +1,8 @@ +Facter.add :rubysitedir do + setcode do + version = RUBY_VERSION.to_s.sub(/\.\d+$/, '') + $:.find do |dir| + dir =~ /#{File.join("site_ruby", version)}$/ + end + end +end |