comfan 0.1.1 → 0.1.2

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: afb0758143ab90e0be99ee57b68dd5e74035be65
4
- data.tar.gz: fad308447bc541608999e92e0fd3a1aa45f59933
3
+ metadata.gz: 1eed71e84f8bf3d0ea494f1be8fc75ba80fb676d
4
+ data.tar.gz: 59b7e624082f9e3538d08066126148d0c1cb0816
5
5
  SHA512:
6
- metadata.gz: 7697fc91308fa856ecd4340f7ff594607680e50a7bd1f757f09a109a9c0261fe1a71e4cd05d2a2ed751aeea081b21a5c49f79d9663840700d0415a2a875c13fe
7
- data.tar.gz: c66ba237e6124b9640952a5ba8c99e42fae6e164c2c3c2fc4b92c5633dbc28c1741088a0237b804d7c7fcb3cb8657f3e910286bc80beecb492abbb4a7590d16b
6
+ metadata.gz: 426d61e573ec30c2787be3ff75f99ae68bb109228bedb33c1c8d7b73706f877d0b508c6ce4b91d4986b5bb6546eb820920953b76f696d487d8f499e3da6cfb5f
7
+ data.tar.gz: 842871db8822a0a7cd879bb9a6ac074fbd6fe5ab863a660c0f5c710aa42bd59b8e0d0716eac3634af84147b400077d62d92ac3b3ab40ce4b783a99b1f765bc23
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.0.0-p195
1
+ 2.1.3
data/Gemfile CHANGED
@@ -1,13 +1,13 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
5
  group :test, :development do
6
- gem 'coveralls', require: false
7
- gem 'guard'
8
- gem 'guard-rspec'
6
+ gem "coveralls", require: false
7
+ gem "guard"
8
+ gem "guard-rspec"
9
9
 
10
- gem 'rb-inotify', require: false
11
- gem 'rb-fsevent', require: false
12
- gem 'rb-fchange', require: false
13
- end
10
+ gem "rb-inotify", require: false
11
+ gem "rb-fsevent", require: false
12
+ gem "rb-fchange", require: false
13
+ end
data/Guardfile CHANGED
@@ -1,5 +1,5 @@
1
1
  guard :rspec do
2
2
  watch(%r{^spec/.+_spec\.rb$})
3
3
  watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
