Search Results

Search found 13929 results on 558 pages for 'ruby on rails plugins'.

Page 113/558 | < Previous Page | 109 110 111 112 113 114 115 116 117 118 119 120  | Next Page >

  • Parsing a UTF-16 encoded xml file in ruby

    - by Matthew Toohey
    Hello I've been trying to parse a UTF-16 encoded xml file in Ruby (1.8.7), and I can't seem to find how to do it by searching (google and stack overflow) Here's the xml file url: http://www.abc.net.au/triplej/feeds/playout/triplejsydneyplayout.xml?_5366 Getting the xml string from Net::HTTP and passing it to REXML, then calling logger.info xmlDoc.inspect produces: <UNDEFINED> ... </> Any ideas? Cheers

    Read the article

  • Error in rounding off values using .round in Ruby

    - by Shreyas Satish
    The following piece of code works perfectly in script/console but returns the following error when i compile the same in a ruby script.: :in `round': wrong number of arguments (1 for 0) (ArgumentError) tf={"ph"={0=1.33333333333333, 1=1.5}, "fee"={0=1.66666666666667}, "test"={0=1.16666666666667, 1=1.25}, "what"={0=2.0, 1=2.0}, "for"={0=1.5}, "is"={0=1.83333333333333, 1=1.75}} tf.each{|k,v| v.each{|k1,v1| tf[k][k1]=(v1.round(5))}} Any Ideas ? Cheers !

    Read the article

  • Ruby Exception or Error?

    - by Ell
    I have noticed that in the Ruby exception hierarchy, there are "errors" such as ArgumentError and there are "exceptions" such as SignalException. Is there a certain practise of naming exceptions? thanks in advance, ell.

    Read the article

  • Ruby: Continue a loop after catching an exception

    - by Santa
    Basically, I want to do something like this (in Python, or similar imperative languages): for i in xrange(1, 5): try: do_something_that_might_raise_exceptions(i) except: continue # continue the loop at i = i + 1 How do I do this in Ruby? I know there are the redo and retry keywords, but they seem to re-execute the "try" block, instead of continuing the loop: for i in 1..5 begin do_something_that_might_raise_exceptions(i) rescue retry # do_something_* again, with same i end end

    Read the article

  • How to generate a unified diff in Ruby?

    - by jstayton
    After reading through this question about Ruby diff packages, I'm still not sure how to generate a unified diff from two text files. I'm not having trouble reading each file into a string (IO.read()), but I'm not finding any package that can generate a unified diff. Does one exist? Is doing a system call to diff even an option I should consider? (I'm thinking no.) Any help is appreciated! Thanks.

    Read the article

  • 'SSL not supported' when calling https web service in Ruby

    - by shaleo
    I am trying to run the following code to call a webservice from ruby but get an error 'SSL not supported'. I have httpclient 2.1.5.2 installed. require 'soap/wsdlDriver' def validate_certificate(is_ok, ctx) cert = ctx.current_cert unless (cert.subject.to_s == cert.issuer.to_s) #check the server certificate only is_ok &&= File.open(file_name).read == ctx.current_cert.to_pem end is_ok end def test_webservice wsdl = "https://.../service.wsdl" driver = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver driver.options['protocol.http.ssl_config.verify_callback'] = method(:validate_certificate) driver.method(params) end

    Read the article

  • Ruby/IRB self help

    - by mozillalives
    I'm new to Ruby - what tricks can I use to help me find documentation on a object I'm working with? Normally I just do a_var.class or a_var.methods and try to guess what I need or search the web for documentation. Are there other methods or modules that might help?

    Read the article

  • Enums in Ruby

    - by auramo
    What's the best way to implement the enum idiom in Ruby? I'm looking for something which I can use (almost) like the Java/C# enums.

    Read the article

  • which ruby twitter library/gem to use?

    - by Radek
    there is a list of ruby gems for twitter could anybody recommend me one that is good to start to learn/use? that have some history of development etc etc? I want to the stuff below on my linux box search for keywords and follow autofollow rewteet

    Read the article

  • Ruby library for Flickr API?

    - by rubayeet
    Is there a solid, production ready library in Ruby that interacts with the Flickr API? I found a few by googing, but their states don't impress me much. I'm looking for something along the lines of flickrapi for Python, with nice documentation.

    Read the article

  • How to organize a Shoes Ruby app?

    - by luca
    can I have some examples of how you organize your Shoes apps? I mean, simply using a Shoes.app{} block and instance variables is clumsy.. I'd like to achieve a MVC like structure.. I'm used to it (from rails, FLEX frameworks and others..) and would like to recreate something similar..

    Read the article

  • Ruby Large HTML getting error, limit to header size

    - by Joe Stein
    def mailTo(subject,msg,folks) begin Net::SMTP.start('localhost', 25) do |smtp| smtp.send_message "MIME-Version: 1.0\nContent-type: text/html\nSubject: #{subject}\n#{msg}\n#{DateTime.now}\n", '[email protected]', folks end rescue => e puts "Emailing Sending Error - #{e}" end end when the HTML is VERY large I get this exception Emailing Sending Error - 552 5.6.0 Headers too large (32768 max) how can i get a larger html above max to work with Net::SMTP in Ruby

    Read the article

  • ruby socket programming using credentials

    - by satya
    HI folks, I'm trying to establish connection to a remote server using ruby socket connection TcpSocket. I started with TcpSocket.new(port,host) Now, How do I pass the credentials to it. The remote server needs credentials to allow me to connect. Any help is very much appreciated. Thanks

    Read the article

  • RVM Ruby 1.9.1 troubles

    - by Casper
    Trying to get Ruby 1.9.1 up and running with RVM on a fresh install(fedora). So after doing rvm install 1.9.1, the rubygems error logs show that zlib can't be located no such file to load -- zlib (LoadError) However both the zlib runtime and development libraries are installed and up-to-date, So I'm kinda stumped on this one at the moment. Any suggestions?

    Read the article

  • Updating and Editing Google Contacts - Ruby Gem

    - by Kyle
    I'm attempting to interact with the Google contacts API through Rails via and oauth-plugin. I need to retrieve and update Google contacts. I know that the portablecontacts gem will retrieve contacts, but does not allow for adding or updating. I was wondering if anyone knew of a gem that will handle this type of interaction. If not what would be the best method to implement a gem that would make it easier to handle the responses.

    Read the article

  • Understanding ruby array sort

    - by user257797
    I am having a problem understanding how array.sort{|x,y| block} works exactly,hence how to use it? ruby-doc example: a = [ "d", "a", "e", "c", "b" ] a.sort #=> ["a", "b", "c", "d", "e"] a.sort {|x,y| y <=> x } #=> ["e", "d", "c", "b", "a"] thanks

    Read the article

< Previous Page | 109 110 111 112 113 114 115 116 117 118 119 120  | Next Page >