<commit_before>Pakyow::App.routes :console do
  include Pakyow::Console::SharedRoutes

  namespace :console, '/console' do
    get :default, '/' do
      reroute router.group(:console).path(:dashboard)
    end

    get :dashboard, '/dashboard', before: [:auth], after: [:setup] do
      if using_platform?
        presenter.path = 'console/dashboard-platform'
        # view.scope(:app_event).mutate(:list, with: data(:app_event).all).subscribe
        view.scope(:app_event).mutate(:list, with: []).subscribe
      end
    end
  end

  # loads configured routes
  # Pakyow::Console::RouteRegistry.config.each do |route|
  #   self.send(route[:method].downcase.to_sym, route[:name].to_sym, route[:path]) do
  #     begin
  #       presenter.path = route[:view_path]
  #     rescue MissingView
  #     end

  #     catch :halt do
  #       route[:functions].each do |function|
  #         invoke(function[:plugin], function[:function], function[:options])
  #       end
  #     end
  #   end
  # end
end

Pakyow::App.after :load do
  Pakyow::Router.instance.set :'console-catchall' do
    # This is the catch-all route for mapping to configured endpoints (plugins, pages, etc).
    # Registered in an after hook so it's at the end.
    #
    get /.*/ do
      Pakyow::Console.handle_slug(self)
    end
  end
end

Pakyow::App.after :reload do
  Pakyow::Router.instance.set :'console-catchall' do
    # This is the catch-all route for mapping to configured endpoints (plugins, pages, etc).
    # Registered in an after hook so it's at the end.
    #
    get /.*/ do
      Pakyow::Console.handle_slug(self)
    end
  end
end
<commit_msg>Mixin project name for pages<commit_after>Pakyow::App.routes :console do
  include Pakyow::Console::SharedRoutes

  namespace :console, '/console' do
    get :default, '/' do
      reroute router.group(:console).path(:dashboard)
    end

    get :dashboard, '/dashboard', before: [:auth], after: [:setup] do
      if using_platform?
        presenter.path = 'console/dashboard-platform'
        # view.scope(:app_event).mutate(:list, with: data(:app_event).all).subscribe
        view.scope(:app_event).mutate(:list, with: []).subscribe
      end
    end
  end

  # loads configured routes
  # Pakyow::Console::RouteRegistry.config.each do |route|
  #   self.send(route[:method].downcase.to_sym, route[:name].to_sym, route[:path]) do
  #     begin
  #       presenter.path = route[:view_path]
  #     rescue MissingView
  #     end

  #     catch :halt do
  #       route[:functions].each do |function|
  #         invoke(function[:plugin], function[:function], function[:options])
  #       end
  #     end
  #   end
  # end
end

Pakyow::App.after :load do
  Pakyow::Router.instance.set :'console-catchall' do
    # This is the catch-all route for mapping to configured endpoints (plugins, pages, etc).
    # Registered in an after hook so it's at the end.
    #
    get /.*/ do
      Pakyow::Console.handle_slug(self)
    end
  end
end

Pakyow::App.after :reload do
  Pakyow::Router.instance.set :'console-catchall' do
    # This is the catch-all route for mapping to configured endpoints (plugins, pages, etc).
    # Registered in an after hook so it's at the end.
    #
    get /.*/, after: [:prepare_project] do
      Pakyow::Console.handle_slug(self)
    end
  end
end

{'fraction_non_alphanumeric': 0.12726723095525996, 'fraction_numerical': 0.0, 'mean_word_length': 2.9439809296781885, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1353780', 'n_tokens_mistral': 1069, 'n_tokens_neox': 1063, 'n_words': 278}