comfan 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f3f83c491c67fef1382e1a2d4a389f0bd48a4f67
4
- data.tar.gz: 728b9a7a8cec86b0c9a72be79bda9638a2b45b53
3
+ metadata.gz: afb0758143ab90e0be99ee57b68dd5e74035be65
4
+ data.tar.gz: fad308447bc541608999e92e0fd3a1aa45f59933
5
5
  SHA512:
6
- metadata.gz: 26db800d4e96ab2a6c052685d557adc733d402d9886de66e833f671c77fe8d727a2e9589f050d054c944a09a6b8cca50dafac46bd065ee60780f4ba5cd9070ab
7
- data.tar.gz: 045f413429303abb7eaddac0474e1d24fd934e3d1f505849aeec392b166ae8527293531d35de953322e44bdc97c7ed3d967fa6ba503e3a0f802ec681e0a3b9a9
6
+ metadata.gz: 7697fc91308fa856ecd4340f7ff594607680e50a7bd1f757f09a109a9c0261fe1a71e4cd05d2a2ed751aeea081b21a5c49f79d9663840700d0415a2a875c13fe
7
+ data.tar.gz: c66ba237e6124b9640952a5ba8c99e42fae6e164c2c3c2fc4b92c5633dbc28c1741088a0237b804d7c7fcb3cb8657f3e910286bc80beecb492abbb4a7590d16b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.1.1 (June 17th, 2013)
2
+
3
+ BUG FIXES:
4
+
5
+ - Just return `nil` for nil input
6
+
1
7
  ## 0.1.0 (June 17th, 2013)
2
8
 
3
9
  - initial release
data/Gemfile CHANGED
@@ -1,6 +1,5 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in comfan.gemspec
4
3
  gemspec
5
4
 
6
5
  group :test, :development do
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
@@ -1 +1,6 @@
1
1
  require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+
4
+ task default: :spec
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
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'
@@ -1,3 +1,3 @@
1
1
  module Comfan
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
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
@@ -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.0
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: []