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

enable -s won't sort resources based on the key values #7

Closed
efinal opened this issue Oct 5, 2013 · 2 comments
Closed

enable -s won't sort resources based on the key values #7

efinal opened this issue Oct 5, 2013 · 2 comments

Comments

@efinal
Copy link

efinal commented Oct 5, 2013

In doc_parser.rb, we put each resource into a Hash.
Ln 5 "@resources = Hash.new"
then in the twitter template, we read it by
Ln 32 "<% @resources.each do |name, endpoints| %>"
which can't ensure read resources in sequence.

what about reading it by:

<% @resources.sort.map do |name, endpoints| %> ?

@malachheb
Copy link
Owner

I use the function "get_resources" to initialize @resources in the function "load_resources".

 def get_resources
    Calamum::Config[:sort]? @definition['resources'].sort : @definition['resources']
 end

For me the option -s works

@efinal
Copy link
Author

efinal commented Oct 12, 2013

yes. it sorts when resources are read from @Definition. but then all resources are saved in @resources which is a Hash map without ordered. the index.html.rb in the template is consuming @resources.

I want all the resources displayed in sort in the html page. not being processed in sequence.

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

No branches or pull requests

2 participants