tests_doc 0.0.2 → 0.0.3

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
  SHA1:
3
- metadata.gz: 2a0c49232ed6b607535353ba0aa08d1deb212906
4
- data.tar.gz: 13aa831908beee3729d76843de58d2ca6262951f
3
+ metadata.gz: 36daab5dc76caf8d5e40caefec0aeef2eeac048e
4
+ data.tar.gz: 1c6fb21fab993de63a0055ba00b481140ff85a82
5
5
  SHA512:
6
- metadata.gz: b539157d78a6403f4732d12342da94fa4f323bf117649dc9b4d29de21120ff635b6efb6a81ec889603244faf215e4ada6727d52c1d0235d61bff936ed5a76997
7
- data.tar.gz: be8b46eec085edb7ed45328989cde4d130dac099af364c433a6b944c890745f1540d2bcb6919021d66fac044bfcdffdae1f9c286af360a27e1a8cee199bb5e17
6
+ metadata.gz: 68071ad2d90621ad152762c4fccbd65f0059c908a3d2b483ebc400401b6958ab4e2ab8aa3db4104abec560ac577102a18466d842e8a79fe8c5922847cbf84f50
7
+ data.tar.gz: 4d5b57030f580f889ce36e72b155ae1919fae743fdeb98197e3d515060cb6c435d27f517d04bced3a5b41c7566d47a5f0d5293181fe80d8e93ef72f96bb1671b
data/README.md CHANGED
@@ -75,6 +75,9 @@ TestsDoc.configure do |config|
75
75
  # Folder name where the tests doc will be stored
76
76
  config.doc_folder = 'api' # default: api
77
77
 
78
+ # Key separator between the path and the key
79
+ config.key_separator = '@' # default: @
80
+
78
81
  # Add RSpec line number to the test doc
79
82
  config.add_spec_file_number = false # default: true
80
83
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../../../tests_doc
3
3
  specs:
4
- tests_doc (0.0.1)
4
+ tests_doc (0.0.3)
5
5
  rails (~> 4.0)
6
6
  rspec (>= 2.0)
7
7
  rspec-rails (>= 2.0)
@@ -20,6 +20,7 @@ module TestsDoc
20
20
  config :changes_whitelist_regexes, []
21
21
  config :root_folder, "tests-doc"
22
22
  config :doc_folder, "api"
23
+ config :key_separator, "@"
23
24
  end
24
25
 
25
26
  end
@@ -51,7 +51,7 @@ module TestsDoc
51
51
  end
52
52
 
53
53
  def file_path
54
- [file_base_path, options.key.to_s].reject(&:blank?).compact.join('@') + '.md'
54
+ [file_base_path, options.key.to_s].reject(&:blank?).compact.join(TestsDoc.configuration.key_separator) + '.md'
55
55
  end
56
56
 
57
57
  def file_base_path
@@ -59,11 +59,12 @@ module TestsDoc
59
59
  end
60
60
 
61
61
  def _path
62
- options.path ? options.path.gsub(/^\//, '') : request_path_without_format
62
+ _path = options.path ? options.path : request_path_without_format
63
+ _path.gsub(/^\//, '') # remove initial / if present
63
64
  end
64
65
 
65
66
  def request_path_without_format
66
- request.path[/^\/?([\w,\/]+)([.].+)?$/, 1].to_s
67
+ request.path.gsub(/(\.[\w]+)?$/, '') # remove .json if present
67
68
  end
68
69
 
69
70
  def formatted_example_location
@@ -1,3 +1,3 @@
1
1
  module TestsDoc
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tests_doc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean-Richard Lai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-04 00:00:00.000000000 Z
11
+ date: 2016-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails