Flowdock
method

sorted_groups

Importance_0
v5.2.3 - Show latest stable - 0 notes - Class: Rails::Generators
sorted_groups() public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File railties/lib/rails/generators.rb, line 206
      def sorted_groups
        namespaces = public_namespaces
        namespaces.sort!

        groups = Hash.new { |h, k| h[k] = [] }
        namespaces.each do |namespace|
          base = namespace.split(":").first
          groups[base] << namespace
        end

        rails = groups.delete("rails")
        rails.map! { |n| n.sub(/^rails:/, "") }
        rails.delete("app")
        rails.delete("plugin")
        rails.delete("encrypted_secrets")
        rails.delete("encrypted_file")
        rails.delete("encryption_key_file")
        rails.delete("master_key")
        rails.delete("credentials")

        hidden_namespaces.each { |n| groups.delete(n.to_s) }

        [[ "rails", rails ]] + groups.sort.to_a
      end
Register or log in to add new notes.