stub_requests 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +7 -0
  3. data/.reek.yml +1 -0
  4. data/.rubocop.yml +2 -0
  5. data/.travis.yml +15 -0
  6. data/.yardopts +1 -1
  7. data/Appraisals +11 -0
  8. data/CHANGELOG.md +17 -0
  9. data/README.md +15 -2
  10. data/Rakefile +16 -1
  11. data/docs/.gitkeep +0 -0
  12. data/docs/Array.html +137 -0
  13. data/docs/FalseClass.html +232 -0
  14. data/docs/Hash.html +137 -0
  15. data/docs/NilClass.html +232 -0
  16. data/docs/Numeric.html +233 -0
  17. data/docs/Object.html +396 -0
  18. data/docs/String.html +298 -0
  19. data/docs/StubRequests/API.html +651 -0
  20. data/docs/StubRequests/ArgumentValidation.html +309 -0
  21. data/docs/StubRequests/Endpoint.html +1187 -0
  22. data/docs/StubRequests/EndpointNotFound.html +157 -0
  23. data/docs/StubRequests/EndpointRegistry.html +1527 -0
  24. data/docs/StubRequests/Error.html +153 -0
  25. data/docs/StubRequests/HashUtil.html +304 -0
  26. data/docs/StubRequests/InvalidType.html +252 -0
  27. data/docs/StubRequests/InvalidUri.html +252 -0
  28. data/docs/StubRequests/Service.html +1307 -0
  29. data/docs/StubRequests/ServiceHaveEndpoints.html +244 -0
  30. data/docs/StubRequests/ServiceNotFound.html +252 -0
  31. data/docs/StubRequests/ServiceRegistry.html +1031 -0
  32. data/docs/StubRequests/URI/Builder.html +1194 -0
  33. data/docs/StubRequests/URI/Scheme.html +315 -0
  34. data/docs/StubRequests/URI/Suffix.html +315 -0
  35. data/docs/StubRequests/URI/Validator.html +770 -0
  36. data/docs/StubRequests/URI.html +144 -0
  37. data/docs/StubRequests/UriSegmentMismatch.html +157 -0
  38. data/docs/StubRequests/WebMockBuilder.html +887 -0
  39. data/docs/StubRequests.html +452 -0
  40. data/docs/Time.html +232 -0
  41. data/docs/TrueClass.html +232 -0
  42. data/docs/_config.yml +1 -0
  43. data/docs/_index.html +391 -0
  44. data/docs/class_list.html +51 -0
  45. data/docs/css/common.css +1 -0
  46. data/docs/css/full_list.css +58 -0
  47. data/docs/css/style.css +496 -0
  48. data/docs/file.README.html +225 -0
  49. data/docs/file_list.html +56 -0
  50. data/docs/frames.html +17 -0
  51. data/docs/index.html +225 -0
  52. data/docs/js/app.js +292 -0
  53. data/docs/js/full_list.js +216 -0
  54. data/docs/js/jquery.js +4 -0
  55. data/docs/method_list.html +707 -0
  56. data/docs/top-level-namespace.html +112 -0
  57. data/gemfiles/.bundle/config +2 -0
  58. data/gemfiles/webmock_2.3.gemfile +8 -0
  59. data/gemfiles/webmock_2.3.gemfile.lock +206 -0
  60. data/gemfiles/webmock_3.5.gemfile +8 -0
  61. data/gemfiles/webmock_3.5.gemfile.lock +206 -0
  62. data/gemfiles/webmock_develop.gemfile +8 -0
  63. data/gemfiles/webmock_develop.gemfile.lock +211 -0
  64. data/lib/stub_requests/version.rb +1 -1
  65. data/lib/tasks/changelog.rake +18 -0
  66. data/lib/tasks/gem.rake +15 -0
  67. data/lib/tasks/git.rake +40 -0
  68. data/stub_requests.gemspec +23 -12
  69. metadata +138 -25
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1bf4b020989fae9d4edf349c5eddb3c5aa3447ccb14f316e5e016be19636205f
4
- data.tar.gz: 40f01c2d62daa3957f5d0331abbbca3df824f1300236cc744541427e696c9bd0
3
+ metadata.gz: bc8e6e325329977ce50cecf33f1261c7194afdfa9dd63f2d18627fd9228aaf2b
4
+ data.tar.gz: d581dbdc2d0c56d55e634754876b62a2ee38cad988c1b9474971308bf51c08e5
5
5
  SHA512:
