From 024ccf5b9a30977e9eee4ecf1d91eaf64f44a509 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Sat, 25 Apr 2009 19:55:05 +0100 Subject: Adding a "json" feature We have to guarantee that the Rails code is loaded before the JSON code, because Rails includes its own incompatible JSON support. --- lib/puppet/feature/base.rb | 1 - lib/puppet/feature/json.rb | 2 ++ lib/puppet/feature/rails.rb | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 lib/puppet/feature/json.rb (limited to 'lib/puppet') diff --git a/lib/puppet/feature/base.rb b/lib/puppet/feature/base.rb index 747468f74..c3fb9a2f3 100644 --- a/lib/puppet/feature/base.rb +++ b/lib/puppet/feature/base.rb @@ -28,4 +28,3 @@ Puppet.features.add(:augeas, :libs => ["augeas"]) # We have RRD available Puppet.features.add(:rrd, :libs => ["RRDtool"]) - diff --git a/lib/puppet/feature/json.rb b/lib/puppet/feature/json.rb new file mode 100644 index 000000000..1f3845c2a --- /dev/null +++ b/lib/puppet/feature/json.rb @@ -0,0 +1,2 @@ +# This is here so it autoloads correctly. +Puppet.features.rails? diff --git a/lib/puppet/feature/rails.rb b/lib/puppet/feature/rails.rb index 533f9ce7c..597b0288c 100644 --- a/lib/puppet/feature/rails.rb +++ b/lib/puppet/feature/rails.rb @@ -35,3 +35,7 @@ Puppet.features.add(:rails) do end end +# We have JSON available +# This is stupid - Rails breaks json compatibility if we load json before +# rails, therefore we load rails and then json. Dumb, mother-dumb. +Puppet.features.add(:json, :libs => ["json"]) -- cgit