Sha256: 953307bb293b977c0f95d27892b91f882ccf7b1c220754d7b1279bce723ce404

Contents?: true

Size: 709 Bytes

Versions: 7

Compression:

Stored size: 709 Bytes

Contents

require 'front_end_builds/routing_constraints/html_routing_constraint'

module ActionDispatch::Routing
  class Mapper

    # Create a front end in your rails router.
    def front_end(name, path = name, options = {})
      # Create a new build for this app.
      post(
        "#{path}" => "front_end_builds/builds#create",
        defaults: {
          app_name: name
        }
      )

      # Get a build for this app.
      constraints FrontEndBuilds::HtmlRoutingConstraint.new do
        get(
          "/#{path}/(*path)" => "front_end_builds/builds#index",
          defaults: {
            branch: 'master',
            app_name: name
          }.merge(options)
        )
      end
    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
front_end_builds-0.0.13 lib/front_end_builds/ext/routes.rb
front_end_builds-0.0.12 lib/front_end_builds/ext/routes.rb
front_end_builds-0.0.11 lib/front_end_builds/ext/routes.rb
front_end_builds-0.0.10 lib/front_end_builds/ext/routes.rb
front_end_builds-0.0.9 lib/front_end_builds/ext/routes.rb
front_end_builds-0.0.8 lib/front_end_builds/ext/routes.rb
front_end_builds-0.0.7 lib/front_end_builds/ext/routes.rb