crapi 0.1.3 → 1.0.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
  SHA256:
3
- metadata.gz: 526054c0e4505c430bcc3d63e726e679d611a14c6523b007b2d55e73ed5e6cb5
4
- data.tar.gz: 69fbccd69cee1dc78d25620bffa29e39443e04025177da5bd80f5663de7bdbde
3
+ metadata.gz: 582aaf5aaa9df6c582205b77f18d8597178ce1b18444a7eb9e744f3c2c08e861
4
+ data.tar.gz: d8efdc1519117a8d6fafe9a8d6a7dd0900191ab845d01c1add645c11ba5bc880
5
5
  SHA512:
6
- metadata.gz: f149b73275cb33895908b1f01fcd00d1bd6031897563bd9d209286a7d01b06b66689ed518551c9b783140f49928bc02dfa11ca74ddbea21ad1d4d412e9ad9139
7
- data.tar.gz: 7a3d54904295924ae1bd7d04e97788de460a2b8ffdd3324bc3da074885baded829fd759bc797e0c150f500ddb5fb792eced8c5ec28d772403b69f808a955285b
6
+ metadata.gz: b1119b534ab3d730c915c5cc0c01b9c24f63ec4f6fd1cf2f94e53b2312ce23cb293b1302f0a40c4948f46ed4f05848b65eb39c9ccf932b0ed5059bb4f4827426
7
+ data.tar.gz: af59a4845a5af3b2d33801bf49df0c8a914b8f7a13febaaa64114ab2d77aec021ed098dfe1ec4eaa0abb76fa70f44403ebcabf7896b1f09e37a7371501099a7e
@@ -0,0 +1,64 @@
1
+ # Ruby CircleCI 2.0 configuration file
2
+ #
3
+ # Check https://circleci.com/docs/2.0/language-ruby/ for more details
4
+ #
5
+ version: 2.1
6
+ jobs:
7
+ build:
8
+ docker:
9
+ # specify the version you desire here
10
+ - image: cimg/ruby:3.4
11
+
12
+ # Specify service dependencies here if necessary
13
+ # CircleCI maintains a library of pre-built images
14
+ # documented at https://circleci.com/docs/2.0/circleci-images/
15
+ # - image: circleci/postgres:9.4
16
+
17
+ working_directory: ~/repo
18
+
19
+ steps:
20
+ - checkout
21
+
22
+ # Download and cache dependencies
23
+ - restore_cache:
24
+ keys:
25
+ - v1-dependencies-{{ checksum "Gemfile.lock" }}
26
+ # fall back to using the latest cache if no exact match is found
27
+ - v1-dependencies
28
+
29
+ - run:
30
+ name: update bundler
31
+ command: |
32
+ gem install bundler --version $(tail -n 1 ~/repo/Gemfile.lock | tr -d ' ')
33
+
34
+ - run:
35
+ name: install dependencies
36
+ command: |
37
+ bundle config set path vendor/bundle
38
+ bundle install --jobs=$(nproc) --retry=3
39
+
40
+ - save_cache:
41
+ paths:
42
+ - ./vendor/bundle
43
+ key: v1-dependencies-{{ checksum "Gemfile.lock" }}
44
+
45
+ # run tests!
46
+ - run:
47
+ name: run tests
48
+ command: |
49
+ mkdir /tmp/test-results
50
+ TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
51
+
52
+ bundle exec rspec --format progress \
53
+ --format RspecJunitFormatter \
54
+ --out /tmp/test-results/rspec.xml \
55
+ --format progress \
56
+ -- \
57
+ $TEST_FILES
58
+
59
+ # collect reports
60
+ - store_test_results:
61
+ path: /tmp/test-results
62
+ - store_artifacts:
63
+ path: /tmp/test-results
64
+ destination: test-results
data/.gitignore CHANGED
@@ -9,3 +9,6 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+
13
+ # don't commit gem builds
14
+ crapi-*.gem
data/.rubocop.yml CHANGED
@@ -1,81 +1,64 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.5
3
- Include:
4
- - "**/*.rake"
5
- - "**/Gemfile"
6
- - "**/Rakefile"
7
- - "**/Capfile"
8
- - "**/Berksfile"
9
- - "**/Cheffile"
10
- Exclude:
11
- - "vendor/**/*"
12
- - "db/**/*"
13
- - "tmp/**/*"
14
- - "true/**/*"
15
- Metrics/ClassLength:
16
- Description: Avoid classes longer than 100 lines of code.
17
- Enabled: false
18
- CountComments: false
19
- Max: 100
20
- Metrics/LineLength:
21
- Description: Limit lines to 100 characters.
2
+ TargetRubyVersion: 3.0
3
+ SuggestExtensions: false
4
+ NewCops: enable
5
+
6
+
7
+ Layout/EmptyLineAfterGuardClause:
8
+ # Add empty line after guard clause.
22
9
  Enabled: false
