On Fri, Mar 5, 2010 at 10:31 PM, Dick Davies <rasput...@hellooperator.net> wrote: > On Thu, Mar 4, 2010 at 5:43 PM, Peter Meier <peter.me...@immerda.ch> wrote: >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >>>> Well, it workes in erb test, but not when puppet runs: >>>> >>>> undefined method `start_with?' for.... via puppet >>>> >>>> erb -x -T '-' test.erb | ruby -c says Syntax OK.... >>> >>> I thought 'start_with" was a ruby 1.9 thing only? And "starts_with" is >>> a Rails-ism ? >> >> exactly. > > No, don't think so: > > ~ $ irb >>> RUBY_VERSION > => "1.8.7" >>> "foo".start_with?("fo") > => true >>> ^D~ $
Interesting. Looks like it appeared in 1.8.7 as well. $ irb >> RUBY_VERSION => "1.8.6" >> "foo".start_with?("fo") NoMethodError: undefined method `start_with?' for "foo":String > > [ this is on Snow Leopard, mind, ] I'm not sure how much of Ruby you can > use in ERB templates, but I'd have thought if a language feature works > on irb, it'll work in templates run on that machine. > > Templates are expanded on the puppetmaster, right? yes. > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-us...@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > > -- nigel -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.