PipedrivePUT 1.1.29 → 1.1.31

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 02e9698b79195972e307561c17c0151d9fe382fe
4
- data.tar.gz: 72255318a3eb52d56a20b76d9c10865dd8e58a46
3
+ metadata.gz: c714ad7bd13d57f1d0d4e1953e0085332a609894
4
+ data.tar.gz: f697f9006e439b1eaa7b4b45f6533882ac138a35
5
5
  SHA512:
6
- metadata.gz: 0fcc6e248354f266d9b5ecfea7f086e283ce8de07e021d421ddbcf3a0ddb12400da7f5c99ec3b11ece06c2a6a51d29b1987feedbee451c0719a598f51d73ab5e
7
- data.tar.gz: e7e4d69f2f9abab294e0415c052172c818e8f943e7998f624141604ee87cc31965d2e49989e111f180acabe0d849d455b1d692f42839b779686353ee52adb9b5
6
+ metadata.gz: 3168d702f0e5d5448900c26b9475e616a0448be2d76a87b085f9218a6b9f850eb1cca1196c2b32adba0735d9485d734818d2424fd58f0684692bddc74a397bf5
7
+ data.tar.gz: 436efbd910bc1d1a275d59072ae2616f81a26ca79b2306ed0da6fa26ce95eeef83e4f4e938b06cac668bae4b16ab942d2eddddd83fe317e127c92d37ce87f397
data/README.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # PipedrivePUT
2
2
 
3
- TODO: Write a gem description
3
+ ## Status
4
+ <a href="https://badge.fury.io/rb/PipedrivePUT"><img src="https://badge.fury.io/rb/PipedrivePUT.svg" alt="Gem Version" height="22"></a>
5
+
6
+ ## Travis CI Build Status
7
+ <a href="https://travis-ci.org/jakepens71"><img src="https://travis-ci.org/jakepens71/RailsPipedriveGem.svg?branch=master" height="22"></a>
8
+
9
+
4
10
 
5
11
  ## Installation
6
12
 
@@ -18,12 +24,23 @@ gem 'httparty'
18
24
 
19
25
  And then execute:
20
26
 
21
- $ bundle
27
+ $ bundle install
22
28
 
23
29
  Or install it yourself as:
24
30
 
25
31
  $ gem install PipedrivePUT
26
32
 
33
+
34
+ ## To install config file
35
+
36
+ rails g pipedrive_p_u_t:config
37
+ This will install a config file in config/initializers/pipedriveput.rb
38
+ Make sure to change the value inside of this file
39
+ ```ruby
40
+ PipedrivePUT.key('your_api_key_goes_here')
41
+
42
+ ```
43
+
27
44
  ## Usage
28
45
 
29
46
  ```ruby
@@ -187,6 +204,12 @@ Get all Activites per user
187
204
  PipedrivePUT::Activity.getActivity(< user_id >)
188
205
  ```
189
206
 
207
+ Get all Activites for a specific organization
208
+
209
+ ```ruby
210
+ PipedrivePUT::Activity.getOrgActivities(< org_id >)
211
+ ```
212
+
190
213
  ## Activity Types
191
214
 
192
215
  Get all Activity Types
