Sha256: 58c1e501003bf96e4d1b83c5073ae78e1475fe5b1367d008315610bd337f6d12

Contents?: true

Size: 489 Bytes

Versions: 93

Compression:

Stored size: 489 Bytes

Contents

# frozen_string_literal: true

module ActionDispatch
  module Journey # :nodoc:
    module NFA # :nodoc:
      module Dot # :nodoc:
        def to_dot
          edges = transitions.map { |from, sym, to|
            "  #{from} -> #{to} [label=\"#{sym || 'ε'}\"];"
          }

          <<-eodot
digraph nfa {
  rankdir=LR;
  node [shape = doublecircle];
  #{accepting_states.join ' '};
  node [shape = circle];
#{edges.join "\n"}
}
          eodot
        end
      end
    end
  end
end

Version data entries

93 entries across 88 versions & 8 rubygems

Version Path
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.3.4/lib/action_dispatch/journey/nfa/dot.rb
actionpack-7.1.5.1 lib/action_dispatch/journey/nfa/dot.rb
actionpack-7.0.8.7 lib/action_dispatch/journey/nfa/dot.rb
actionpack-7.1.5 lib/action_dispatch/journey/nfa/dot.rb
actionpack-7.1.4.2 lib/action_dispatch/journey/nfa/dot.rb
actionpack-7.0.8.6 lib/action_dispatch/journey/nfa/dot.rb
actionpack-6.1.7.10 lib/action_dispatch/journey/nfa/dot.rb
actionpack-6.1.7.9 lib/action_dispatch/journey/nfa/dot.rb
actionpack-7.1.4.1 lib/action_dispatch/journey/nfa/dot.rb
actionpack-7.0.8.5 lib/action_dispatch/journey/nfa/dot.rb
actionpack-7.1.4 lib/action_dispatch/journey/nfa/dot.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/actionpack-7.0.8.4/lib/action_dispatch/journey/nfa/dot.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.3.4/lib/action_dispatch/journey/nfa/dot.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/actionpack-7.0.5.1/lib/action_dispatch/journey/nfa/dot.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/actionpack-7.0.5.1/lib/action_dispatch/journey/nfa/dot.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/actionpack-7.0.5.1/lib/action_dispatch/journey/nfa/dot.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_dispatch/journey/nfa/dot.rb
actionpack-7.1.3.4 lib/action_dispatch/journey/nfa/dot.rb
actionpack-7.0.8.4 lib/action_dispatch/journey/nfa/dot.rb
actionpack-6.1.7.8 lib/action_dispatch/journey/nfa/dot.rb