summaryrefslogtreecommitdiffstats
path: root/lib/puppet/util/rails
Commit message (Collapse)AuthorAgeFilesLines
* Code smell: Two space indentationMarkus Roberts2010-07-093-88/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaced 106806 occurances of ^( +)(.*$) with The ruby community almost universally (i.e. everyone but Luke, Markus, and the other eleven people who learned ruby in the 1900s) uses two-space indentation. 3 Examples: The code: end # Tell getopt which arguments are valid def test_get_getopt_args element = Setting.new :name => "foo", :desc => "anything", :settings => Puppet::Util::Settings.new assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args") becomes: end # Tell getopt which arguments are valid def test_get_getopt_args element = Setting.new :name => "foo", :desc => "anything", :settings => Puppet::Util::Settings.new assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args") The code: assert_equal(str, val) assert_instance_of(Float, result) end # Now test it with a passed object becomes: assert_equal(str, val) assert_instance_of(Float, result) end # Now test it with a passed object The code: end assert_nothing_raised do klass[:Yay] = "boo" klass["Cool"] = :yayness end becomes: end assert_nothing_raised do klass[:Yay] = "boo" klass["Cool"] = :yayness end
* Fixing most of the broken tests in test/Luke Kanies2010-02-171-1/+1
| | | | | | | | This involves a bit of refactoring in the rest of the code to make it all work, but most of the changes are fixing or removing old tests. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Initial implementation of a "cache accumulator" behavior.Ethan Rowe2009-04-221-0/+65
| | | | | | | | | | | | | Mix Puppet::Util::CacheAccumulator into an ActiveRecord-like class, and then for any attribute in that class on which you are likely to call find_or_create_by_*, specify: accumulates :foo and instead of :find_or_create_by_foo use :accumulate_by_foo. The class will cache known results keyed by values of :foo. Do an initial bulk-lookup: class.accumulate_by_foo('foo1', 'foo2', 'foo3', 'foo4')
* Changing rails value serialization to deal with booleansLuke Kanies2009-04-221-3/+17
| | | | | | | | The database was automatically converting booleans to strings, and value comparison was not working correctly as a result. Signed-off-by: Luke Kanies <luke@madstop.com>
* Refactoring the Rails integrationLuke Kanies2009-04-221-39/+0
| | | | | | | | This moves all code from the Parser class into the ActiveRecord classes, and gets rid of 'ar_hash_merge'. Signed-off-by: Luke Kanies <luke@madstop.com>
* Rails serialization module to help serialize/unserialize some Puppet ObjectsBrice Figureau2009-02-061-0/+18
| | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Removing the Id tags from all of the filesLuke Kanies2007-10-031-1/+0
|
* Major rework of the rails feature. Changed the relationship between ballman2007-06-121-0/+15
| | | | | | | | | | | | | | | | host and facts (now many-to-many with fact_name through fact_values). Also changed the relationship between resource and params (similarly many-to-many with param_names through param_values). Added the resource_tags and puppet_tags. The latter has the tag names and the former is the man-to-many link with resources. There is a little clean up left but the schema is in order. Also a test for the tags stuff is required. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2565 980ebf18-57e1-0310-9a29-db15c13687c0
* Refactoring some of the rails code. The speed is now pretty good, but the ↵luke2007-03-241-13/+30
| | | | | | tagging stuff does not seem to be working and is certainly working very ineffficiently. Blake says he is going to take a look at that. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2350 980ebf18-57e1-0310-9a29-db15c13687c0
* All rails *and* language tests now pass, with the exception of a ↵luke2006-12-191-0/+25
language/resource test that passes by itself but fails when run as part of the whole suite. Also, I added deletion where appropriate, so that unspecified resources, parameters, and facts are now deleted, as one would expect. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1951 980ebf18-57e1-0310-9a29-db15c13687c0