diff options
author | shadoi <shadoi@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-02-17 02:07:32 +0000 |
---|---|---|
committer | shadoi <shadoi@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-02-17 02:07:32 +0000 |
commit | 65599af2f4b48cd78e651f3a807f27283bf038fc (patch) | |
tree | 1391b5e6118bdf3bfa07396cd3659db2d690872d /lib/puppet/rails | |
parent | beb78735f5ec4e7932c36dc7fdf9907ac770a938 (diff) | |
download | puppet-65599af2f4b48cd78e651f3a807f27283bf038fc.tar.gz puppet-65599af2f4b48cd78e651f3a807f27283bf038fc.tar.xz puppet-65599af2f4b48cd78e651f3a807f27283bf038fc.zip |
Re-add the files
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2210 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/rails')
-rw-r--r-- | lib/puppet/rails/fact_name.rb | 7 | ||||
-rw-r--r-- | lib/puppet/rails/fact_value.rb | 5 | ||||
-rw-r--r-- | lib/puppet/rails/param_name.rb | 28 | ||||
-rw-r--r-- | lib/puppet/rails/param_value.rb | 5 |
4 files changed, 45 insertions, 0 deletions
diff --git a/lib/puppet/rails/fact_name.rb b/lib/puppet/rails/fact_name.rb new file mode 100644 index 000000000..e6e7c5d03 --- /dev/null +++ b/lib/puppet/rails/fact_name.rb @@ -0,0 +1,7 @@ +require 'puppet/rails/fact_value' + +class Puppet::Rails::FactName < ActiveRecord::Base + has_many :fact_values, :dependent => :destroy +end + +# $Id: fact_name.rb 1952 2006-12-19 05:47:57Z luke $ diff --git a/lib/puppet/rails/fact_value.rb b/lib/puppet/rails/fact_value.rb new file mode 100644 index 000000000..a800ad597 --- /dev/null +++ b/lib/puppet/rails/fact_value.rb @@ -0,0 +1,5 @@ +class Puppet::Rails::FactValue < ActiveRecord::Base + belongs_to :fact_name +end + +# $Id: fact_value.rb 1952 2006-12-19 05:47:57Z luke $ diff --git a/lib/puppet/rails/param_name.rb b/lib/puppet/rails/param_name.rb new file mode 100644 index 000000000..1b708cacb --- /dev/null +++ b/lib/puppet/rails/param_name.rb @@ -0,0 +1,28 @@ +require 'puppet/util/rails/collection_merger' +require 'puppet/rails/param_value' + +class Puppet::Rails::ParamName < ActiveRecord::Base + include Puppet::Util::CollectionMerger + has_many :param_values, :dependent => :destroy +# def <<(value) +# ParamValue.with_scope(:create => {:value => value}) +# end +## end + belongs_to :resource + + def to_resourceparam(source) + hash = {} + hash[:name] = self.name.to_sym + hash[:source] = source + hash[:value] = self.param_values.find(:all).collect { |v| v.value } + if hash[:value].length == 1 + hash[:value] = hash[:value].shift + end + if hash[:value].empty? + hash[:value] = nil + end + Puppet::Parser::Resource::Param.new hash + end +end + +# $Id$ diff --git a/lib/puppet/rails/param_value.rb b/lib/puppet/rails/param_value.rb new file mode 100644 index 000000000..d988559af --- /dev/null +++ b/lib/puppet/rails/param_value.rb @@ -0,0 +1,5 @@ +class Puppet::Rails::ParamValue < ActiveRecord::Base + belongs_to :param_name +end + +# $Id$ |