Class: Mysql2psql
- Inherits:
-
Object
- Object
- Mysql2psql
- Defined in:
- lib/mysql2psql.rb,
lib/mysql2psql/config.rb,
lib/mysql2psql/errors.rb,
lib/mysql2psql/writer.rb,
lib/mysql2psql/version.rb,
lib/mysql2psql/converter.rb,
lib/mysql2psql/config_base.rb,
lib/mysql2psql/mysql_reader.rb,
lib/mysql2psql/postgres_writer.rb,
lib/mysql2psql/postgres_db_writer.rb,
lib/mysql2psql/postgres_file_writer.rb
Defined Under Namespace
Modules: Version Classes: Config, ConfigBase, ConfigurationError, ConfigurationFileInitialized, ConfigurationFileNotFound, Converter, GeneralError, MysqlReader, PostgresDbWriter, PostgresFileWriter, PostgresWriter, UninitializedValueError, Writer
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#reader ⇒ Object
readonly
Returns the value of attribute reader.
-
#writer ⇒ Object
readonly
Returns the value of attribute writer.
Instance Method Summary collapse
- #convert ⇒ Object
- #help ⇒ Object
-
#initialize(args) ⇒ Mysql2psql
constructor
A new instance of Mysql2psql.
Constructor Details
#initialize(args) ⇒ Mysql2psql
Returns a new instance of Mysql2psql.
16 17 18 19 20 |
# File 'lib/mysql2psql.rb', line 16 def initialize(args) help if args.length==1 && args[0] =~ /^-.?|^-*he?l?p?$/i configfile = args[0] || File.('mysql2psql.yml') @options = Config.new( configfile, true ) end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
14 15 16 |
# File 'lib/mysql2psql.rb', line 14 def @options end |
#reader ⇒ Object (readonly)
Returns the value of attribute reader.
14 15 16 |
# File 'lib/mysql2psql.rb', line 14 def reader @reader end |
#writer ⇒ Object (readonly)
Returns the value of attribute writer.
14 15 16 |
# File 'lib/mysql2psql.rb', line 14 def writer @writer end |
Instance Method Details
#convert ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/mysql2psql.rb', line 22 def convert @reader = MysqlReader.new( ) if .destfile(nil) @writer = PostgresFileWriter.new(.destfile) else @writer = PostgresDbWriter.new() end Converter.new(reader, writer, ).convert end |
#help ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/mysql2psql.rb', line 34 def help puts <<EOS MySQL to PostgreSQL Conversion EOS exit -2 end |