zoho_wrapper 0.0.5
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.
- data/.gitignore +17 -0
- data/.ruby-version +1 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +140 -0
- data/README.rdoc +28 -0
- data/Rakefile +6 -0
- data/config.ru +4 -0
- data/lib/zoho_wrapper/lead.rb +48 -0
- data/lib/zoho_wrapper.rb +5 -0
- data/zoho_wrapper.gemspec +25 -0
- metadata +120 -0
data/.gitignore
ADDED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.9.3
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,140 @@
|
|
1
|
+
GEM
|
2
|
+
remote: https://rubygems.org/
|
3
|
+
specs:
|
4
|
+
actionmailer (4.0.4)
|
5
|
+
actionpack (= 4.0.4)
|
6
|
+
mail (~> 2.5.4)
|
7
|
+
actionpack (4.0.4)
|
8
|
+
activesupport (= 4.0.4)
|
9
|
+
builder (~> 3.1.0)
|
10
|
+
erubis (~> 2.7.0)
|
11
|
+
rack (~> 1.5.2)
|
12
|
+
rack-test (~> 0.6.2)
|
13
|
+
activemodel (4.0.4)
|
14
|
+
activesupport (= 4.0.4)
|
15
|
+
builder (~> 3.1.0)
|
16
|
+
activerecord (4.0.4)
|
17
|
+
activemodel (= 4.0.4)
|
18
|
+
activerecord-deprecated_finders (~> 1.0.2)
|
19
|
+
activesupport (= 4.0.4)
|
20
|
+
arel (~> 4.0.0)
|
21
|
+
activerecord-deprecated_finders (1.0.3)
|
22
|
+
activesupport (4.0.4)
|
23
|
+
i18n (~> 0.6, >= 0.6.9)
|
24
|
+
minitest (~> 4.2)
|
25
|
+
multi_json (~> 1.3)
|
26
|
+
thread_safe (~> 0.1)
|
27
|
+
tzinfo (~> 0.3.37)
|
28
|
+
arel (4.0.2)
|
29
|
+
builder (3.1.4)
|
30
|
+
coffee-rails (4.0.1)
|
31
|
+
coffee-script (>= 2.2.0)
|
32
|
+
railties (>= 4.0.0, < 5.0)
|
33
|
+
coffee-script (2.2.0)
|
34
|
+
coffee-script-source
|
35
|
+
execjs
|
36
|
+
coffee-script-source (1.7.0)
|
37
|
+
erubis (2.7.0)
|
38
|
+
execjs (2.0.2)
|
39
|
+
hike (1.2.3)
|
40
|
+
httmultiparty (0.3.14)
|
41
|
+
httparty (>= 0.7.3)
|
42
|
+
mimemagic
|
43
|
+
multipart-post
|
44
|
+
httparty (0.13.1)
|
45
|
+
json (~> 1.8)
|
46
|
+
multi_xml (>= 0.5.2)
|
47
|
+
i18n (0.6.9)
|
48
|
+
jbuilder (1.5.3)
|
49
|
+
activesupport (>= 3.0.0)
|
50
|
+
multi_json (>= 1.2.0)
|
51
|
+
jquery-rails (3.1.0)
|
52
|
+
railties (>= 3.0, < 5.0)
|
53
|
+
thor (>= 0.14, < 2.0)
|
54
|
+
json (1.8.1)
|
55
|
+
mail (2.5.4)
|
56
|
+
mime-types (~> 1.16)
|
57
|
+
treetop (~> 1.4.8)
|
58
|
+
mime-types (1.25.1)
|
59
|
+
mimemagic (0.2.1)
|
60
|
+
mini_portile (0.5.3)
|
61
|
+
minitest (4.7.5)
|
62
|
+
multi_json (1.9.3)
|
63
|
+
multi_xml (0.5.5)
|
64
|
+
multipart-post (2.0.0)
|
65
|
+
nokogiri (1.6.1)
|
66
|
+
mini_portile (~> 0.5.0)
|
67
|
+
polyglot (0.3.4)
|
68
|
+
rack (1.5.2)
|
69
|
+
rack-test (0.6.2)
|
70
|
+
rack (>= 1.0)
|
71
|
+
rails (4.0.4)
|
72
|
+
actionmailer (= 4.0.4)
|
73
|
+
actionpack (= 4.0.4)
|
74
|
+
activerecord (= 4.0.4)
|
75
|
+
activesupport (= 4.0.4)
|
76
|
+
bundler (>= 1.3.0, < 2.0)
|
77
|
+
railties (= 4.0.4)
|
78
|
+
sprockets-rails (~> 2.0.0)
|
79
|
+
railties (4.0.4)
|
80
|
+
actionpack (= 4.0.4)
|
81
|
+
activesupport (= 4.0.4)
|
82
|
+
rake (>= 0.8.7)
|
83
|
+
thor (>= 0.18.1, < 2.0)
|
84
|
+
rake (10.3.1)
|
85
|
+
rdoc (4.1.1)
|
86
|
+
json (~> 1.4)
|
87
|
+
roxml (3.3.1)
|
88
|
+
activesupport (>= 2.3.0)
|
89
|
+
nokogiri (>= 1.3.3)
|
90
|
+
rubyzoho (0.2.0)
|
91
|
+
activemodel
|
92
|
+
httmultiparty
|
93
|
+
multipart-post
|
94
|
+
roxml
|
95
|
+
sass (3.2.19)
|
96
|
+
sass-rails (4.0.3)
|
97
|
+
railties (>= 4.0.0, < 5.0)
|
98
|
+
sass (~> 3.2.0)
|
99
|
+
sprockets (~> 2.8, <= 2.11.0)
|
100
|
+
sprockets-rails (~> 2.0)
|
101
|
+
sdoc (0.4.0)
|
102
|
+
json (~> 1.8)
|
103
|
+
rdoc (~> 4.0, < 5.0)
|
104
|
+
sprockets (2.11.0)
|
105
|
+
hike (~> 1.2)
|
106
|
+
multi_json (~> 1.0)
|
107
|
+
rack (~> 1.0)
|
108
|
+
tilt (~> 1.1, != 1.3.0)
|
109
|
+
sprockets-rails (2.0.1)
|
110
|
+
actionpack (>= 3.0)
|
111
|
+
activesupport (>= 3.0)
|
112
|
+
sprockets (~> 2.8)
|
113
|
+
sqlite3 (1.3.9)
|
114
|
+
thor (0.19.1)
|
115
|
+
thread_safe (0.3.3)
|
116
|
+
tilt (1.4.1)
|
117
|
+
treetop (1.4.15)
|
118
|
+
polyglot
|
119
|
+
polyglot (>= 0.3.1)
|
120
|
+
turbolinks (2.2.2)
|
121
|
+
coffee-rails
|
122
|
+
tzinfo (0.3.39)
|
123
|
+
uglifier (2.5.0)
|
124
|
+
execjs (>= 0.3.0)
|
125
|
+
json (>= 1.8.0)
|
126
|
+
|
127
|
+
PLATFORMS
|
128
|
+
ruby
|
129
|
+
|
130
|
+
DEPENDENCIES
|
131
|
+
coffee-rails (~> 4.0.0)
|
132
|
+
jbuilder (~> 1.2)
|
133
|
+
jquery-rails
|
134
|
+
rails (= 4.0.4)
|
135
|
+
rubyzoho
|
136
|
+
sass-rails (~> 4.0.2)
|
137
|
+
sdoc
|
138
|
+
sqlite3
|
139
|
+
turbolinks
|
140
|
+
uglifier (>= 1.3.0)
|
data/README.rdoc
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
== README
|
2
|
+
|
3
|
+
This README would normally document whatever steps are necessary to get the
|
4
|
+
application up and running.
|
5
|
+
|
6
|
+
Things you may want to cover:
|
7
|
+
|
8
|
+
* Ruby version
|
9
|
+
|
10
|
+
* System dependencies
|
11
|
+
|
12
|
+
* Configuration
|
13
|
+
|
14
|
+
* Database creation
|
15
|
+
|
16
|
+
* Database initialization
|
17
|
+
|
18
|
+
* How to run the test suite
|
19
|
+
|
20
|
+
* Services (job queues, cache servers, search engines, etc.)
|
21
|
+
|
22
|
+
* Deployment instructions
|
23
|
+
|
24
|
+
* ...
|
25
|
+
|
26
|
+
|
27
|
+
Please feel free to use a different markup language if you do not plan to run
|
28
|
+
<tt>rake doc:app</tt>.
|
data/Rakefile
ADDED
data/config.ru
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
module ZohoWrapper
|
2
|
+
module ActiveRecord
|
3
|
+
|
4
|
+
def zoho_save
|
5
|
+
logger.info 'Saving #{fullname} to zoho'
|
6
|
+
|
7
|
+
begin
|
8
|
+
setup_zoho
|
9
|
+
lead = RubyZoho::Crm::Lead.new(self.zoho_lead.dup)
|
10
|
+
lead.save
|
11
|
+
self.on_zoho = true
|
12
|
+
self.save!
|
13
|
+
rescue Exception => exception
|
14
|
+
logger.error(
|
15
|
+
"<Error while trying to SAVE new lead at zoho> \n" +
|
16
|
+
"#{exception.class} (#{exception.message})")
|
17
|
+
return false
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def zoho_remove
|
22
|
+
logger.info 'Removing #{fullname} from zoho'
|
23
|
+
|
24
|
+
begin
|
25
|
+
setup_zoho
|
26
|
+
leads = RubyZoho::Crm::Lead.find_by_email(self.email)
|
27
|
+
for lead in leads
|
28
|
+
RubyZoho::Crm::Lead.delete(lead.id)
|
29
|
+
end
|
30
|
+
self.on_zoho = false
|
31
|
+
self.save!
|
32
|
+
rescue Exception => exception
|
33
|
+
logger.error(
|
34
|
+
"<Error while trying to REMOVE lead at zoho> \n" +
|
35
|
+
"#{exception.class} (#{exception.message})")
|
36
|
+
return false
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
def setup_zoho
|
42
|
+
RubyZoho.configure do |config|
|
43
|
+
# 'ed7fc5b8a28a358793dcd162e67c43e1'
|
44
|
+
config.api_key = self.zoho_token
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
data/lib/zoho_wrapper.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
lib = File.expand_path('../lib', __FILE__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "zoho_wrapper"
|
8
|
+
spec.version = "0.0.5"
|
9
|
+
spec.authors = ["marcelorxs"]
|
10
|
+
spec.email = ["marcelorxs@gmail.com"]
|
11
|
+
spec.summary = "A gem for accessing Zoho CRM API"
|
12
|
+
spec.description = "A rubyzoho wrapper that allows Zoho CRM API access."
|
13
|
+
spec.homepage = "http://github.com/marcelorxaviers/zoho_wrapper"
|
14
|
+
spec.license = "MIT"
|
15
|
+
spec.platform = Gem::Platform::RUBY
|
16
|
+
spec.required_ruby_version = ">= 1.9.3"
|
17
|
+
spec.files = `git ls-files -z`.split("\x0")
|
18
|
+
# spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
|
+
# spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.5"
|
22
|
+
spec.add_development_dependency "rake", "~> 0"
|
23
|
+
spec.add_development_dependency "rspec", "~> 0"
|
24
|
+
spec.add_dependency "rubyzoho", "~> 0.2.0"
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,120 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: zoho_wrapper
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.5
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- marcelorxs
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2014-05-03 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: bundler
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '1.5'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.5'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rspec
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ~>
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rubyzoho
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ~>
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 0.2.0
|
70
|
+
type: :runtime
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 0.2.0
|
78
|
+
description: A rubyzoho wrapper that allows Zoho CRM API access.
|
79
|
+
email:
|
80
|
+
- marcelorxs@gmail.com
|
81
|
+
executables: []
|
82
|
+
extensions: []
|
83
|
+
extra_rdoc_files: []
|
84
|
+
files:
|
85
|
+
- .gitignore
|
86
|
+
- .ruby-version
|
87
|
+
- Gemfile
|
88
|
+
- Gemfile.lock
|
89
|
+
- README.rdoc
|
90
|
+
- Rakefile
|
91
|
+
- config.ru
|
92
|
+
- lib/zoho_wrapper.rb
|
93
|
+
- lib/zoho_wrapper/lead.rb
|
94
|
+
- zoho_wrapper.gemspec
|
95
|
+
homepage: http://github.com/marcelorxaviers/zoho_wrapper
|
96
|
+
licenses:
|
97
|
+
- MIT
|
98
|
+
post_install_message:
|
99
|
+
rdoc_options: []
|
100
|
+
require_paths:
|
101
|
+
- lib
|
102
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
103
|
+
none: false
|
104
|
+
requirements:
|
105
|
+
- - ! '>='
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: 1.9.3
|
108
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
|
+
none: false
|
110
|
+
requirements:
|
111
|
+
- - ! '>='
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: '0'
|
114
|
+
requirements: []
|
115
|
+
rubyforge_project:
|
116
|
+
rubygems_version: 1.8.24
|
117
|
+
signing_key:
|
118
|
+
specification_version: 3
|
119
|
+
summary: A gem for accessing Zoho CRM API
|
120
|
+
test_files: []
|