console_util 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module ConsoleUtil
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
data/lib/console_util.rb CHANGED
@@ -28,6 +28,12 @@ module ConsoleUtil
28
28
  def import_mysql_dump(filename)
29
29
  sql_dump_file = File.open(filename)
30
30
  while sql_statement = sql_dump_file.gets(";\n") do
31
+ # Ruby 1.9 introduces support for encodings, so we need to handle this
32
+ if RUBY_VERSION >= '1.9.0'
33
+ # Force string to be recognized as ISO-8859-1 first so the call to encode won't be a no-op
34
+ sql_statement = sql_statement.force_encoding("ISO-8859-1").encode("UTF-8", :replace => nil)
35
+ end
36
+
31
37
  ActiveRecord::Base.connection.execute(sql_statement) unless sql_statement.blank?
32
38
  end
33
39
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: console_util
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 0
10
- version: 0.4.0
9
+ - 1
10
+ version: 0.4.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Clyde Law
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-07-16 00:00:00 Z
18
+ date: 2016-12-09 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rails
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  requirements: []
81
81
 
82
82
  rubyforge_project: console_util
83
- rubygems_version: 1.8.24
83
+ rubygems_version: 1.8.30
84
84
  signing_key:
85
85
  specification_version: 3
86
86
  summary: Contains various utilities for working in the Rails console.