23
- Max: 100
10
+
11
+ Layout/LineLength:
12
+ # Checks that line length does not exceed the configured limit.
13
+ Max: 150
14
+
15
+
16
+ Metrics/AbcSize:
17
+ # A calculated magnitude based on number of assignments, branches, and conditions.
18
+ Max: 30
19
+
24
20
  Metrics/BlockLength:
21
+ # Avoid long blocks with many lines.
25
22
  Exclude:
26
23
  - 'spec/**/*.rb'
27
- Metrics/MethodLength:
28
- Description: Avoid methods longer than 10 lines of code.
29
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
30
- Enabled: false
31
- CountComments: false
32
- Max: 10
33
- Metrics/AbcSize:
34
- Description: A calculated magnitude based on number of assignments, branches, and conditions.
35
- Enabled: false
36
- Max: 15
24
+
37
25
  Metrics/CyclomaticComplexity:
38
- Description: A complexity metric that is strongly correlated to the number of test cases needed to validate a method.
39
- Enabled: false
40
- Max: 6
41
- Lint/Debugger:
42
- Description: Warn in debugger entries
43
- Enabled: false
44
- Style/SymbolArray:
45
- Description: Use %i or %I for arrays of symbols.
46
- Enabled: false
47
- Style/RegexpLiteral:
48
- Description: Enforces using / or %r around regular expressions.
49
- EnforcedStyle: percent_r
26
+ # A complexity metric that is strongly correlated to the number of test cases needed to validate a method.
27
+ Max: 10
28
+
29
+ Metrics/MethodLength:
30
+ # Avoid methods longer than 25 lines of code.
31
+ Max: 25
32
+
33
+
50
34
  Style/AsciiComments:
51
- # Disabling this so we can use non-breaking spaces (' ') in documentation comments, preventing browsers from collapsing multiple spaces in code blocks.
52
- Description: This cop checks for non-ascii (non-English) characters in comments.
53
- Enabled: false
54
- Style/NumericLiterals:
55
- Description: This cop checks for big numeric literals without _ between groups of digits in them.
56
- Enabled: false
57
- Style/Documentation:
58
- Description: Document classes and non-namespace modules.
59
- Enabled: false
35
+ # Use only ASCII symbols in comments.
36
+ #
37
+ # NLC: We're allowing non-breaking spaces (' '), as they're needed to prevent
38
+ # browsers from collapsing multiple spaces in documentation code blocks.
39
+ AllowedChars:
40
+ - ' '
41
+
60
42
  Style/ClassAndModuleChildren:
61
- Description: Use nested modules/class definitions instead of compact style.
62
- Enabled: false
63
- Style/FrozenStringLiteralComment:
64
- Enabled: false
65
- Style/EmptyMethod:
43
+ # Checks style of children classes and modules.
66
44
  Enabled: false
67
- Style/StderrPuts:
68
- Enabled: true
69
- Exclude:
70
- - 'bin/**/*'
71
- Style/BlockDelimiters:
72
- Description: Check for uses of braces or do/end around single line or multi-line blocks.
73
- Enabled: true
74
- Exclude:
75
- - 'spec/**/*.rb'
76
- Style/RescueModifier:
77
- Description: This cop checks for uses of rescue in its modifier form.
45
+
46
+ Style/FetchEnvVar:
47
+ # Suggests `ENV.fetch` for the replacement of `ENV[]`.
78
48
  Enabled: false
