Sha256: c08148315cc57a4c9fc8b59202c626f83aa4476865c3912292a8063c35811e79

Contents?: true

Size: 793 Bytes

Versions: 6

Compression:

Stored size: 793 Bytes

Contents

# frozen_string_literal: true

require "snowpack/cli/application/command"

module Snowpack
  module CLI
    module Application
      module Commands
        module Routes
          class Update < Command
            desc "Update Roda routes.json"

            def call(**)
              measure "routes.json updated" do
                `bundle exec roda-parse_routes #{route_files} -f #{routes_json_file}`
              end
            end

            private

            def route_files
              Dir["#{application.root}/apps/**/web/routes/**/*.rb"].join(" ")
            end

            def routes_json_file
              "#{application.root}/config/routes.json"
            end
          end
        end

        register "routes update", Routes::Update
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
snowpack-1.0.0.alpha7 lib/snowpack/cli/application/commands/routes/update.rb
snowpack-1.0.0.alpha6 lib/snowpack/cli/application/commands/routes/update.rb
snowpack-1.0.0.alpha5 lib/snowpack/cli/application/commands/routes/update.rb
snowpack-1.0.0.alpha4 lib/snowpack/cli/application/commands/routes/update.rb
snowpack-1.0.0.alpha3 lib/snowpack/cli/application/commands/routes/update.rb
snowpack-1.0.0.alpha2 lib/snowpack/cli/application/commands/routes/update.rb