regressor 0.4.0 → 0.4.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a26f0b24d23a0675677e10e674bdd1f5f9d45ba1
|
4
|
+
data.tar.gz: d33e20d7d14a6de3b1bfd9d91d141c3ab8352d66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d624d33ce8c31ced528dbf21f1375421c773401fef614e74cd7d3919c8880e7bc96829181e8bbc2882558f5eff9c76afe2d9832627b391794129856dce47fbe3
|
7
|
+
data.tar.gz: dd6a8615fe4efb6451d50e53f6c7cf8853c330fc7e5ebf0dc96f8044484c1a6ed1dd3c794556cbec4997aee84f10149df78b461a9e0c648d03eaed17ca76da01
|
@@ -24,23 +24,29 @@ module Regressor
|
|
24
24
|
def generate_example(journey_route, controller_path, action_method, required_parts, url)
|
25
25
|
request_method = journey_route.constraints[:request_method]
|
26
26
|
if request_method.match('GET')
|
27
|
-
"it { should route(:get, '#{url}').to(#{{
|
27
|
+
"it { should route(:get, '#{url}').to('#{controller_path}##{action_method}', #{required_parts}) }"
|
28
28
|
elsif request_method.match('POST')
|
29
|
-
"it { should route(:post, '#{url}').to(#{{
|
29
|
+
"it { should route(:post, '#{url}').to('#{controller_path}##{action_method}', #{required_parts}) } "
|
30
30
|
elsif request_method.match('PUT')
|
31
|
-
"it { should route(:put, '#{url}').to(#{{
|
31
|
+
"it { should route(:put, '#{url}').to('#{controller_path}##{action_method}', #{required_parts}) } "
|
32
32
|
elsif request_method.match('PATCH')
|
33
|
-
"it { should route(:patch, '#{url}').to(#{{
|
33
|
+
"it { should route(:patch, '#{url}').to('#{controller_path}##{action_method}', #{required_parts}) } "
|
34
34
|
elsif request_method.match('DELETE')
|
35
|
-
"it { should route(:delete, '#{url}').to(#{{
|
35
|
+
"it { should route(:delete, '#{url}').to('#{controller_path}##{action_method}', #{required_parts}) } "
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
39
|
def extract_required_parts(journey_route)
|
40
40
|
journey_route.required_parts.inject({}) do |required_part_hash, required_part|
|
41
41
|
required_part_hash.merge!({
|
42
|
-
required_part => 1
|
42
|
+
required_part => '1'
|
43
43
|
})
|
44
|
+
if journey_route.defaults[:format]
|
45
|
+
required_part_hash.reverse_merge!({
|
46
|
+
format: journey_route.defaults[:format]
|
47
|
+
})
|
48
|
+
end
|
49
|
+
required_part_hash
|
44
50
|
end
|
45
51
|
end
|
46
52
|
|
data/lib/regressor/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: regressor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erwin Schens
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: shoulda-matchers
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.7.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.7.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: faker
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|