79
- Naming/UncommunicativeMethodParamName:
80
- Description: This cop checks method parameter names for how descriptive they are.
49
+
50
+ Style/FrozenStringLiteralComment:
51
+ # Add the frozen_string_literal comment to the top of files to help transition to frozen string literals by default.
52
+ EnforcedStyle: never
53
+
54
+ Style/NumericLiterals:
55
+ # Add underscores to large numeric literals to improve their readability.
81
56
  Enabled: false
57
+
58
+ Style/RegexpLiteral:
59
+ # Use / or %r around regular expressions.
60
+ EnforcedStyle: percent_r
61
+
62
+ Style/StringLiterals:
63
+ # Check for use of ' vs ".
64
+ ConsistentQuotesInMultiline: true
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.5.1
1
+ 3.4
data/Gemfile.lock CHANGED
@@ -1,62 +1,157 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- crapi (0.1.3)
5
- activesupport (~> 5.2.0)
4
+ crapi (1.0.0)
5
+ activesupport (>= 6.1.0, < 9)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activesupport (5.2.0)
11
- concurrent-ruby (~> 1.0, >= 1.0.2)
12
- i18n (>= 0.7, < 2)
13
- minitest (~> 5.1)
14
- tzinfo (~> 1.1)
15
- byebug (10.0.2)
16
- coderay (1.1.2)
17
- concurrent-ruby (1.0.5)
18
- diff-lcs (1.3)
19
- i18n (1.0.1)
10
+ activesupport (8.1.3)
11
+ base64
12
+ bigdecimal
13
+ concurrent-ruby (~> 1.0, >= 1.3.1)
14
+ connection_pool (>= 2.2.5)
15
+ drb
16
+ i18n (>= 1.6, < 2)
17
+ json
18
+ logger (>= 1.4.2)
19
+ minitest (>= 5.1)
20
+ securerandom (>= 0.3)
21
+ tzinfo (~> 2.0, >= 2.0.5)
22
+ uri (>= 0.13.1)
23
+ addressable (2.9.0)
24
+ public_suffix (>= 2.0.2, < 8.0)
25
+ ast (2.4.3)
26
+ base64 (0.3.0)
27
+ bigdecimal (4.1.2)
28
+ concurrent-ruby (1.3.7)
29
+ connection_pool (3.0.2)
30
+ crack (1.0.1)
31
+ bigdecimal
32
+ rexml
33
+ diff-lcs (1.6.2)
34
+ drb (2.2.3)
35
+ hashdiff (1.2.1)
36
+ i18n (1.15.2)
20
37
  concurrent-ruby (~> 1.0)
21
- method_source (0.9.0)
22
- minitest (5.11.3)
23
- pry (0.11.3)
24
- coderay (~> 1.1.0)
25
- method_source (~> 0.9.0)
26
- pry-byebug (3.6.0)
27
- byebug (~> 10.0)
28
- pry (~> 0.10)
29
- rake (10.5.0)
30
- rspec (3.7.0)
31
- rspec-core (~> 3.7.0)
32
- rspec-expectations (~> 3.7.0)
33
- rspec-mocks (~> 3.7.0)
34
- rspec-core (3.7.1)
35
- rspec-support (~> 3.7.0)
36
- rspec-expectations (3.7.0)
38
+ json (2.20.0)
39
+ language_server-protocol (3.17.0.6)
40
+ lint_roller (1.1.0)
41
+ logger (1.7.0)
42
+ minitest (6.0.6)
43
+ drb (~> 2.0)
44
+ prism (~> 1.5)
45
+ parallel (2.1.0)
46
+ parser (3.3.11.1)
47
+ ast (~> 2.4.1)
48
+ racc
49
+ prism (1.9.0)
50
+ public_suffix (7.0.5)
51
+ racc (1.8.1)
52
+ rainbow (3.1.1)
53
+ regexp_parser (2.12.0)
54
+ rexml (3.4.4)
55
+ rspec (3.13.2)
56
+ rspec-core (~> 3.13.0)
57
+ rspec-expectations (~> 3.13.0)
58
+ rspec-mocks (~> 3.13.0)
59
+ rspec-core (3.13.6)
60
+ rspec-support (~> 3.13.0)
61
+ rspec-expectations (3.13.5)
37
62
  diff-lcs (>= 1.2.0, < 2.0)
