comfan 0.1.0 → 0.1.1
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile +0 -1
- data/README.md +10 -0
- data/Rakefile +5 -0
- data/comfan.gemspec +2 -2
- data/lib/comfan/version.rb +1 -1
- data/lib/comfan.rb +2 -2
- data/spec/lib/comfan_spec.rb +8 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afb0758143ab90e0be99ee57b68dd5e74035be65
|
4
|
+
data.tar.gz: fad308447bc541608999e92e0fd3a1aa45f59933
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7697fc91308fa856ecd4340f7ff594607680e50a7bd1f757f09a109a9c0261fe1a71e4cd05d2a2ed751aeea081b21a5c49f79d9663840700d0415a2a875c13fe
|
7
|
+
data.tar.gz: c66ba237e6124b9640952a5ba8c99e42fae6e164c2c3c2fc4b92c5633dbc28c1741088a0237b804d7c7fcb3cb8657f3e910286bc80beecb492abbb4a7590d16b
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -20,18 +20,28 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
+
To get access to the functions require the gem with `require 'comfan'`
|
24
|
+
|
23
25
|
### api_id
|
24
26
|
|
25
27
|
This method returns a API ID for the input ID. If the input already is an API (length >= 18 character), the same ID is returned.
|
26
28
|
|
27
29
|
Otherwise the API ID is calculated
|
28
30
|
|
31
|
+
~~~ ruby
|
32
|
+
Comfan.api_id '0D50000000IehZ' # 00D50000000IehZEAS
|
33
|
+
~~~
|
34
|
+
|
29
35
|
### ui_id
|
30
36
|
|
31
37
|
This is method converts an API ID to an UI ID. If an UI ID is provided (length <= 15 characters), the same ID is returned.
|
32
38
|
|
33
39
|
Otherwise the UI ID is calculated
|
34
40
|
|
41
|
+
~~~ ruby
|
42
|
+
Comfan.api_id '00D50000000IehZEAS' # 0D50000000IehZ
|
43
|
+
~~~
|
44
|
+
|
35
45
|
## Contributing
|
36
46
|
|
37
47
|
1. Fork it
|
data/Rakefile
CHANGED
data/comfan.gemspec
CHANGED
@@ -6,8 +6,8 @@ require 'comfan/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = 'comfan'
|
8
8
|
spec.version = Comfan::VERSION
|
9
|
-
spec.authors = ['Leif Gensert']
|
10
|
-
spec.email = ['leif@propertybase.com']
|
9
|
+
spec.authors = ['Leif Gensert', 'Thomas Rudolf']
|
10
|
+
spec.email = ['leif@propertybase.com', 'thomas@propertybase.com']
|
11
11
|
spec.description = %q{This tool provides simple helper methods for ruby to provide functionality used in Salesforce}
|
12
12
|
spec.summary = %q{Ruby Helper Tools for Salesforce functionality}
|
13
13
|
spec.homepage = 'https://github.com/propertybase/comfan'
|
data/lib/comfan/version.rb
CHANGED
data/lib/comfan.rb
CHANGED
@@ -4,7 +4,7 @@ module Comfan
|
|
4
4
|
extend self
|
5
5
|
|
6
6
|
def api_id input_id
|
7
|
-
return input_id if input_id.length >= 18
|
7
|
+
return input_id if input_id.nil? || input_id.length >= 18
|
8
8
|
suffix = ''
|
9
9
|
|
10
10
|
3.times do |i|
|
@@ -21,7 +21,7 @@ module Comfan
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def ui_id input_id
|
24
|
-
return input_id if input_id.length <= 15
|
24
|
+
return input_id if input_id.nil? || input_id.length <= 15
|
25
25
|
|
26
26
|
input_id[0..-4]
|
27
27
|
end
|
data/spec/lib/comfan_spec.rb
CHANGED
@@ -15,6 +15,10 @@ describe Comfan do
|
|
15
15
|
output = '752S00000000KtkIAE'
|
16
16
|
expect(subject.api_id(input)).to eq(output)
|
17
17
|
end
|
18
|
+
|
19
|
+
it 'returns nil for nil input' do
|
20
|
+
expect(subject.api_id(nil)).to be_nil
|
21
|
+
end
|
18
22
|
end
|
19
23
|
|
20
24
|
describe '.ui_id' do
|
@@ -28,5 +32,9 @@ describe Comfan do
|
|
28
32
|
output = '752S00000000Ktk'
|
29
33
|
expect(subject.ui_id(input)).to eq(output)
|
30
34
|
end
|
35
|
+
|
36
|
+
it 'returns nil for nil input' do
|
37
|
+
expect(subject.ui_id(nil)).to be_nil
|
38
|
+
end
|
31
39
|
end
|
32
40
|
end
|
metadata
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: comfan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leif Gensert
|
8
|
+
- Thomas Rudolf
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
@@ -56,6 +57,7 @@ description: This tool provides simple helper methods for ruby to provide functi
|
|
56
57
|
used in Salesforce
|
57
58
|
email:
|
58
59
|
- leif@propertybase.com
|
60
|
+
- thomas@propertybase.com
|
59
61
|
executables: []
|
60
62
|
extensions: []
|
61
63
|
extra_rdoc_files: []
|