[Puppet-dev] [PATCH/puppet 1/1] Fixed #6818 - Changed named_scope to scope to remove Rails 3 deprecation

2011-03-23 Thread James Turnbull
Added alias method for ActiveRecord versions before 3.0 Signed-off-by: James Turnbull --- Local-branch: tickets/master/6818 lib/puppet/rails/inventory_node.rb |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/puppet/rails/inventory_node.rb b/lib/puppet/rails/in

Re: [Puppet-dev]

2011-03-23 Thread Thomas S Hatch
On Wed, Mar 23, 2011 at 2:19 PM, Matt Robinson wrote: > These changes get our tests running under Ruby 1.9 instead of just giving > syntax errors and bombing out early. More importantly, the changes don't > break any tests (or appear to break any functionality) when running Puppet > under Ruby 1

[Puppet-dev]

2011-03-23 Thread Matt Robinson
These changes get our tests running under Ruby 1.9 instead of just giving syntax errors and bombing out early. More importantly, the changes don't break any tests (or appear to break any functionality) when running Puppet under Ruby 1.8. When running under Ruby 1.9 there are currently 2003 fai

[Puppet-dev] [PATCH/puppet 6/6] (#6820) Fix File class lookup in the file type for Ruby 1.9

2011-03-23 Thread Matt Robinson
Was getting the following error when we simply called File.dirname err: Got an uncaught exception of type NoMethodError: undefined method `dirname' for Puppet::Type::File:Class The constant lookup has changed in Ruby 1.9 to look at local scopes first, so we need to make it clearer that File is th

[Puppet-dev] [PATCH/puppet 2/6] (#6820) Fix invalid next that should be a return

2011-03-23 Thread Matt Robinson
The old code under ruby 1.8.7 if it was hit would result in: unexpected next (LocalJumpError) In Ruby 1.9 it doesn't even give you the chance to run the code since you get: compile error (SyntaxError) The code isn't tested so the intented behavior isn't clear, but in context this looks like the

[Puppet-dev] [PATCH/puppet 1/6] (#2782) Fix constant_defined?

2011-03-23 Thread Matt Robinson
Thanks to Al Hoang for the bit of code for choosing how to use constant_defined? depending on the version of Ruby. In Ruby 1.9 const_defined? has a new parameter for inherit (from Ruby docs) mod.const_defined?(sym, inherit=true) -> true or false Returns true if a constant with the given name is d

[Puppet-dev] [PATCH/puppet 4/6] (#6820) Fix Invalid multibyte character

2011-03-23 Thread Matt Robinson
puppet/spec/unit/network/authstore_spec.rb:89: invalid multibyte char (US-ASCII) puppet/spec/unit/network/authstore_spec.rb:89: syntax error, unexpected $end, expecting ']' " 2001::1234:::C1C0:ABCD:0876  0", ^ There was a non-break

[Puppet-dev] [PATCH/puppet 5/6] (#6820) Fix nagios parser to use proper hash syntax for Ruby 1.9

2011-03-23 Thread Matt Robinson
Reviewed-by: Jacob Helwig Signed-off-by: Matt Robinson --- Local-branch: ticket/next/6820_ruby19_fixes lib/puppet/external/nagios/parser.rb |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib/puppet/external/nagios/parser.rb b/lib/puppet/external/nagios/parser.rb index

[Puppet-dev] [PATCH/puppet 3/6] (#6820) Fix RDOC parser to work with Ruby 1.9

2011-03-23 Thread Matt Robinson
Lovely RDOC changed where it put everything in Ruby 1.9. Now there's some conditional logic depending on Ruby version to determine which files to requrie. The tests still fail, but at least they run now. Reviewed-by: Jacob Helwig Signed-off-by: Matt Robinson --- Local-branch: ticket/next/6820_r

[Puppet-dev] [PATCH/puppet 1/1] Fixed #6818 - Changed named_scope to scope to remove Rails 3 deprecation

2011-03-23 Thread James Turnbull
Signed-off-by: James Turnbull --- Local-branch: tickets/master/6818 lib/puppet/rails/inventory_node.rb |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/puppet/rails/inventory_node.rb b/lib/puppet/rails/inventory_node.rb index 52f8621..49468f4 100644 --- a/lib/pupp

Re: [Puppet-dev] Is it possible to call a custom function from a custom type.

2011-03-23 Thread Trevor Vaughan
I'll need to work out a cleaner example. Thanks for the help though. Perhaps re-working the steps will show me what I'm doing incorrectly. Trevor On Tue, Mar 22, 2011 at 10:45 PM, Luke Kanies wrote: > Is your code published?  You should be using a util class loaded by > both the function and th