38
- rspec-support (~> 3.7.0)
39
- rspec-mocks (3.7.0)
63
+ rspec-support (~> 3.13.0)
64
+ rspec-mocks (3.13.8)
40
65
  diff-lcs (>= 1.2.0, < 2.0)
41
- rspec-support (~> 3.7.0)
42
- rspec-support (3.7.1)
43
- rspec_junit_formatter (0.3.0)
66
+ rspec-support (~> 3.13.0)
67
+ rspec-support (3.13.7)
68
+ rspec_junit_formatter (0.6.0)
44
69
  rspec-core (>= 2, < 4, != 2.12.0)
45
- thread_safe (0.3.6)
46
- tzinfo (1.2.5)
47
- thread_safe (~> 0.1)
70
+ rubocop (1.88.1)
71
+ json (~> 2.3)
72
+ language_server-protocol (~> 3.17.0.2)
73
+ lint_roller (~> 1.1.0)
74
+ parallel (>= 1.10)
75
+ parser (>= 3.3.0.2)
76
+ rainbow (>= 2.2.2, < 4.0)
77
+ regexp_parser (>= 2.9.3, < 3.0)
78
+ rubocop-ast (>= 1.49.0, < 2.0)
79
+ ruby-progressbar (~> 1.7)
80
+ unicode-display_width (>= 2.4.0, < 4.0)
81
+ rubocop-ast (1.50.0)
82
+ parser (>= 3.3.7.2)
83
+ prism (~> 1.7)
84
+ ruby-progressbar (1.13.0)
85
+ securerandom (0.4.1)
86
+ tzinfo (2.0.6)
87
+ concurrent-ruby (~> 1.0)
88
+ unicode-display_width (3.2.0)
89
+ unicode-emoji (~> 4.1)
90
+ unicode-emoji (4.2.0)
91
+ uri (1.1.1)
92
+ webmock (3.26.2)
93
+ addressable (>= 2.8.0)
94
+ crack (>= 0.3.2)
95
+ hashdiff (>= 0.4.0, < 2.0.0)
96
+ yard (0.9.44)
48
97
 
49
98
  PLATFORMS
50
99
  ruby
100
+ x86_64-linux
51
101
 
52
102
  DEPENDENCIES
53
- bundler (~> 1.16)
103
+ bundler (~> 4)
54
104
  crapi!
55
- pry (~> 0.11)
56
- pry-byebug (~> 3.6)
57
- rake (~> 10.0)
58
- rspec (~> 3.0)
59
- rspec_junit_formatter (~> 0.3)
105
+ rspec (~> 3)
106
+ rspec_junit_formatter
107
+ rubocop
108
+ webmock
109
+ yard
110
+
111
+ CHECKSUMS
112
+ activesupport (8.1.3) sha256=21a5e0dfbd4c3ddd9e1317ec6a4d782fa226e7867dc70b0743acda81a1dca20e
113
+ addressable (2.9.0) sha256=7fdf6ac3660f7f4e867a0838be3f6cf722ace541dd97767fa42bc6cfa980c7af
114
+ ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
115
+ base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
116
+ bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd
117
+ bundler (4.0.14) sha256=d09a0a965cf772266a7e49e83610be7c2f4e49e61134c42a56804bb383cc24b8
118
+ concurrent-ruby (1.3.7) sha256=4412caec3a5ea2e5fdc52076724c071a81f2c0593d83b2ac8cbb8ca63b3151b0
119
+ connection_pool (3.0.2) sha256=33fff5ba71a12d2aa26cb72b1db8bba2a1a01823559fb01d29eb74c286e62e0a
120
+ crack (1.0.1) sha256=ff4a10390cd31d66440b7524eb1841874db86201d5b70032028553130b6d4c7e
121
+ crapi (1.0.0)
122
+ diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
123
+ drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
124
+ hashdiff (1.2.1) sha256=9c079dbc513dfc8833ab59c0c2d8f230fa28499cc5efb4b8dd276cf931457cd1
125
+ i18n (1.15.2) sha256=00f9eb62412fe593b2a65a97daa75300d37abb8f7202ec748e94b6d46a9dd1b5
126
+ json (2.20.0) sha256=9362bc6e55a952b056abf9167cf053358181c904cb70cd6eee0808ea830fc32b
127
+ language_server-protocol (3.17.0.6) sha256=5ef2c0c138f8267e1bc631d3328347d354f96724b0af22f2c79516120443b7f0
128
+ lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
129
+ logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
130
+ minitest (6.0.6) sha256=153ea36d1d987a62942382b61075745042a2b3123b1cd48f4c3675af9cc7d6f1
131
+ parallel (2.1.0) sha256=b35258865c2e31134c5ecb708beaaf6772adf9d5efae28e93e99260877b09356
132
+ parser (3.3.11.1) sha256=d17ace7aabe3e72c3cc94043714be27cc6f852f104d81aa284c2281aecc65d54
133
+ prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85
134
+ public_suffix (7.0.5) sha256=1a8bb08f1bbea19228d3bed6e5ed908d1cb4f7c2726d18bd9cadf60bc676f623
135
+ racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
136
+ rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
137
+ regexp_parser (2.12.0) sha256=35a916a1d63190ab5c9009457136ae5f3c0c7512d60291d0d1378ba18ce08ebb
138
+ rexml (3.4.4) sha256=19e0a2c3425dfbf2d4fc1189747bdb2f849b6c5e74180401b15734bc97b5d142
139
+ rspec (3.13.2) sha256=206284a08ad798e61f86d7ca3e376718d52c0bc944626b2349266f239f820587
140
+ rspec-core (3.13.6) sha256=a8823c6411667b60a8bca135364351dda34cd55e44ff94c4be4633b37d828b2d
141
+ rspec-expectations (3.13.5) sha256=33a4d3a1d95060aea4c94e9f237030a8f9eae5615e9bd85718fe3a09e4b58836
142
+ rspec-mocks (3.13.8) sha256=086ad3d3d17533f4237643de0b5c42f04b66348c28bf6b9c2d3f4a3b01af1d47
143
+ rspec-support (3.13.7) sha256=0640e5570872aafefd79867901deeeeb40b0c9875a36b983d85f54fb7381c47c
144
+ rspec_junit_formatter (0.6.0) sha256=40dde674e6ae4e6cc0ff560da25497677e34fefd2338cc467a8972f602b62b15
145
+ rubocop (1.88.1) sha256=726af773d6bc169ed3ff852f3ca020b7c58d39c34e7a8d879a8e0147cc994f26
146
+ rubocop-ast (1.50.0) sha256=b9ca88300da0803ee222ad20cdb30494c0a784eed06fdc35d254b06d662788db
147
+ ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
148
+ securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
149
+ tzinfo (2.0.6) sha256=8daf828cc77bcf7d63b0e3bdb6caa47e2272dcfaf4fbfe46f8c3a9df087a829b
150
+ unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42
151
+ unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f
152
+ uri (1.1.1) sha256=379fa58d27ffb1387eaada68c749d1426738bd0f654d812fcc07e7568f5c57c6
153
+ webmock (3.26.2) sha256=774556f2ea6371846cca68c01769b2eac0d134492d21f6d0ab5dd643965a4c90
154
+ yard (0.9.44) sha256=eb087e9b631ccd887b049f303d489963945452d5e2a7eb49a5a74a7cf6887f28
60
155
 
61
156
  BUNDLED WITH
62
- 1.16.2
157
+ 4.0.14
data/README.md CHANGED
@@ -1,10 +1,12 @@
1
- # Crapi [![Gem Version](https://badge.fury.io/rb/crapi.svg)](https://badge.fury.io/rb/crapi)
1
+ [![Gem Version](https://img.shields.io/github/v/release/nestor-custodio/crapi?color=green&label=gem%20version)](https://rubygems.org/gems/crapi)
2
+ [![MIT License](https://img.shields.io/github/license/nestor-custodio/crapi)](https://tldrlegal.com/license/mit-license)
2
3
 
3
- Crapi is yet another API wrapper. Yes, there is no shortage of these out there, but no other API wrapper gem (that I could find) provided the kind of functionality you get from the Crapi::Proxy class, which is really the biggest benefit here.
4
4
 
5
- **Crapi::Client** will connect to the target system and handily provides a base path for you (becaue some APIs and services have a path that is always part of every request), **Crapi::Proxy** lets you add to the root client's base path or default set of headers without having to create any new connections.
5
+ # CrAPI
6
6
 
7
- Why "crapi"? Because it's a <u>CR</u>UD <u>API</u> client, and (honestly) "... It could be better."™️
7
+ CrAPI is yet another **Cr**ud **API** client wrapper. Yes, there is no shortage of these out there, but no other API wrapper gem (that I could find) provided the kind of functionality you get from the CrAPI::Proxy class, which is really the biggest benefit here.
8
+
9
+ **CrAPI::Client** will connect to the target system and handily provides a base path for you (because some APIs and services have a path that is always part of every request), **CrAPI::Proxy** lets you add to the root client's base path or default set of headers without having to create any new connections.
8
10
 
9
11
 
10
12
  ## Installation
@@ -24,24 +26,24 @@ Or install it yourself as:
24
26
  $ gem install crapi
25
27
 
26
28
 
27
- ## Using The Crapi Tools
29
+ ## Using The CrAPI Tools
28
30
 
29
31
  ### Client Usage
30
32
 
31
33
  ```ruby
32
- ## Connect to an API.
34
+ # Connect to an API.
33
35
 
34
- api = Crapi::Client.new('https://jsonplaceholder.typicode.com/')
36
+ api = CrAPI::Client.new('https://jsonplaceholder.typicode.com/')
35
37
 
36
38
 
37
- ## Issue requests against the API.
39
+ # Issue requests against the API.
38
40
 
39
- api.get('users/1') ## GETs /users/1; returns a Hash.
41
+ api.get('users/1') # GETs /users/1; returns a Hash.
40
42
 
41
- api.get('posts', query: { userId: 2 }) ## GETs /posts?userId=2; returns an Array.
43
+ api.get('posts', query: { userId: 2 }) # GETs /posts?userId=2; returns an Array.
42
44
 
43
45
  mew_comment = { user: 'megapwner', text: 'FRIST!!1!' }
44
- api.post('comments', payload: new_comment) ## POSTs to /comments; returns a Hash.
46
+ api.post('comments', payload: new_comment) # POSTs to /comments; returns a Hash.
45
47
  ```
46
48
 
47
49
  ---
@@ -49,40 +51,40 @@ api.post('comments', payload: new_comment) ## POSTs to /comments; returns a Has
49
51
  ### Proxy Usage
50
52
 
51
53
  ```ruby
52
- ## Connect to an API.
54
+ # Connect to an API.
53
55
 
54
- api = Crapi::Client.new('https://versioned.fake-api.com/api/')
56
+ api = CrAPI::Client.new('https://versioned.fake-api.com/api/')
55
57
 
56
58
 
57
- ## Back in the v1 days, versioning of this API was via the URL ...
59
+ # Back in the v1 days, versioning of this API was via the URL ...
58
60
 
59
61
  v1 = api.new_proxy('/v1')
60
62
 
61
- v1.get('data') ## GETs /api/v1/data; pretty straight-forward.
62
- v1.post('data', payload: values) ## POSTs *values* to /api/v1/data.
63
+ v1.get('data') # GETs /api/v1/data; pretty straight-forward.
64
+ v1.post('data', payload: values) # POSTs *values* to /api/v1/data.
63
65
 
64
66
 
65
- ## For API v2, they switched to an Accept header approach ...
67
+ # For API v2, they switched to an Accept header approach ...
66
68
 
67
69
  v2 = api.new_proxy('/', headers: { Accept: 'application/vnd.fake-api.v2+json' })
68
70
 
69
- v2.get('data') ## GETs /api/data with the v2 header.
71
+ v2.get('data') # GETs /api/data with the v2 header.
70
72
 
71
73
 
72
- ## API v3 keeps the Accept header approach ...
74
+ # API v3 keeps the Accept header approach ...
73
75
 
74
76
  v3 = api.new_proxy('/', headers: { Accept: 'application/vnd.fake-api.v3+json' })
75
77
 
76
- v3.get('data') ## GETs /api/data with the v3 header.
78
+ v3.get('data') # GETs /api/data with the v3 header.
77
79
 
78
80
 
79
- ## Note that only one connection to the client is made and you can easily make
80
- ## v1, v2, and v3 API calls ad hoc without having to juggle paths/headers yourself.
81
+ # Note that only one connection to the client is made and you can easily make
82
+ # v1, v2, and v3 API calls ad hoc without having to juggle paths/headers yourself.
81
83
  ```
82
84
 
83
85
  ---
84
86
 
85
- [Consult the repo docs for the full Crapi documentation.](http://nestor-custodio.github.io/crapi/Crapi.html)
87
+ [Consult the repo docs for the full CrAPI documentation.](https://nestor-custodio.github.io/crapi/CrAPI.html)
86
88
 
87
89
 
88
90
  ## Feature Roadmap / Future Development
@@ -95,13 +97,13 @@ Additional features/options coming in the future:
95
97
 
96
98
  ## Contribution / Development
97
99
 
98
- Bug reports and pull requests are welcome on GitHub at https://github.com/nestor-custodio/crapi.
100
+ Bug reports and pull requests are welcome at: [https://github.com/nestor-custodio/crapi](https://github.com/nestor-custodio/crapi)
99
101
 
100
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
102
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
101
103
 
102
- Linting is courtesy of [Rubocop](https://github.com/bbatsov/rubocop) and documentation is built using [Yard](https://yardoc.org/). Neither is included in the Gemspec; you'll need to install these locally (`gem install rubocop yard`) to take advantage.
104
+ Linting is courtesy of [Rubocop](https://docs.rubocop.org/) (`bundle exec rubocop`) and documentation is built using [Yard](https://yardoc.org/) (`bundle exec yard`). Please ensure you have a clean bill of health from Rubocop and that any new features and/or changes to behaviour are reflected in the documentation before submitting a pull request.
103
105
 
104
106
 
105
107
  ## License
106
108
 
107
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
109
+ CrAPI is available as open source under the terms of the [MIT License](https://tldrlegal.com/license/mit-license).
data/crapi.gemspec CHANGED
@@ -1,31 +1,31 @@
1
-
2
1
  lib = File.expand_path('lib', __dir__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
3
  require 'crapi/version'
5
4
 
6
5
  Gem::Specification.new do |spec|
6
+ spec.required_ruby_version = ['>= 3']
7
+
7
8
  spec.name = 'crapi'
8
- spec.version = Crapi::VERSION
9
+ spec.version = CrAPI::VERSION
9
10
  spec.authors = ['Nestor Custodio']
10
- spec.email = ['sakimorix@gmail.com']
11
+ spec.email = ['nestor@custodio.org']
11
12
 
12
- spec.summary = 'A simple API client with built-in segment/header proxy support. "... It could be better." ™️'
13
- spec.homepage = 'https://www.github.com/nestor-custodio/crapi'
13
+ spec.summary = 'A simple API client with built-in segment/header proxy support.'
14
+ spec.homepage = 'https://github.com/nestor-custodio/crapi'
14
15
  spec.license = 'MIT'
15
16
 
16
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
17
- f.match(%r{^(test|spec|features)/})
18
- end
19
- spec.bindir = 'exe'
20
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |filename| filename.start_with? 'spec/' }
18
+ spec.executables = []
21
19
  spec.require_paths = ['lib']
22
20
 
23
- spec.add_development_dependency 'bundler', '~> 1.16'
24
- spec.add_development_dependency 'pry', '~> 0.11'
25
- spec.add_development_dependency 'pry-byebug', '~> 3.6'
26
- spec.add_development_dependency 'rake', '~> 10.0'
27
- spec.add_development_dependency 'rspec', '~> 3.0'
28
- spec.add_development_dependency 'rspec_junit_formatter', '~> 0.3'
21
+ spec.metadata['rubygems_mfa_required'] = 'true'
22
+
23
+ spec.add_dependency 'activesupport', ['>= 6.1.0', '< 9']
29
24
 
30
- spec.add_dependency 'activesupport', '~> 5.2.0'
25
+ spec.add_development_dependency 'bundler', '~> 4'
26
+ spec.add_development_dependency 'rspec', '~> 3'
27
+ spec.add_development_dependency 'rspec_junit_formatter'
28
+ spec.add_development_dependency 'rubocop'
29
+ spec.add_development_dependency 'webmock'
30
+ spec.add_development_dependency 'yard'
31
31
  end