jahuty 2.0.0 → 3.2.0
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 +4 -4
- data/.circleci/config.yml +33 -0
- data/.rubocop.yml +15 -0
- data/CHANGELOG.md +24 -0
- data/Gemfile +3 -1
- data/README.md +176 -39
- data/Rakefile +11 -3
- data/bin/console +4 -3
- data/bin/setup +2 -0
- data/jahuty.gemspec +33 -16
- data/lib/jahuty.rb +25 -15
- data/lib/jahuty/action/base.rb +15 -0
- data/lib/jahuty/action/index.rb +9 -0
- data/lib/jahuty/action/show.rb +16 -0
- data/lib/jahuty/api/client.rb +37 -0
- data/lib/jahuty/cache/facade.rb +46 -0
- data/lib/jahuty/client.rb +51 -0
- data/lib/jahuty/exception/{not_ok.rb → error.rb} +6 -1
- data/lib/jahuty/request/base.rb +16 -0
- data/lib/jahuty/request/factory.rb +29 -0
- data/lib/jahuty/resource/factory.rb +27 -0
- data/lib/jahuty/resource/problem.rb +25 -0
- data/lib/jahuty/resource/render.rb +26 -0
- data/lib/jahuty/response/handler.rb +60 -0
- data/lib/jahuty/service/base.rb +12 -0
- data/lib/jahuty/service/snippet.rb +97 -0
- data/lib/jahuty/util.rb +25 -0
- data/lib/jahuty/version.rb +3 -1
- metadata +140 -12
- data/lib/jahuty/data/problem.rb +0 -21
- data/lib/jahuty/data/render.rb +0 -21
- data/lib/jahuty/service/connect.rb +0 -23
- data/lib/jahuty/service/render.rb +0 -25
- data/lib/jahuty/snippet.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42d427523be1564e07087d282367b7c13b9e80ac7219522a26a86a04f6fd23e7
|
4
|
+
data.tar.gz: 5f164380a18fda536c08c918dbfaaba6aaffc02183cfb2e74c6944b3e0bc42c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5b8c35c587b3f26a7fce8830963c98c859307e444edf5a0b058695e954fc5ce1dd0220b25f99d874ed983f1c72474546b51a2294f718bbea0358198d01ce6f6
|
7
|
+
data.tar.gz: 6f037d7ee49936532c2bd2ed5ed6f91942352f95082da4af28bd390afd3bc0d0dfdcda847f2c4e4ad742e4b1702562c9c6cba6c0fd5df4c923756c4113aa3d6a
|
@@ -0,0 +1,33 @@
|
|
1
|
+
version: 2.1
|
2
|
+
orbs:
|
3
|
+
ruby: circleci/ruby@0.1.2
|
4
|
+
codecov: codecov/codecov@1.1.3
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
docker:
|
8
|
+
- image: circleci/ruby:2.6.3-stretch-node
|
9
|
+
executor: ruby/default
|
10
|
+
steps:
|
11
|
+
- checkout
|
12
|
+
- run:
|
13
|
+
name: Update bundler
|
14
|
+
command: gem install bundler
|
15
|
+
- run:
|
16
|
+
name: Which bundler?
|
17
|
+
command: bundle -v
|
18
|
+
- ruby/bundle-install
|
19
|
+
- run:
|
20
|
+
name: Run rubocop
|
21
|
+
command: bundle exec rake rubocop
|
22
|
+
- run:
|
23
|
+
name: Run specs
|
24
|
+
command: |
|
25
|
+
bundle exec rspec --profile 10 \
|
26
|
+
--format RspecJunitFormatter \
|
27
|
+
--out test_results/rspec.xml \
|
28
|
+
--format progress \
|
29
|
+
$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
|
30
|
+
- store_test_results:
|
31
|
+
path: test_results
|
32
|
+
- codecov/upload:
|
33
|
+
file: ./coverage/coverage.xml
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-performance
|
3
|
+
- rubocop-rspec
|
4
|
+
AllCops:
|
5
|
+
TargetRubyVersion: 2.6
|
6
|
+
NewCops: enable
|
7
|
+
Metrics/BlockLength:
|
8
|
+
Exclude:
|
9
|
+
- 'jahuty.gemspec'
|
10
|
+
- 'Rakefile'
|
11
|
+
- '**/*.rake'
|
12
|
+
- 'spec/**/*.rb'
|
13
|
+
Metrics/ModuleLength:
|
14
|
+
Exclude:
|
15
|
+
- 'spec/**/*.rb'
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,30 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
7
|
|
8
|
+
## 3.2.0 - 2020-03-08
|
9
|
+
|
10
|
+
* Added collections to the library with `all_renders` method. This was a rather large change and required adding new objects like `Action::Show`, refactoring old ones like `Resource::Factory`, and removing some objects like `Cache::Manager` and `Service::Factory` which added unnecessary complexity.
|
11
|
+
* Added `snippet_id` to `Resource::Render` to help keep track of a render's parent snippet.
|
12
|
+
|
13
|
+
## 3.1.1 - 2020-02-26
|
14
|
+
|
15
|
+
- Add support for extra, unused attributes returned by the API to support evolution.
|
16
|
+
- Fix the `method redefined` warnings in `cache/manager_spec.rb` and `cache/facade_spec.rb`.
|
17
|
+
- Fix the `expect { }.not_to raise_error(SpecificErrorClass)` false positives warnings in `resource/render_spec.rb`.
|
18
|
+
|
19
|
+
## 3.1.0 - 2020-01-04
|
20
|
+
|
21
|
+
- Add caching support for any cache implementation that supports `get/set` or `read/write` methods.
|
22
|
+
- Default to using in-memory [mini-cache](https://github.com/derrickreimer/mini_cache) storage.
|
23
|
+
|
24
|
+
## 3.0.0 - 2020-12-30
|
25
|
+
|
26
|
+
- Change from a static-based architecture (e.g., `Jahuty::Snippet.render(1)`) to an instance-based one (e.g., `jahuty.snippets.render(1)`) to make the library easier to develop, test, and use.
|
27
|
+
- Change `README` and fix broken links from `www.jahuty.com/docs` to `docs.jahuty.com`.
|
28
|
+
- Add [CircleCI](https://circleci.com/gh/jahuty/jahuty-ruby) continuous integration.
|
29
|
+
- Add [Rubocop](https://github.com/rubocop-hq/rubocop) code analyzer and formatter, based on the community style guide.
|
30
|
+
- Add code coverage analysis with [Simplecov](https://github.com/simplecov-ruby/simplecov) and [Codecov.io](https://codecov.io/gh/jahuty/jahuty-ruby).
|
31
|
+
|
8
32
|
## 2.0.0 - 2020-07-04
|
9
33
|
|
10
34
|
- Change `Service::Get` to `Service::Render`.
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,96 +1,233 @@
|
|
1
|
+
[](https://circleci.com/gh/jahuty/jahuty-ruby) [](https://codecov.io/gh/jahuty/jahuty-ruby) [](https://github.com/rubocop-hq/rubocop)
|
2
|
+
|
1
3
|
# jahuty-ruby
|
2
|
-
|
4
|
+
|
5
|
+
Welcome to the [Ruby SDK](https://docs.jahuty.com/sdks/ruby) for [Jahuty's API](https://docs.jahuty.com/api)!
|
3
6
|
|
4
7
|
## Installation
|
5
8
|
|
6
|
-
This library requires [Ruby 2.
|
9
|
+
This library requires [Ruby 2.6+](https://www.ruby-lang.org/en/downloads/releases/).
|
7
10
|
|
8
11
|
It is multi-platform, and we strive to make it run equally well on Windows, Linux, and OSX.
|
9
12
|
|
10
|
-
|
13
|
+
To install, add this line to your application's `Gemfile` and run `bundle install`:
|
11
14
|
|
12
15
|
```ruby
|
13
|
-
gem
|
14
|
-
```
|
15
|
-
|
16
|
-
And then execute:
|
17
|
-
|
18
|
-
```bash
|
19
|
-
$ bundle
|
16
|
+
gem 'jahuty', '~> 3.1'
|
20
17
|
```
|
21
18
|
|
22
19
|
## Usage
|
23
20
|
|
24
|
-
|
21
|
+
Instantiate the client with your [API key](https://docs.jahuty.com/api#authentication) and use `snippets.render` to render your snippet:
|
25
22
|
|
26
23
|
```ruby
|
27
|
-
|
24
|
+
jahuty = Jahuty::Client.new(api_key: 'YOUR_API_KEY')
|
28
25
|
|
29
|
-
|
26
|
+
puts jahuty.snippets.render YOUR_SNIPPET_ID
|
30
27
|
```
|
31
28
|
|
32
|
-
|
29
|
+
You can access the render's content with `to_s` or `content`:
|
33
30
|
|
34
31
|
```ruby
|
35
|
-
|
32
|
+
jahuty = Jahuty::Client.new(api_key: 'YOUR_API_KEY')
|
36
33
|
|
37
|
-
|
38
|
-
render = Snippet.render YOUR_SNIPPET_ID
|
34
|
+
render = jahuty.snippets.render YOUR_SNIPPET_ID
|
39
35
|
|
40
|
-
|
41
|
-
render.to_s
|
36
|
+
a = render.to_s
|
42
37
|
|
43
|
-
|
44
|
-
|
38
|
+
b = render.content
|
39
|
+
|
40
|
+
a == b # returns true
|
45
41
|
```
|
46
42
|
|
47
43
|
In an HTML view:
|
48
44
|
|
49
45
|
```html+erb
|
50
|
-
<%-
|
51
|
-
require "jahuty"
|
52
|
-
|
53
|
-
Jahuty.key = "YOUR_API_KEY"
|
54
|
-
%>
|
46
|
+
<%- jahuty = Jahuty::Client.new(api_key: 'YOUR_API_KEY') -%>
|
55
47
|
<!doctype html>
|
56
48
|
<html>
|
57
49
|
<head>
|
58
50
|
<title>Awesome example</title>
|
59
51
|
</head>
|
60
52
|
<body>
|
61
|
-
|
53
|
+
<%== jahuty.snippets.render YOUR_SNIPPET_ID %>
|
62
54
|
</body>
|
63
55
|
```
|
64
56
|
|
57
|
+
You can also use tags to render a collection of snippets with the `snippets.all_renders` method:
|
58
|
+
|
59
|
+
```ruby
|
60
|
+
jahuty = Jahuty::Client.new(api_key: 'YOUR_API_KEY')
|
61
|
+
|
62
|
+
renders = jahuty.snippets.all_renders 'YOUR_TAG'
|
63
|
+
|
64
|
+
renders.each { |render| puts render }
|
65
|
+
```
|
66
|
+
|
65
67
|
## Parameters
|
66
68
|
|
67
|
-
You can [pass parameters](https://
|
69
|
+
You can [pass parameters](https://docs.jahuty.com/liquid/parameters) into your renders using the `params` option:
|
68
70
|
|
69
71
|
```ruby
|
70
|
-
|
72
|
+
jahuty = Jahuty::Client.new(api_key: 'YOUR_API_KEY')
|
71
73
|
|
72
|
-
|
74
|
+
jahuty.snippets.render YOUR_SNIPPET_ID, params: { foo: 'bar' }
|
73
75
|
```
|
74
76
|
|
75
|
-
The parameters above would be equivalent to [assigning the
|
77
|
+
The parameters above would be equivalent to [assigning the variable](https://docs.jahuty.com/liquid/variables) below in your snippet:
|
76
78
|
|
77
79
|
```html
|
78
80
|
{% assign foo = "bar" %}
|
79
81
|
```
|
80
82
|
|
81
|
-
|
83
|
+
If you're rendering a collection, the first dimension of the `params` key determines the parameters' scope. Use an asterisk key (`*`) to pass the same parameters to all snippets, or use a snippet id as key to pass parameters to a specific snippet.
|
84
|
+
|
85
|
+
```ruby
|
86
|
+
jahuty = Jahuty::Client.new(api_key: 'YOUR_API_KEY')
|
87
|
+
|
88
|
+
jahuty.snippets.all_renders 'YOUR_TAG', params: {
|
89
|
+
'*' => { foo: 'bar' },
|
90
|
+
'1' => { baz: 'qux' }
|
91
|
+
}
|
92
|
+
```
|
82
93
|
|
83
|
-
|
94
|
+
This will pass the params `{ foo: 'bar' }` to all snippets, except for snippet `1`, which will be passed `{ foo: 'bar', baz: 'qux' }`.
|
95
|
+
|
96
|
+
The two parameter lists will be merged recursively, and parameters for a specific snippet will take precedence over parameters for all snippets. For example, the parameter `foo` will be assigned the value `"bar"` for all snippets, except for snippet `1`, where it will be assigned the value `"qux"`:
|
84
97
|
|
85
98
|
```ruby
|
86
|
-
|
99
|
+
jahuty = Jahuty::Client.new(api_key: 'YOUR_API_KEY')
|
100
|
+
|
101
|
+
jahuty.snippets.all_renders 'YOUR_TAG', params: {
|
102
|
+
'*' => { foo: 'bar' },
|
103
|
+
'1' => { foo: 'qux' }
|
104
|
+
}
|
105
|
+
```
|
106
|
+
|
107
|
+
## Caching
|
108
|
+
|
109
|
+
You can use caching to control how frequently this library requests the latest content from Jahuty's API.
|
110
|
+
|
111
|
+
* When content is in _development_ (i.e., frequently changing and low traffic), you can use the default in-memory store to view content changes instantaneously with slower response times.
|
112
|
+
* When content is in _production_ (i.e., more stable and high traffic), you can use persistent caching to update content less frequently and improve your application's response time.
|
113
|
+
|
114
|
+
### Caching in memory (default)
|
115
|
+
|
116
|
+
By default, this library uses an in-memory cache to avoid requesting the same render more than once during the same request lifecycle. For example:
|
117
|
+
|
118
|
+
```ruby
|
119
|
+
jahuty = Jahuty::Client.new(api_key: 'YOUR_API_KEY')
|
120
|
+
|
121
|
+
# This call will send a synchronous API request; cache the result in memory;
|
122
|
+
# and, return the result to the caller.
|
123
|
+
render1 = jahuty.snippets.render YOUR_SNIPPET_ID
|
124
|
+
|
125
|
+
# This call skips sending an API request and uses the cached value instead.
|
126
|
+
render2 = jahuty.snippets.render YOUR_SNIPPET_ID
|
127
|
+
```
|
128
|
+
|
129
|
+
The in-memory cache only persists for the duration of the original request, however. At the end of the request's lifecycle, the cache will be discarded. To store renders across requests, you need a persistent cache.
|
130
|
+
|
131
|
+
### Caching persistently
|
132
|
+
|
133
|
+
A persistent cache allows renders to be cached across multiple requests. This reduces the number of synchronous network requests to Jahuty's API and improves your application's average response time.
|
134
|
+
|
135
|
+
To configure Jahuty to use your persistent cache, pass a cache implementation to the client via the `cache` configuration option:
|
136
|
+
|
137
|
+
```ruby
|
138
|
+
jahuty = new Jahuty::Client.new(
|
139
|
+
api_key: 'YOUR_API_KEY',
|
140
|
+
cache: cache
|
141
|
+
)
|
142
|
+
```
|
143
|
+
|
144
|
+
The persistent cache implementation you choose and configure is up to you. There are many libraries available, and most frameworks provide their own. At this time, we support any object which responds to `get(key)`/`set(key, value, expires_in:)` or `read(key)`/`write(key, value, expires_in:)` including [ActiveSupport::Cache::Store](https://api.rubyonrails.org/classes/ActiveSupport/Cache/Store.html#method-i-fetch).
|
87
145
|
|
146
|
+
### Expiring
|
147
|
+
|
148
|
+
There are three methods for configuring this library's `:expires_in`, the amount of time between when a render is stored and when it's considered stale. From lowest-to-highest precedence, the methods are:
|
149
|
+
|
150
|
+
1. configuring your caching implementation,
|
151
|
+
1. configuring this library's default `:expires_in`, and
|
152
|
+
1. configuring a render's `:expires_in`.
|
153
|
+
|
154
|
+
#### Configuring your caching implementation
|
155
|
+
|
156
|
+
You can usually configure your caching implementation with a default `:expires_in`. If no other `:expires_in` is configured, this library will defer to the caching implementation's default `:expires_in`.
|
157
|
+
|
158
|
+
#### Configuring this library's default `:expires_in`
|
159
|
+
|
160
|
+
You can configure a default `:expires_in` for all of this library's renders by passing an integer number of seconds via the client's `:expires_in` configuration option:
|
161
|
+
|
162
|
+
```ruby
|
163
|
+
jahuty = Jahuty::Client.new(
|
164
|
+
api_key: 'YOUR_API_KEY',
|
165
|
+
cache: cache,
|
166
|
+
expires_in: 60 # <- Cache all renders for sixty seconds
|
167
|
+
)
|
168
|
+
```
|
169
|
+
|
170
|
+
If this library's default `:expires_in` is set, it will take precedence over the default `:expires_in` of the caching implementation.
|
171
|
+
|
172
|
+
#### Configuring a render's `:expires_in`
|
173
|
+
|
174
|
+
You can configure `:expires_in` for individual renders by passing an integer number of seconds via the render method's `:expires_in` configuration option:
|
175
|
+
|
176
|
+
```ruby
|
177
|
+
# Cache all renders 300 seconds (five minutes).
|
178
|
+
jahuty = Jahuty::Client.new(api_key: 'YOUR_API_KEY', cache: cache, expires_in: 300)
|
179
|
+
|
180
|
+
# Except, cache this render for 60 seconds.
|
181
|
+
render = jahuty.snippets.render YOUR_SNIPPET_ID, expires_in: 60
|
182
|
+
|
183
|
+
# Except, cache the renders in this collection for 120 seconds.
|
184
|
+
render = jahuty.snippets.all_renders 'YOUR_TAG', expires_in: 120
|
185
|
+
```
|
186
|
+
|
187
|
+
If a render's `:expires_in` is set, it will take precedence over the library's default `:expires_in` and the caching implementation's `:expires_in`.
|
188
|
+
|
189
|
+
### Caching collections
|
190
|
+
|
191
|
+
By default, this library will cache each render returned by `all_renders`:
|
192
|
+
|
193
|
+
```ruby
|
194
|
+
jahuty = Jahuty::Client.new(api_key: 'YOUR_API_KEY', cache: cache)
|
195
|
+
|
196
|
+
# Sends a network request, caches each render, and returns the collection.
|
197
|
+
jahuty.snippets.all_renders 'YOUR_TAG';
|
198
|
+
|
199
|
+
# If this reder exists in the collection, the cached value will be used instead
|
200
|
+
# of sending a network request for the latest version.
|
201
|
+
jahuty.snippets.render YOUR_SNIPPET_ID;
|
202
|
+
```
|
203
|
+
|
204
|
+
This is a powerful feature, especially when combined with a persistent cache. Using the `all_renders` method, you can render and cache an arbitrarily large chunk of content with a single network request. Because any subsequent call to `render` a snippet in the collection will use its cached version, you can reduce the number of network requests to load your content.
|
205
|
+
|
206
|
+
This method is even more powerful when combined with an asynchronous background job. When `all_renders` can be called outside your request cycle periodically, you can turn your cache into your content storage mechanism. You can render and cache dynamic content as frequently as you like without any hit to your application's response time.
|
207
|
+
|
208
|
+
### Disabling caching
|
209
|
+
|
210
|
+
You can disable caching, even the default in-memory caching, by passing an `:expires_in` of zero (`0`) or a negative integer (e.g., `-1`) via any of the methods described above. For example:
|
211
|
+
|
212
|
+
```ruby
|
213
|
+
# Disable all caching.
|
214
|
+
jahuty1 = Jahuty::Client.new(api_key: 'YOUR_API_KEY', expires_in: 0)
|
215
|
+
|
216
|
+
# Disable caching for this render.
|
217
|
+
jahuty2 = Jahuty::Client.new(api_key: 'YOUR_API_KEY', expires_in: 60)
|
218
|
+
jahuty2.snippets.render 1, expires_in: 0
|
219
|
+
```
|
220
|
+
|
221
|
+
## Errors
|
222
|
+
|
223
|
+
If an error occurs with [Jahuty's API](https://docs.jahuty.com/api#errors), a `Jahuty::Exception::Error` will be raised:
|
224
|
+
|
225
|
+
```ruby
|
88
226
|
begin
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
# hmm, the API returned something besides 2xx status code
|
227
|
+
jahuty = Jahuty::Client.new(api_key: 'YOUR_API_KEY')
|
228
|
+
jahuty.snippets.render YOUR_SNIPPET_ID
|
229
|
+
rescue Jahuty::Exception::Error => e
|
230
|
+
# The API returned an error. See the error's problem for details.
|
94
231
|
puts e.problem.type # a URL to more information
|
95
232
|
puts e.problem.status # the status code
|
96
233
|
puts e.problem.detail # a description of the error
|
data/Rakefile
CHANGED
@@ -1,6 +1,14 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'bundler/gem_tasks'
|
4
|
+
require 'rspec/core/rake_task'
|
5
|
+
require 'rubocop/rake_task'
|
3
6
|
|
4
7
|
RSpec::Core::RakeTask.new(:spec)
|
5
8
|
|
6
|
-
task :
|
9
|
+
task default: :spec
|
10
|
+
|
11
|
+
RuboCop::RakeTask.new do |task|
|
12
|
+
task.requires << 'rubocop-performance'
|
13
|
+
task.requires << 'rubocop-rspec'
|
14
|
+
end
|
data/bin/console
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
|
-
require
|
4
|
-
require
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'jahuty/snippets'
|
5
6
|
|
6
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
8
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +11,5 @@ require "jahuty/snippets"
|
|
10
11
|
# require "pry"
|
11
12
|
# Pry.start
|
12
13
|
|
13
|
-
require
|
14
|
+
require 'irb'
|
14
15
|
IRB.start(__FILE__)
|
data/bin/setup
CHANGED
data/jahuty.gemspec
CHANGED
@@ -1,30 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
|
2
|
-
lib = File.expand_path(
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
|
5
|
-
require
|
6
|
+
require 'jahuty/version'
|
6
7
|
|
7
8
|
Gem::Specification.new do |spec|
|
8
|
-
spec.name =
|
9
|
+
spec.name = 'jahuty'
|
9
10
|
spec.version = Jahuty::VERSION
|
10
|
-
spec.authors = [
|
11
|
-
spec.email = [
|
11
|
+
spec.authors = ['Jack Clayton']
|
12
|
+
spec.email = ['jack@jahuty.com']
|
12
13
|
|
13
|
-
spec.summary =
|
14
|
-
spec.description =
|
15
|
-
spec.homepage =
|
16
|
-
spec.license =
|
14
|
+
spec.summary = 'Jahuty\'s Ruby SDK.'
|
15
|
+
spec.description = 'Turn any page into a content-managed page.'
|
16
|
+
spec.homepage = 'https://www.jahuty.com'
|
17
|
+
spec.license = 'MIT'
|
17
18
|
|
18
|
-
spec.
|
19
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
20
|
+
|
21
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
22
|
+
spec.metadata['source_code_uri'] = 'https://github.com/jahuty/jahuty-ruby'
|
23
|
+
spec.metadata['changelog_uri'] = 'https://github.com/jahuty/jahuty-ruby/blob/master/CHANGELOG.md'
|
24
|
+
|
25
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
19
26
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
20
27
|
end
|
21
|
-
spec.bindir =
|
28
|
+
spec.bindir = 'exe'
|
22
29
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
|
-
spec.require_paths = [
|
30
|
+
spec.require_paths = ['lib']
|
31
|
+
|
32
|
+
spec.required_ruby_version = '~> 2.6'
|
24
33
|
|
25
|
-
spec.add_dependency
|
34
|
+
spec.add_dependency 'faraday', '~> 1.0'
|
35
|
+
spec.add_dependency 'mini_cache', '~> 1.1'
|
26
36
|
|
27
|
-
spec.add_development_dependency
|
28
|
-
spec.add_development_dependency
|
29
|
-
spec.add_development_dependency
|
37
|
+
spec.add_development_dependency 'bundler', '~> 2.0'
|
38
|
+
spec.add_development_dependency 'rake', '~> 12.3'
|
39
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
40
|
+
spec.add_development_dependency 'rspec_junit_formatter', '~>0.4'
|
41
|
+
spec.add_development_dependency 'rubocop', '~> 1.7'
|
42
|
+
spec.add_development_dependency 'rubocop-performance', '~> 1.9'
|
43
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 2.1'
|
44
|
+
spec.add_development_dependency 'simplecov', '~>0.20'
|
45
|
+
spec.add_development_dependency 'simplecov-cobertura', '~> 1.4'
|
46
|
+
spec.add_development_dependency 'webmock', '~> 3.11'
|
30
47
|
end
|