4
- watch('spec/spec_helper.rb') { "spec" }
5
- end
4
+ watch("spec/spec_helper.rb") { "spec" }
5
+ end
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013 Leif Gensert
1
+ Copyright (c) 2013 Leif Gensert, Propertybase GmbH
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -39,7 +39,7 @@ This is method converts an API ID to an UI ID. If an UI ID is provided (length <
39
39
  Otherwise the UI ID is calculated
40
40
 
41
41
  ~~~ ruby
42
- Comfan.api_id '00D50000000IehZEAS' # 0D50000000IehZ
42
+ Comfan.ui_id '00D50000000IehZEAS' # 0D50000000IehZ
43
43
  ~~~
44
44
 
45
45
  ## Contributing
@@ -48,4 +48,4 @@ Comfan.api_id '00D50000000IehZEAS' # 0D50000000IehZ
48
48
  2. Create your feature branch (`git checkout -b my-new-feature`)
49
49
  3. Commit your changes (`git commit -am 'Add some feature'`)
50
50
  4. Push to the branch (`git push origin my-new-feature`)
51
- 5. Create new Pull Request
51
+ 5. Create new Pull Request
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
- require 'bundler/gem_tasks'
2
- require 'rspec/core/rake_task'
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
3
 
4
4
  task default: :spec
5
5
 
6
- RSpec::Core::RakeTask.new(:spec)
6
+ RSpec::Core::RakeTask.new(:spec)
data/comfan.gemspec CHANGED
@@ -1,24 +1,24 @@
1
1
  # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
2
+ lib = File.expand_path("../lib", __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'comfan/version'
4
+ require "comfan/version"
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = 'comfan'
7
+ spec.name = "comfan"
8
8
  spec.version = Comfan::VERSION
9
- spec.authors = ['Leif Gensert', 'Thomas Rudolf']
10
- spec.email = ['leif@propertybase.com', 'thomas@propertybase.com']
11
- spec.description = %q{This tool provides simple helper methods for ruby to provide functionality used in Salesforce}
12
- spec.summary = %q{Ruby Helper Tools for Salesforce functionality}
13
- spec.homepage = 'https://github.com/propertybase/comfan'
14
- spec.license = 'MIT'
9
+ spec.authors = ["Leif Gensert", "Thomas Rudolf"]
10
+ spec.email = ["leif@propertybase.com", "thomas@propertybase.com"]
11
+ spec.description = "This tool provides simple helper methods for ruby " \
12
+ "to provide functionality used in Salesforce"
13
+ spec.summary = "Ruby Helper Tools for Salesforce functionality"
14
+ spec.homepage = "https://github.com/propertybase/comfan"
15
+ spec.license = "MIT"
15
16
 
16
17
  spec.files = `git ls-files`.split($/)
17
18
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
- spec.require_paths = ['lib']
20
+ spec.require_paths = ["lib"]
20
21
 
21
- spec.add_development_dependency 'bundler', '~> 1.3'
22
- spec.add_development_dependency 'rake'
23
- spec.add_development_dependency 'rspec', '< 2.14'
22
+ spec.add_development_dependency "rake"
23
+ spec.add_development_dependency "rspec", "< 3.2"
24
24
  end
data/lib/comfan.rb CHANGED
@@ -3,26 +3,26 @@ require "comfan/version"
3
3
  module Comfan
4
4
  extend self
5
5
 
6
- def api_id input_id
7
- return input_id if input_id.nil? || input_id.length >= 18
8
- suffix = ''
9
-
6
+ def api_id(input_id)
7
+ return input_id if input_id.nil? || input_id.length != 15
8
+ suffix = ""
9
+
10
10
  3.times do |i|
11
11
  flags = 0
12
12
  5.times do |j|
13
13
  c = input_id[i * 5 + j]
14
- if c.upcase == c && c >= 'A' && c <= 'Z'
15
- flags = flags + ( 1 << j )
14
+ if c.upcase == c && c >= "A" && c <= "Z"
15
+ flags = flags + (1 << j)
16
16
  end
17
17
  end
18
- suffix += 'ABCDEFGHIJKLMNOPQRSTUVWXYZ012345'[flags]
18
+ suffix += "ABCDEFGHIJKLMNOPQRSTUVWXYZ012345"[flags]
19
19
  end
20
20
  input_id + suffix
21
21
  end
22
22
 
23
- def ui_id input_id
24
- return input_id if input_id.nil? || input_id.length <= 15
23
+ def ui_id(input_id)
24
+ return input_id if input_id.nil? || input_id.length != 18
25
25
 
26
26
  input_id[0..-4]
27
27
  end
28
- end
28
+ end
@@ -1,3 +1,3 @@
1
1
  module Comfan
2
- VERSION = '0.1.1'
2
+ VERSION = "0.1.2"
3
3
  end
@@ -1,40 +1,45 @@
1
- #encoding: utf-8
2
- require 'spec_helper'
1
+ # encoding: utf-8
2
+ require "spec_helper"
3
3
 
4
4
  describe Comfan do
5
- subject{Comfan}
5
+ subject { described_class }
6
6
 
7
- describe '.api_id' do
8
- it 'returns the same ID for API ID' do
9
- input = '752S00000000KtkIAE'
7
+ describe ".api_id" do
8
+ it "returns the same ID for API ID" do
9
+ input = "752S00000000KtkIAE"
10
10
  expect(subject.api_id(input)).to eq(input)
11
11
  end
12
12
 
13
- it 'returns the correct API ID for UI ID' do
14
- input = '752S00000000Ktk'
15
- output = '752S00000000KtkIAE'
13
+ it "returns the correct API ID for UI ID" do
14
+ input = "752S00000000Ktk"
15
+ output = "752S00000000KtkIAE"
16
16
  expect(subject.api_id(input)).to eq(output)
17
17
  end
18
18
 
19
- it 'returns nil for nil input' do
19
+ it "returns nil for nil input" do
20
20
  expect(subject.api_id(nil)).to be_nil
21
21
  end
22
+
23
+ it "returns same ID if too short" do
24
+ input = "752S00000000"
25
+ expect(subject.api_id(input)).to eq(input)
26
+ end
22
27
  end
23
28
 
24
- describe '.ui_id' do
25
- it 'returns the same ID for UI ID' do
26
- input = '752S00000000Ktk'
29
+ describe ".ui_id" do
30
+ it "returns the same ID for UI ID" do
31
+ input = "752S00000000Ktk"
27
32
  expect(subject.ui_id(input)).to eq(input)
28
33
  end
29
34
 
30
- it 'returns the correct UI ID for API ID' do
31
- input = '752S00000000KtkIAE'
32
- output = '752S00000000Ktk'
35
+ it "returns the correct UI ID for API ID" do
36
+ input = "752S00000000KtkIAE"
37
+ output = "752S00000000Ktk"
33
38
  expect(subject.ui_id(input)).to eq(output)
34
39
  end
35
40
 
36
- it 'returns nil for nil input' do
41
+ it "returns nil for nil input" do
37
42
  expect(subject.ui_id(nil)).to be_nil
38
43
  end
39
44
  end
40
- end
45
+ end
data/spec/spec_helper.rb CHANGED
@@ -1,15 +1,15 @@
1
- require 'simplecov'
2
- require 'coveralls'
1
+ require "simplecov"
2
+ require "coveralls"
3
3
 
4
4
  SimpleCov.formatter = Coveralls::SimpleCov::Formatter
5
5
  SimpleCov.start do
6
- add_filter 'spec'
6
+ add_filter "spec"
7
7
  end
8
8
 
9
- require 'comfan'
9
+ require "comfan"
10
10
 
11
11
  RSpec.configure do |config|
12
12
  config.mock_with :rspec
13
- config.order = 'random'
13
+ config.order = "random"
14
14
  config.filter_run_excluding skip: true
15
- end
15
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comfan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leif Gensert
@@ -9,50 +9,36 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-17 00:00:00.000000000 Z
12
+ date: 2014-10-06 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: bundler
16
- requirement: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - ~>
19
- - !ruby/object:Gem::Version
20
- version: '1.3'
21
- type: :development
22
- prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ~>
26
- - !ruby/object:Gem::Version
27
- version: '1.3'
28
14
  - !ruby/object:Gem::Dependency
29
15
  name: rake
30
16
  requirement: !ruby/object:Gem::Requirement
31
17
  requirements:
32
- - - '>='
18
+ - - ">="
33
19
  - !ruby/object:Gem::Version
34
20
  version: '0'
35
21
  type: :development
36
22
  prerelease: false
37
23
  version_requirements: !ruby/object:Gem::Requirement
38
24
  requirements:
39
- - - '>='
25
+ - - ">="
40
26
  - !ruby/object:Gem::Version
41
27
  version: '0'
42
28
  - !ruby/object:Gem::Dependency
43
29
  name: rspec
44
30
  requirement: !ruby/object:Gem::Requirement
45
31
  requirements:
46
- - - <
32
+ - - "<"
47
33
  - !ruby/object:Gem::Version
48
- version: '2.14'
34
+ version: '3.2'
49
35
  type: :development
50
36
  prerelease: false
51
37
  version_requirements: !ruby/object:Gem::Requirement
52
38
  requirements:
53
- - - <
39
+ - - "<"
54
40
  - !ruby/object:Gem::Version
55
- version: '2.14'
41
+ version: '3.2'
56
42
  description: This tool provides simple helper methods for ruby to provide functionality
57
43
  used in Salesforce
58
44
  email:
@@ -62,15 +48,14 @@ executables: []
62
48
  extensions: []
63
49
  extra_rdoc_files: []
64
50
  files:
65
- - .gitignore
66
- - .rspec
67
- - .ruby-version
68
- - .travis.yml
51
+ - ".gitignore"
52
+ - ".rspec"
53
+ - ".ruby-version"
54
+ - ".travis.yml"
69
55
  - CHANGELOG.md
70
56
  - Gemfile
71
57
  - Guardfile
72
58
  - LICENSE
73
- - LICENSE.txt
74
59
  - README.md
75
60
  - Rakefile
76
61
  - comfan.gemspec
@@ -88,17 +73,17 @@ require_paths:
88
73
  - lib
89
74
  required_ruby_version: !ruby/object:Gem::Requirement
90
75
  requirements:
91
- - - '>='
76
+ - - ">="
92
77
  - !ruby/object:Gem::Version
93
78
  version: '0'
94
79
  required_rubygems_version: !ruby/object:Gem::Requirement
95
80
  requirements:
96
- - - '>='
81
+ - - ">="
97
82
  - !ruby/object:Gem::Version
98
83
  version: '0'
99
84
  requirements: []
100
85
  rubyforge_project:
101
- rubygems_version: 2.0.2
86
+ rubygems_version: 2.2.2
102
87
  signing_key:
103
88
  specification_version: 4
104
89
  summary: Ruby Helper Tools for Salesforce functionality
data/LICENSE.txt DELETED
@@ -1,22 +0,0 @@
1
- Copyright (c) 2013 Leif Gensert, Propertybase GmbH
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.