@@ -195,6 +218,18 @@ Get all Activity Types
195
218
  ```
196
219
 
197
220
 
221
+ ## Currencies
222
+
223
+ Get all Currencies
224
+ ```ruby
225
+ PipedrivePUT::Currencies.getAllCurr
226
+ ```
227
+
228
+ Search for Currencies based off currency name
229
+ ```ruby
230
+ PipedrivePUT::Currencies.getCurr(< currency_name >)
231
+ ```
232
+
198
233
  ## Pipelines
199
234
 
200
235
  Get all Pipelines
data/Rakefile CHANGED
@@ -1,2 +1,7 @@
1
1
  require "bundler/gem_tasks"
2
2
 
3
+ require "rspec/core/rake_task"
4
+
5
+ RSpec::Core::RakeTask.new(:spec)
6
+
7
+ task :default => :spec
data/lib/PipedrivePUT.rb CHANGED
@@ -9,7 +9,7 @@ require 'PipedrivePUT/recents'
9
9
  require 'PipedrivePUT/organization_field'
10
10
  require 'PipedrivePUT/activity'
11
11
  require 'PipedrivePUT/activity-type'
12
-
12
+ require 'PipedrivePUT/currencies'
13
13
 
14
14
  require 'json'
15
15
  require 'open-uri'
@@ -20,6 +20,7 @@ module PipedrivePUT
20
20
 
21
21
  attr_accessor :key
22
22
 
23
+
23
24
  #set the giving API key for pipedrive
24
25
  def self.key(key)
25
26
  @@key = key
@@ -10,7 +10,19 @@ module PipedrivePUT
10
10
  @parsed = JSON.parse(@content)
11
11
  return @parsed
12
12
  end
13
- #-------------------------------------------------------------------------------------------------------------------------------------
13
+ #------------------------------------------------------------------------------------------------------------------------------------
14
+
15
+ #----------------------------------------- Gets activites of a specific organization------------------------------------------------
16
+
17
+ def self.getOrgActivities(org_id)
18
+ @slash = "/"
19
+ @base = 'https://api.pipedrive.com/v1/organizations/' + org_id.to_s + @slash + 'activities?start=0' + '&api_token=' + @@key.to_s
20
+ #puts @base
21
+ @content = open(@base.to_s).read
22
+ @parsed = JSON.parse(@content)
23
+ return @parsed
24
+ end
25
+ #-----------------------------------------------------------------------------------------------------------------------------------
14
26
  end
15
27
  end
16
28
 
@@ -0,0 +1,69 @@
1
+ module PipedrivePUT
2
+ class Currencies
3
+ include PipedrivePUT
4
+
5
+ #---------------------------------------------------------get all currencies----------------------------------------------------------------------------------------------------------------------
6
+ def self.getAllCurr
7
+ @base = 'https://api.pipedrive.com/v1/currencies?api_token=' + @@key.to_s
8
+ @content = open(@base.to_s).read
9
+ @parsed = JSON.parse(@content)
10
+ return @parsed
11
+ end
12
+ #---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
13
+
14
+ #----------------------------------------- search for currencies -----------------------------------------------------------------------------------------------------------------------------------
15
+ def self.getCurr(currency_name)
16
+ curr_string = currency_name.to_s
17
+ curr_string_count = curr_string.split.size
18
+ if curr_string_count <= 1
19
+ @words = curr_string.split.each_slice(1).map {|a| a.join ' '}
20
+ @first = @words[0]
21
+ @base = 'https://api.pipedrive.com/v1/currencies?term=' + @first.to_s + '&api_token=' + @@key.to_s
22
+ @content = open(@base.to_s).read
23
+ @parsed = JSON.parse(@content)
24
+ return @parsed
25
+ elsif curr_string_count <= 2
26
+ @words = curr_string.split.each_slice(1).map {|a| a.join ' '}
27
+ @first = @words[0]
28
+ @second = @words[1]
29
+ @base = 'https://api.pipedrive.com/v1/currencies?term=' + @first.to_s + '%20' + @second.to_s + '&api_token=' + @@key.to_s
30
+ @content = open(@base.to_s).read
31
+ @parsed = JSON.parse(@content)
32
+ return @parsed
33
+ elsif curr_string_count <= 3
34
+ @words = curr_string.split.each_slice(1).map {|a| a.join ' '}
35
+ @first = @words[0]
36
+ @second = @words[1]
37
+ @third = @words[2]
38
+ @base = 'https://api.pipedrive.com/v1/currencies?term=' + @first.to_s + '%20' + @second.to_s + '%20' + @third.to_s + '&api_token=' + @@key.to_s
39
+ @content = open(@base.to_s).read
40
+ @parsed = JSON.parse(@content)
41
+ return @parsed
42
+ elsif curr_string_count <= 4
43
+ @words = curr_string.split.each_slice(1).map {|a| a.join ' '}
44
+ @first = @words[0]
45
+ @second = @words[1]
46
+ @third = @words[2]
47
+ @fourth = @words[3]
48
+ @base = 'https://api.pipedrive.com/v1/currencies?term=' + @first.to_s + '%20' + @second.to_s + '%20' + @third.to_s + '%20' + @fourth.to_s + '&api_token=' + @@key.to_s
49
+ @content = open(@base.to_s).read
50
+ @parsed = JSON.parse(@content)
51
+ return @parsed
52
+ elsif curr_string_count <= 5
53
+ @words = curr_string.split.each_slice(1).map {|a| a.join ' '}
54
+ @first = @words[0]
55
+ @second = @words[1]
56
+ @third = @words[2]
57
+ @fourth = @words[3]
58
+ @fifth = @words[4]
59
+ @base = 'https://api.pipedrive.com/v1/currencies?term=' + @first.to_s + '%20' + @second.to_s + '%20' + @third.to_s + '%20' + @fourth.to_s + '%20' + @fifth.to_s + '&api_token=' + @@key.to_s
60
+ @content = open(@base.to_s).read
61
+ @parsed = JSON.parse(@content)
62
+ return @parsed
63
+ end
64
+ end
65
+ #----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
66
+ end
67
+ end
68
+
69
+
@@ -42,7 +42,8 @@ require 'rest-client'
42
42
  return table
43
43
  end
44
44
 
45
-
45
+
46
+
46
47
  #Add an organization
47
48
  def self.addOrganization(companyName, options = {})
48
49
  #args.each_with_index{ |arg, i| puts "#{i+1}. #{arg}" }
@@ -1,3 +1,3 @@
1
1
  module PipedrivePUT
2
- VERSION = "1.1.29"
2
+ VERSION = "1.1.31"
3
3
  end
@@ -0,0 +1,5 @@
1
+ Description:
2
+ Creates a config file for PipedrivePUT gem with key to access Pipedrive Api
3
+
4
+ Example:
5
+ rails g pipedriveput:config
@@ -0,0 +1,13 @@
1
+ module PipedrivePUT
2
+ module Generators
3
+
4
+ # Generates a sample config file
5
+ class ConfigGenerator < ::Rails::Generators::Base
6
+ source_root File.expand_path('../templates', __FILE__)
7
+
8
+ def generate_config
9
+ template "config.rb.erb", "config/initializers/pipedriveput.rb"
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1 @@
1
+ PipedrivePUT.key('api_key_goes_here')
@@ -0,0 +1 @@
1
+ #nothing
@@ -0,0 +1,2 @@
1
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
+ require 'PipedrivePUT'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: PipedrivePUT
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.29
4
+ version: 1.1.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - JakePens71
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-01-28 00:00:00.000000000 Z
12
+ date: 2016-02-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -110,6 +110,7 @@ files:
110
110
  - lib/PipedrivePUT.rb
111
111
  - lib/PipedrivePUT/activity-type.rb
112
112
  - lib/PipedrivePUT/activity.rb
113
+ - lib/PipedrivePUT/currencies.rb
113
114
  - lib/PipedrivePUT/deal.rb
114
115
  - lib/PipedrivePUT/organization.rb
115
116
  - lib/PipedrivePUT/organization_field.rb
@@ -119,6 +120,11 @@ files:
119
120
  - lib/PipedrivePUT/search.rb
120
121
  - lib/PipedrivePUT/users.rb
121
122
  - lib/PipedrivePUT/version.rb
123
+ - lib/generators/pipedrive_p_u_t/config/USAGE
124
+ - lib/generators/pipedrive_p_u_t/config/config_generator.rb
125
+ - lib/generators/pipedrive_p_u_t/config/templates/config.rb.erb
126
+ - spec/PipedrivePUT_spec.rb
127
+ - spec/spec_helper.rb
122
128
  homepage: https://github.com/jakepens71/RailsPipedriveGem
123
129
  licenses:
124
130
  - MIT
@@ -143,5 +149,7 @@ rubygems_version: 2.2.2
143
149
  signing_key:
144
150
  specification_version: 4
145
151
  summary: Pipedrive gem to retrieve data from Pipedrive.com
146
- test_files: []
152
+ test_files:
153
+ - spec/PipedrivePUT_spec.rb
154
+ - spec/spec_helper.rb
147
155
  has_rdoc: