Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
mathematical operation
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Antidot SAS  
View profile  
 More options Jun 20 2012, 5:06 am
From: Antidot SAS <antidot...@gmail.com>
Date: Wed, 20 Jun 2012 11:06:35 +0200
Local: Wed, Jun 20 2012 5:06 am
Subject: mathematical operation

HI everyone,

I am trying to use the ruby modulo function but without any success, here
is the template:
--
$tt=regsubst($::hostname,'.*front(\d+).*','\1')
notice("$tt")
notice(inline_template("<% tt.to_i.modulo(60) %>"))
--
Here is the result:
notice: Scope(Class[main]): 04
notice: Scope(Class[main]):
notice: Finished catalog run in 0.22 seconds

Any idea?

Regards,
JM


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Hendrik Jäger  
View profile  
 More options Jun 20 2012, 5:24 am
From: Hendrik Jäger <puppet-us...@henk.geekmail.org>
Date: Wed, 20 Jun 2012 11:24:26 +0200
Local: Wed, Jun 20 2012 5:24 am
Subject: Re: [Puppet Users] mathematical operation

Hi,

- notice(inline_template("<% tt.to_i.modulo(60) %>"))
+ notice(inline_template("<%= tt.to_i.modulo(60) %>"))

Best regards

henk

  signature.asc
< 1K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Antidot SAS  
View profile  
 More options Jun 20 2012, 6:23 am
From: Antidot SAS <antidot...@gmail.com>
Date: Wed, 20 Jun 2012 12:23:27 +0200
Local: Wed, Jun 20 2012 6:23 am
Subject: Re: [Puppet Users] mathematical operation

Thx, it helps :D

On Wed, Jun 20, 2012 at 11:24 AM, Hendrik Jäger <


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ilya Dmitrichenko  
View profile  
 More options Jun 24 2012, 2:22 pm
From: Ilya Dmitrichenko <errordevelo...@gmail.com>
Date: Sun, 24 Jun 2012 19:22:28 +0100
Local: Sun, Jun 24 2012 2:22 pm
Subject: Re: [Puppet Users] mathematical operation

On Jun 20, 2012 10:06 AM, "Antidot SAS" <antidot...@gmail.com> wrote:

> HI everyone,

> I am trying to use the ruby modulo function but without any success, here
is the template:
> --
> $tt=regsubst($::hostname,'.*front(\d+).*','\1')
> notice("$tt")
> notice(inline_template("<% tt.to_i.modulo(60) %>"))

try `"<%= tt.to_i.modulo(60).to_s %>"`, well `to_s` is just for being
explicit really and you can omit it, but what's important is the `<%=`
instead of `%<`. See a Ruby template tutorial for more details :)

"Puppet Users" group.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to

puppet-users+unsubscribe@googlegroups.com.
> For more options, visit this group at

http://groups.google.com/group/puppet-users?hl=en.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »