rare_map 1.1.5 → 1.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rare_map/schema_reader.rb +12 -3
- data/lib/rare_map/version.rb +1 -1
- metadata +3 -3
@@ -4,16 +4,25 @@ module RareMap
|
|
4
4
|
module SchemaReader
|
5
5
|
def read_schema(db_profile)
|
6
6
|
conn = db_profile.connection.map { |k, v| v.kind_of?(Integer) ? "'#{k}'=>#{v}" : "'#{k}'=>'#{v}'" }.join(', ')
|
7
|
-
if RUBY_PLATFORM ==
|
8
|
-
%x[jruby -e "require 'active_record'; require 'activerecord-jdbc-adapter'; ActiveRecord::Base.establish_connection(#{conn}); ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection);"]
|
7
|
+
schema = if RUBY_PLATFORM == 'java'
|
8
|
+
%x[jruby -e "require 'active_record'; require 'activerecord-jdbc-adapter'; ActiveRecord::Base.establish_connection(#{conn}); ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection);" 2>&1]
|
9
9
|
else
|
10
|
-
%x[ruby -e "require 'active_record'; ActiveRecord::Base.establish_connection(#{conn}); ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection);"]
|
10
|
+
%x[ruby -e "require 'active_record'; ActiveRecord::Base.establish_connection(#{conn}); ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection);" 2>&1]
|
11
11
|
end
|
12
|
+
detect_errors schema
|
13
|
+
schema
|
12
14
|
# schema = StringIO.new
|
13
15
|
# ActiveRecord::Base.establish_connection db_profile.connection
|
14
16
|
# ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, schema)
|
15
17
|
# schema.close
|
16
18
|
# schema.string
|
17
19
|
end
|
20
|
+
|
21
|
+
def detect_errors(schema)
|
22
|
+
if $? != 0
|
23
|
+
puts schema
|
24
|
+
schema = ''
|
25
|
+
end
|
26
|
+
end
|
18
27
|
end
|
19
28
|
end
|
data/lib/rare_map/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rare_map
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -142,7 +142,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
142
142
|
version: '0'
|
143
143
|
segments:
|
144
144
|
- 0
|
145
|
-
hash:
|
145
|
+
hash: 2461692809645872672
|
146
146
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
147
147
|
none: false
|
148
148
|
requirements:
|