pupper 0.1.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 +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.ruby-version +1 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/LICENSE +21 -0
- data/LICENSE.txt +21 -0
- data/README.md +41 -0
- data/Rakefile +10 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/pupper/api_associations.rb +82 -0
- data/lib/pupper/auditable.rb +64 -0
- data/lib/pupper/backend.rb +52 -0
- data/lib/pupper/model.rb +71 -0
- data/lib/pupper/parse_json.rb +7 -0
- data/lib/pupper/trackable_attributes.rb +59 -0
- data/lib/pupper/version.rb +3 -0
- data/lib/pupper.rb +30 -0
- data/pupper.gemspec +33 -0
- metadata +190 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: '0290fefffb2e32822798c08c308a923748e6401c'
|
4
|
+
data.tar.gz: e599fee355ab08a376567c4adfea8817d60565bb
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 46a4bdb94f785741e88964ed7d64c3620c0ccb9e74f2d94a964eb7538af62461c0cbc4f558094979b72c43c083aab3efa5e2ffc0f00aa754d6d58967c8f7ed58
|
7
|
+
data.tar.gz: b92a2e1245d5d0a112bf53f53a3d39e815aab35aacaa6ab8912be0ce751374ca33965ea177bdc1afc8bbace7b58be2a665d8368c051df21366b0d73386126790
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.4.0
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2017 Lee Machin
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 Lee Machin
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# Pupper
|
2
|
+
|
3
|
+
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/pupper`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'pupper'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install pupper
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
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).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/Lee Machin/pupper.
|
36
|
+
|
37
|
+
|
38
|
+
## License
|
39
|
+
|
40
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
41
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "pupper"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
module Pupper
|
2
|
+
module ApiAssociations
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
|
5
|
+
class_methods do
|
6
|
+
def associations
|
7
|
+
@associations ||= { has_one: [], has_many: [] }
|
8
|
+
end
|
9
|
+
|
10
|
+
def has_one(assoc)
|
11
|
+
associations[:has_one] << assoc
|
12
|
+
end
|
13
|
+
|
14
|
+
def has_many(assoc)
|
15
|
+
associations[:has_many] << assoc
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
included do
|
20
|
+
private
|
21
|
+
|
22
|
+
delegate :associations, to: :class
|
23
|
+
attr_reader :excluded_attrs
|
24
|
+
|
25
|
+
def build_associations(assocs)
|
26
|
+
assocs.each_with_object({}) do |(name, value), memo|
|
27
|
+
name = name.to_s
|
28
|
+
foreign_key = name.slice!(/_u?id/)&.[](1..-1)&.to_sym
|
29
|
+
name = name.to_sym
|
30
|
+
|
31
|
+
create_assoc_model(memo, name, foreign_key, value)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def create_attribute(name, foreign_key = nil, value = nil)
|
36
|
+
self.class.attr_accessor(name)
|
37
|
+
|
38
|
+
return unless foreign_key.present?
|
39
|
+
|
40
|
+
excluded_attrs << name if foreign_key.present?
|
41
|
+
send("#{name}_#{foreign_key}=", value)
|
42
|
+
end
|
43
|
+
|
44
|
+
def find_assoc_type(name)
|
45
|
+
associations
|
46
|
+
.find { |(_, assoc)| assoc.include?(name) }&.first
|
47
|
+
end
|
48
|
+
|
49
|
+
def create_has_one_assoc_model(name, foreign_key, value)
|
50
|
+
create_attribute(name, foreign_key, value)
|
51
|
+
model = "#{self.class.parent}/#{name}".classify.constantize
|
52
|
+
|
53
|
+
if foreign_key
|
54
|
+
model.new(foreign_key => value)
|
55
|
+
else
|
56
|
+
model.new(value)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def create_has_many_assoc_model(name, values)
|
61
|
+
create_attribute(name)
|
62
|
+
values.map(&name.constantize)
|
63
|
+
end
|
64
|
+
|
65
|
+
def create_assoc_model(assocs, name, foreign_key, value)
|
66
|
+
case find_assoc_type(name)
|
67
|
+
when :has_one
|
68
|
+
assocs[name] = create_has_one_assoc_model(name, foreign_key, value)
|
69
|
+
when :has_many
|
70
|
+
assocs[name] = create_has_many_assoc_model(name, value)
|
71
|
+
else
|
72
|
+
Rails.logger.warn("Try to use an association for #{name} in #{model_name.name}!")
|
73
|
+
assocs[:"#{name}_#{foreign_key}"] = value
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
def excluded_attrs
|
78
|
+
@excluded_attrs ||= []
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
module Pupper
|
2
|
+
module Auditable
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
|
5
|
+
class_methods do
|
6
|
+
def audit(*methods)
|
7
|
+
underlying_methods = ''
|
8
|
+
|
9
|
+
methods.each do |meth|
|
10
|
+
underlying_methods << <<-RB.strip_heredoc
|
11
|
+
def #{meth}
|
12
|
+
audit { super }
|
13
|
+
changes_applied
|
14
|
+
end
|
15
|
+
RB
|
16
|
+
end
|
17
|
+
|
18
|
+
prepend Module.new { module_eval(underlying_methods, __FILE__, __LINE__) }
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
included do
|
23
|
+
extend ActiveModel::Callbacks
|
24
|
+
|
25
|
+
define_model_callbacks :update, only: :after
|
26
|
+
after_update :create_audit_log
|
27
|
+
|
28
|
+
def audit(&block)
|
29
|
+
run_callbacks :update, &block
|
30
|
+
changes_applied
|
31
|
+
end
|
32
|
+
|
33
|
+
def audit_logs
|
34
|
+
AuditLog.where(auditable_type: model_name.name, auditable_id: primary_key)
|
35
|
+
end
|
36
|
+
|
37
|
+
def create_audit_log
|
38
|
+
return unless changed?
|
39
|
+
|
40
|
+
audit_model.create(
|
41
|
+
auditable_type: model_name.name,
|
42
|
+
auditable_id: primary_key,
|
43
|
+
user: Pupper.config.current_user,
|
44
|
+
what_changed: changes
|
45
|
+
)
|
46
|
+
end
|
47
|
+
|
48
|
+
def update_attributes(**attrs)
|
49
|
+
run_callbacks(:update) do
|
50
|
+
assign_attributes(**attrs)
|
51
|
+
backend.update(self)
|
52
|
+
end
|
53
|
+
|
54
|
+
changes_applied
|
55
|
+
end
|
56
|
+
|
57
|
+
private
|
58
|
+
|
59
|
+
def audit_model
|
60
|
+
@audit_model ||= Pupper.config.audit_with.to_s.classify.constantize
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require 'pupper/parse_json'
|
2
|
+
|
3
|
+
module Pupper
|
4
|
+
class Backend
|
5
|
+
class BaseUrlNotDefined < StandardError; end
|
6
|
+
|
7
|
+
attr_reader :client, :model
|
8
|
+
|
9
|
+
delegate :base_url, to: :class
|
10
|
+
|
11
|
+
class << self
|
12
|
+
attr_writer :base_url
|
13
|
+
|
14
|
+
def base_url
|
15
|
+
if @base_url.nil?
|
16
|
+
raise BaseUrlNotDefined, <<-ERR
|
17
|
+
Add the following to #{name} to make it work:
|
18
|
+
|
19
|
+
self.base_url = "https://example.com/some/path"
|
20
|
+
|
21
|
+
Making sure to change the URL to something useful :)))
|
22
|
+
ERR
|
23
|
+
end
|
24
|
+
|
25
|
+
@base_url
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
%i(get put post delete patch).each do |name|
|
30
|
+
class_eval <<-RB.strip_heredoc, __FILE__, __LINE__
|
31
|
+
def #{name}(*args)
|
32
|
+
client.send(:#{name}, *args).body
|
33
|
+
end
|
34
|
+
RB
|
35
|
+
end
|
36
|
+
|
37
|
+
def initialize
|
38
|
+
@client = Faraday.new(base_url, ssl: { verify: Rails.env.production? }) do |builder|
|
39
|
+
builder.request :json
|
40
|
+
builder.use Pupper::ParseJson
|
41
|
+
builder.response :logger if Rails.env.development?
|
42
|
+
builder.response :raise_error
|
43
|
+
builder.adapter :typhoeus
|
44
|
+
builder.headers['User-Agent'] = Pupper.config.user_agent
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def register_model(model)
|
49
|
+
@model = model
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
data/lib/pupper/model.rb
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
require 'pupper/api_associations'
|
2
|
+
require 'pupper/auditable'
|
3
|
+
require 'pupper/trackable_attributes'
|
4
|
+
|
5
|
+
module Pupper
|
6
|
+
module Model
|
7
|
+
extend ActiveSupport::Concern
|
8
|
+
|
9
|
+
class NoSuchBackend < NameError; end
|
10
|
+
|
11
|
+
included do
|
12
|
+
include ActiveModel::Model
|
13
|
+
include ActiveModel::Serializers::JSON
|
14
|
+
|
15
|
+
include Pupper::Auditable
|
16
|
+
include Pupper::TrackableAttributes
|
17
|
+
include Pupper::ApiAssociations
|
18
|
+
|
19
|
+
delegate :backend, to: :class
|
20
|
+
|
21
|
+
def initialize(**args)
|
22
|
+
assocs, attrs = args.partition do |attr, value|
|
23
|
+
attr.to_s =~ /_u?id$/ || value.is_a?(Hash)
|
24
|
+
end.map(&Hash.method(:[]))
|
25
|
+
|
26
|
+
assocs = build_associations(assocs)
|
27
|
+
|
28
|
+
super(**attrs, **assocs)
|
29
|
+
|
30
|
+
changes_applied
|
31
|
+
|
32
|
+
backend.register_model(self)
|
33
|
+
end
|
34
|
+
|
35
|
+
def primary_key
|
36
|
+
send(self.class.primary_key)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
class_methods do
|
41
|
+
attr_writer :primary_key, :backend
|
42
|
+
|
43
|
+
def primary_key
|
44
|
+
@primary_key ||= :uid
|
45
|
+
end
|
46
|
+
|
47
|
+
def backend
|
48
|
+
@backend ||= "#{model_name.name.pluralize}Client".constantize.new
|
49
|
+
rescue NameError
|
50
|
+
raise NoSuchBackend, <<-ERR
|
51
|
+
Model #{model_name.name} is looking for an API client that doesn't exist!
|
52
|
+
|
53
|
+
Either a) implement the new client:
|
54
|
+
|
55
|
+
# app/api_clients/#{model_name.name.sub('::', '/').downcase.pluralize}_client.rb
|
56
|
+
class #{model_name.name.pluralize}Client < Pupper::Backend
|
57
|
+
end
|
58
|
+
|
59
|
+
Or b) use a different client instead
|
60
|
+
|
61
|
+
self.backend = Other::BackendClient
|
62
|
+
|
63
|
+
ERR
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def to_json(*)
|
68
|
+
attributes.except(*excluded_attrs).to_json
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
module Pupper
|
2
|
+
module TrackableAttributes
|
3
|
+
def self.included(base)
|
4
|
+
base.send :include, ActiveModel::Dirty
|
5
|
+
base.send :include, InstanceMethods
|
6
|
+
|
7
|
+
class << base
|
8
|
+
prepend ClassMethods
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
module InstanceMethods
|
13
|
+
def attributes
|
14
|
+
@attributes ||= {}
|
15
|
+
end
|
16
|
+
|
17
|
+
def reload!
|
18
|
+
restore_attributes
|
19
|
+
end
|
20
|
+
|
21
|
+
def rollback!
|
22
|
+
restore_attributes
|
23
|
+
end
|
24
|
+
|
25
|
+
def refresh(**attrs)
|
26
|
+
assign_attributes(**attrs)
|
27
|
+
changes_applied
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
module ClassMethods
|
32
|
+
def _attributes
|
33
|
+
@_attributes ||= []
|
34
|
+
end
|
35
|
+
|
36
|
+
def _attributes=(attrs)
|
37
|
+
@_attributes = attrs
|
38
|
+
end
|
39
|
+
|
40
|
+
def attr_accessor(*attrs)
|
41
|
+
# override the default so that we can hook into the created methods
|
42
|
+
define_attribute_methods(*attrs)
|
43
|
+
|
44
|
+
_attributes << attrs
|
45
|
+
|
46
|
+
attrs.each do |attr|
|
47
|
+
define_method attr do
|
48
|
+
attributes[attr]
|
49
|
+
end
|
50
|
+
|
51
|
+
define_method "#{attr}=" do |value|
|
52
|
+
send("#{attr}_will_change!") unless value == send(attr)
|
53
|
+
attributes[attr] = value
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
data/lib/pupper.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'active_support/all'
|
2
|
+
require 'active_model'
|
3
|
+
require 'faraday'
|
4
|
+
require 'faraday_middleware'
|
5
|
+
require 'oj'
|
6
|
+
require 'typhoeus/adapters/faraday'
|
7
|
+
|
8
|
+
require 'pupper/version'
|
9
|
+
require 'pupper/backend'
|
10
|
+
require 'pupper/model'
|
11
|
+
|
12
|
+
module Pupper
|
13
|
+
|
14
|
+
mattr_accessor :config
|
15
|
+
|
16
|
+
def self.configure
|
17
|
+
self.config ||= Config.new
|
18
|
+
yield self.config
|
19
|
+
end
|
20
|
+
|
21
|
+
class Config
|
22
|
+
attr_accessor :audit_with, :user_agent
|
23
|
+
thread_mattr_accessor :current_user
|
24
|
+
|
25
|
+
def initialize
|
26
|
+
@audit_with = :audit_log
|
27
|
+
@user_agent = "pupper (v: #{Pupper::VERSION})"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/pupper.gemspec
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'pupper/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'pupper'
|
8
|
+
spec.version = Pupper::VERSION
|
9
|
+
spec.authors = ['Lee Machin']
|
10
|
+
spec.email = ['lee@typeform.com']
|
11
|
+
spec.summary = 'Interact with APIs as if they were ActiveRecord models.'
|
12
|
+
spec.homepage = 'https://github.com/leemachin/pupper'
|
13
|
+
spec.license = 'MIT'
|
14
|
+
|
15
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
16
|
+
f.match(%r{^(test|spec|features)/})
|
17
|
+
end
|
18
|
+
|
19
|
+
spec.bindir = 'exe'
|
20
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
|
+
spec.require_paths = ['lib']
|
22
|
+
|
23
|
+
spec.add_development_dependency 'bundler', '~> 1.14'
|
24
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
25
|
+
spec.add_development_dependency 'rspec'
|
26
|
+
|
27
|
+
spec.add_dependency 'activesupport', '~> 5.0'
|
28
|
+
spec.add_dependency 'activemodel', '~> 5.0'
|
29
|
+
spec.add_dependency 'faraday'
|
30
|
+
spec.add_dependency 'faraday_middleware'
|
31
|
+
spec.add_dependency 'typhoeus'
|
32
|
+
spec.add_dependency 'oj'
|
33
|
+
end
|
metadata
ADDED
@@ -0,0 +1,190 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pupper
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Lee Machin
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-02-13 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.14'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.14'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: activesupport
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '5.0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '5.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: activemodel
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '5.0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '5.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: faraday
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: faraday_middleware
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: typhoeus
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: oj
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
description:
|
140
|
+
email:
|
141
|
+
- lee@typeform.com
|
142
|
+
executables: []
|
143
|
+
extensions: []
|
144
|
+
extra_rdoc_files: []
|
145
|
+
files:
|
146
|
+
- ".gitignore"
|
147
|
+
- ".rspec"
|
148
|
+
- ".ruby-version"
|
149
|
+
- ".travis.yml"
|
150
|
+
- Gemfile
|
151
|
+
- LICENSE
|
152
|
+
- LICENSE.txt
|
153
|
+
- README.md
|
154
|
+
- Rakefile
|
155
|
+
- bin/console
|
156
|
+
- bin/setup
|
157
|
+
- lib/pupper.rb
|
158
|
+
- lib/pupper/api_associations.rb
|
159
|
+
- lib/pupper/auditable.rb
|
160
|
+
- lib/pupper/backend.rb
|
161
|
+
- lib/pupper/model.rb
|
162
|
+
- lib/pupper/parse_json.rb
|
163
|
+
- lib/pupper/trackable_attributes.rb
|
164
|
+
- lib/pupper/version.rb
|
165
|
+
- pupper.gemspec
|
166
|
+
homepage: https://github.com/leemachin/pupper
|
167
|
+
licenses:
|
168
|
+
- MIT
|
169
|
+
metadata: {}
|
170
|
+
post_install_message:
|
171
|
+
rdoc_options: []
|
172
|
+
require_paths:
|
173
|
+
- lib
|
174
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
175
|
+
requirements:
|
176
|
+
- - ">="
|
177
|
+
- !ruby/object:Gem::Version
|
178
|
+
version: '0'
|
179
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
180
|
+
requirements:
|
181
|
+
- - ">="
|
182
|
+
- !ruby/object:Gem::Version
|
183
|
+
version: '0'
|
184
|
+
requirements: []
|
185
|
+
rubyforge_project:
|
186
|
+
rubygems_version: 2.6.8
|
187
|
+
signing_key:
|
188
|
+
specification_version: 4
|
189
|
+
summary: Interact with APIs as if they were ActiveRecord models.
|
190
|
+
test_files: []
|