Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zoholib
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gems
zoholib
Commits
e580b7a8
Commit
e580b7a8
authored
Apr 25, 2020
by
Jose Ernesto Suarez
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix/submodule' into 'master'
Fix/submodule See merge request wedoops/zoholib!1
parents
0e4138c5
ed7c5be6
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
1058 additions
and
1044 deletions
+1058
-1044
.rspec_status
.rspec_status
+7
-7
zoholib.rb
lib/zoholib.rb
+17
-15
adamo_client.rb
lib/zoholib/adamo_client.rb
+83
-82
authorization_request.rb
lib/zoholib/authorization_request.rb
+104
-103
b12_client.rb
lib/zoholib/b12_client.rb
+39
-38
configuration.rb
lib/zoholib/configuration.rb
+16
-15
grant_request.rb
lib/zoholib/grant_request.rb
+20
-18
refresh_request.rb
lib/zoholib/refresh_request.rb
+19
-17
response.rb
lib/zoholib/response.rb
+2
-2
version.rb
lib/zoholib/version.rb
+5
-4
zoho_basic_client.rb
lib/zoholib/zoho_basic_client.rb
+145
-144
zoho_client.rb
lib/zoholib/zoho_client.rb
+580
-579
zoho_request.rb
lib/zoholib/zoho_request.rb
+12
-11
spec_helper.rb
spec/spec_helper.rb
+1
-1
zoholib_spec.rb
spec/zoholib_spec.rb
+7
-7
zoholib.gemspec
zoholib.gemspec
+1
-1
No files found.
.rspec_status
View file @
e580b7a8
example_id | status | run_time |
example_id | status | run_time |
----------------------------- | ------ | --------------- |
----------------------------- | ------ | --------------- |
./spec/zoholib_spec.rb[1:1] | passed | 0.001
83
seconds |
./spec/zoholib_spec.rb[1:1] | passed | 0.001
55
seconds |
./spec/zoholib_spec.rb[1:2] | passed | 0.001
44
seconds |
./spec/zoholib_spec.rb[1:2] | passed | 0.001
56
seconds |
./spec/zoholib_spec.rb[1:3:1] | passed | 0.00
112
seconds |
./spec/zoholib_spec.rb[1:3:1] | passed | 0.00
096
seconds |
./spec/zoholib_spec.rb[1:3:2] | passed | 0.00
12 seconds
|
./spec/zoholib_spec.rb[1:3:2] | passed | 0.00
039 seconds
|
./spec/zoholib_spec.rb[1:3:3] | passed | 0.000
0
9 seconds |
./spec/zoholib_spec.rb[1:3:3] | passed | 0.000
3
9 seconds |
./spec/zoholib_spec.rb[1:3:4] | passed | 0.0002
seconds
|
./spec/zoholib_spec.rb[1:3:4] | passed | 0.0002
9 seconds
|
./spec/zoholib_spec.rb[1:3:5] | passed | 0.000
22
seconds |
./spec/zoholib_spec.rb[1:3:5] | passed | 0.000
45
seconds |
lib/zoholib.rb
View file @
e580b7a8
...
@@ -14,7 +14,8 @@ require 'zoholib/zoho_client'
...
@@ -14,7 +14,8 @@ require 'zoholib/zoho_client'
##
##
# This library is used for access Zoho
# This library is used for access Zoho
module
Zoholib
module
Wedoops
module
Zoholib
class
<<
self
class
<<
self
attr_accessor
:configuration
attr_accessor
:configuration
end
end
...
@@ -30,4 +31,5 @@ module Zoholib
...
@@ -30,4 +31,5 @@ module Zoholib
def
self
.
configure
def
self
.
configure
yield
(
configuration
)
yield
(
configuration
)
end
end
end
end
end
lib/zoholib/adamo_client.rb
View file @
e580b7a8
...
@@ -4,8 +4,8 @@ require 'json'
...
@@ -4,8 +4,8 @@ require 'json'
require
'logger'
require
'logger'
require
'date'
require
'date'
module
Wedoops
module
Zoholib
module
Zoholib
class
AdamoClient
class
AdamoClient
def
initialize
(
options
=
{})
def
initialize
(
options
=
{})
...
@@ -93,4 +93,5 @@ module Zoholib
...
@@ -93,4 +93,5 @@ module Zoholib
@http
.
get
(
url
)
@http
.
get
(
url
)
end
end
end
end
end
end
end
\ No newline at end of file
lib/zoholib/authorization_request.rb
View file @
e580b7a8
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
#En algun momento tenemos que abrir un navegador
#En algun momento tenemos que abrir un navegador
require
'launchy'
require
'launchy'
require
'socket'
require
'socket'
module
Wedoops
module
Zoholib
module
Zoholib
class
AuthorizationRequest
<
ZohoRequest
class
AuthorizationRequest
<
ZohoRequest
# Sin en algun momento se quiere evitar el encode de URL
# Sin en algun momento se quiere evitar el encode de URL
...
@@ -121,4 +121,5 @@ module Zoholib
...
@@ -121,4 +121,5 @@ module Zoholib
end
end
end
end
end
\ No newline at end of file
lib/zoholib/b12_client.rb
View file @
e580b7a8
...
@@ -5,8 +5,8 @@ require 'logger'
...
@@ -5,8 +5,8 @@ require 'logger'
require
'date'
require
'date'
require
'savon'
require
'savon'
module
Wedoops
module
Zoholib
module
Zoholib
class
B12Client
class
B12Client
def
initialize
(
options
=
{})
def
initialize
(
options
=
{})
...
@@ -53,5 +53,6 @@ module Zoholib
...
@@ -53,5 +53,6 @@ module Zoholib
end
end
end
end
end
end
end
\ No newline at end of file
lib/zoholib/configuration.rb
View file @
e580b7a8
# frozen_string_literal: true
# frozen_string_literal: true
module
Wedoops
module
Zoholib
module
Zoholib
##
##
# This class permits the configuration of the Valenciaport Access.
# This class permits the configuration of the Valenciaport Access.
# Is neccesary the WDSL URLs for the login and transport endpoint
# Is neccesary the WDSL URLs for the login and transport endpoint
...
@@ -16,5 +16,6 @@ module Zoholib
...
@@ -16,5 +16,6 @@ module Zoholib
end
end
end
end
end
end
end
\ No newline at end of file
lib/zoholib/grant_request.rb
View file @
e580b7a8
#require './lib/zoho_request'
#require './lib/zoho_request'
module
Zoholib
module
Wedoops
module
Zoholib
class
GrantRequest
<
ZohoRequest
class
GrantRequest
<
ZohoRequest
#base_uri "https://accounts.zoho.com/oauth/v2/token"
#base_uri "https://accounts.zoho.com/oauth/v2/token"
...
@@ -22,4 +23,5 @@ module Zoholib
...
@@ -22,4 +23,5 @@ module Zoholib
end
end
end
end
end
\ No newline at end of file
lib/zoholib/refresh_request.rb
View file @
e580b7a8
#require './lib/zoho_request'
#require './lib/zoho_request'
module
Zoholib
module
Wedoops
module
Zoholib
class
RefreshRequest
<
ZohoRequest
class
RefreshRequest
<
ZohoRequest
# Sin en algun momento se quiere evitar el encode de URL
# Sin en algun momento se quiere evitar el encode de URL
...
@@ -22,4 +23,5 @@ module Zoholib
...
@@ -22,4 +23,5 @@ module Zoholib
end
end
end
end
end
\ No newline at end of file
lib/zoholib/response.rb
View file @
e580b7a8
module
Zoholib
module
Wedoops
module
Zoho
module
Zoho
lib
class
Response
class
Response
...
...
lib/zoholib/version.rb
View file @
e580b7a8
# frozen_string_literal: true
# frozen_string_literal: true
module
Wedoops
module
Zoholib
module
Zoholib
VERSION
=
'0.0.1b'
VERSION
=
'0.0.1b'
end
end
end
\ No newline at end of file
lib/zoholib/zoho_basic_client.rb
View file @
e580b7a8
...
@@ -7,8 +7,8 @@ require 'httparty'
...
@@ -7,8 +7,8 @@ require 'httparty'
#require './lib/authorization_request'
#require './lib/authorization_request'
module
Wedoops
module
Zoholib
module
Zoholib
class
ZohoBasicClient
class
ZohoBasicClient
include
HTTParty
include
HTTParty
base_uri
'https://www.zohoapis.com/crm/v2/'
base_uri
'https://www.zohoapis.com/crm/v2/'
...
@@ -156,7 +156,7 @@ module Zoholib
...
@@ -156,7 +156,7 @@ module Zoholib
return
result
return
result
end
end
private
private
def
build_header
def
build_header
{
:headers
=>
{
"Authorization"
=>
"Zoho-oauthtoken
#{
@token
}
"
}}
{
:headers
=>
{
"Authorization"
=>
"Zoho-oauthtoken
#{
@token
}
"
}}
...
@@ -170,4 +170,5 @@ private
...
@@ -170,4 +170,5 @@ private
end
end
end
end
end
end
end
\ No newline at end of file
lib/zoholib/zoho_client.rb
View file @
e580b7a8
...
@@ -7,8 +7,8 @@ require 'date'
...
@@ -7,8 +7,8 @@ require 'date'
require
'httparty'
require
'httparty'
#include ERB::Util
#include ERB::Util
module
Wedoops
module
Zoholib
module
Zoholib
class
ZohoClient
<
ERB
class
ZohoClient
<
ERB
attr_accessor
:token
,
:scope
,
:auth_type
,
:client_id
,
:redirect_uri
,
:code
attr_accessor
:token
,
:scope
,
:auth_type
,
:client_id
,
:redirect_uri
,
:code
...
@@ -622,4 +622,5 @@ module Zoholib
...
@@ -622,4 +622,5 @@ module Zoholib
end
end
end
end
end
end
end
lib/zoholib/zoho_request.rb
View file @
e580b7a8
require
'httparty'
require
'httparty'
require
'json'
require
'json'
module
Wedoops
module
Zoholib
module
Zoholib
class
ZohoRequest
class
ZohoRequest
include
HTTParty
include
HTTParty
#debug_output $stdout
#debug_output $stdout
...
@@ -13,4 +13,5 @@ module Zoholib
...
@@ -13,4 +13,5 @@ module Zoholib
attr_reader
:subdomain
,
:uri
attr_reader
:subdomain
,
:uri
end
end
end
end
end
\ No newline at end of file
spec/spec_helper.rb
View file @
e580b7a8
...
@@ -5,7 +5,7 @@ require 'zoholib'
...
@@ -5,7 +5,7 @@ require 'zoholib'
RSpec
.
configure
do
|
conf
|
RSpec
.
configure
do
|
conf
|
conf
.
before
(
:all
)
do
conf
.
before
(
:all
)
do
Zoholib
.
configure
do
|
config
|
Wedoops
::
Zoholib
.
configure
do
|
config
|
puts
"Trying to config"
puts
"Trying to config"
config
.
client_id
=
"client_id"
config
.
client_id
=
"client_id"
config
.
client_secret
=
"client_secret"
config
.
client_secret
=
"client_secret"
...
...
spec/zoholib_spec.rb
View file @
e580b7a8
require
'spec_helper'
require
'spec_helper'
require
'stringio'
require
'stringio'
RSpec
.
describe
Zoholib
do
RSpec
.
describe
Wedoops
::
Zoholib
do
it
'has a version number'
do
it
'has a version number'
do
expect
(
Zoholib
::
VERSION
).
not_to
be
nil
expect
(
Wedoops
::
Zoholib
::
VERSION
).
not_to
be
nil
end
end
it
'does something useful'
do
it
'does something useful'
do
...
@@ -12,23 +12,23 @@ RSpec.describe Zoholib do
...
@@ -12,23 +12,23 @@ RSpec.describe Zoholib do
describe
'Configuration'
do
describe
'Configuration'
do
it
'The configuration shuld be a Zoholib::Configuration'
do
it
'The configuration shuld be a Zoholib::Configuration'
do
expect
(
Zoholib
.
configuration
).
to
be_a_kind_of
(
Zoholib
::
Configuration
)
expect
(
Wedoops
::
Zoholib
.
configuration
).
to
be_a_kind_of
(
Wedoops
::
Zoholib
::
Configuration
)
end
end
it
'The client_id is a string'
do
it
'The client_id is a string'
do
expect
(
Zoholib
.
configuration
.
client_id
).
to
be_an
(
String
)
expect
(
Wedoops
::
Zoholib
.
configuration
.
client_id
).
to
be_an
(
String
)
end
end
it
'The client_secret is a string'
do
it
'The client_secret is a string'
do
expect
(
Zoholib
.
configuration
.
client_secret
).
to
be_an
(
String
)
expect
(
Wedoops
::
Zoholib
.
configuration
.
client_secret
).
to
be_an
(
String
)
end
end
it
'The scopes is a string'
do
it
'The scopes is a string'
do
expect
(
Zoholib
.
configuration
.
scope
).
to
be_an
(
String
)
expect
(
Wedoops
::
Zoholib
.
configuration
.
scope
).
to
be_an
(
String
)
end
end
it
'The refresh_token is a string'
do
it
'The refresh_token is a string'
do
expect
(
Zoholib
.
configuration
.
refresh_token
).
to
be_an
(
String
)
expect
(
Wedoops
::
Zoholib
.
configuration
.
refresh_token
).
to
be_an
(
String
)
end
end
end
end
end
end
\ No newline at end of file
zoholib.gemspec
View file @
e580b7a8
...
@@ -6,7 +6,7 @@ require 'zoholib/version'
...
@@ -6,7 +6,7 @@ require 'zoholib/version'
Gem
::
Specification
.
new
do
|
spec
|
Gem
::
Specification
.
new
do
|
spec
|
spec
.
name
=
'zoholib'
spec
.
name
=
'zoholib'
spec
.
version
=
Zoholib
::
VERSION
spec
.
version
=
Wedoops
::
Zoholib
::
VERSION
spec
.
date
=
'2020-04-25'
spec
.
date
=
'2020-04-25'
spec
.
authors
=
[
'Wedoops.io'
]
spec
.
authors
=
[
'Wedoops.io'
]
spec
.
email
=
'wedoops@wedoops.io'
spec
.
email
=
'wedoops@wedoops.io'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment