spryte 0.0.1.pre3 → 0.0.1.pre4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d56ebe1a3afce044a3fcd353d6506f4ed0c37f4b
4
- data.tar.gz: 8dd9ce18e41f4655b1e459f420fb08c9f71b7b51
3
+ metadata.gz: d57dd0a3cae0564cd5f32d38da372e9b3fe2c3fc
4
+ data.tar.gz: 217816bb77d222d9f50235e913c3c9a0e7ebe76a
5
5
  SHA512:
6
- metadata.gz: a8efc466d1c934b168b46a8bd9d10614e300f7987e156be692a9785d3851da782eed1c5c0652de8545ec8c7bd21fe9808af51f1c6069f632474859ee311461d9
7
- data.tar.gz: 02b38487470311443f23aa3ee3af8af601172ead40afb5fda01a9bbe61a631b126381d0121626b68474e1b4644a224028bc919bc0055a8393e6a412a6603fb0f
6
+ metadata.gz: 1fc9e5e4d5f38543cf5c75f59ddf2ac9e12039811164f7f181a3d131ce293c2a99d300b77d72cd994eab684aa95d092acc12d240a2ed36bf82cf3eaa0bbb8754
7
+ data.tar.gz: e1c2a6e1c331c4f935540c9fd6cd273d4743029e781a47a3f5447ec0a1fd30e65cc7e02dab15a28840b5034aad70bce71db7e577eeaf401493c61d16eae9ed11
@@ -0,0 +1,17 @@
1
+ module Spryte
2
+ module Routing
3
+ module FallbackMapper
4
+
5
+ extend ActiveSupport::Concern
6
+
7
+ def fallback(to)
8
+ match "/(errors/):status", to: "base#error", via: :all, constraints: { status: /\d{3}/ }, defaults: Spryte::Routing::DEFAULTS
9
+ match "*path", to: to, via: :all
10
+ root to: to
11
+ end
12
+
13
+ end
14
+ end
15
+ end
16
+
17
+ ActionDispatch::Routing::Mapper.include Spryte::Routing::FallbackMapper
@@ -0,0 +1,16 @@
1
+ module Spryte
2
+ module Routing
3
+ module VersionMapper
4
+
5
+ extend ActiveSupport::Concern
6
+
7
+ def version(number, &block)
8
+ namespace (v_string = [ "v", number ].join), defaults: Spryte::Routing::DEFAULTS, &block
9
+ match "/*path", to: [ v_string, "base#not_found" ].join("/"), via: :all, defaults: Spryte::Routing::DEFAULTS
10
+ end
11
+
12
+ end
13
+ end
14
+ end
15
+
16
+ ActionDispatch::Routing::Mapper.include Spryte::Routing::VersionMapper
@@ -0,0 +1,7 @@
1
+ module Spryte
2
+ module Routing
3
+ DEFAULTS = { format: "json" }.freeze
4
+ require "spryte/routing/version"
5
+ require "spryte/routing/fallback"
6
+ end
7
+ end
@@ -1,6 +1,6 @@
1
1
  module Spryte
2
2
  MAJOR = "0"
3
3
  MINOR = "0"
4
- PATCH = "1.pre3"
4
+ PATCH = "1.pre4"
5
5
  VERSION = [ MAJOR, MINOR, PATCH ].join(".")
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spryte
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.pre3
4
+ version: 0.0.1.pre4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip Vieira
@@ -51,6 +51,9 @@ files:
51
51
  - README.md
52
52
  - Rakefile
53
53
  - lib/spryte.rb
54
+ - lib/spryte/routing.rb
55
+ - lib/spryte/routing/fallback_mapper.rb
56
+ - lib/spryte/routing/version_mapper.rb
54
57
  - lib/spryte/rspec.rb
55
58
  - lib/spryte/rspec/helpers.rb
56
59
  - lib/spryte/rspec/macros.rb