jcangas-datagateway 1.2.2 → 1.4.4
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.
- data/VERSION.yml +2 -2
- data/lib/datagateway/conduits/csv_conduit.rb +0 -0
- data/lib/datagateway/conduits/yaml_conduit.rb +0 -0
- data/lib/datagateway/data_gateway.rb +27 -514
- data/lib/datagateway/dbchange_point.rb +0 -0
- data/lib/datagateway/encoder.rb +27 -0
- data/lib/datagateway/folder_writer.rb +0 -0
- data/lib/datagateway/job.rb +223 -0
- data/lib/datagateway/jobs/nexus_export.rb +7 -6
- data/lib/datagateway/jobs/nexus_import.rb +1 -4
- data/lib/datagateway/jobs/shopin_export.rb +9 -6
- data/lib/datagateway/jobs/shopin_import.rb +9 -8
- data/lib/datagateway/mapper.rb +226 -0
- data/lib/datagateway/nexus/nax_ar.rb +0 -0
- data/lib/datagateway/nexus/nax_tlb.rb +0 -0
- data/lib/datagateway/nexus/nexus_ar.rb +0 -0
- data/lib/datagateway/ssh_transfer.rb +0 -0
- data/lib/datagateway.rb +111 -77
- data/lib/version.rb +0 -0
- data/template-prj/{README → nexus/README} +0 -0
- data/template-prj/{config → nexus/config}/README +0 -0
- data/template-prj/nexus/config/database.yml +17 -0
- data/template-prj/{config → nexus/config}/settings.yml +0 -2
- data/template-prj/{data → nexus/data}/donebox/README +0 -0
- data/template-prj/{data → nexus/data}/inbox/README +0 -0
- data/template-prj/{data → nexus/data}/outbox/README +0 -0
- data/template-prj/nexus/export-data.rb +9 -0
- data/template-prj/nexus/import-data.rb +14 -0
- data/template-prj/{log → nexus/log}/README +0 -0
- data/template-prj/{ruby.exe → nexus/ruby.exe} +0 -0
- data/template-prj/nexus/sistema.ini +4 -0
- data/template-prj/shopin/README +2 -0
- data/template-prj/shopin/config/README +4 -0
- data/template-prj/shopin/config/database.yml +8 -0
- data/template-prj/shopin/config/settings.yml +13 -0
- data/template-prj/shopin/data/donebox/README +1 -0
- data/template-prj/shopin/data/inbox/README +1 -0
- data/template-prj/shopin/data/outbox/README +1 -0
- data/template-prj/shopin/export-data.rb +6 -0
- data/template-prj/shopin/import-data.rb +6 -0
- data/template-prj/shopin/log/README +2 -0
- data/test/datagateway_test.rb +0 -0
- data/test/test_helper.rb +0 -0
- metadata +41 -20
- data/template-prj/config/database.yml +0 -32
- data/template-prj/dgw-job.rb +0 -25
- data/template-prj/run.bat +0 -1
- data/template-prj/sistema.ini +0 -3
data/lib/datagateway.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require 'rubygems'
|
|
2
|
-
require 'optparse'
|
|
2
|
+
require 'optparse'
|
|
3
3
|
require 'rdoc/usage'
|
|
4
4
|
require 'ostruct'
|
|
5
5
|
require 'date'
|
|
@@ -19,7 +19,7 @@ class LogFormatter < Logger::Formatter
|
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
class AppConfig
|
|
22
|
-
|
|
22
|
+
GEMROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
|
23
23
|
class << self
|
|
24
24
|
attr :config
|
|
25
25
|
|
|
@@ -28,12 +28,12 @@ class AppConfig
|
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
def run
|
|
31
|
-
if parsed_options? && arguments_valid?
|
|
31
|
+
if parsed_options? && arguments_valid?
|
|
32
32
|
puts "Start at #{DateTime.now}\\n\\n" if @options.verbose
|
|
33
33
|
|
|
34
34
|
output_options if @options.verbose # [Optional]
|
|
35
35
|
|
|
36
|
-
process_arguments
|
|
36
|
+
process_arguments
|
|
37
37
|
process_command
|
|
38
38
|
|
|
39
39
|
puts "\\nFinished at #{DateTime.now}" if @options.verbose
|
|
@@ -53,8 +53,7 @@ class AppConfig
|
|
|
53
53
|
@options = OpenStruct.new
|
|
54
54
|
@options.verbose = false
|
|
55
55
|
@options.quiet = false
|
|
56
|
-
@options.
|
|
57
|
-
@options.environment = (ENV['APP_ENV'] || 'production').dup
|
|
56
|
+
@options.log_level = nil
|
|
58
57
|
@options.generate = false
|
|
59
58
|
|
|
60
59
|
# Specify options
|
|
@@ -63,43 +62,49 @@ class AppConfig
|
|
|
63
62
|
opts.separator "----------------------"
|
|
64
63
|
opts.separator "opciones:"
|
|
65
64
|
|
|
66
|
-
opts.on("-
|
|
67
|
-
ouput_version
|
|
68
|
-
puts opts
|
|
69
|
-
exit
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
opts.on("-e", "--environment [ENVIRONMENT]", %w[development production test],
|
|
73
|
-
"(development | production | test)") { |env| @options.environment = env }
|
|
74
|
-
|
|
75
|
-
opts.on("-g", '--generate [prj_name]', "Genera un proyecto nuevo") { |project|
|
|
65
|
+
opts.on("-g", '--generate [PROYECTO]', "Genera un proyecto nuevo en la carpeta PROYECTO") { |project|
|
|
76
66
|
@options.project = project
|
|
77
|
-
@options.generate = true
|
|
67
|
+
@options.generate = true
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
opts.on("-t", '--template [PLANTILLA]', "Usa PLANTILLA al generar un proyecto") { |template|
|
|
71
|
+
@options.template = template
|
|
78
72
|
}
|
|
79
73
|
|
|
74
|
+
opts.on('-j', '--job [FICHERO]', String, 'ejecuta el fichero de trabajos') { |file|
|
|
75
|
+
@options.file = file
|
|
76
|
+
@options.job = true
|
|
77
|
+
}
|
|
78
|
+
|
|
80
79
|
opts.on("-q", '--quiet', 'Modo "silencioso": no muestra nada en pantalla durante la ejecución') { @options.quiet = true }
|
|
81
80
|
|
|
82
81
|
opts.on('-v', '--version', 'Muestra la version y termina') { output_version ; exit 0 }
|
|
83
82
|
|
|
84
|
-
opts.on('-
|
|
85
|
-
|
|
86
|
-
opts.on('-f', '--file [FICHERO]', String, 'procesao el fichero') { |file|
|
|
87
|
-
@options.file = file
|
|
83
|
+
opts.on('-l', '--level [LEVEL]', [:debug, :warn, :info], 'Nivel de detalle informativo (debug | warn | info)') { |level|
|
|
84
|
+
@options.log_level = level
|
|
88
85
|
}
|
|
86
|
+
|
|
87
|
+
opts.on_tail("-h", "--help", "Muestra este mensaje de ayuda.") do
|
|
88
|
+
output_version
|
|
89
|
+
puts opts
|
|
90
|
+
exit
|
|
91
|
+
end
|
|
92
|
+
|
|
89
93
|
end
|
|
90
94
|
|
|
91
95
|
opts.parse!(ARGV) rescue puts opts; return false
|
|
92
96
|
|
|
93
97
|
process_options
|
|
94
|
-
true
|
|
98
|
+
true
|
|
95
99
|
end
|
|
96
100
|
|
|
97
101
|
# Performs post-parse processing on options
|
|
98
102
|
def process_options
|
|
103
|
+
@options.template ||= 'nexus' if @options.generate
|
|
99
104
|
end
|
|
100
105
|
|
|
101
106
|
# True if required arguments were provided
|
|
102
|
-
|
|
107
|
+
def arguments_valid?
|
|
103
108
|
# TO DO - implement your real logic here
|
|
104
109
|
true
|
|
105
110
|
end
|
|
@@ -113,7 +118,7 @@ class AppConfig
|
|
|
113
118
|
exit
|
|
114
119
|
puts "Options:\\n"
|
|
115
120
|
|
|
116
|
-
@options.marshal_dump.each do |name, val|
|
|
121
|
+
@options.marshal_dump.each do |name, val|
|
|
117
122
|
puts " #{name} = #{val}"
|
|
118
123
|
end
|
|
119
124
|
end
|
|
@@ -129,48 +134,38 @@ class AppConfig
|
|
|
129
134
|
end
|
|
130
135
|
|
|
131
136
|
def output_version
|
|
132
|
-
puts
|
|
137
|
+
puts version_msg
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
def version_msg
|
|
141
|
+
"#{Application::VERSION::PRODUCT} version #{Application::VERSION::STRING}"
|
|
133
142
|
end
|
|
134
143
|
|
|
135
144
|
def process_command
|
|
136
|
-
dir = @options.
|
|
145
|
+
dir = @options.job ? File.dirname(@options.file) : Dir.pwd
|
|
137
146
|
Module.const_set('APP_ROOT', dir) unless Module.const_defined?('APP_ROOT')
|
|
138
|
-
Module.const_set('APP_ENV', AppConfig.options.environment) unless Module.const_defined?('APP_ENV')
|
|
139
147
|
|
|
140
|
-
if @options.generate
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
FileUtils.cp_r(File.expand_path(File.join(AppConfig::ROOT, '..', 'template-prj'))+'/.', target, :verbose => !@options.quiet)
|
|
145
|
-
elsif @options.file
|
|
146
|
-
run_app(@options.file)
|
|
148
|
+
if @options.generate
|
|
149
|
+
command_generate
|
|
150
|
+
elsif @options.job
|
|
151
|
+
command_job
|
|
147
152
|
end
|
|
148
153
|
|
|
149
154
|
#process_standard_input # [Optional]
|
|
150
155
|
end
|
|
156
|
+
|
|
157
|
+
def command_generate
|
|
158
|
+
target = File.expand_path(@options.project)
|
|
159
|
+
FileUtils.mkdir target
|
|
160
|
+
puts "generating #{target}"
|
|
161
|
+
FileUtils.cp_r(File.join(AppConfig::GEMROOT, '..', 'template-prj', "#{@options.template}/."), target, :verbose => !@options.quiet)
|
|
162
|
+
end
|
|
151
163
|
|
|
152
|
-
def
|
|
153
|
-
|
|
154
|
-
# TO DO - process input
|
|
155
|
-
|
|
156
|
-
# [Optional]
|
|
157
|
-
# @stdin.each do |line|
|
|
158
|
-
# # TO DO - process each line
|
|
159
|
-
#end
|
|
160
|
-
end
|
|
161
|
-
|
|
162
|
-
def logger
|
|
163
|
-
@logger ||= setup_logger
|
|
164
|
-
end
|
|
165
|
-
|
|
166
|
-
def path(filename='')
|
|
167
|
-
File.expand_path(filename, APP_ROOT)
|
|
168
|
-
end
|
|
169
|
-
|
|
170
|
-
def run_app(file)
|
|
164
|
+
def command_job
|
|
165
|
+
echo version_msg
|
|
171
166
|
AppConfig.logger.info echo("Data Gateway started")
|
|
172
|
-
#AppConfig.logger.debug echo("
|
|
173
|
-
|
|
167
|
+
#AppConfig.logger.debug echo("configuración: #{AppConfig.config.inspect}")
|
|
168
|
+
|
|
174
169
|
require 'activerecord'
|
|
175
170
|
require 'data_gateway'
|
|
176
171
|
ActiveRecord::Base.logger = AppConfig.logger
|
|
@@ -180,31 +175,52 @@ class AppConfig
|
|
|
180
175
|
DataGateway.inbox = AppConfig.path(AppConfig.data['inbox'])
|
|
181
176
|
DataGateway.outbox = AppConfig.path(AppConfig.data['outbox'])
|
|
182
177
|
DataGateway.donebox = AppConfig.path(AppConfig.data['donebox'])
|
|
183
|
-
DataGateway.use_resources = AppConfig.data['use_resources']
|
|
178
|
+
DataGateway.use_resources = AppConfig.data['use_resources']
|
|
179
|
+
|
|
180
|
+
DataGateway.last_time = AppConfig.last_time
|
|
184
181
|
DataGateway.resource_path(AppConfig.path(AppConfig.data['resource_path']))
|
|
185
|
-
|
|
186
182
|
DataGateway.logger.info "using resources #{DataGateway.use_resources} | #{DataGateway.resource_path}"
|
|
187
|
-
|
|
183
|
+
|
|
184
|
+
file = @options.file
|
|
188
185
|
require file
|
|
189
186
|
## Porque no va:?
|
|
190
|
-
##eval(File.read(File.expand_path(file)))
|
|
191
|
-
|
|
187
|
+
##eval(File.read(File.expand_path(file)))
|
|
188
|
+
|
|
189
|
+
AppConfig.last_time = DataGateway.last_time
|
|
190
|
+
save
|
|
192
191
|
AppConfig.logger.info echo("Data Gateway finished ok")
|
|
193
192
|
|
|
194
193
|
rescue Exception => e
|
|
195
194
|
puts "Error:\n#{e}\n."
|
|
196
|
-
AppConfig.logger.error "#{e}\n" + e.backtrace.join("\n")
|
|
195
|
+
AppConfig.logger.error "#{e}\n" + e.backtrace.join("\n")
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
def process_standard_input
|
|
199
|
+
input = @stdin.read
|
|
200
|
+
# TO DO - process input
|
|
201
|
+
|
|
202
|
+
# [Optional]
|
|
203
|
+
# @stdin.each do |line|
|
|
204
|
+
# # TO DO - process each line
|
|
205
|
+
#end
|
|
197
206
|
end
|
|
198
207
|
|
|
208
|
+
def logger
|
|
209
|
+
@logger ||= setup_logger
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
def path(filename='')
|
|
213
|
+
File.expand_path(filename, APP_ROOT)
|
|
214
|
+
end
|
|
215
|
+
|
|
199
216
|
def log_path
|
|
200
217
|
path('log/application.log')
|
|
201
218
|
end
|
|
202
|
-
|
|
219
|
+
|
|
203
220
|
def settings(name)
|
|
204
|
-
|
|
205
|
-
path("config#{env}/#{name}.yml")
|
|
221
|
+
path("config/#{name}.yml")
|
|
206
222
|
end
|
|
207
|
-
|
|
223
|
+
|
|
208
224
|
def connections
|
|
209
225
|
unless @connections
|
|
210
226
|
@connections = yaml_load(settings('database'))
|
|
@@ -216,22 +232,34 @@ class AppConfig
|
|
|
216
232
|
end
|
|
217
233
|
return @connections
|
|
218
234
|
end
|
|
219
|
-
|
|
235
|
+
|
|
236
|
+
def last_time
|
|
237
|
+
unless @last_time
|
|
238
|
+
@last_time = yaml_load(settings('last_time')) || {'export' => Time.at(0), 'import' => Time.at(0)}
|
|
239
|
+
class << @last_time
|
|
240
|
+
def [](name)
|
|
241
|
+
super(name.to_s)
|
|
242
|
+
end
|
|
243
|
+
end
|
|
244
|
+
end
|
|
245
|
+
return @last_time
|
|
246
|
+
end
|
|
247
|
+
|
|
220
248
|
def [](name)
|
|
221
249
|
method_missing(name.to_sym)
|
|
222
250
|
end
|
|
223
251
|
|
|
224
252
|
private
|
|
225
|
-
|
|
253
|
+
|
|
226
254
|
def setup_logger
|
|
227
255
|
load
|
|
228
256
|
FileUtils.mkpath(File.dirname(log_path))
|
|
229
257
|
@logger = Logger.new(log_path, log_options['rotate'] )
|
|
230
258
|
@logger.progname = ''
|
|
231
259
|
@logger.formatter = LogFormatter.new
|
|
232
|
-
@logger.datetime_format = log_options['time_format']
|
|
233
|
-
|
|
234
|
-
|
|
260
|
+
@logger.datetime_format = log_options['time_format']
|
|
261
|
+
level = options.log_level || log_options['level']
|
|
262
|
+
@logger.level = Logger.const_get(level.upcase)
|
|
235
263
|
@logger
|
|
236
264
|
rescue StandardError => e
|
|
237
265
|
@logger = Logger.new(STDERR)
|
|
@@ -241,20 +269,25 @@ class AppConfig
|
|
|
241
269
|
@logger.warn e.message
|
|
242
270
|
@logger.warn(
|
|
243
271
|
"Unable to access log file. Please ensure that #{self.log_path} exists and has correct permissions. " +
|
|
244
|
-
"
|
|
272
|
+
"\nThe log level has been raised to WARN and the output directed to STDERR until the problem is fixed."
|
|
245
273
|
)
|
|
246
274
|
@logger
|
|
247
275
|
end
|
|
248
276
|
|
|
249
277
|
def yaml_load(file_name)
|
|
250
|
-
YAML::load(ERB.new(IO.read(file_name)).result)
|
|
251
|
-
end
|
|
278
|
+
YAML::load(ERB.new(IO.read(file_name)).result) if File.exist?(file_name)
|
|
279
|
+
end
|
|
280
|
+
|
|
252
281
|
|
|
253
282
|
def load
|
|
254
283
|
return if @config
|
|
255
284
|
@config = yaml_load(settings('settings'))
|
|
256
|
-
end
|
|
257
|
-
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
def save
|
|
288
|
+
File.open(settings('last_time'), "w") {|f| YAML.dump(@last_time, f)}
|
|
289
|
+
end
|
|
290
|
+
|
|
258
291
|
def echo(msg)
|
|
259
292
|
puts msg unless AppConfig.options.quiet
|
|
260
293
|
msg
|
|
@@ -268,11 +301,12 @@ class AppConfig
|
|
|
268
301
|
else
|
|
269
302
|
@config.send(name, *args)
|
|
270
303
|
end
|
|
271
|
-
elsif @config.has_key?(name.to_s)
|
|
272
|
-
@config[name.to_s]
|
|
304
|
+
elsif @config.has_key?(name.to_s)
|
|
305
|
+
@config[name.to_s]
|
|
273
306
|
else
|
|
274
307
|
super
|
|
275
308
|
end
|
|
276
309
|
end
|
|
277
310
|
end
|
|
278
311
|
end
|
|
312
|
+
|
data/lib/version.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
nexusdb:
|
|
3
|
+
adapter: sqlserver
|
|
4
|
+
host: '.\NEXUS'
|
|
5
|
+
mode: ado # or odbc
|
|
6
|
+
username: sa
|
|
7
|
+
password: sie48
|
|
8
|
+
autocommit: true
|
|
9
|
+
|
|
10
|
+
# required for ado:
|
|
11
|
+
database: 'TRADE_SL'
|
|
12
|
+
nax_empresa: 'VTRADE'
|
|
13
|
+
|
|
14
|
+
#required for odbc:
|
|
15
|
+
#dsn:
|
|
16
|
+
#provider: SQLOLEDB
|
|
17
|
+
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Esta carpeta contine los ficheros que han sido recibidos y procesados
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Esta carpeta contine los ficheros que han sido recibidos y estan pendientes de procesarse
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Esta carpeta contine los ficheros que han sido pendientes de ser enviados
|
data/test/datagateway_test.rb
CHANGED
|
File without changes
|
data/test/test_helper.rb
CHANGED
|
File without changes
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jcangas-datagateway
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.4.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jorge L. Cangas
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2009-02-
|
|
12
|
+
date: 2009-02-12 00:00:00 -08:00
|
|
13
13
|
default_executable: datagw
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
@@ -34,6 +34,7 @@ files:
|
|
|
34
34
|
- bin/datagw
|
|
35
35
|
- lib/version.rb
|
|
36
36
|
- lib/datagateway
|
|
37
|
+
- lib/datagateway/job.rb
|
|
37
38
|
- lib/datagateway/dbchange_point.rb
|
|
38
39
|
- lib/datagateway/ssh_transfer.rb
|
|
39
40
|
- lib/datagateway/jobs
|
|
@@ -48,29 +49,49 @@ files:
|
|
|
48
49
|
- lib/datagateway/nexus/nax_ar.rb
|
|
49
50
|
- lib/datagateway/nexus/nax_tlb.rb
|
|
50
51
|
- lib/datagateway/nexus/nexus_ar.rb
|
|
52
|
+
- lib/datagateway/mapper.rb
|
|
51
53
|
- lib/datagateway/data_gateway.rb
|
|
54
|
+
- lib/datagateway/encoder.rb
|
|
52
55
|
- lib/datagateway/folder_writer.rb
|
|
53
56
|
- lib/datagateway.rb
|
|
54
57
|
- test/test_helper.rb
|
|
55
58
|
- test/datagateway_test.rb
|
|
56
|
-
- template-prj/
|
|
57
|
-
- template-prj/log
|
|
58
|
-
- template-prj/
|
|
59
|
-
- template-prj/data
|
|
60
|
-
- template-prj/data/outbox
|
|
61
|
-
- template-prj/data/outbox/README
|
|
62
|
-
- template-prj/data/donebox
|
|
63
|
-
- template-prj/data/donebox/README
|
|
64
|
-
- template-prj/data/inbox
|
|
65
|
-
- template-prj/data/inbox/README
|
|
66
|
-
- template-prj/config
|
|
67
|
-
- template-prj/config/settings.yml
|
|
68
|
-
- template-prj/config/README
|
|
69
|
-
- template-prj/config/database.yml
|
|
70
|
-
- template-prj/ruby.exe
|
|
71
|
-
- template-prj/README
|
|
72
|
-
- template-prj/sistema.ini
|
|
73
|
-
- template-prj/
|
|
59
|
+
- template-prj/nexus
|
|
60
|
+
- template-prj/nexus/log
|
|
61
|
+
- template-prj/nexus/log/README
|
|
62
|
+
- template-prj/nexus/data
|
|
63
|
+
- template-prj/nexus/data/outbox
|
|
64
|
+
- template-prj/nexus/data/outbox/README
|
|
65
|
+
- template-prj/nexus/data/donebox
|
|
66
|
+
- template-prj/nexus/data/donebox/README
|
|
67
|
+
- template-prj/nexus/data/inbox
|
|
68
|
+
- template-prj/nexus/data/inbox/README
|
|
69
|
+
- template-prj/nexus/config
|
|
70
|
+
- template-prj/nexus/config/settings.yml
|
|
71
|
+
- template-prj/nexus/config/README
|
|
72
|
+
- template-prj/nexus/config/database.yml
|
|
73
|
+
- template-prj/nexus/ruby.exe
|
|
74
|
+
- template-prj/nexus/README
|
|
75
|
+
- template-prj/nexus/sistema.ini
|
|
76
|
+
- template-prj/nexus/import-data.rb
|
|
77
|
+
- template-prj/nexus/export-data.rb
|
|
78
|
+
- template-prj/shopin
|
|
79
|
+
- template-prj/shopin/log
|
|
80
|
+
- template-prj/shopin/log/README
|
|
81
|
+
- template-prj/shopin/data
|
|
82
|
+
- template-prj/shopin/data/outbox
|
|
83
|
+
- template-prj/shopin/data/outbox/README
|
|
84
|
+
- template-prj/shopin/data/donebox
|
|
85
|
+
- template-prj/shopin/data/donebox/README
|
|
86
|
+
- template-prj/shopin/data/inbox
|
|
87
|
+
- template-prj/shopin/data/inbox/README
|
|
88
|
+
- template-prj/shopin/config
|
|
89
|
+
- template-prj/shopin/config/settings.yml
|
|
90
|
+
- template-prj/shopin/config/README
|
|
91
|
+
- template-prj/shopin/config/database.yml
|
|
92
|
+
- template-prj/shopin/README
|
|
93
|
+
- template-prj/shopin/import-data.rb
|
|
94
|
+
- template-prj/shopin/export-data.rb
|
|
74
95
|
has_rdoc: true
|
|
75
96
|
homepage: http://github.com/jcangas/datagateway
|
|
76
97
|
post_install_message:
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
nexusdb:
|
|
3
|
-
adapter: sqlserver
|
|
4
|
-
host: '.\NEXUS'
|
|
5
|
-
mode: ado # or odbc
|
|
6
|
-
username: sa
|
|
7
|
-
password: sie48
|
|
8
|
-
autocommit: true
|
|
9
|
-
|
|
10
|
-
# required for ado:
|
|
11
|
-
database: 'TRADE_SL'
|
|
12
|
-
nax_empresa: 'VTRADE'
|
|
13
|
-
|
|
14
|
-
#required for odbc:
|
|
15
|
-
#dsn:
|
|
16
|
-
#provider: SQLOLEDB
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
shopindb_production: &shopin_production
|
|
20
|
-
adapter: mysql
|
|
21
|
-
database: shopin
|
|
22
|
-
timeout: 5000
|
|
23
|
-
user: root
|
|
24
|
-
password: masterkey
|
|
25
|
-
socket: /var/run/mysqld/mysqld.sock
|
|
26
|
-
|
|
27
|
-
shopindb_development: &shopin_development
|
|
28
|
-
adapter: sqlite3
|
|
29
|
-
database: '../db/development.sqlite3'
|
|
30
|
-
timeout: 5000
|
|
31
|
-
|
|
32
|
-
shopindb: *shopin_development
|
data/template-prj/dgw-job.rb
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
## Sample job file for datagateway
|
|
3
|
-
include DataGateway
|
|
4
|
-
|
|
5
|
-
# we can use built-in jobs
|
|
6
|
-
require 'datagateway/jobs/nexus_export'
|
|
7
|
-
require 'datagateway/jobs/nexus_import'
|
|
8
|
-
require 'datagateway/jobs/shopin_export'
|
|
9
|
-
require 'datagateway/jobs/shopin_export'
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
nexus_export.run
|
|
13
|
-
upload_to AppConfig.sftp
|
|
14
|
-
|
|
15
|
-
download_from AppConfig.sftp
|
|
16
|
-
begin
|
|
17
|
-
nexus_import.run
|
|
18
|
-
ensure
|
|
19
|
-
NAX::ActiveRecord::Base.close
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
resource_path AppConfig.path('../public/images/db/')
|
|
24
|
-
|
|
25
|
-
|
data/template-prj/run.bat
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
datagw -f dgw-job
|
data/template-prj/sistema.ini
DELETED