jets 1.1.4 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ce0b14790bc57baa9dfcdf1caf6c4d6f4224326a3664b2ec47d20bd05abd123f
4
- data.tar.gz: 5964441e10debe6a51e185c02ba32d88a81196713be63d4d136a106510830466
3
+ metadata.gz: 20fa97bccfb5b99e19a2edcf301bf31e53cd433a13862114fcb9648880e11fcc
4
+ data.tar.gz: 124710223a460aed3a74a7498e2d2a15e5227c820d20a59db639ce83bdf2fb73
5
5
  SHA512:
6
- metadata.gz: 13948762fdf93c03173f85267fdd5f9b268b6aacc8de062633a07b6da89e8046ff350e6e5d3d4fba16f9524265ce32d928221cc7252c59f8cd16f93daa9bc589
7
- data.tar.gz: '078b9ab98342bdd28126a69e2a363b3cbe01c673987a1e19290aaed451587fbaed2ae48cb3400891d45339bb38ac2e51bf044567a3ef3e997b7765a696c873a6'
6
+ metadata.gz: d6ce23cf7b443de33af876d2ac178eaaa2faca79eb5b70188cedd726861478cb030f4dbcab3d03a894f271878a7d4b1923e9bef1555db97faebc4b34aa5cfb36
7
+ data.tar.gz: b415939caba3f43bd03a5c10e47263ca2cd5adb0ebd01c7e76e495b3d09d25228863f51c83b9ece4eee865a0aa6ce5b64f1de3c6ac29234f55c0cde2d3ee0581
data/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [1.1.5]
7
+ - Support multiple path parameters. Also allow path parameters to hold any value other than '/'.
8
+ - Merge pull request #82 from adam-harwood/master
9
+
6
10
  ## [1.1.4]
7
11
  - Fully qualify bundle install path, to fix issue when building on CodeBuild. Fixes #80.
8
12
  - Merge pull request #81 from adam-harwood/master
data/Gemfile.lock CHANGED
@@ -11,7 +11,7 @@ GIT
11
11
  PATH
12
12
  remote: .
13
13
  specs:
14
- jets (1.1.4)
14
+ jets (1.1.5)
15
15
  actionpack (>= 5.2.1)
16
16
  actionview (>= 5.2.1)
17
17
  activerecord (>= 5.2.1)
@@ -39,40 +39,40 @@ PATH
39
39
  GEM
40
40
  remote: https://rubygems.org/
41
41
  specs:
42
- actionpack (5.2.1)
43
- actionview (= 5.2.1)
44
- activesupport (= 5.2.1)
42
+ actionpack (5.2.1.1)
43
+ actionview (= 5.2.1.1)
44
+ activesupport (= 5.2.1.1)
45
45
  rack (~> 2.0)
46
46
  rack-test (>= 0.6.3)
47
47
  rails-dom-testing (~> 2.0)
48
48
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
49
- actionview (5.2.1)
50
- activesupport (= 5.2.1)
49
+ actionview (5.2.1.1)
50
+ activesupport (= 5.2.1.1)
51
51
  builder (~> 3.1)
52
52
  erubi (~> 1.4)
53
53
  rails-dom-testing (~> 2.0)
54
54
  rails-html-sanitizer (~> 1.0, >= 1.0.3)
55
- activemodel (5.2.1)
56
- activesupport (= 5.2.1)
57
- activerecord (5.2.1)
58
- activemodel (= 5.2.1)
59
- activesupport (= 5.2.1)
55
+ activemodel (5.2.1.1)
56
+ activesupport (= 5.2.1.1)
57
+ activerecord (5.2.1.1)
58
+ activemodel (= 5.2.1.1)
59
+ activesupport (= 5.2.1.1)
60
60
  arel (>= 9.0)
61
- activesupport (5.2.1)
61
+ activesupport (5.2.1.1)
62
62
  concurrent-ruby (~> 1.0, >= 1.0.2)
63
63
  i18n (>= 0.7, < 2)
64
64
  minitest (~> 5.1)
65
65
  tzinfo (~> 1.1)
66
66
  arel (9.0.0)
67
67
  aws-eventstream (1.0.1)
68
- aws-partitions (1.117.0)
68
+ aws-partitions (1.118.0)
69
69
  aws-sdk-cloudformation (1.13.0)
70
70
  aws-sdk-core (~> 3, >= 3.39.0)
71
71
  aws-sigv4 (~> 1.0)
72
- aws-sdk-cloudwatchlogs (1.11.0)
72
+ aws-sdk-cloudwatchlogs (1.12.0)
73
73
  aws-sdk-core (~> 3, >= 3.39.0)
74
74
  aws-sigv4 (~> 1.0)
75
- aws-sdk-core (3.40.0)
75
+ aws-sdk-core (3.41.0)
76
76
  aws-eventstream (~> 1.0)
77
77
  aws-partitions (~> 1.0)
78
78
  aws-sigv4 (~> 1.0)
@@ -131,9 +131,9 @@ GEM
131
131
  nokogiri (>= 1.6)
132
132
  rails-html-sanitizer (1.0.4)
133
133
  loofah (~> 2.2, >= 2.2.2)
134
- railties (5.2.1)
135
- actionpack (= 5.2.1)
136
- activesupport (= 5.2.1)
134
+ railties (5.2.1.1)
135
+ actionpack (= 5.2.1.1)
136
+ activesupport (= 5.2.1.1)
137
137
  method_source
138
138
  rake (>= 0.8.7)
139
139
  thor (>= 0.19.0, < 2.0)
data/lib/jets/route.rb CHANGED
@@ -4,7 +4,7 @@
4
4
  # to: "posts#index",
5
5
  # )
6
6
  class Jets::Route
7
- CAPTURE_REGEX = "([a-zA\\-Z0-9_.]*)" # as string
7
+ CAPTURE_REGEX = "([^/]*)" # as string
8
8
 
9
9
  def initialize(options)
10
10
  @options = options
@@ -105,19 +105,23 @@ class Jets::Route
105
105
  def extract_parameters_capture(actual_path)
106
106
  # changes path to a string used for a regexp
107
107
  # posts/:id/edit => posts\/(.*)\/edit
108
+ labels = []
108
109
  regexp_string = path.split('/').map do |s|
109
- s.include?(':') ? CAPTURE_REGEX : s
110
+ if s.start_with?(':')
111
+ labels << s.delete_prefix(':')
112
+ CAPTURE_REGEX
113
+ else
114
+ s
115
+ end
110
116
  end.join('\/')
111
117
  # make sure beginning and end of the string matches
112
118
  regexp_string = "^#{regexp_string}$"
113
119
  regexp = Regexp.new(regexp_string)
114
- value = regexp.match(actual_path)[1]
115
120
 
116
- # only supports one path parameter key right now
117
- key = path.split('/').find {|s| s.include?(':') } # :id
118
- key = key.sub(':','')
119
-
120
- { key => value }
121
+ values = regexp.match(actual_path).captures
122
+ labels.map do |next_label|
123
+ [next_label, values.delete_at(0)]
124
+ end.to_h
121
125
  end
122
126
 
123
127
  def authorization_type
data/lib/jets/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jets
2
- VERSION = "1.1.4"
2
+ VERSION = "1.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jets
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-27 00:00:00.000000000 Z
11
+ date: 2018-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack