search for: each_lin

Displaying 20 results from an estimated 25 matches for "each_lin".

Did you mean: each_line
2007 May 15
2
openURI not capturing pages from the same rails app
...m openURI does not work for capturing pages from the same rails application. Here is the code: class CdCreatorController < ApplicationController require ''open-uri'' def generate lines = [] file = open("http://127.0.0.1:3001/cd_creator/product/1"){ |f| f.each_line {|line| lines << line}} @obj = lines end def product @product = Product.find(params[:id]) {|f| f.each_line {|line| p line} } end end When I call method generate I get an TimeOut Error (execution expired). But this method works just fine when I''m capturi...
2008 Jan 28
9
Nested matchers
We''re encountering a failure with Mocha 0.5.6. We had this expectation: game_version.expects(:attributes=).with(:game_file => kind_of(GameFile), :game_id => @game.id) This expectation was passing with 0.5.5, but fails with 0.5.6. I added this test to parameter_matcher_acceptance_test.rb, which passes in 0.5.5 and fails in 0.5.6 def test_should_match_nested_parameters
2006 Jun 16
2
News posting system without a database
...post and have the view post each file in a specific directory as HTML. The newspost will contain: 1. A title. 2. A date. 3. The body. In the text file, I want line 1 to be the title, line 2 to be the date, and everything from line 3 on down to the be the body. What method (so far I know File.each_line lets me read each line) would I use to select a specific line in the text file? Thanks, David -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060616/ab6e290b/attachment.html
2006 Dec 21
10
versioning of win32 versus ruby gems
I know we already mentioned this before on the list but I couldn''t find it in the archives. Is there a way to differentiate the versions for ruby/mswin32 so that I could run a command like: # sudo gem install mongrel --source=http://mongrel.rubyforge.org/releases/ --include-dependencies --version 1.0 and have it not prompt me like this: Select which gem to install for your platform
2006 Apr 05
1
send_file VS. send_data (performance)
...----- send_file "test.png", :type => ''image/png'', :disposition => ''inline'' ------------------------------- #2------------------------------------------ content = '''' File.open("test.png", "rb") do |f| f.each_line { |line| content += line } end send_data content, :type => ''image/png'', :disposition => ''inline'' --------------------------------------------------------------------------- Are there any other methods? Can method #2 get faster by reading the entire file...
2009 Apr 21
1
[PATCH server] add dns setup clarification in installer
...ler | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/installer/bin/ovirt-installer b/installer/bin/ovirt-installer index 2d88886..862c5e2 100755 --- a/installer/bin/ovirt-installer +++ b/installer/bin/ovirt-installer @@ -183,6 +183,8 @@ File.open('/etc/resolv.conf').each_line{ |line| line = line.chomp puts line if line =~ /nameserver/ } + at cli.say("<%= color('\nIf your above dns servers contain the A records for your management server select \"y\" +otherwise select \"n\" and a dns server will be configured during the install...
2006 Aug 02
3
using migration--newbie
...I''m using a migratio to import data into a database but nothing is being happens. I''m importing strings from a parsed file. this is what I have: controller: class UploadController < ApplicationController def create table = { } params[:localized_string][:data].each_line do |line| if line =~ /^\s* " (.*?) " \s* = \s* " (.*?) "/x table[$1] = $2 end end table.each do |key, val| LocalizedString.save(:key =>key, :value=> val) end end end model: class LocalizedString < ActiveRecord::...
2009 Sep 12
11
Installing a lot of packages
How can I install a lot (more than 800) of APT packages using an easy way in puppet? I mean, using some file.txt where I put there the packages I want to install and my package resource get the list . Is it possible? Or do I have to put all packages in the package resource? regards, Israel. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed
2007 Jun 06
2
lookup in CSV recipe
...n(:lookup_csv, :type => :rvalue) do |args| filename = args[0] key = args[1] column = args[2] File.open(filename) do |file| # find which column we are after colnum = file.gets.chomp.split(/,/).index(column) return nil if colnum == nil # find row file.each_line { |line| row = line.chomp.split(/,/) if (row[0] == key) return row[colnum] end } end # no match found return nil end end Adrian
2010 Jan 20
2
Using ruby-1.9.x with Puppet 0.25.x
I read somewhere recently about problems with Puppet and Ruby 1.9. I''m wondering if this is still an issue? Thanks. -- You received this message because you are subscribed to the Google Groups "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
2006 Mar 12
2
Find all the methods on a object in an irb session?
How can I find all the methods on an object from withing irb? Thanks, Joe
2009 Nov 24
0
xrcise now works
...to outputter.rb did work for me. It looks like adding a routine to string should also work but it didn''t for me. Thanks for your help. -Philip ===== from RubyForge ========== Date: 2009-11-18 00:25 Sender: Konstantin Shabanov After changing ''each'' method to ''each_line'' in outputter.rb on lines 39 and 46 xrcise code generation seems to be working. ================================ From: Mario Steele <mario@ruby-im.net> To: General discussion of wxRuby <wxruby-users@rubyforge.org> Date: Mon, 23 Nov 2009 06:24:32 -0500 Subject: Re: [wxruby-use...
2011 Oct 24
0
Announce: Puppet 2.6.12 Available [security update]
...to Rubies < 1.8.7 5f44c23 More 1.8.5 compatibility fixes. ef1b960 Better 1.8.5 compatible implementation of `lines`. 246e875 (#2848) Config options require ''_'', not ''-''. 3bdeb3a Ruby 1.8.5 compatibility changes in tests and code. 6866d4b Add `lines` alias for `each_line` in Ruby 1.8.5. 2f9ec3c s/not_to/should_not/ for older versions of RSpec 2. 56320ea (#2848) Eliminate redundant `master_dns_alt_names`. de19861 (#2848) Remove the legacy SSLCertificates code cf008a6 (#2848) Rework the xmlrpc CA handler to use the modern SSL code 32be180 (#2848) Remove unused xmlrp...
2006 Jul 21
1
Newbie Question about Ruby on rails---cant upload data
Hi everybody, Ruby on Rails is my first programming lenguage...it looks to me like i''m missing the big picture. I''m trying to upload a file into a database. In my app. my user needs to select a file and upload it...however I only want him to upload certain information from that file. I have written code to parse only string tables from that file. For example, the table
2009 May 29
0
[PATCH server] last patch to implement remote freeipa
..._for_answer("Enter the hostname of the FreeIPA server", :regex => IP_OR_FQDN) else @@ -196,14 +195,25 @@ ldap_dn_temp.each do |i| # DNS Configuration +ns_count = 0 +ns_list = {} @cli.say( "\nThe following DNS servers were found:") File.open('/etc/resolv.conf').each_line{ |line| line = line.chomp - puts line if line =~ /nameserver/ + if line =~ /nameserver/ + @cli.say(line) + ns,ip = line.split() + ns_list[ns_count] = ip + end } + +if remote_ipa == "y" +dns_servers = "n" +else @cli.say("<%= color('\nIf your ab...
2006 Aug 08
3
How can i read a properties file in RoR
Hi, Iam a nubie, i wanna know how can i load/read a .properties file in to my rails application. For example i have a property file where i have defined the spanish equivalants of some english words as follows user Name:nombre del usuario user Code :c?digo del usuario likewise. now , where should i store this properties file in the directory structure and how can i read these in to my
2010 Mar 31
5
undefined method `each' for "":String
I implemented creating an object within another object according to this Railscast: http://railscasts.com/episodes/74-complex-forms-part-2 but I''m getting this error after I submit. Any ideas? undefined method `each'' for "":String -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this
2006 Apr 26
5
accessing created_on causes type error
I assume that this is some newbie stupidity, but I haven''t found my way around this problem. I have an ActiveRecord object fetched from the database, and I need to evaluate the contents of the updated_on field. However, *any* attempt to access that data in the program results in a TypeError with the message ''no implicit conversion from nil to integer''. cust =
2006 Jul 31
10
nothing uploads.....why? (newbie question)
Hi everybody, I know this is an easy question but I don''t seem to see the solution. I''m trying to have a user select a file so that my code can parse it and populate the database with corresponding values. So far it seems like uploads but nothing shows in my db. Can anybody give me a hand? thanks view: h1>Importing Strings<h1>
2011 Oct 10
0
Announce: Facter 1.6.2. available
...ide zones db3c606 (#9786) Add aliases: specs, tests, test in rake that points at ''spec''. dfda9be (#4980, #6470) Fix architecture in Darwin and Ubuntu 8f938c1 (#6792) Added osfamily fact. af1ef43 (#6515) Fix for ruby-1.8.5. Switched use of ''line.each'' to ''each_line''. 328ff75 (#6515 and #2945) Fix processorcount for arm, sparc & ppc for linux. 51329b8 (#3856) Detect VirtualBox on Darwin as well as Linux and SunOS 83498b5 (#7996) Restrict solaris cpu processor detection 6e29ff7 (#8615) ENV hash is now local to tests 124a09b (#8240) Fixed regex pat...