Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds keeping the order of elements #55

Closed
wants to merge 6 commits into from
Closed

Adds keeping the order of elements #55

wants to merge 6 commits into from

Conversation

deiga
Copy link

@deiga deiga commented Sep 11, 2014

@deiga
Copy link
Author

deiga commented Oct 5, 2014

ping @dam5s

@Danicela
Copy link

Danicela commented Jul 6, 2015

I search to make elements ordering.
Why isn't this update also available in nokogiri-happymapper ?
Am I obliged to use nokogiri-happymapper-deiga to get elements ordering ? (or is there any other way, even if more complicated?)
What are the other differences between nokogiri-happymapper and nokogiri-happymapper-deiga ? (is the first abandonned?)

@deiga
Copy link
Author

deiga commented Jul 6, 2015

My Pull Request was never accepted, I think nokogiri-happymapper has been abandoned.

Ordering was the only thing I added, here's the changelog

I didn't find any other way, when I was working at the problem.

@Danicela
Copy link

Danicela commented Jul 6, 2015

How do you use the new order attribute ? (I mean, can you give me a syntax exemple, I'm beginner in Ruby)

[quote]Added compatibility with Ruby 1.8.7
Added ordering of elements[/quote]

What has been modified for Ruby 1.8.7 ? That's the version I use but dam5s's happymapper already works on 1.8.7 ?

@deiga
Copy link
Author

deiga commented Jul 6, 2015

The gems tests didn't run on 1.8.7 or some such :P You can always check the commits :)

@Danicela
Copy link

How do you use the new order attribute ? (I mean, can you give me a syntax exemple, I'm beginner in Ruby)

@deiga
Copy link
Author

deiga commented Aug 11, 2015

Theres no special syntax there, it just keeps the order of elements. As a Hash in ruby 1.8.7 sorts elements automatically, which broke the order I needed :)

@Danicela
Copy link

Do you mean that for Ruby >1.8.7, nokogiri-happymapper already does the correct ordering ?

@deiga
Copy link
Author

deiga commented Aug 12, 2015

AFAIK Hashes in ruby 1.9 keep the order of elements according to the order they were added, so yeah, in ruby >= 1.9 the ordering should work intrinsicly

@mvz
Copy link
Owner

mvz commented Dec 31, 2017

Closing this since according to #55 (comment) this works in all currently supported Ruby versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is there a way to force order of elements in the built XML?
3 participants