6
- metadata.gz: 98f4dfc578779e820b115309a966d412054927fdb7a58487cc11dcd221e3bee013fdc772917324285039000815f8dc9d05788a8aced3b43e4e72d044de0927e1
7
- data.tar.gz: 05376f6ec2b7ec7f4974af7c635fd6f6596f5b49beed93e2cedcb0f51db147574757bd6ffbe75bf5259123e309dae7aa0d0677f0063022ef532fc25a3cc8caa3
6
+ metadata.gz: 516de1eae065073fb7e97d73793283943e22d2b328de5d1cd870aefbb068e3f8b3d7c149280a186c3c19ae9d84d2aaa6cdb7dc3a53532f5dec3776225804a102
7
+ data.tar.gz: 0bae1c15d8fa2101f1c205d0424524d626ea0599cfe07e15da374bdee39891759a57f53b379459e7e97d7b583430a9cde2d5ad15b8a3f9ec3d67b6b9b854f47f
data/.codeclimate.yml CHANGED
@@ -21,3 +21,10 @@ plugins:
21
21
  channel: rubocop-0-63
22
22
  config:
23
23
  file: .rubocop.yml
24
+
25
+ exclude_patterns:
26
+ - "doc/"
27
+ - "docs/"
28
+ - "gemfiles/"
29
+ - "pkg/"
30
+ - "lib/stub_requests/core_ext/"
data/.reek.yml CHANGED
@@ -10,3 +10,4 @@ detectors:
10
10
 
11
11
  exclude_paths:
12
12
  - vendor/bundle
13
+ - gemfiles
data/.rubocop.yml CHANGED
@@ -16,6 +16,7 @@ AllCops:
16
16
  - "lib/stub_requests/core_ext/**/*"
17
17
  - "Gemfile.lock"
18
18
  - "bin/setup"
19
+ - "gemfiles/**/*"
19
20
 
20
21
  Lint/HandleExceptions:
21
22
  Enabled: true
@@ -39,6 +40,7 @@ Metrics/BlockLength:
39
40
  Enabled: true
40
41
  Exclude:
41
42
  - '**/spec/**/*.rb'
43
+ - '**/*.rake'
42
44
 
43
45
  Metrics/PerceivedComplexity:
44
46
  Max: 8
data/.travis.yml CHANGED
@@ -7,10 +7,12 @@ env:
7
7
  - CC_TEST_REPORTER_ID=8ef08c06ceb394c164b97b5d4c5874b016b1a85a760cf05521503dac6dde0eeb
8
8
  - GIT_COMMITTED_AT=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then git log -1 --pretty=format:%ct;
9
9
  else git log -1 --skip 1 --pretty=format:%ct; fi)
10
+
10
11
  before_install:
11
12
  - gem install bundler -v 2.0.1
12
13
  - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
13
14
  - chmod +x ./cc-test-reporter
15
+
14
16
  before_script:
15
17
  - "./cc-test-reporter before-build"
16
18
  script:
@@ -19,14 +21,27 @@ script:
19
21
  - bundle exec rspec
20
22
  after_script:
21
23
  - if [[ "${COV}" = "true" ]]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi;
24
+
22
25
  rvm:
23
26
  - 2.3.7
24
27
  - 2.4.5
28
+
25
29
  matrix:
26
30
  fast_finish: true
27
31
  include:
28
32
  - rvm: 2.5.3
29
33
  env: COV=true
34
+
35
+ gemfile:
36
+ - gemfiles/webmock_2.3.gemfile
37
+ - gemfiles/webmock_3.5.gemfile
38
+ - gemfiles/webmock_develop.gemfile
39
+
40
+ notifications:
41
+ email:
42
+ recipients:
43
+ - mikael@zoolutions.se
44
+
30
45
  deploy:
31
46
  provider: rubygems
32
47
  api_key:
data/.yardopts CHANGED
@@ -1 +1 @@
1
- --no-private --protected lib/**/*.rb - README.md
1
+ --no-private --output-dir docs lib/stub_requests/**/*.rb --markup-provider=redcarpet --markup=markdown - README.md
data/Appraisals ADDED
@@ -0,0 +1,11 @@
1
+ appraise "webmock-2.3" do
2
+ gem "webmock", "~> 2.3.0"
3
+ end
4
+
5
+ appraise "webmock-3.5" do
6
+ gem "webmock", "~> 3.5.0"
7
+ end
8
+
9
+ appraise "webmock-develop" do
10
+ gem "webmock", git: "https://github.com/bblimke/webmock.git"
11
+ end
data/CHANGELOG.md CHANGED
@@ -0,0 +1,17 @@
1
+ # Change Log
2
+
3
+ ## [Unreleased](https://github.com/mhenrixon/stub_requests/tree/HEAD)
4
+
5
+ [Full Changelog](https://github.com/mhenrixon/stub_requests/compare/v0.1.0...HEAD)
6
+
7
+ **Merged pull requests:**
8
+
9
+ - Add docs folder and CHANGELOG.md [\#2](https://github.com/mhenrixon/stub_requests/pull/2) ([mhenrixon](https://github.com/mhenrixon))
10
+
11
+ ## [v0.1.0](https://github.com/mhenrixon/stub_requests/tree/v0.1.0) (2019-02-01)
12
+ **Merged pull requests:**
13
+
14
+ - Add rough initial implementation [\#1](https://github.com/mhenrixon/stub_requests/pull/1) ([mhenrixon](https://github.com/mhenrixon))
15
+
16
+
17
+ \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
data/README.md CHANGED
@@ -26,6 +26,7 @@ This is achieve by keeping a registry over the service endpoints.
26
26
 
27
27
  <!-- /MarkdownTOC -->
28
28
 
29
+ <a id="installation"></a>
29
30
  ## Installation
30
31
 
31
32
  Add this line to your application's Gemfile:
@@ -36,12 +37,17 @@ gem "stub_requests"
36
37
 
37
38
  And then execute:
38
39
 
39
- `bundle`
40
+ ```
41
+ bundle
42
+ ```
40
43
 
41
44
  Or install it yourself as:
42
45
 
43
- `gem install stub_requests`
46
+ ```
47
+ gem install stub_requests
48
+ ```
44
49
 
50
+ <a id="usage"></a>
45
51
  ## Usage
46
52
 
47
53
  To use the gem we need to register some service endpoints. In the following example we are connecting to a rails inspired service.
@@ -93,8 +99,10 @@ Imagine a code base with thousands of stubbed request. You always have to look a
93
99
 
94
100
  Madness!!
95
101
 
102
+ <a id="future-improvements"></a>
96
103
  ## Future Improvements
97
104
 
105
+ <a id="api-client-gem"></a>
98
106
  ### API Client Gem
99
107
 
100
108
  Since we have a service + endpoint registry, I was thinking it might make
@@ -103,10 +111,12 @@ sense to make this into an API client. Not sure yet, maybe this will become mult
103
111
  Anyway, the idea was to provide endpoint calls in production and stubbed
104
112
  requests in tests using the same registry.
105
113
 
114
+ <a id="debugging"></a>
106
115
  ### Debugging
107
116
 
108
117
  I want to provide information about where a request stub was created from. In the project I am currently working this would have saved me a days work already.
109
118
 
119
+ <a id="development"></a>
110
120
  ## Development
111
121
 
112
122
  After checking out the repo, run `bin/setup` to install dependencies.
@@ -116,6 +126,7 @@ interactive prompt that will allow you to experiment.
116
126
 
117
127
  To install this gem onto your local machine run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
118
128
 
129
+ <a id="contributing"></a>
119
130
  ## Contributing
120
131
 
121
132
  Bug reports and pull requests are welcome on GitHub at:
@@ -124,10 +135,12 @@ Bug reports and pull requests are welcome on GitHub at:
124
135
  This project is intended to be a safe, welcoming space for collaboration, and
125
136
  contributors are expected to adhere to the [Contributor Covenant](cc) code of conduct.
126
137
 
138
+ <a id="license"></a>
127
139
  ## License
128
140
 
129
141
  The gem is available as open source under the terms of the [MIT License](mit).
130
142
 
143
+ <a id="code-of-conduct"></a>
131
144
  ## Code of Conduct
132
145
 
133
146
  Everyone interacting in the StubRequests project’s codebases, issue trackers,
data/Rakefile CHANGED
@@ -1,8 +1,23 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
5
4
 
5
+ Dir.glob("#{File.expand_path(__dir__)}/lib/tasks/**/*.rake").each { |f| import f }
6
+
7
+ require "rspec/core/rake_task"
6
8
  RSpec::Core::RakeTask.new(:spec)
7
9
 
10
+ require "yard"
11
+ YARD::Rake::YardocTask.new do |t|
12
+ t.files = %w[lib/stub_requests/**/*.rb"]
13
+ t.options = %w[
14
+ --no-private
15
+ --output-dir docs
16
+ --readme README.md
17
+ --output-dir docs
18
+ --markup=markdown
19
+ --markup-provider=redcarpet
20
+ ]
21
+ end
22
+
8
23
  task default: :spec
data/docs/.gitkeep ADDED
File without changes
data/docs/Array.html ADDED
@@ -0,0 +1,137 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: Array
8
+
9
+ &mdash; Documentation by YARD 0.9.18
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "Array";
19
+ relpath = '';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="_index.html">Index (A)</a> &raquo;
40
+
41
+
42
+ <span class="title">Array</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: Array
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName"><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></span>
73
+
74
+ <ul class="fullTree">
75
+ <li><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></li>
76
+
77
+ <li class="next">Array</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <dl>
96
+ <dt>Defined in:</dt>
97
+ <dd>lib/stub_requests/core_ext/object/blank.rb</dd>
98
+ </dl>
99
+
100
+ </div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+
105
+
106
+ </div>
107
+ </div>
108
+ <div class="tags">
109
+
110
+
111
+ <p class="tag_title">See Also:</p>
112
+ <ul class="see">
113
+
114
+ <li><span class='object_link'><a href="" title="Array (class)">Array</a></span></li>
115
+
116
+ </ul>
117
+
118
+ </div>
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+ </div>
128
+
129
+ <div id="footer">
130
+ Generated on Fri Feb 1 19:57:30 2019 by
131
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
132
+ 0.9.18 (ruby-2.5.3).
133
+ </div>
134
+
135
+ </div>
136
+ </body>
137
+ </html>
@@ -0,0 +1,232 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: FalseClass
8
+
9
+ &mdash; Documentation by YARD 0.9.18
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "FalseClass";
19
+ relpath = '';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="_index.html">Index (F)</a> &raquo;
40
+
41
+
42
+ <span class="title">FalseClass</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: FalseClass
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName"><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></span>
73
+
74
+ <ul class="fullTree">
75
+ <li><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></li>
76
+
77
+ <li class="next">FalseClass</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <dl>
96
+ <dt>Defined in:</dt>
97
+ <dd>lib/stub_requests/core_ext/object/blank.rb</dd>
98
+ </dl>
99
+
100
+ </div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+
105
+
106
+ </div>
107
+ </div>
108
+ <div class="tags">
109
+
110
+
111
+ <p class="tag_title">See Also:</p>
112
+ <ul class="see">
113
+
114
+ <li><span class='object_link'><a href="" title="FalseClass (class)">FalseClass</a></span></li>
115
+
116
+ </ul>
117
+
118
+ </div>
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+ <h2>
127
+ Instance Method Summary
128
+ <small><a href="#" class="summary_toggle">collapse</a></small>
129
+ </h2>
130
+
131
+ <ul class="summary">
132
+
133
+ <li class="public ">
134
+ <span class="summary_signature">
135
+
136
+ <a href="#blank%3F-instance_method" title="#blank? (instance method)">#<strong>blank?</strong> &#x21d2; true </a>
137
+
138
+
139
+
140
+ </span>
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+ <span class="summary_desc"><div class='inline'><p>+false+ is blank:.</p>
151
+ </div></span>
152
+
153
+ </li>
154
+
155
+
156
+ </ul>
157
+
158
+
159
+
160
+
161
+ <div id="instance_method_details" class="method_details_list">
162
+ <h2>Instance Method Details</h2>
163
+
164
+
165
+ <div class="method_details first">
166
+ <h3 class="signature first" id="blank?-instance_method">
167
+
168
+ #<strong>blank?</strong> &#x21d2; <tt>true</tt>
169
+
170
+
171
+
172
+
173
+
174
+ </h3><div class="docstring">
175
+ <div class="discussion">
176
+ <p>+false+ is blank:</p>
177
+
178
+ <p>false.blank? # =&gt; true</p>
179
+
180
+
181
+ </div>
182
+ </div>
183
+ <div class="tags">
184
+
185
+ <p class="tag_title">Returns:</p>
186
+ <ul class="return">
187
+
188
+ <li>
189
+
190
+
191
+ <span class='type'>(<tt>true</tt>)</span>
192
+
193
+
194
+
195
+ </li>
196
+
197
+ </ul>
198
+
199
+ </div><table class="source_code">
200
+ <tr>
201
+ <td>
202
+ <pre class="lines">
203
+
204
+
205
+ 75
206
+ 76
207
+ 77</pre>
208
+ </td>
209
+ <td>
210
+ <pre class="code"><span class="info file"># File 'lib/stub_requests/core_ext/object/blank.rb', line 75</span>
211
+
212
+ <span class='kw'>def</span> <span class='id identifier rubyid_blank?'>blank?</span>
213
+ <span class='kw'>true</span>
214
+ <span class='kw'>end</span></pre>
215
+ </td>
216
+ </tr>
217
+ </table>
218
+ </div>
219
+
220
+ </div>
221
+
222
+ </div>
223
+
224
+ <div id="footer">
225
+ Generated on Fri Feb 1 19:57:30 2019 by
226
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
227
+ 0.9.18 (ruby-2.5.3).
228
+ </div>
229
+
230
+ </div>
231
+ </body>
232
+ </html>