Sha256: 58c1e501003bf96e4d1b83c5073ae78e1475fe5b1367d008315610bd337f6d12

Contents?: true

Size: 489 Bytes

Versions: 94

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

94 entries across 89 versions & 9 rubygems

Version Path
actionpack-7.0.0.alpha2 lib/action_dispatch/journey/nfa/dot.rb
actionpack-7.0.0.alpha1 lib/action_dispatch/journey/nfa/dot.rb
actionpack-6.1.4.1 lib/action_dispatch/journey/nfa/dot.rb
rails_mini_profiler-0.2.0 vendor/bundle/ruby/3.0.0/gems/actionpack-6.1.4/lib/action_dispatch/journey/nfa/dot.rb
actionpack-6.1.4 lib/action_dispatch/journey/nfa/dot.rb
actionpack-6.1.3.2 lib/action_dispatch/journey/nfa/dot.rb
actionpack-6.1.3.1 lib/action_dispatch/journey/nfa/dot.rb
actionpack-6.1.3 lib/action_dispatch/journey/nfa/dot.rb
actionpack-6.1.2.1 lib/action_dispatch/journey/nfa/dot.rb
actionpack-6.1.2 lib/action_dispatch/journey/nfa/dot.rb
actionpack-6.1.1 lib/action_dispatch/journey/nfa/dot.rb
actionpack-6.1.0 lib/action_dispatch/journey/nfa/dot.rb
actionpack-6.1.0.rc2 lib/action_dispatch/journey/nfa/dot.rb
actionpack-6.1.0.rc1 lib/action_dispatch/journey/nfa/dot.rb