datapipe2 0.0.5 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/datapipe2.rb +1 -0
- data/lib/fns/mssql_to_pgsql.rb +1 -0
- data/lib/fns/smb_to_local.rb +22 -0
- metadata +4 -45
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e58251e81793f50d5d677bf7485c1f469dbc222c
|
4
|
+
data.tar.gz: d66a83209077537948f0f1cc37278c657a50e333
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e2998ba98a465152dbaa9ed9e18253062e880a97625ff1cb55b085c55ceca0c68e32caaf6f77b20af13cbfacb15f09353be8455ba405ec79a9e2682ee9086ad
|
7
|
+
data.tar.gz: 7d8cc4e5d3eb90df850c5f0f2bac941a4166dd5adcf2e0c2f971f962d5ed6fdc18e98b8df1ec2a63f2ef4047907af4a38e097b86f24372e2fb99e4d6c24ae9b3
|
data/lib/datapipe2.rb
CHANGED
data/lib/fns/mssql_to_pgsql.rb
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'sambal'
|
2
|
+
require 'uri'
|
3
|
+
require 'cgi'
|
4
|
+
|
5
|
+
def smb_to_local(smb_uri_string, local_folder)
|
6
|
+
# encode the string
|
7
|
+
uri = URI.parse(URI.escape(smb_uri_string))
|
8
|
+
domain = nil
|
9
|
+
unless uri.query.nil?
|
10
|
+
params = CGI.parse(uri.query)
|
11
|
+
domain = params['domain'][0]
|
12
|
+
end
|
13
|
+
p "#{domain}, #{uri.host}, #{uri.user}, #{uri.password}"
|
14
|
+
client = Sambal::Client.new(domain: domain, host: uri.host,
|
15
|
+
share: 'Data', user: uri.user, password: uri.password)
|
16
|
+
client.ls(remote_dirpath).each do |remote_filepath|
|
17
|
+
local_filepath = local_folder
|
18
|
+
client.get(remote_filepath, local_filepath) # downloads file from server
|
19
|
+
client.del(remote_filepath) # deletes files from server
|
20
|
+
end
|
21
|
+
client.close # closes connection
|
22
|
+
end
|
metadata
CHANGED
@@ -1,57 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: datapipe2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guy Irvine
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: json
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - '>='
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - '>='
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: fluiddb
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - '>='
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - '>='
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: parse-cron
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - '>='
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - '>='
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
11
|
+
date: 2016-07-01 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
55
13
|
description: zero to one for moving data
|
56
14
|
email: guy@guyirvine.com
|
57
15
|
executables:
|
@@ -64,6 +22,7 @@ files:
|
|
64
22
|
- lib/fns/db_to_csv.rb
|
65
23
|
- lib/fns/db_to_json.rb
|
66
24
|
- lib/fns/mssql_to_pgsql.rb
|
25
|
+
- lib/fns/smb_to_local.rb
|
67
26
|
- lib/helper_functions.rb
|
68
27
|
- lib/host.rb
|
69
28
|
- lib/jobs.rb
|