Giter Club home page Giter Club logo

Comments (8)

mjpete3 avatar mjpete3 commented on August 29, 2024

Wylan,

Have you been able to come up with a better work around instead of commenting out the line?
I haven't had a chance to really look at the issue yet.
Marty

from x12.

Wylan avatar Wylan commented on August 29, 2024

Hi Marty,

I've been pretty busy so I haven't had a chance to dive deeper into it yet, but hopefully I will this weekend.

from x12.

Wylan avatar Wylan commented on August 29, 2024

So I had a little more time to look into the issue and it seems that changing

#{next_repeat.inspect}

to

#{next_repeat}

avoids the issue, but again the output is not super legible.

from x12.

mjpete3 avatar mjpete3 commented on August 29, 2024

This is very helpful. I'm trying to see if I can free up some time this
weekend to work on the code. In addition to working full time, I'm also
starting up a new business. Time is a premium. The work your putting
in is extremely helpful and appreciated!!

I think this may stem from the newer version of Ruby (although I may be
wrong on that).

Marty

On Tue, 2015-04-14 at 09:25 -0700, Wylan wrote:

So I had a little more time to look into the issue and it seems that
changing

#{next_repeat.inspect}
to

#{next_repeat}
avoids the issue, but again the output is not super legible.


Reply to this email directly or view it on GitHub.

from x12.

Wylan avatar Wylan commented on August 29, 2024

I'm glad to be able to help, we using the gem in a project at work so I am able to take some time during the day to look into it. I too suspect that the ruby version has something to do with it since we didnt have issues before upgrading to 2.1, although I'm not sure exactly what changed.

I do think I may have found a decent workaround though. It seems that it was looping in loop.rb (hows that for a pun?). If I copy the inspect method into loop.rb, but remove the call to super.inspect it seems to work. Also the output is not missing anything so far as I can tell.

# inspect in loop.rb
def inspect
  "#{self.class.to_s.sub(/^.*::/, '')} (#{name}) #{repeats} =<#{parsed_str}, #{next_repeat.inspect}> ".gsub(/\\*\"/, '"')
end 

# inspect in base.rb

def inspect
  "#{self.class.to_s.sub(/^.*::/, '')} (#{name}) #{repeats} #{super.inspect[1..-2]} =<#{parsed_str}, #{next_repeat.inspect}> ".gsub(/\\*\"/, '"')
end

from x12.

mjpete3 avatar mjpete3 commented on August 29, 2024

I had some time this morning to research differences with inspect
between ruby 1.9.3 and 2.0.0. In version 1.9.3, the inspect method
would be overridden with to_s method. In version 2.0.0 this was changed
so to_s wouldn't override inspect and the object would be return instead
of a string. The base class has both inspect and to_s methods.

I think what is happening is from the loop class, the base class inspect
method is called. The super.inspect is returning an object, not a
string. Then inspect is being called on that object.....

Your monkey patch makes sense. I'm going to bring it into code base and
release ver 1.5.1 in a little bit.

Marty

On Wed, 2015-04-15 at 08:49 -0700, Wylan wrote:

I'm glad to be able to help, we using the gem in a project at work so
I am able to take some time during the day to look into it. I too
suspect that the ruby version has something to do with it since we
didnt have issues before upgrading to 2.1, although I'm not sure
exactly what changed.

I do think I may have found a decent workaround though. It seems that
it was looping in loop.rb (hows that for a pun?). If I copy the
inspect method into loop.rb, but remove the call to super.inspect it
seems to work. Also the output is not missing anything so far as I can
tell.

inspect in loop.rb

def inspect
"#{self.class.to_s.sub(/^._::/, '')} (#{name}) #{repeats} =<#{parsed_str}, #{next_repeat.inspect}> ".gsub(/_"/, '"')
end

inspect in base.rb

def inspect
"#{self.class.to_s.sub(/^._::/, '')} (#{name}) #{repeats} #{super.inspect[1..-2]} =<#{parsed_str},
#{next_repeat.inspect}> ".gsub(/_"/, '"')
end

Reply to this email directly or view it on GitHub.

from x12.

mjpete3 avatar mjpete3 commented on August 29, 2024

Version 1.5.1 of pd_x12 is available on rubygems.org

On Wed, 2015-04-15 at 08:49 -0700, Wylan wrote:

I'm glad to be able to help, we using the gem in a project at work so
I am able to take some time during the day to look into it. I too
suspect that the ruby version has something to do with it since we
didnt have issues before upgrading to 2.1, although I'm not sure
exactly what changed.

I do think I may have found a decent workaround though. It seems that
it was looping in loop.rb (hows that for a pun?). If I copy the
inspect method into loop.rb, but remove the call to super.inspect it
seems to work. Also the output is not missing anything so far as I can
tell.

inspect in loop.rb

def inspect
"#{self.class.to_s.sub(/^._::/, '')} (#{name}) #{repeats} =<#{parsed_str}, #{next_repeat.inspect}> ".gsub(/_"/, '"')
end

inspect in base.rb

def inspect
"#{self.class.to_s.sub(/^._::/, '')} (#{name}) #{repeats} #{super.inspect[1..-2]} =<#{parsed_str},
#{next_repeat.inspect}> ".gsub(/_"/, '"')
end

Reply to this email directly or view it on GitHub.

from x12.

Wylan avatar Wylan commented on August 29, 2024

Glad I was able to help, I just updated to 1.5.1 and everything seems to be working as expected.

from x12.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.