mongify 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +2 -2
- data/README.rdoc +4 -0
- data/bin/mongify +3 -1
- data/lib/mongify/cli/application.rb +1 -4
- data/lib/mongify/database/base_connection.rb +24 -10
- data/lib/mongify/version.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c9b7a85234abf8705ad06a4f3b17df8b041f347
|
4
|
+
data.tar.gz: 88ac19500da4d1bf630de63a79273dafa09e91f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 258b0d620e1b5de76f308aca344a50dc8a0f6ea6d9506f2558e2ee205394dc75dfe63111789995c2b307905b91eb926e7a33c407b58e276ffca131864a0f4908
|
7
|
+
data.tar.gz: 77c2164795bfcf713b1af6af6eda7030f39c8b8b98bdc60e2f4871032e23e2fa43c755e7c0235bd3fb057edb9c83c321b004d31b9ce824753ece779a4b27a65d
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Mongify ChangeLog
|
2
2
|
|
3
|
+
## 1.3.2 / 04 Sep 2017
|
4
|
+
* Minor code refactoring
|
5
|
+
* Removed exception handling around ALL exceptions (this should improve finding issues outside of Mongify)
|
6
|
+
|
3
7
|
## 1.3.1 / 09 Nov 2016
|
4
8
|
* Updated gem requirements to exlucde ActiveRecord/ActiveSupport 5.0
|
5
9
|
* Locked down gem versions to prevent issues on newer gems (Like ActiveRecord 5 and Mongo)
|
data/Gemfile.lock
CHANGED
data/README.rdoc
CHANGED
@@ -36,11 +36,15 @@ Building a config file is as simple as this:
|
|
36
36
|
password "passw0rd"
|
37
37
|
database "my_database"
|
38
38
|
batch_size 10000 # This is defaulted to 10000 but in case you want to make that smaller (on lower RAM machines)
|
39
|
+
# Uncomment the following line if you get a "String not valid UTF-8" error.
|
40
|
+
# encoding "utf8"
|
39
41
|
end
|
40
42
|
|
41
43
|
mongodb_connection do
|
42
44
|
host "localhost"
|
43
45
|
database "my_database"
|
46
|
+
# Uncomment the following line if you get a "String not valid UTF-8" error.
|
47
|
+
# encoding "utf8"
|
44
48
|
end
|
45
49
|
|
46
50
|
You can check your configuration by running
|
data/bin/mongify
CHANGED
@@ -6,7 +6,9 @@
|
|
6
6
|
# Author: Andrew Kalek
|
7
7
|
#
|
8
8
|
|
9
|
-
|
9
|
+
$LOAD_PATH.unshift File.join(
|
10
|
+
File.dirname(File.dirname(File.expand_path(__FILE__))), 'lib'
|
11
|
+
)
|
10
12
|
require 'mongify/cli'
|
11
13
|
|
12
14
|
Mongify.root = Dir.pwd
|
@@ -6,11 +6,21 @@ module Mongify
|
|
6
6
|
#
|
7
7
|
class BaseConnection
|
8
8
|
# List of required fields to make a valid base connection
|
9
|
-
REQUIRED_FIELDS = %w
|
9
|
+
REQUIRED_FIELDS = %w[host].freeze
|
10
10
|
# List of all the available fields to make up a connection
|
11
|
-
AVAILABLE_FIELDS = %w
|
11
|
+
AVAILABLE_FIELDS = %w[
|
12
|
+
adapter
|
13
|
+
host
|
14
|
+
username
|
15
|
+
password
|
16
|
+
database
|
17
|
+
socket
|
18
|
+
port
|
19
|
+
encoding
|
20
|
+
batch_size
|
21
|
+
].freeze
|
12
22
|
# List of all fields that should be forced to a string
|
13
|
-
STRING_FIELDS = %w
|
23
|
+
STRING_FIELDS = %w[adapter].freeze
|
14
24
|
|
15
25
|
def initialize(options=nil)
|
16
26
|
if options
|
@@ -21,19 +31,21 @@ module Mongify
|
|
21
31
|
end
|
22
32
|
end
|
23
33
|
|
24
|
-
# Returns all settings as a hash, this is used mainly in building
|
34
|
+
# Returns all settings as a hash, this is used mainly in building
|
35
|
+
# ActiveRecord::Base.establish_connection
|
25
36
|
def to_hash
|
26
37
|
hash = {}
|
27
38
|
instance_variables.each do |variable|
|
28
|
-
value =
|
29
|
-
hash[variable.to_s.
|
39
|
+
value = instance_variable_get variable
|
40
|
+
hash[variable.to_s.delete('@').to_sym] = value unless value.nil?
|
30
41
|
end
|
31
42
|
hash
|
32
43
|
end
|
33
44
|
|
34
45
|
# Ensures the required fields are filled
|
35
46
|
def valid?
|
36
|
-
#TODO: Improve this to create an errors array with detailed errors
|
47
|
+
# TODO: Improve this to create an errors array with detailed errors
|
48
|
+
# (or maybe just use activemodel)
|
37
49
|
REQUIRED_FIELDS.each do |require_field|
|
38
50
|
return false unless instance_variables.map(&:to_s).include?("@#{require_field}") and
|
39
51
|
!instance_variable_get("@#{require_field}").to_s.empty?
|
@@ -41,12 +53,14 @@ module Mongify
|
|
41
53
|
true
|
42
54
|
end
|
43
55
|
|
44
|
-
# Used to setup connection, Raises NotImplementedError because it
|
56
|
+
# Used to setup connection, Raises NotImplementedError because it
|
57
|
+
# needs to be setup in BaseConnection's children
|
45
58
|
def setup_connection_adapter
|
46
59
|
raise NotImplementedMongifyError
|
47
60
|
end
|
48
61
|
|
49
|
-
# Used to test connection, Raises NotImplementedError because it needs to
|
62
|
+
# Used to test connection, Raises NotImplementedError because it needs to
|
63
|
+
# be setup in BaseConnection's children
|
50
64
|
def has_connection?
|
51
65
|
raise NotImplementedMongifyError
|
52
66
|
end
|
@@ -93,4 +107,4 @@ module Mongify
|
|
93
107
|
|
94
108
|
end
|
95
109
|
end
|
96
|
-
end
|
110
|
+
end
|
data/lib/mongify/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kalek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -370,7 +370,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
370
370
|
version: '0'
|
371
371
|
requirements: []
|
372
372
|
rubyforge_project:
|
373
|
-
rubygems_version: 2.6.
|
373
|
+
rubygems_version: 2.6.11
|
374
374
|
signing_key:
|
375
375
|
specification_version: 4
|
376
376
|
summary: Translate your SQL data to MongoDB with ease
|