Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/amorail.gemspec +1 -1
  3. data/lib/amorail.rb +2 -0
  4. data/lib/amorail/client.rb +2 -0
  5. data/lib/amorail/config.rb +2 -0
  6. data/lib/amorail/entities/company.rb +2 -0
  7. data/lib/amorail/entities/contact.rb +2 -0
  8. data/lib/amorail/entities/contact_link.rb +2 -0
  9. data/lib/amorail/entities/elementable.rb +4 -2
  10. data/lib/amorail/entities/lead.rb +2 -0
  11. data/lib/amorail/entities/leadable.rb +2 -0
  12. data/lib/amorail/entities/note.rb +2 -0
  13. data/lib/amorail/entities/task.rb +2 -0
  14. data/lib/amorail/entities/webhook.rb +2 -0
  15. data/lib/amorail/entity.rb +2 -0
  16. data/lib/amorail/entity/finders.rb +2 -0
  17. data/lib/amorail/entity/params.rb +2 -0
  18. data/lib/amorail/entity/persistence.rb +2 -0
  19. data/lib/amorail/exceptions.rb +2 -0
  20. data/lib/amorail/property.rb +2 -0
  21. data/lib/amorail/railtie.rb +2 -0
  22. data/lib/amorail/version.rb +3 -1
  23. data/lib/tasks/amorail.rake +2 -0
  24. data/spec/client_spec.rb +2 -0
  25. data/spec/company_spec.rb +2 -0
  26. data/spec/contact_link_spec.rb +2 -0
  27. data/spec/contact_spec.rb +2 -0
  28. data/spec/entity_spec.rb +2 -0
  29. data/spec/helpers/webmock_helpers.rb +2 -0
  30. data/spec/lead_spec.rb +2 -0
  31. data/spec/my_contact_spec.rb +2 -0
  32. data/spec/note_spec.rb +2 -0
  33. data/spec/property_spec.rb +2 -0
  34. data/spec/spec_helper.rb +2 -0
  35. data/spec/support/elementable_example.rb +2 -0
  36. data/spec/support/entity_class_example.rb +2 -0
  37. data/spec/support/leadable_example.rb +2 -0
  38. data/spec/support/my_contact.rb +2 -0
  39. data/spec/support/my_entity.rb +2 -0
  40. data/spec/task_spec.rb +2 -0
  41. data/spec/webhook_spec.rb +2 -0
  42. metadata +5 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
---
2
2
SHA256:
3
- metadata.gz: f65fb80eb5f426c50e32fa474252e764e42e3887cddbf7f735ad217ad98560cf
4
- data.tar.gz: 5f44b5e558be01b346ad68d4d84c903deec88e05514430531b6aa0b6e02c3e73
3
+ metadata.gz: 6047ec19aa4839d30b29fc1cb9ee38079a04812b2ed6547d2e24e1e8ed16a57d
4
+ data.tar.gz: 64bfbcd2f8574b70c420a274bd8707533b4f4334020d180fda7acb85cdcee509
5
5
SHA512:
6
- metadata.gz: 14958c70d64dda63dd82c334d08b2c63cbe8183fbffc8b5c5a63893e42280b0439e8eef4411b9b222c52e54d7dfa0949e82061de6feb4b3814ad169d5ab37cc6
7
- data.tar.gz: a370262be82cdde926d639976fea7e23833a6f999cff3100c2a5df57e9962c8ea05b5e6b682e4d2738b4f322a3cba73d81195e721eefe017e8717c103a665f2e
6
+ metadata.gz: 55fc29183cff4df2db947a76ceae748d289ebab1f1e88310e7c13234dd75886c87e9f68c41b782ba251be69f2226f386501974108ce2cc00fdc656e1ccdfe059
7
+ data.tar.gz: da64fc02f0bc506319bd543e7b35cb5dfdd3b112cc04458f25904c5d9ece1bc38df8d659ca1d705e17fcea8e7cd82e954c7f4642048fb2ed627a03c0f1802b8c
data/amorail.gemspec CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
spec.add_development_dependency "pry"
26
26
spec.add_development_dependency "shoulda-matchers", "~> 2.0"
27
27
spec.add_development_dependency "rubocop", "~> 0.49"
28
- spec.add_dependency "anyway_config", "~> 0", ">= 0.3"
28
+ spec.add_dependency "anyway_config", ">= 1.0"
29
29
spec.add_dependency "faraday"
30
30
spec.add_dependency "faraday_middleware"
31
31
spec.add_dependency 'activemodel'
data/lib/amorail.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'amorail/version'
2
4
require 'amorail/config'
3
5
require 'amorail/client'
data/lib/amorail/client.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'faraday'
2
4
require 'faraday_middleware'
3
5
require 'json'
data/lib/amorail/config.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'anyway'
2
4
3
5
module Amorail
data/lib/amorail/entities/company.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'amorail/entities/leadable'
2
4
3
5
module Amorail
data/lib/amorail/entities/contact.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'amorail/entities/leadable'
2
4
3
5
module Amorail
data/lib/amorail/entities/contact_link.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
module Amorail
2
4
# AmoCRM contact-link join model
3
5
class ContactLink < Amorail::Entity
data/lib/amorail/entities/elementable.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
module Amorail
2
4
# Provides common functionallity for entities
3
5
# that can be attached to another objects.
@@ -6,9 +8,9 @@ module Amorail
6
8
7
9
ELEMENT_TYPES = {
8
10
contact: 1,
9
- lead: 2,
11
+ lead: 2,
10
12
company: 3,
11
- task: 4
13
+ task: 4
12
14
}.freeze
13
15
14
16
included do
data/lib/amorail/entities/lead.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
module Amorail
2
4
# AmoCRM lead entity
3
5
class Lead < Amorail::Entity
data/lib/amorail/entities/leadable.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
module Amorail
2
4
# Lead associations
3
5
module Leadable
data/lib/amorail/entities/note.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'amorail/entities/elementable'
2
4
3
5
module Amorail
data/lib/amorail/entities/task.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'amorail/entities/elementable'
2
4
3
5
module Amorail
data/lib/amorail/entities/webhook.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
module Amorail
2
4
# AmoCRM webhook entity
3
5
class Webhook < Entity
data/lib/amorail/entity.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'active_model'
2
4
3
5
module Amorail
data/lib/amorail/entity/finders.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
module Amorail # :nodoc: all
2
4
class Entity
3
5
class << self
data/lib/amorail/entity/params.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require "active_support/core_ext/hash/indifferent_access"
2
4
3
5
module Amorail # :nodoc: all
data/lib/amorail/entity/persistence.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
module Amorail # :nodoc: all
2
4
class Entity
3
5
class InvalidRecord < ::Amorail::Error; end
data/lib/amorail/exceptions.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
# Amorail Exceptions.
2
4
# Every class is name of HTTP response error code(status)
3
5
module Amorail
data/lib/amorail/property.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
module Amorail
2
4
# Return hash key as method call
3
5
module MethodMissing
data/lib/amorail/railtie.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
module Amorail
2
4
# Add amorail rake tasks
3
5
class Railtie < Rails::Railtie
data/lib/amorail/version.rb CHANGED
@@ -1,4 +1,6 @@
1
+ # frozen_string_literal: true
2
+
1
3
# Amorail version
2
4
module Amorail
3
- VERSION = "0.5.0".freeze
5
+ VERSION = '0.6.0'
4
6
end
data/lib/tasks/amorail.rake CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
namespace :amorail do
2
4
desc 'Check Amorail configuration'
3
5
task :check do
data/spec/client_spec.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require "spec_helper"
2
4
3
5
describe Amorail::Client do
data/spec/company_spec.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require "spec_helper"
2
4
3
5
describe Amorail::Company do
data/spec/contact_link_spec.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require "spec_helper"
2
4
3
5
describe Amorail::ContactLink do
data/spec/contact_spec.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require "spec_helper"
2
4
3
5
describe Amorail::Contact do
data/spec/entity_spec.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require "spec_helper"
2
4
3
5
describe MyEntity do
data/spec/helpers/webmock_helpers.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
# rubocop: disable Metrics/ModuleLength
2
4
module AmoWebMock
3
5
def mock_api
data/spec/lead_spec.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require "spec_helper"
2
4
3
5
describe Amorail::Lead do
data/spec/my_contact_spec.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require "spec_helper"
2
4
3
5
describe MyContact do
data/spec/note_spec.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'spec_helper'
2
4
3
5
describe Amorail::Note do
data/spec/property_spec.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require "spec_helper"
2
4
require "webmock/rspec"
3
5
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
4
$LOAD_PATH.unshift(File.dirname(__FILE__))
3
5
data/spec/support/elementable_example.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
shared_examples 'elementable' do
2
4
describe 'validations' do
3
5
it { is_expected.to validate_presence_of(:element_id) }
data/spec/support/entity_class_example.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'spec_helper'
2
4
3
5
shared_examples 'entity_class' do
data/spec/support/leadable_example.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'spec_helper'
2
4
3
5
shared_examples 'leadable' do
data/spec/support/my_contact.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
class MyContact < Amorail::Contact # :nodoc:
2
4
amo_property :teachbase_id
3
5
end
data/spec/support/my_entity.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
# We only need this class to set Amo names for core Entity
2
4
class MyEntity < Amorail::Entity # :nodoc:
3
5
amo_names 'entity'
data/spec/task_spec.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require "spec_helper"
2
4
3
5
describe Amorail::Task do
data/spec/webhook_spec.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
require 'spec_helper'
2
4
3
5
describe Amorail::Webhook do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
--- !ruby/object:Gem::Specification
2
2
name: amorail
3
3
version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
platform: ruby
6
6
authors:
7
7
- alekseenkoss
@@ -9,7 +9,7 @@ authors:
9
9
autorequire:
10
10
bindir: bin
11
11
cert_chain: []
12
- date: 2018-10-24 00:00:00.000000000 Z
12
+ date: 2019-11-08 00:00:00.000000000 Z
13
13
dependencies:
14
14
- !ruby/object:Gem::Dependency
15
15
name: bundler
@@ -113,22 +113,16 @@ dependencies:
113
113
name: anyway_config
114
114
requirement: !ruby/object:Gem::Requirement
115
115
requirements:
116
- - - "~>"
117
- - !ruby/object:Gem::Version
118
- version: '0'
119
116
- - ">="
120
117
- !ruby/object:Gem::Version
121
- version: '0.3'
118
+ version: '1.0'
122
119
type: :runtime
123
120
prerelease: false
124
121
version_requirements: !ruby/object:Gem::Requirement
125
122
requirements:
126
- - - "~>"
127
- - !ruby/object:Gem::Version
128
- version: '0'
129
123
- - ">="
130
124
- !ruby/object:Gem::Version
131
- version: '0.3'
125
+ version: '1.0'
132
126
- !ruby/object:Gem::Dependency
133
127
name: faraday
134
128
requirement: !ruby/object:Gem::Requirement
@@ -276,8 +270,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
276
270
- !ruby/object:Gem::Version
277
271
version: '0'
278
272
requirements: []
279
- rubyforge_project:
273
+ rubygems_version: 3.0.4
280
- rubygems_version: 2.7.7
281
274
signing_key:
282
275
specification_version: 4
283
276
summary: Ruby API client for AmoCRM