thecore_mssql_importer_common 0 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/db/migrate/20180621103713_add_sql_server_connector_params.rb +7 -6
- data/lib/tasks/thecore_mssql_importer_common_tasks.rake +4 -13
- data/lib/thecore_mssql_importer_common.rb +0 -1
- data/lib/thecore_mssql_importer_common/engine.rb +1 -1
- data/lib/thecore_mssql_importer_common/version.rb +1 -1
- metadata +4 -4
- data/lib/mssql_importer_common.rb +0 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8e39a71cb9d4f47ffbb625b7d5de9137d999178d
|
4
|
+
data.tar.gz: fe28bb5a393df43deb538ac520ed3774a5aeb0b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9aaa731bd6bdda6998a46e58567cad3b5095cd79f01cb4dd79706464d6933df96834ff5e54f00fc12de2075304742ef5b0b10568de7a668d9347d0c8bd9d1fe4
|
7
|
+
data.tar.gz: e87057157af1da5074c9e8ee7b4e87c83620009c61cd2c7ce3e8379c652c15a9bd5cd60e77811ba98265458be2f08bc8087b30e6513d26b61cb38b3728074753
|
@@ -1,11 +1,12 @@
|
|
1
1
|
class AddSqlServerConnectorParams < ActiveRecord::Migration[5.2]
|
2
2
|
def change
|
3
|
-
Settings.ns('mssql_connector').username = '
|
4
|
-
Settings.ns('mssql_connector').password = '
|
5
|
-
Settings.ns('mssql_connector').host = '
|
6
|
-
Settings.ns('mssql_connector').port
|
7
|
-
Settings.ns('mssql_connector').
|
8
|
-
Settings.ns('mssql_connector').
|
3
|
+
Settings.ns('mssql_connector').username = 'bancolini'
|
4
|
+
Settings.ns('mssql_connector').password = 'B@2(0l121'
|
5
|
+
Settings.ns('mssql_connector').host = '10.0.123.1'
|
6
|
+
Settings.ns('mssql_connector').port(kind: 'integer', default: 3499)
|
7
|
+
Settings.ns('mssql_connector').port = 3500
|
8
|
+
Settings.ns('mssql_connector').database = 'bancolini'
|
9
|
+
Settings.ns('mssql_connector').table_read = 'test'
|
9
10
|
Settings.ns('mssql_connector').latest_migration_code = ''
|
10
11
|
end
|
11
12
|
end
|
@@ -1,13 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
task ping_mssql_server: :environment do
|
6
|
-
MSSQLImporterCommon.ping_mssql_server
|
7
|
-
end
|
8
|
-
|
9
|
-
desc "Retrieves all records from the reading table."
|
10
|
-
task get_all_records: :environment do
|
11
|
-
MSSQLImporterCommon.get_all_records
|
12
|
-
end
|
13
|
-
end
|
1
|
+
# desc "Explaining what the task does"
|
2
|
+
# task :thecore_mssql_importer_common do
|
3
|
+
# # Task goes here
|
4
|
+
# end
|
@@ -3,7 +3,7 @@ module ThecoreMssqlImporterCommon
|
|
3
3
|
class Engine < ::Rails::Engine
|
4
4
|
|
5
5
|
initializer 'thecore_mssql_importer_common.add_to_migrations' do |app|
|
6
|
-
unless app.root.to_s
|
6
|
+
unless app.root.to_s == root.to_s
|
7
7
|
# APPEND TO MAIN APP MIGRATIONS FROM THIS GEM
|
8
8
|
config.paths['db/migrate'].expanded.each do |expanded_path|
|
9
9
|
app.config.paths['db/migrate'] << expanded_path
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thecore_mssql_importer_common
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriele Tassoni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thecore
|
@@ -53,7 +53,6 @@ files:
|
|
53
53
|
- config/initializers/thecore_mssql_importer_common_after_initialize.rb
|
54
54
|
- config/routes.rb
|
55
55
|
- db/migrate/20180621103713_add_sql_server_connector_params.rb
|
56
|
-
- lib/mssql_importer_common.rb
|
57
56
|
- lib/tasks/thecore_mssql_importer_common_tasks.rake
|
58
57
|
- lib/thecore_mssql_importer_common.rb
|
59
58
|
- lib/thecore_mssql_importer_common/engine.rb
|
@@ -88,7 +87,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
87
|
- !ruby/object:Gem::Version
|
89
88
|
version: '0'
|
90
89
|
requirements: []
|
91
|
-
|
90
|
+
rubyforge_project:
|
91
|
+
rubygems_version: 2.6.14
|
92
92
|
signing_key:
|
93
93
|
specification_version: 4
|
94
94
|
summary: Thecorized thecore_mssql_importer_common
|
@@ -1,34 +0,0 @@
|
|
1
|
-
require 'tiny_tds'
|
2
|
-
|
3
|
-
class MSSQLImporterCommon
|
4
|
-
# "Just tests connection to the DB configured in Settings."
|
5
|
-
def self.ping_mssql_server
|
6
|
-
connect
|
7
|
-
puts 'Connecting to SQL Server'
|
8
|
-
|
9
|
-
if @client.active? == true then puts 'Done' end
|
10
|
-
|
11
|
-
@client.close
|
12
|
-
end
|
13
|
-
|
14
|
-
# "Retrieves all records from the reading table."
|
15
|
-
def self.get_all_records
|
16
|
-
connect
|
17
|
-
# Read all employees
|
18
|
-
puts "Reading data from table"
|
19
|
-
@client.execute("SELECT * FROM #{Settings.ns('mssql_connector').table_read}").each do |row|
|
20
|
-
puts row
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
def self.connect
|
25
|
-
conn = {
|
26
|
-
username: Settings.ns('mssql_connector').username,
|
27
|
-
password: Settings.ns('mssql_connector').password,
|
28
|
-
host: Settings.ns('mssql_connector').host,
|
29
|
-
port: Settings.ns('mssql_connector').port,
|
30
|
-
database: Settings.ns('mssql_connector').database,
|
31
|
-
}
|
32
|
-
@client = TinyTds::Client.new conn
|
33
|
-
end
|
34
|
-
end
|