sf_migrate 1.0.4 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/export.rb +22 -15
- data/lib/fields.rb +13 -9
- data/lib/import.rb +685 -269
- data/lib/sf_migrate.rb +14 -12
- metadata +48 -7
data/lib/sf_migrate.rb
CHANGED
@@ -3,7 +3,6 @@ $LOAD_PATH.unshift File.dirname(__FILE__)
|
|
3
3
|
require 'optparse'
|
4
4
|
require 'csv'
|
5
5
|
require 'yaml'
|
6
|
-
require 'logger'
|
7
6
|
require 'fileutils'
|
8
7
|
require 'databasedotcom'
|
9
8
|
require 'sugarcrm'
|
@@ -42,6 +41,9 @@ module SalesforceMigration
|
|
42
41
|
opts.on("-l", "--log_dir LOG_DIR", "Set the directory in which the logger will reside") do |l|
|
43
42
|
options[:log_dir] = l
|
44
43
|
end
|
44
|
+
opts.on("-t", "--last_modified_date DATE/DATETIME", "Set the date from which you would like to get results") do |t|
|
45
|
+
options[:last_modified_date] = t
|
46
|
+
end
|
45
47
|
opts.on("-m", "--send_mail", "Send activation email to every new user") do |m|
|
46
48
|
options[:send_mail] = m
|
47
49
|
end
|
@@ -61,17 +63,17 @@ module SalesforceMigration
|
|
61
63
|
end
|
62
64
|
|
63
65
|
def create_logger
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
66
|
+
original_formatter = Logger::Formatter.new
|
67
|
+
today = lambda { Date.today.to_s }
|
68
|
+
dateDir = "#{@log_dir}/#{today.call}"
|
69
|
+
dateLog = "#{dateDir}/migration.log"
|
70
|
+
FileUtils.mkdir_p(dateDir) unless Dir.exists? dateDir
|
71
|
+
@logger = Logger.new(dateLog)
|
72
|
+
@logger.formatter = proc { |severity, datetime, progname, msg|
|
73
|
+
original_formatter.call("IMPORT", datetime, progname, msg)
|
74
|
+
}
|
75
|
+
@logger
|
76
|
+
end
|
75
77
|
|
76
78
|
end
|
77
79
|
end
|
metadata
CHANGED
@@ -1,17 +1,22 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sf_migrate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 31
|
4
5
|
prerelease:
|
5
|
-
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 2
|
9
|
+
- 0
|
10
|
+
version: 1.2.0
|
6
11
|
platform: ruby
|
7
12
|
authors:
|
8
|
-
-
|
9
|
-
-
|
13
|
+
- Emil Petkov
|
14
|
+
- Petar Manchev
|
10
15
|
autorequire:
|
11
16
|
bindir: bin
|
12
17
|
cert_chain: []
|
13
18
|
|
14
|
-
date:
|
19
|
+
date: 2014-02-03 00:00:00 Z
|
15
20
|
dependencies:
|
16
21
|
- !ruby/object:Gem::Dependency
|
17
22
|
name: sugarcrm_emp
|
@@ -21,7 +26,12 @@ dependencies:
|
|
21
26
|
requirements:
|
22
27
|
- - ~>
|
23
28
|
- !ruby/object:Gem::Version
|
24
|
-
|
29
|
+
hash: 61
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
- 10
|
33
|
+
- 5
|
34
|
+
version: 0.10.5
|
25
35
|
type: :runtime
|
26
36
|
version_requirements: *id001
|
27
37
|
- !ruby/object:Gem::Dependency
|
@@ -32,6 +42,11 @@ dependencies:
|
|
32
42
|
requirements:
|
33
43
|
- - ~>
|
34
44
|
- !ruby/object:Gem::Version
|
45
|
+
hash: 25
|
46
|
+
segments:
|
47
|
+
- 1
|
48
|
+
- 3
|
49
|
+
- 1
|
35
50
|
version: 1.3.1
|
36
51
|
type: :runtime
|
37
52
|
version_requirements: *id002
|
@@ -43,6 +58,11 @@ dependencies:
|
|
43
58
|
requirements:
|
44
59
|
- - ~>
|
45
60
|
- !ruby/object:Gem::Version
|
61
|
+
hash: 3
|
62
|
+
segments:
|
63
|
+
- 3
|
64
|
+
- 2
|
65
|
+
- 6
|
46
66
|
version: 3.2.6
|
47
67
|
type: :runtime
|
48
68
|
version_requirements: *id003
|
@@ -54,6 +74,11 @@ dependencies:
|
|
54
74
|
requirements:
|
55
75
|
- - ~>
|
56
76
|
- !ruby/object:Gem::Version
|
77
|
+
hash: 21
|
78
|
+
segments:
|
79
|
+
- 3
|
80
|
+
- 2
|
81
|
+
- 13
|
57
82
|
version: 3.2.13
|
58
83
|
type: :runtime
|
59
84
|
version_requirements: *id004
|
@@ -65,6 +90,11 @@ dependencies:
|
|
65
90
|
requirements:
|
66
91
|
- - ~>
|
67
92
|
- !ruby/object:Gem::Version
|
93
|
+
hash: 29
|
94
|
+
segments:
|
95
|
+
- 2
|
96
|
+
- 5
|
97
|
+
- 3
|
68
98
|
version: 2.5.3
|
69
99
|
type: :runtime
|
70
100
|
version_requirements: *id005
|
@@ -76,12 +106,17 @@ dependencies:
|
|
76
106
|
requirements:
|
77
107
|
- - ~>
|
78
108
|
- !ruby/object:Gem::Version
|
109
|
+
hash: 59
|
110
|
+
segments:
|
111
|
+
- 1
|
112
|
+
- 10
|
113
|
+
- 2
|
79
114
|
version: 1.10.2
|
80
115
|
type: :runtime
|
81
116
|
version_requirements: *id006
|
82
117
|
description: SalesForce to SugarCRM migration tool
|
83
118
|
email:
|
84
|
-
-
|
119
|
+
- p.manchev@emerchantpay.com
|
85
120
|
executables:
|
86
121
|
- sf_migrate
|
87
122
|
extensions: []
|
@@ -111,17 +146,23 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
111
146
|
requirements:
|
112
147
|
- - ">="
|
113
148
|
- !ruby/object:Gem::Version
|
149
|
+
hash: 3
|
150
|
+
segments:
|
151
|
+
- 0
|
114
152
|
version: "0"
|
115
153
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
154
|
none: false
|
117
155
|
requirements:
|
118
156
|
- - ">="
|
119
157
|
- !ruby/object:Gem::Version
|
158
|
+
hash: 3
|
159
|
+
segments:
|
160
|
+
- 0
|
120
161
|
version: "0"
|
121
162
|
requirements: []
|
122
163
|
|
123
164
|
rubyforge_project:
|
124
|
-
rubygems_version: 1.8.
|
165
|
+
rubygems_version: 1.8.25
|
125
166
|
signing_key:
|
126
167
|
specification_version: 3
|
127
168
|
summary: Makes a bridge between Salesforce and SugarCRM
|