<commit_before>require 'pp'
require 'roundabout/application_controller'
require 'graphviz'

module Roundabout
  class RoundaboutController < ::Roundabout::ApplicationController
    def index
      if (json = Rails.root.join('doc/roundabout.json')).exist?
        transitions = ActiveSupport::JSON.decode json.read
        GraphViz.new(:G, type: :digraph, rankdir: 'LR') {|g|
          transitions.each do |t|
            from = g.add_nodes t['from'], shape: 'box'
            to = g.add_nodes t['to'], shape: 'box'
            color = case t['type']
            when 'redirect'
              'red'
            when 'form'
              'purple'
            else
              if t['method'] != 'get'
                'purple'
              else
                'blue'
              end
            end
            g.add_edges from, to, color: color
          end
        }.output(png: Rails.root.join('public/images/roundabout.png'))
      else
        render 'readme'
      end
    end
  end
end
<commit_msg>edge_colors: {get: darkblue, forms: green}<commit_after>require 'pp'
require 'roundabout/application_controller'
require 'graphviz'

module Roundabout
  class RoundaboutController < ::Roundabout::ApplicationController
    def index
      if (json = Rails.root.join('doc/roundabout.json')).exist?
        transitions = ActiveSupport::JSON.decode json.read
        GraphViz.new(:G, type: :digraph, rankdir: 'LR') {|g|
          transitions.each do |t|
            from = g.add_nodes t['from'], shape: 'box'
            to = g.add_nodes t['to'], shape: 'box'
            color = case t['type']
            when 'redirect'
              'red'
            when 'form'
              'green'
            else
              if t['method'] != 'get'
                'green'
              else
                'darkblue'
              end
            end
            g.add_edges from, to, color: color
          end
        }.output(png: Rails.root.join('public/images/roundabout.png'))
      else
        render 'readme'
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.11529066927210552, 'fraction_numerical': 0.0, 'mean_word_length': 1.6911957950065704, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2762038', 'n_tokens_mistral': 591, 'n_tokens_neox': 583, 'n_words': 146}