esi 0.4.21 → 0.4.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -19
- data/esi.gemspec +2 -0
- data/lib/esi/version.rb +1 -1
- data/lib/generators/esi/install_generator.rb +26 -0
- data/lib/generators/esi/templates/initializer.rb +25 -0
- metadata +32 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 123d405531560b767184c3892d28e5f9805e442c05d4728cf74e9c085145ade3
|
4
|
+
data.tar.gz: 7d5d5ae42b9aa16a2d45c067c9372112319c2e83928a065757d79176b157b2a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2475204c9c2002eec3b323ca1d682a9cb5af98aed1ccdabfd9f21c587749cece51f451e094ba04a6113f87906b170aced227654055662d60ad52e9182f9dc7f2
|
7
|
+
data.tar.gz: ebf4e296a46f87a060a7f75c4dce35f1c05bede58dd5da0a7b9ab2eaa61a4a7dc2f4d29a826c4719f50407e08f1d2593c09500866fc693c873a01444b2677337
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Esi
|
2
|
-
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/esi.svg)](https://badge.fury.io/rb/esi)
|
3
3
|
[![TravisCI build status](https://travis-ci.org/dhiemstra/esi.svg?branch=master)](https://travis-ci.org/dhiemstra/esi)
|
4
4
|
|
5
5
|
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/esi`. To experiment with that code, run `bin/console` for an interactive prompt.
|
@@ -41,26 +41,12 @@ Add your client id and secret in an initializer or so.
|
|
41
41
|
Esi.config.client_id = 'APP_CLIENT_ID'
|
42
42
|
Esi.config.client_secret = 'APP_CLIENT_SECRET'
|
43
43
|
|
44
|
-
## Configuration
|
45
|
-
|
46
|
-
Create a file `config/initializers/esi.rb` with the following options:
|
47
|
-
|
48
|
-
# Specify a custom log level
|
49
|
-
Esi.config.log_level = :debug
|
50
|
-
|
51
|
-
# Specify a custom log path
|
52
|
-
Esi.config.log_target = Rails.root.join('log', 'esi.log')
|
53
|
-
|
54
|
-
# Specify a custom logger
|
55
|
-
Esi.config.logger = Rails.logger
|
56
|
-
|
57
|
-
# Set esi api version to dev
|
58
|
-
Esi.config.api_version = :dev
|
44
|
+
## Configuration in Rails
|
59
45
|
|
60
|
-
|
61
|
-
|
46
|
+
Install the initializer with `rails generator esi:install` and modify
|
47
|
+
`config/initializers/esi.rb`.
|
62
48
|
|
63
|
-
|
49
|
+
### Caching
|
64
50
|
|
65
51
|
ESI will cache API requests that auto expire based on the `Expires-At` header returned by ESI. By default [`ActiveSupport::Cache::MemoryStore`](http://api.rubyonrails.org/classes/ActiveSupport/Cache/MemoryStore.html) is used. When using Rails you can configure ESI to use the cache configured in your app by setting the `cache` config variable.
|
66
52
|
|
data/esi.gemspec
CHANGED
@@ -21,10 +21,12 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_dependency 'activesupport'
|
22
22
|
spec.add_dependency 'addressable', '~> 2.3'
|
23
23
|
spec.add_dependency 'oauth2', '~> 1.4'
|
24
|
+
spec.add_dependency 'railties', '~> 5.1'
|
24
25
|
spec.add_development_dependency 'bundler', '~> 1.14'
|
25
26
|
spec.add_development_dependency 'minitest', '~> 5.0'
|
26
27
|
spec.add_development_dependency 'rake', '~> 10.0'
|
27
28
|
spec.add_development_dependency 'rubocop', '~> 0.52'
|
28
29
|
spec.add_development_dependency 'shoulda', '~> 3.5'
|
30
|
+
spec.add_development_dependency 'simplecov', '~> 0.16'
|
29
31
|
spec.add_development_dependency 'yard', '~> 0.9'
|
30
32
|
end
|
data/lib/esi/version.rb
CHANGED
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails/generators'
|
4
|
+
require 'rails/generators/active_record'
|
5
|
+
|
6
|
+
# The Esi generator module
|
7
|
+
# @private
|
8
|
+
module Esi
|
9
|
+
# Rails ESI Install Generator
|
10
|
+
# @author Aaron Allen <hello@aaronmallen.me>
|
11
|
+
# @version 0.1
|
12
|
+
# @since 0.4.21
|
13
|
+
# @private
|
14
|
+
class InstallGenerator < ::Rails::Generators::Base
|
15
|
+
include ::Rails::Generators::Migration
|
16
|
+
source_root File.expand_path('templates', __dir__)
|
17
|
+
desc 'Installs Esi.'
|
18
|
+
|
19
|
+
# Called by rails generate
|
20
|
+
# Installs esi.rb in config/initializers and
|
21
|
+
# prints a helpful guide for next steps.
|
22
|
+
def install
|
23
|
+
template 'initializer.rb', 'config/initializers/esi.rb'
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Specify a custom log level
|
4
|
+
Esi.config.log_level = :info
|
5
|
+
|
6
|
+
# Specify a custom log path
|
7
|
+
Esi.config.log_target = Rails.root.join('log', 'esi.log')
|
8
|
+
|
9
|
+
# Specify a custom logger
|
10
|
+
Esi.config.logger = Rails.logger
|
11
|
+
|
12
|
+
# Set esi api version to dev
|
13
|
+
Esi.config.api_version = :latest
|
14
|
+
|
15
|
+
# Save all raw JSON responses in this folder
|
16
|
+
Esi.config.response_log_path = Rails.root.join('tmp', 'esi')
|
17
|
+
|
18
|
+
# Set Esi Cache to Rails.cache
|
19
|
+
Esi.config.cache = Rails.cache
|
20
|
+
|
21
|
+
# Set Esi Client Id
|
22
|
+
Esi.config.client_id = ENV['ESI_CLIENT_ID']
|
23
|
+
|
24
|
+
# Set Esi Client Secret
|
25
|
+
Esi.config.client_secret = ENV['ESI_CLIENT_SECRET']
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: esi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danny Hiemstra
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-05-
|
12
|
+
date: 2018-05-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -53,6 +53,20 @@ dependencies:
|
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '1.4'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: railties
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '5.1'
|
63
|
+
type: :runtime
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '5.1'
|
56
70
|
- !ruby/object:Gem::Dependency
|
57
71
|
name: bundler
|
58
72
|
requirement: !ruby/object:Gem::Requirement
|
@@ -123,6 +137,20 @@ dependencies:
|
|
123
137
|
- - "~>"
|
124
138
|
- !ruby/object:Gem::Version
|
125
139
|
version: '3.5'
|
140
|
+
- !ruby/object:Gem::Dependency
|
141
|
+
name: simplecov
|
142
|
+
requirement: !ruby/object:Gem::Requirement
|
143
|
+
requirements:
|
144
|
+
- - "~>"
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: '0.16'
|
147
|
+
type: :development
|
148
|
+
prerelease: false
|
149
|
+
version_requirements: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - "~>"
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: '0.16'
|
126
154
|
- !ruby/object:Gem::Dependency
|
127
155
|
name: yard
|
128
156
|
requirement: !ruby/object:Gem::Requirement
|
@@ -173,6 +201,8 @@ files:
|
|
173
201
|
- lib/esi/o_auth.rb
|
174
202
|
- lib/esi/response.rb
|
175
203
|
- lib/esi/version.rb
|
204
|
+
- lib/generators/esi/install_generator.rb
|
205
|
+
- lib/generators/esi/templates/initializer.rb
|
176
206
|
- lib/omniauth/esi.rb
|
177
207
|
- lib/omniauth/strategies/esi.rb
|
178
208
|
homepage: https://github.com/dhiemstra/esi
|