fruit_to_lime 2.1.1 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/fruit_to_lime/errors.rb +4 -0
- data/lib/fruit_to_lime/model/class_settings.rb +22 -2
- data/lib/fruit_to_lime/model/coworker.rb +2 -4
- data/lib/fruit_to_lime/model/note.rb +0 -4
- data/lib/fruit_to_lime/model/organization.rb +39 -5
- data/lib/fruit_to_lime/model/person.rb +12 -3
- data/lib/fruit_to_lime/model/rootmodel.rb +41 -6
- data/lib/fruit_to_lime/model/settings.rb +24 -0
- data/lib/fruit_to_lime.rb +2 -1
- data/spec/class_settings_spec.rb +26 -0
- data/spec/helpers/csv_helper_spec.rb +14 -0
- data/spec/helpers/xsd_validate_spec.rb +9 -3
- data/spec/rootmodel_spec.rb +58 -0
- metadata +8 -3
- data/templates/csv/export.xml +0 -152
@@ -21,10 +21,15 @@ module FruitToLime
|
|
21
21
|
"ClassSettings"
|
22
22
|
end
|
23
23
|
|
24
|
+
# Set custom field. If there is already an existing custom field, then it is overwritten.
|
24
25
|
def set_custom_field(obj)
|
25
26
|
@custom_fields = [] if @custom_fields==nil
|
26
27
|
|
27
|
-
|
28
|
+
if obj.is_a?(CustomField)
|
29
|
+
field = obj
|
30
|
+
else
|
31
|
+
field = CustomField.new(obj)
|
32
|
+
end
|
28
33
|
|
29
34
|
index = @custom_fields.find_index do |custom_field|
|
30
35
|
custom_field.same_as?(field)
|
@@ -38,13 +43,28 @@ module FruitToLime
|
|
38
43
|
return field
|
39
44
|
end
|
40
45
|
|
46
|
+
# Add custom field. If there is already an existing custom field, then an AlreadyAddedError will be raised.
|
41
47
|
def add_custom_field(obj)
|
42
48
|
@custom_fields = [] if @custom_fields==nil
|
43
49
|
|
44
|
-
|
50
|
+
if obj.is_a?(CustomField)
|
51
|
+
field = obj
|
52
|
+
else
|
53
|
+
field = CustomField.new(obj)
|
54
|
+
end
|
55
|
+
|
56
|
+
index = @custom_fields.find_index do |custom_field|
|
57
|
+
custom_field.same_as?(field)
|
58
|
+
end
|
59
|
+
|
60
|
+
if index
|
61
|
+
raise AlreadyAddedError, "Already added a custom same as #{obj}"
|
62
|
+
end
|
63
|
+
|
45
64
|
@custom_fields.push field
|
46
65
|
|
47
66
|
return field
|
48
67
|
end
|
68
|
+
|
49
69
|
end
|
50
70
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module FruitToLime
|
2
2
|
class Coworker
|
3
3
|
include SerializeHelper
|
4
|
-
attr_accessor :id, :integration_id, :
|
4
|
+
attr_accessor :id, :integration_id, :email, :first_name, :last_name, :direct_phone_number,
|
5
5
|
:mobile_phone_number, :home_phone_number
|
6
6
|
|
7
7
|
def initialize(opt = nil)
|
@@ -15,7 +15,7 @@ module FruitToLime
|
|
15
15
|
|
16
16
|
def serialize_variables
|
17
17
|
[
|
18
|
-
:id, :integration_id, :first_name, :last_name,
|
18
|
+
:id, :integration_id, :email, :first_name, :last_name,
|
19
19
|
:direct_phone_number, :mobile_phone_number, :home_phone_number
|
20
20
|
].map {|p| { :id => p, :type => :string } }
|
21
21
|
end
|
@@ -40,8 +40,6 @@ module FruitToLime
|
|
40
40
|
|
41
41
|
if that.is_a? Coworker
|
42
42
|
return @integration_id == that.integration_id
|
43
|
-
elsif that.is_a? String
|
44
|
-
return @integration_id == that
|
45
43
|
end
|
46
44
|
|
47
45
|
return false
|
@@ -47,28 +47,60 @@ module FruitToLime
|
|
47
47
|
|
48
48
|
if that.is_a? Organization
|
49
49
|
return @integration_id == that.integration_id
|
50
|
-
elsif that.is_a? String
|
51
|
-
return @integration_id == that
|
52
50
|
end
|
53
51
|
|
54
52
|
return false
|
55
53
|
end
|
56
54
|
|
55
|
+
# @example Set city of postal address to 'Lund'
|
56
|
+
# o.with_postal_address do |addr|
|
57
|
+
# addr.city = "Lund"
|
58
|
+
# end
|
59
|
+
# @see Address address
|
57
60
|
def with_postal_address
|
58
|
-
@postal_address = Address.new
|
61
|
+
@postal_address = Address.new if @postal_address == nil
|
59
62
|
yield @postal_address
|
60
63
|
end
|
61
64
|
|
65
|
+
# @example Set city of visit address to 'Lund'
|
66
|
+
# o.with_visit_address do |addr|
|
67
|
+
# addr.city = "Lund"
|
68
|
+
# end
|
69
|
+
# @see Address address
|
62
70
|
def with_visit_address
|
63
|
-
@visit_address = Address.new
|
71
|
+
@visit_address = Address.new if @visit_address == nil
|
64
72
|
yield @visit_address
|
65
73
|
end
|
66
74
|
|
75
|
+
# @example Set the source to par id 4653
|
76
|
+
# o.with_source do |source|
|
77
|
+
# source.par_se('4653')
|
78
|
+
# end
|
79
|
+
# @see ReferenceToSource source
|
67
80
|
def with_source
|
68
|
-
@source = ReferenceToSource.new
|
81
|
+
@source = ReferenceToSource.new if @source == nil
|
69
82
|
yield @source
|
70
83
|
end
|
71
84
|
|
85
|
+
# @example Set the responsible coworker of the organization to the coworker with integration id 943
|
86
|
+
# o.with_responsible_coworker do |responsible_coworker|
|
87
|
+
# responsible_coworker.integration_id = "943"
|
88
|
+
# end
|
89
|
+
# @see CoworkerReference responsible_coworker
|
90
|
+
def with_responsible_coworker
|
91
|
+
@responsible_coworker = CoworkerReference.new if @responsible_coworker==nil
|
92
|
+
yield @responsible_coworker
|
93
|
+
end
|
94
|
+
|
95
|
+
# @example Add an employee and then add additional info to that employee
|
96
|
+
# employee = o.add_employee({
|
97
|
+
# :integration_id => "79654",
|
98
|
+
# :first_name => "Peter",
|
99
|
+
# :last_name => "Wilhelmsson"
|
100
|
+
# })
|
101
|
+
# employee.direct_phone_number = '+234234234'
|
102
|
+
# employee.currently_employed = true
|
103
|
+
# @see Person employee
|
72
104
|
def add_employee(val)
|
73
105
|
@employees = [] if @employees == nil
|
74
106
|
person = if val.is_a? Person then val else Person.new(val) end
|
@@ -76,6 +108,8 @@ module FruitToLime
|
|
76
108
|
person
|
77
109
|
end
|
78
110
|
|
111
|
+
# TODO! Remove, it's obsolete
|
112
|
+
# @!visibility private
|
79
113
|
def add_responsible_coworker(val)
|
80
114
|
coworker = if val.is_a? CoworkerReference then val else CoworkerReference.new(val) end
|
81
115
|
@responsible_coworker = coworker
|
@@ -34,14 +34,23 @@ module FruitToLime
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|
37
|
-
|
37
|
+
# @example Set city of postal address to 'Lund'
|
38
|
+
# p.with_postal_address do |addr|
|
39
|
+
# addr.city = "Lund"
|
40
|
+
# end
|
41
|
+
# @see Address address
|
38
42
|
def with_postal_address
|
39
|
-
@postal_address = Address.new
|
43
|
+
@postal_address = Address.new if @postal_address == nil
|
40
44
|
yield @postal_address
|
41
45
|
end
|
42
46
|
|
47
|
+
# @example Set the source to par id 4653
|
48
|
+
# p.with_source do |source|
|
49
|
+
# source.par_se('4653')
|
50
|
+
# end
|
51
|
+
# @see ReferenceToSource source
|
43
52
|
def with_source
|
44
|
-
@source = ReferenceToSource.new
|
53
|
+
@source = ReferenceToSource.new if @source == nil
|
45
54
|
yield @source
|
46
55
|
end
|
47
56
|
|
@@ -36,20 +36,53 @@ module FruitToLime
|
|
36
36
|
end
|
37
37
|
|
38
38
|
# Adds the specifed coworker object to the model.
|
39
|
+
# @example Add a coworker from a hash
|
40
|
+
# rootmodel.add_coworker({
|
41
|
+
# :integration_id=>"123",
|
42
|
+
# :first_name=>"Kalle",
|
43
|
+
# :last_name=>"Anka",
|
44
|
+
# :email=>"kalle.anka@vonanka.com"
|
45
|
+
# })
|
46
|
+
#
|
47
|
+
# @example Add a coworker from a new coworker
|
48
|
+
# coworker = FruitToLime::Coworker.new
|
49
|
+
# coworker.integration_id = "123"
|
50
|
+
# coworker.first_name="Kalle"
|
51
|
+
# coworker.last_name="Anka"
|
52
|
+
# coworker.email = "kalle.anka@vonanka.com"
|
53
|
+
# rootmodel.add_coworker(coworker)
|
54
|
+
#
|
55
|
+
# @example If you want to keep adding coworkers and dont care about duplicates not being added
|
56
|
+
# begin
|
57
|
+
# rootmodel.add_coworker(coworker)
|
58
|
+
# rescue FruitToLime::AlreadyAddedError
|
59
|
+
# puts "Warning: already added coworker"
|
60
|
+
# end
|
61
|
+
# @see Coworker
|
39
62
|
def add_coworker(coworker)
|
40
63
|
@coworkers = [] if @coworkers == nil
|
41
64
|
|
42
|
-
if coworker
|
43
|
-
|
65
|
+
if coworker == nil
|
66
|
+
raise "Missing coworker to add!"
|
44
67
|
end
|
68
|
+
|
69
|
+
coworker = Coworker.new(coworker) if !coworker.is_a?(Coworker)
|
70
|
+
|
71
|
+
if find_coworker_by_integration_id(coworker.integration_id)!=nil
|
72
|
+
raise AlreadyAddedError, "Already added a coworker with integration_id #{coworker.integration_id}"
|
73
|
+
end
|
74
|
+
|
75
|
+
@coworkers.push(coworker)
|
45
76
|
end
|
46
77
|
|
78
|
+
# TODO! Remove, it's obsolete
|
79
|
+
# @!visibility private
|
47
80
|
def add_note(text)
|
48
81
|
@notes = [] if @notes == nil
|
49
82
|
@notes.push(if text.is_a? Note then text else Note.new(text) end)
|
50
83
|
end
|
51
84
|
|
52
|
-
def
|
85
|
+
def with_new_note
|
53
86
|
@notes = [] if @notes == nil
|
54
87
|
|
55
88
|
note = Note.new
|
@@ -59,13 +92,13 @@ module FruitToLime
|
|
59
92
|
|
60
93
|
def find_coworker_by_integration_id(integration_id)
|
61
94
|
return @coworkers.find do |coworker|
|
62
|
-
coworker == integration_id
|
95
|
+
coworker.integration_id == integration_id
|
63
96
|
end
|
64
97
|
end
|
65
98
|
|
66
99
|
def find_organization_by_integration_id(integration_id)
|
67
100
|
return @organizations.find do |organization|
|
68
|
-
organization == integration_id
|
101
|
+
organization.integration_id == integration_id
|
69
102
|
end
|
70
103
|
end
|
71
104
|
|
@@ -107,7 +140,9 @@ module FruitToLime
|
|
107
140
|
|
108
141
|
# returns all items from the object array with duplicate keys.
|
109
142
|
# To get all organizations with the same integration_id use
|
110
|
-
#
|
143
|
+
# @example Get all the organization duplicates with the same integration id
|
144
|
+
# rm.get_duplicates(rm.organizations, {|org| org.integration_id})
|
145
|
+
#
|
111
146
|
def get_duplicates(objects, &key)
|
112
147
|
uniq_items = objects.uniq {|item| key.call(item)}.compact
|
113
148
|
|
@@ -4,14 +4,38 @@ module FruitToLime
|
|
4
4
|
include SerializeHelper
|
5
5
|
attr_reader :organization, :person, :deal
|
6
6
|
|
7
|
+
# @example Add custom fields available for organization
|
8
|
+
# rootmodel.settings.with_organization do |organization_settings|
|
9
|
+
# organization_settings.set_custom_field({:integration_id=>"link_to_bi_system", :title=>"Link to BI system"})
|
10
|
+
# organization_settings.set_custom_field({:integration_id=>"yield_quota", :title=>"Yield quota"})
|
11
|
+
# end
|
12
|
+
# @see ClassSettings
|
13
|
+
# @see CustomField
|
14
|
+
# @see RootModel
|
7
15
|
def with_organization
|
8
16
|
@organization = ClassSettings.new if @organization ==nil
|
9
17
|
yield @organization
|
10
18
|
end
|
19
|
+
|
20
|
+
# @example Add custom fields available for person
|
21
|
+
# rootmodel.settings.with_person do |person_settings|
|
22
|
+
# person_settings.set_custom_field({:integration_id=>"link_to_bi_system", :title=>"Link to BI system"})
|
23
|
+
# end
|
24
|
+
# @see ClassSettings
|
25
|
+
# @see CustomField
|
26
|
+
# @see RootModel
|
11
27
|
def with_person
|
12
28
|
@person = ClassSettings.new if @person ==nil
|
13
29
|
yield @person
|
14
30
|
end
|
31
|
+
|
32
|
+
# @example Add custom fields available for deal
|
33
|
+
# rootmodel.settings.with_deal do |deal_settings|
|
34
|
+
# deal_settings.set_custom_field({:integration_id=>"link_to_bi_system", :title=>"Link to BI system"})
|
35
|
+
# end
|
36
|
+
# @see ClassSettings
|
37
|
+
# @see CustomField
|
38
|
+
# @see RootModel
|
15
39
|
def with_deal
|
16
40
|
@deal = ClassSettings.new if @deal ==nil
|
17
41
|
yield @deal
|
data/lib/fruit_to_lime.rb
CHANGED
@@ -3,7 +3,8 @@ module FruitToLime
|
|
3
3
|
def self.require_all_in(folder)
|
4
4
|
Dir.glob(File.join( File.dirname(File.absolute_path(__FILE__)),folder), &method(:require))
|
5
5
|
end
|
6
|
-
|
6
|
+
|
7
|
+
require 'fruit_to_lime/errors'
|
7
8
|
require 'fruit_to_lime/serialize_helper'
|
8
9
|
require 'fruit_to_lime/model_helpers'
|
9
10
|
FruitToLime::require_all_in 'fruit_to_lime/model/*.rb'
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require 'fruit_to_lime'
|
3
|
+
|
4
|
+
describe "ClassSettings" do
|
5
|
+
let(:class_settings) {
|
6
|
+
FruitToLime::ClassSettings.new
|
7
|
+
}
|
8
|
+
|
9
|
+
it "can set custom field and if there is already an existing custom field, then it is overwritten." do
|
10
|
+
class_settings.set_custom_field({:integration_id=>"link_to_bi_system", :title=>"Link to BI system"})
|
11
|
+
class_settings.set_custom_field({:integration_id=>"link_to_bi_system", :title=>"Link to BI system 2"})
|
12
|
+
class_settings.custom_fields.length.should eq 1
|
13
|
+
class_settings.custom_fields[0].title.should eq "Link to BI system 2"
|
14
|
+
end
|
15
|
+
|
16
|
+
it "can add custom field and if there is already an existing custom field, then an AlreadyAddedError will be raised (and nothing is added)." do
|
17
|
+
class_settings.add_custom_field({:integration_id=>"link_to_bi_system", :title=>"Link to BI system"})
|
18
|
+
expect {
|
19
|
+
class_settings.add_custom_field({:integration_id=>"link_to_bi_system", :title=>"Link to BI system 2"})
|
20
|
+
}.to raise_error(FruitToLime::AlreadyAddedError)
|
21
|
+
class_settings.custom_fields.length.should eq 1
|
22
|
+
class_settings.custom_fields[0].title.should eq "Link to BI system"
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
@@ -12,4 +12,18 @@ describe FruitToLime::CsvHelper do
|
|
12
12
|
1;Bj\u{00F6}rk")
|
13
13
|
v.should include({"id"=>"1","navn"=>"Bj\u{00F6}rk"})
|
14
14
|
end
|
15
|
+
it "should handle escaped newlines" do
|
16
|
+
v = FruitToLime::CsvHelper.text_to_hashes("id;navn
|
17
|
+
1;\"Bj\u{00F6}rk
|
18
|
+
And a new line\"")
|
19
|
+
v.should include({"id"=>"1","navn"=>"Bj\u{00F6}rk
|
20
|
+
And a new line"})
|
21
|
+
end
|
22
|
+
it "should handle escaped newlines with ',' as delim" do
|
23
|
+
v = FruitToLime::CsvHelper.text_to_hashes("id,navn
|
24
|
+
1,\"Bj\u{00F6}rk
|
25
|
+
And a new line\"")
|
26
|
+
v.should include({"id"=>"1","navn"=>"Bj\u{00F6}rk
|
27
|
+
And a new line"})
|
28
|
+
end
|
15
29
|
end
|
@@ -11,6 +11,12 @@ describe FruitToLime::SerializeHelper do
|
|
11
11
|
s.set_custom_field({:integration_id=>"2", :title=>"cf title"})
|
12
12
|
s.set_custom_field({:integration_id=>"3", :title=>"cf title2"})
|
13
13
|
end
|
14
|
+
i.add_coworker({
|
15
|
+
:integration_id=>"123",
|
16
|
+
:first_name=>"Kalle",
|
17
|
+
:last_name=>"Anka",
|
18
|
+
:email=>"kalle.anka@vonanka.com"
|
19
|
+
})
|
14
20
|
o = FruitToLime::Organization.new
|
15
21
|
o.name = "Ankeborgs bibliotek"
|
16
22
|
o.with_source do |source|
|
@@ -27,9 +33,9 @@ describe FruitToLime::SerializeHelper do
|
|
27
33
|
o.with_visit_address do |addr|
|
28
34
|
addr.city = "Gaaseborg"
|
29
35
|
end
|
30
|
-
o.
|
31
|
-
|
32
|
-
|
36
|
+
o.with_responsible_coworker do |coworker|
|
37
|
+
coworker.integration_id = "1"
|
38
|
+
end
|
33
39
|
emp = o.add_employee({
|
34
40
|
:integration_id => "1",
|
35
41
|
:first_name => "Kalle",
|
@@ -0,0 +1,58 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require 'fruit_to_lime'
|
3
|
+
|
4
|
+
describe "RootModel" do
|
5
|
+
let(:rootmodel) {
|
6
|
+
FruitToLime::RootModel.new
|
7
|
+
}
|
8
|
+
|
9
|
+
it "will contain integration coworker by default" do
|
10
|
+
rootmodel.find_coworker_by_integration_id("import").first_name.should eq "Import"
|
11
|
+
rootmodel.coworkers.length.should eq 1
|
12
|
+
end
|
13
|
+
|
14
|
+
|
15
|
+
it "can add a coworker from a hash" do
|
16
|
+
rootmodel.add_coworker({
|
17
|
+
:integration_id=>"123key",
|
18
|
+
:first_name=>"Kalle",
|
19
|
+
:last_name=>"Anka",
|
20
|
+
:email=>"kalle.anka@vonanka.com"
|
21
|
+
})
|
22
|
+
rootmodel.find_coworker_by_integration_id("123key").first_name.should eq "Kalle"
|
23
|
+
rootmodel.coworkers.length.should eq 2
|
24
|
+
end
|
25
|
+
|
26
|
+
it "can add a coworker from a new coworker" do
|
27
|
+
coworker = FruitToLime::Coworker.new
|
28
|
+
coworker.integration_id = "123key"
|
29
|
+
coworker.first_name="Kalle"
|
30
|
+
coworker.last_name="Anka"
|
31
|
+
coworker.email = "kalle.anka@vonanka.com"
|
32
|
+
rootmodel.add_coworker(coworker)
|
33
|
+
rootmodel.find_coworker_by_integration_id("123key").first_name.should eq "Kalle"
|
34
|
+
rootmodel.coworkers.length.should eq 2
|
35
|
+
end
|
36
|
+
|
37
|
+
it "will not add a new coworker when the coworker is already added (same integration id)" do
|
38
|
+
rootmodel.add_coworker({
|
39
|
+
:integration_id=>"123key",
|
40
|
+
:first_name=>"Kalle",
|
41
|
+
:last_name=>"Anka",
|
42
|
+
:email=>"kalle.anka@vonanka.com"
|
43
|
+
})
|
44
|
+
rootmodel.coworkers.length.should eq 2
|
45
|
+
expect {
|
46
|
+
rootmodel.add_coworker({
|
47
|
+
:integration_id=>"123key",
|
48
|
+
:first_name=>"Knatte",
|
49
|
+
:last_name=>"Anka",
|
50
|
+
:email=>"knatte.anka@vonanka.com"
|
51
|
+
})
|
52
|
+
}.to raise_error(FruitToLime::AlreadyAddedError)
|
53
|
+
rootmodel.find_coworker_by_integration_id("123key").first_name.should eq "Kalle"
|
54
|
+
rootmodel.coworkers.length.should eq 2
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fruit_to_lime
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2014-04-
|
14
|
+
date: 2014-04-30 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: iso_country_codes
|
@@ -136,6 +136,7 @@ extensions: []
|
|
136
136
|
extra_rdoc_files: []
|
137
137
|
files:
|
138
138
|
- lib/fruit_to_lime/csv_helper.rb
|
139
|
+
- lib/fruit_to_lime/errors.rb
|
139
140
|
- lib/fruit_to_lime/model/address.rb
|
140
141
|
- lib/fruit_to_lime/model/class_settings.rb
|
141
142
|
- lib/fruit_to_lime/model/coworker.rb
|
@@ -157,7 +158,6 @@ files:
|
|
157
158
|
- lib/fruit_to_lime.rb
|
158
159
|
- bin/fruit_to_lime
|
159
160
|
- templates/csv/convert.rb
|
160
|
-
- templates/csv/export.xml
|
161
161
|
- templates/csv/Gemfile
|
162
162
|
- templates/csv/lib/tomodel.rb
|
163
163
|
- templates/csv/Rakefile.rb
|
@@ -181,12 +181,14 @@ files:
|
|
181
181
|
- templates/sqlserver/spec/spec_helper.rb
|
182
182
|
- templates/sqlserver/spec/tomodel_spec.rb
|
183
183
|
- spec/address_spec.rb
|
184
|
+
- spec/class_settings_spec.rb
|
184
185
|
- spec/custom_field_spec.rb
|
185
186
|
- spec/helpers/csv_helper_spec.rb
|
186
187
|
- spec/helpers/roo_helper_spec.rb
|
187
188
|
- spec/helpers/serialize_helper_spec.rb
|
188
189
|
- spec/helpers/xsd_validate_spec.rb
|
189
190
|
- spec/person_spec.rb
|
191
|
+
- spec/rootmodel_spec.rb
|
190
192
|
- spec/spec_helper.rb
|
191
193
|
- spec/templating_spec.rb
|
192
194
|
homepage:
|
@@ -215,11 +217,14 @@ specification_version: 3
|
|
215
217
|
summary: Library to generate Lime Go xml import format
|
216
218
|
test_files:
|
217
219
|
- spec/address_spec.rb
|
220
|
+
- spec/class_settings_spec.rb
|
218
221
|
- spec/custom_field_spec.rb
|
219
222
|
- spec/helpers/csv_helper_spec.rb
|
220
223
|
- spec/helpers/roo_helper_spec.rb
|
221
224
|
- spec/helpers/serialize_helper_spec.rb
|
222
225
|
- spec/helpers/xsd_validate_spec.rb
|
223
226
|
- spec/person_spec.rb
|
227
|
+
- spec/rootmodel_spec.rb
|
224
228
|
- spec/spec_helper.rb
|
225
229
|
- spec/templating_spec.rb
|
230
|
+
has_rdoc:
|
data/templates/csv/export.xml
DELETED
@@ -1,152 +0,0 @@
|
|
1
|
-
<GoImport Version='v2_0'
|
2
|
-
><Settings
|
3
|
-
><Organization
|
4
|
-
><CustomFields
|
5
|
-
><CustomField
|
6
|
-
><Title
|
7
|
-
>Link to external system</Title
|
8
|
-
><Type
|
9
|
-
>Link</Type
|
10
|
-
></CustomField
|
11
|
-
></CustomFields
|
12
|
-
></Organization
|
13
|
-
></Settings
|
14
|
-
><Coworkers
|
15
|
-
><Coworker
|
16
|
-
><IntegrationId
|
17
|
-
>import</IntegrationId
|
18
|
-
><FirstName
|
19
|
-
>Import</FirstName
|
20
|
-
></Coworker
|
21
|
-
><Coworker
|
22
|
-
><IntegrationId
|
23
|
-
>666</IntegrationId
|
24
|
-
><FirstName
|
25
|
-
>Evil</FirstName
|
26
|
-
><LastName
|
27
|
-
>Elvis</LastName
|
28
|
-
><Email
|
29
|
-
>t@e.com</Email
|
30
|
-
><DirectPhoneNumber
|
31
|
-
>+46121212</DirectPhoneNumber
|
32
|
-
><MobilePhoneNumber
|
33
|
-
>+46324234</MobilePhoneNumber
|
34
|
-
><HomePhoneNumber
|
35
|
-
>+46234234</HomePhoneNumber
|
36
|
-
></Coworker
|
37
|
-
></Coworkers
|
38
|
-
><Organizations
|
39
|
-
><Organization
|
40
|
-
><IntegrationId
|
41
|
-
>6</IntegrationId
|
42
|
-
><Name
|
43
|
-
>Alfs Mjukvaruutveckling</Name
|
44
|
-
><OrganizationNumber
|
45
|
-
>a number</OrganizationNumber
|
46
|
-
><PostalAddress
|
47
|
-
><Street
|
48
|
-
>postal street</Street
|
49
|
-
><ZipCode
|
50
|
-
>226 48</ZipCode
|
51
|
-
><City
|
52
|
-
>LUND</City
|
53
|
-
></PostalAddress
|
54
|
-
><VisitAddress
|
55
|
-
><Street
|
56
|
-
>visit street</Street
|
57
|
-
><ZipCode
|
58
|
-
>visit zip</ZipCode
|
59
|
-
><City
|
60
|
-
>visit city</City
|
61
|
-
></VisitAddress
|
62
|
-
><CentralPhoneNumber
|
63
|
-
>0000</CentralPhoneNumber
|
64
|
-
><Email
|
65
|
-
>email to organizaiton, not the person</Email
|
66
|
-
><WebSite
|
67
|
-
>www.whatever.com</WebSite
|
68
|
-
><Employees
|
69
|
-
><Person
|
70
|
-
><IntegrationId
|
71
|
-
>123</IntegrationId
|
72
|
-
><FirstName
|
73
|
-
>Rune</FirstName
|
74
|
-
><LastName
|
75
|
-
>Rebellion</LastName
|
76
|
-
><DirectPhoneNumber
|
77
|
-
>+4611111</DirectPhoneNumber
|
78
|
-
><FaxPhoneNumber
|
79
|
-
>+4623234234234</FaxPhoneNumber
|
80
|
-
><MobilePhoneNumber
|
81
|
-
>+462321212</MobilePhoneNumber
|
82
|
-
><Email
|
83
|
-
>x@y.com</Email
|
84
|
-
><AlternativeEmail
|
85
|
-
>y@x.com</AlternativeEmail
|
86
|
-
><PostalAddress
|
87
|
-
><Street
|
88
|
-
>postal street</Street
|
89
|
-
><ZipCode
|
90
|
-
>226 48</ZipCode
|
91
|
-
><City
|
92
|
-
>LUND</City
|
93
|
-
></PostalAddress
|
94
|
-
><CurrentlyEmployed
|
95
|
-
>true</CurrentlyEmployed
|
96
|
-
></Person
|
97
|
-
></Employees
|
98
|
-
><CustomValues
|
99
|
-
><CustomValue
|
100
|
-
><Field
|
101
|
-
>external_url</Field
|
102
|
-
><Value
|
103
|
-
>http://something.com?key=6</Value
|
104
|
-
></CustomValue
|
105
|
-
></CustomValues
|
106
|
-
><Tags
|
107
|
-
><Tag
|
108
|
-
>Imported</Tag
|
109
|
-
></Tags
|
110
|
-
><ResponsibleCoworker
|
111
|
-
><Heading
|
112
|
-
>Evil Elvis</Heading
|
113
|
-
><IntegrationId
|
114
|
-
>666</IntegrationId
|
115
|
-
></ResponsibleCoworker
|
116
|
-
></Organization
|
117
|
-
></Organizations
|
118
|
-
><Deals
|
119
|
-
><Deal
|
120
|
-
><IntegrationId
|
121
|
-
>333</IntegrationId
|
122
|
-
><Name
|
123
|
-
>Feta affären</Name
|
124
|
-
><Probability
|
125
|
-
>50</Probability
|
126
|
-
><Value
|
127
|
-
>10000</Value
|
128
|
-
><OfferDate
|
129
|
-
>2013-12-01</OfferDate
|
130
|
-
><OrderDate
|
131
|
-
>2014-01-05</OrderDate
|
132
|
-
><Customer
|
133
|
-
><IntegrationId
|
134
|
-
>6</IntegrationId
|
135
|
-
><Heading
|
136
|
-
>Alfs Mjukvaruutveckling</Heading
|
137
|
-
></Customer
|
138
|
-
><ResponsibleCoworker
|
139
|
-
><Heading
|
140
|
-
>Evil Elvis</Heading
|
141
|
-
><IntegrationId
|
142
|
-
>666</IntegrationId
|
143
|
-
></ResponsibleCoworker
|
144
|
-
><CustomerContact
|
145
|
-
><IntegrationId
|
146
|
-
>123</IntegrationId
|
147
|
-
></CustomerContact
|
148
|
-
></Deal
|
149
|
-
></Deals
|
150
|
-
><Notes
|
151
|
-
/></GoImport
|
152
|
-
>
|