mongify 1.3.1 → 1.3.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2666a90ce1ed143778b58f442d33914ff368d1b6
4
- data.tar.gz: 231908954f10b624d88056e633141035c1aaaa1b
3
+ metadata.gz: 2c9b7a85234abf8705ad06a4f3b17df8b041f347
4
+ data.tar.gz: 88ac19500da4d1bf630de63a79273dafa09e91f9
5
5
  SHA512:
6
- metadata.gz: 9b6f9ab2f4445bde689ad9d1ea14fb729e88961030a25c72a21a387e333dae7559ff6a5b11295b7c7b0e8957d372bb0910b339f548b6e95ad0088b0d5c19e3c1
7
- data.tar.gz: fb4dc2a80709689de982330db5fb900d8d602128e700f243b41c7b5e2c4749f2673222797ab6388ca072b5393f0425e190563251a4e9175881fe14bf2d2ad308
6
+ metadata.gz: 258b0d620e1b5de76f308aca344a50dc8a0f6ea6d9506f2558e2ee205394dc75dfe63111789995c2b307905b91eb926e7a33c407b58e276ffca131864a0f4908
7
+ data.tar.gz: 77c2164795bfcf713b1af6af6eda7030f39c8b8b98bdc60e2f4871032e23e2fa43c755e7c0235bd3fb057edb9c83c321b004d31b9ce824753ece779a4b27a65d
@@ -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)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mongify (1.3.1)
4
+ mongify (1.3.2)
5
5
  activerecord (>= 4.2, < 5.0)
6
6
  activesupport (>= 4.2, < 5.0)
7
7
  bson (= 1.12.5)
@@ -120,4 +120,4 @@ DEPENDENCIES
120
120
  yard (>= 0.8)
121
121
 
122
122
  BUNDLED WITH
123
- 1.13.5
123
+ 1.15.4
@@ -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
@@ -6,7 +6,9 @@
6
6
  # Author: Andrew Kalek
7
7
  #
8
8
 
9
- $:.unshift File.join(File.dirname(File.dirname(File.expand_path(__FILE__))), 'lib')
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
@@ -29,9 +29,6 @@ module Mongify
29
29
  rescue MongifyError => error
30
30
  $stderr.puts "Error: #{error}"
31
31
  report_error
32
- rescue Exception => error
33
- report_error
34
- raise error
35
32
  end
36
33
  end
37
34
 
@@ -51,4 +48,4 @@ module Mongify
51
48
  end
52
49
  end
53
50
  end
54
- end
51
+ end
@@ -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{host}
9
+ REQUIRED_FIELDS = %w[host].freeze
10
10
  # List of all the available fields to make up a connection
11
- AVAILABLE_FIELDS = %w{adapter host username password database socket port encoding batch_size}
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{adapter}
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 ActiveRecord::Base.establish_connection
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 = self.instance_variable_get variable
29
- hash[variable.to_s.gsub('@','').to_sym] = value unless value.nil?
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 (or maybe just use activemodel)
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 needs to be setup in BaseConnection's children
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 be setup in BaseConnection's children
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
@@ -1,4 +1,4 @@
1
1
  module Mongify
2
2
  # Mongify's Current Version Number
3
- VERSION = "1.3.1"
4
- end
3
+ VERSION = "1.3.2"
4
+ end
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.1
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: 2016-11-09 00:00:00.000000000 Z
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.7
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