search for: chomps

Displaying 20 results from an estimated 346 matches for "chomps".

Did you mean: chomp
2006 Jan 23
3
date.to_s trimming
...n I convert a datetime to a string, it prints out something like this Jan 20 12:00:00 EST 2006 I want to trim off the last twelve characters, i.e. :00 EST 2006 I tried to do it like so: @date = @meeting.date.to_s.chomp.chomp.chomp.chomp.chomp.chomp.chomp.chomp.chomp.chomp.chomp.chomp but the chomps seem to do nothing. I''d love to use regex, but I don''t know which method to use to remove text from a string, or to just sever the end of it (I tried unshift). -- Posted via http://www.ruby-forum.com/.
2017 Jul 21
3
[PATCH] common/mlstdutils: Add chomp function to remove \n from end of strings.
This is like the Perl chomp function, it removes a single \n from the end of a string if present, else leaves the string alone. I believe I found the only (two) places where such a function is used, but there may be a few more lurking. --- common/mlstdutils/std_utils.ml | 7 +++++++ common/mlstdutils/std_utils.mli | 2 ++ common/mlstdutils/std_utils_tests.ml | 10 ++++++++++
2010 Dec 26
6
variables created with generate() function have a newline when used in a template
I have this in nodes.pp $puppetmaster_fqdn = generate("/usr/bin/facter","fqdn") and this in a template http://<%= puppetmaster_fqdn %>:8080 When puppet runs, this is the result: http://puppet.home :8080 Anybody any clue to whats causing this? I''ve tried -%> -- You received this message because you are subscribed to the Google Groups "Puppet
2010 Mar 25
2
NoMethodError (private method `chomp' called for nil:NilClas
Hi: I am using Rails 2.3.5 with paperclip, mime-types and uploadify. So far the application is working in development environment. But when I switched to the production environment, it produced the following error. NoMethodError (private method `chomp'' called for nil:NilClass): /usr/lib/ruby/gems/1.8/gems/mime-types-1.16/lib/mime/types.rb:665:in `type_for''
2010 Dec 30
4
perl code to remove newlines
Given an HTML file which looks like this: --------- begin snippet --------- <HTML ><HEAD ><TITLE >We've Lied to You&#8230;</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="Maximum RPM" HREF="index.html"><LINK REL="UP"
2003 Aug 25
2
SetVar on sample.call
Hi all!! Does anyone have a short example or even better - a working AGI script that uses "GET VARIABLE' from a /var/spool/asterisk/outgoing call that uses "SetVar"? Here's what I've tried with no luck so far: sample.call ================= Channel: SIP/1000 MaxRetries: 2 RetryTime: 60 WaitTime: 30 Application: Agi Data: playTasks.agi Callerid: Nightly Processor
2009 Nov 04
11
Sending Mails with mutations ä,ü,ö
Hi everyone I am sending mails with rails in German. The Problem is that the German letters ä,ü,ö are arriving correctly at the receiver. When the subject contains the word Für the receiver gets Für Does anybody knows this issue? Thanks in advance. Adam -- Posted via http://www.ruby-forum.com/.
2012 Mar 16
3
custom fact issue
Would anyone please assist me on this one? This fact seems to work, but it doesn''t return when called directly via facter --puppet noop, but the resulting facts end up in the reports. I''m at wits end with this. Thanks! <snip> utc_hour = Facter::Util::Resolution.exec(%q</bin/date -u +"%H">).chomp Facter.add(:noop) do setcode do
2011 Aug 25
5
custom fact regex problem
Hi guys I have a custom fact envt, it was working fine but now I have to make some changes in it; puppet client''s hostname is of the type 1234qa-abc-de.local where 1234 can be any thing of any length.My custom fact should contain qa, ie I want to check in the first part(before the first -) of the hostname if there exists a pattern/word qa and if it exists then my custom fact for envt
2005 Dec 29
6
How do I open and read/write to a file?
I need to process some text files quickly. I''ve not been able to find the answer in the archive. The Ruby Standard Library site times out. Can someone tell me where to find info on how to: 1. Get a list of filenames in a directory. 2. How to open a file. 3. How to read it a line at a time. -- Thanks in advance for the help, -Larry "Work, work, work...there is no satisfactory
2004 Jan 14
0
Réf. : samba 2.2.8a PDC LDAP CTRL+ALT+DEL password change, not chaning Unix password
Hi, Why you sp?cifie : smb passwd file = /etc/samba/smbpasswd pam password change = Yes If you use LDAP ? It's the interaction between LDAP and these parameter which cause the problem. ----------------------------------- St?phane PURNELLE stephane.purnelle@corman.be Service Informatique Corman S.A. Tel : 00 32 087/342467
2004 Sep 10
0
FLAC to mp3 batch converter?
Here's an extremely quick-and-dirty Perl script I wrote to do just that. This script depends on having the MP3::Info Perl module for ID3 tag information, and assumes that you have lame set up. It will take a flac file (or a wildcard) as an argument, decompress that file, and encode it as a fairly high-bitrate VBR MP3. I want to stress that this is just something I wrote for my needs, so
2010 Dec 30
2
remove newlines / perl /concise example
Thanks for the previous tips and suggestions. Here's a more concise example: Input file: <aaaa> <bbbb> <cccc> <dddd> I want everything on one line, i.e., remove all newlines. Like so: <aaaa><bbbb><cccc><dddd> Simple perl code: #!/usr/bin/env perl # Remove newlines from a file in two ways: # (1) Just "chomp" them; # (2) Replace
2008 May 25
2
storing data from a txt file in ruby?
Hello Im trying to write a a ruby program that takes a list of books title ,author so on and i can read in the file with no problem but im trying to store the list into either a array or hash so i ca say run different methods view, delete ect.. anyhelp would be great this is what i have so far IO.foreach("book_list.txt") do |line| catalog=line.chomp.split(",")
2002 Apr 22
3
no output from perl script
Here is the first Perl script I've tried to write to run rsync. It seems to work, but I don't see the progress like I should. I apologize if it's sloppy, I should add that it's not only the first perl script I've written for rsync, it's the first perl script I've written at all. ___________________________ #!/usr/bin/perl -w print " This command will DELETE
2008 Nov 20
1
Stopping bdrb from another process gets the process killed
Hi, I''ve been having some issues integrating bdrb on a cruisecontrolrb server It''s related to the way we stop the bdrb server. The thing is, right now when we stop the process we are killing the parent of the group of the process. This is ok if you''re running script/backgroundrb stop directly from the console, but if I''m running this from another process,
2009 May 29
0
[PATCH server] last patch to implement remote freeipa
This completes the last few requirements for remote ipa, one thing to note is that when using remote ipa we do not allow the choice of creating a local dns server on the ovirt node. --- installer/bin/ovirt-installer | 22 ++++++++++++++++--- .../modules/ovirt/files/ovirt-remote-ipa.conf | 1 + installer/modules/ovirt/manifests/freeipa.pp | 10 +++++++++
2010 Mar 23
2
Samba / Lucid / Windows 7 problem
Hi list I'm running a Samba PDC on Ubuntu Lucid (3.4.7) and am unable to join Windows 7 machines to the domain. I have applied the registry changes described at http://wiki.samba.org/index.php/Windows7 Windows XP machines can join with no problems. Samba log: stty: standard input: Inappropriate ioctl for device Use of uninitialized value $pass in chomp at /usr/sbin/smbldap-useradd line
2006 May 29
3
File.size() on Uploaded Images Fail
I am checking the file size of an uploaded file and storing it in a filesize column. It will work just fine when the user uploads any files other than images (jpg,png,gif). Word, Excel, Powerpoint, .zip and more all work fine. This is my model asset.rb that handles the file upload. def newfile=(newfile_field) self.filename = base_part_of(newfile_field.original_filename) self.filetype
2007 Jun 06
2
lookup in CSV recipe
I await Luke''s node settings implementation with interest. At the moment however, I have this sort of ugliness: $site = $hostname ? { fred => "opsera", barney => "bedrock", default => "unknown site", ... } So I''ve knocked up this little function to use CSV files instead. Now I can just do: $site =