mongify 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +20 -0
- data/CHANGELOG.rdoc +22 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +68 -0
- data/LICENSE +20 -0
- data/README.rdoc +86 -0
- data/Rakefile +73 -0
- data/bin/mongify +14 -0
- data/features/options.feature +46 -0
- data/features/print.feature +10 -0
- data/features/process.feature +19 -0
- data/features/step_definitions/mongify_steps.rb +42 -0
- data/features/step_definitions/mongo_steps.rb +7 -0
- data/features/support/env.rb +28 -0
- data/lib/mongify.rb +22 -0
- data/lib/mongify/cli.rb +8 -0
- data/lib/mongify/cli/application.rb +43 -0
- data/lib/mongify/cli/help_command.rb +16 -0
- data/lib/mongify/cli/options.rb +94 -0
- data/lib/mongify/cli/report.rb +11 -0
- data/lib/mongify/cli/version_command.rb +18 -0
- data/lib/mongify/cli/worker_command.rb +93 -0
- data/lib/mongify/configuration.rb +46 -0
- data/lib/mongify/database.rb +5 -0
- data/lib/mongify/database/base_connection.rb +78 -0
- data/lib/mongify/database/column.rb +81 -0
- data/lib/mongify/database/no_sql_connection.rb +62 -0
- data/lib/mongify/database/sql_connection.rb +61 -0
- data/lib/mongify/database/table.rb +74 -0
- data/lib/mongify/exceptions.rb +13 -0
- data/lib/mongify/translation.rb +55 -0
- data/lib/mongify/translation/printer.rb +20 -0
- data/lib/mongify/translation/process.rb +61 -0
- data/lib/mongify/ui.rb +45 -0
- data/lib/mongify/version.rb +3 -0
- data/mongify.gemspec +42 -0
- data/spec/default.watch +199 -0
- data/spec/files/base_configuration.rb +9 -0
- data/spec/files/empty_translation.rb +0 -0
- data/spec/files/simple_translation.rb +26 -0
- data/spec/mongify/cli/application_spec.rb +19 -0
- data/spec/mongify/cli/help_command_spec.rb +18 -0
- data/spec/mongify/cli/options_spec.rb +62 -0
- data/spec/mongify/cli/version_command_spec.rb +24 -0
- data/spec/mongify/cli/worker_command_spec.rb +115 -0
- data/spec/mongify/configuration_spec.rb +25 -0
- data/spec/mongify/database/base_connection_spec.rb +59 -0
- data/spec/mongify/database/column_spec.rb +103 -0
- data/spec/mongify/database/no_sql_connection_spec.rb +131 -0
- data/spec/mongify/database/sql_connection_spec.rb +91 -0
- data/spec/mongify/database/table_spec.rb +120 -0
- data/spec/mongify/translation/printer_spec.rb +34 -0
- data/spec/mongify/translation/process_spec.rb +68 -0
- data/spec/mongify/translation_spec.rb +59 -0
- data/spec/mongify/ui_spec.rb +73 -0
- data/spec/mongify_spec.rb +15 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +22 -0
- data/spec/support/config_reader.rb +21 -0
- data/spec/support/database.example +17 -0
- data/spec/support/database_output.txt +27 -0
- data/spec/support/generate_database.rb +91 -0
- metadata +370 -0
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Mongify::Translation do
|
4
|
+
context "print" do
|
5
|
+
before(:each) do
|
6
|
+
cols = [Mongify::Database::Column.new('first_name', :string),
|
7
|
+
Mongify::Database::Column.new('age', :integer, :default => 18),
|
8
|
+
Mongify::Database::Column.new('bio', :text)]
|
9
|
+
@table = Mongify::Database::Table.new("users", :columns => cols)
|
10
|
+
@translation = Mongify::Translation.new()
|
11
|
+
@translation.add_table(@table)
|
12
|
+
@table2 = Mongify::Database::Table.new('posts')
|
13
|
+
@table2.column('id', :integer)
|
14
|
+
@translation.add_table(@table2)
|
15
|
+
end
|
16
|
+
|
17
|
+
subject{@translation}
|
18
|
+
|
19
|
+
it "should output correctly" do
|
20
|
+
subject.print.should == <<-EOF
|
21
|
+
table "users" do
|
22
|
+
\tcolumn "first_name", :string
|
23
|
+
\tcolumn "age", :integer, :default => "18"
|
24
|
+
\tcolumn "bio", :text
|
25
|
+
end
|
26
|
+
|
27
|
+
table "posts" do
|
28
|
+
\tcolumn "id", :key
|
29
|
+
end
|
30
|
+
|
31
|
+
EOF
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Mongify::Translation::Process do
|
4
|
+
before(:each) do
|
5
|
+
GenerateDatabase.clear_mongodb
|
6
|
+
@sql_connection = GenerateDatabase.sqlite_connection
|
7
|
+
@no_sql_connection = GenerateDatabase.mongo_connection
|
8
|
+
@translation = Mongify::Translation.new
|
9
|
+
end
|
10
|
+
|
11
|
+
it "validates a sqlconnection" do
|
12
|
+
lambda { @translation.process('bad param', 'bad param2') }.should raise_error(Mongify::SqlConnectionRequired)
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should require a NoSqlConnection" do
|
16
|
+
lambda { @translation.process(@sql_connection, 'bad param2') }.should raise_error(Mongify::NoSqlConnectionRequired)
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should call copy" do
|
20
|
+
@translation.should_receive(:copy)
|
21
|
+
@translation.stub(:update_reference_ids)
|
22
|
+
@translation.process(@sql_connection, @no_sql_connection)
|
23
|
+
end
|
24
|
+
it "should call update_reference_ids" do
|
25
|
+
@translation.should_receive(:update_reference_ids)
|
26
|
+
@translation.stub(:copy)
|
27
|
+
@translation.process(@sql_connection, @no_sql_connection)
|
28
|
+
end
|
29
|
+
|
30
|
+
|
31
|
+
context "processing actions" do
|
32
|
+
before(:each) do
|
33
|
+
@sql_connection = mock(:select_rows => [{'first_name'=> 'Timmy', 'last_name' => 'Zuza'}])
|
34
|
+
@translation.stub(:sql_connection).and_return(@sql_connection)
|
35
|
+
|
36
|
+
@no_sql_connection = mock()
|
37
|
+
@translation.stub(:no_sql_connection).and_return(@no_sql_connection)
|
38
|
+
|
39
|
+
@table = mock(:translate => {}, :name => 'users')
|
40
|
+
@translation.stub(:tables).and_return([@table])
|
41
|
+
end
|
42
|
+
|
43
|
+
context "copy" do
|
44
|
+
it "should call translate on the tables" do
|
45
|
+
@no_sql_connection.should_receive(:insert_into).and_return(true)
|
46
|
+
@table.should_receive(:translate).once.and_return({})
|
47
|
+
@translation.send(:copy)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
context "update_reference_ids" do
|
52
|
+
it "should work correctly" do
|
53
|
+
@no_sql_connection.should_receive(:select_rows).and_return([{'_id' => 100, 'user_id' => 1}, {'_id'=> 101, 'user_id' => 2}])
|
54
|
+
@no_sql_connection.stub(:get_id_using_pre_mongified_id).twice.and_return(500)
|
55
|
+
@table.should_receive(:reference_columns).twice.and_return([mock(:name => 'user_id', :references=>'users')])
|
56
|
+
@no_sql_connection.should_receive(:update).twice
|
57
|
+
@translation.send(:update_reference_ids)
|
58
|
+
end
|
59
|
+
it "should only update when new_id is present" do
|
60
|
+
@no_sql_connection.should_receive(:select_rows).and_return([{'_id' => 100, 'user_id' => 1}, {'_id'=> 101, 'user_id' => 2}])
|
61
|
+
@no_sql_connection.stub(:get_id_using_pre_mongified_id).twice.and_return(nil)
|
62
|
+
@table.should_receive(:reference_columns).twice.and_return([mock(:name => 'user_id', :references=>'users')])
|
63
|
+
@no_sql_connection.should_receive(:update).never
|
64
|
+
@translation.send(:update_reference_ids)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Mongify::Translation do
|
4
|
+
before(:all) do
|
5
|
+
@file_path = File.expand_path(File.dirname(__FILE__) + '/../files/simple_translation.rb')
|
6
|
+
@translation = Mongify::Translation.parse(@file_path)
|
7
|
+
end
|
8
|
+
|
9
|
+
context "self.load" do
|
10
|
+
it "should require connection" do
|
11
|
+
lambda {Mongify::Translation.load}.should raise_error(ArgumentError)
|
12
|
+
end
|
13
|
+
it "should only take sql_connections" do
|
14
|
+
lambda {Mongify::Translation.load("Something else")}.should raise_error(Mongify::SqlConnectionRequired)
|
15
|
+
end
|
16
|
+
context "translation" do
|
17
|
+
before(:each) do
|
18
|
+
@connection = Mongify::Database::SqlConnection.new
|
19
|
+
@connection.stub(:has_connection?).and_return(true)
|
20
|
+
@connection.stub(:tables).and_return(['users'])
|
21
|
+
col = mock(:name => 'first_name', :type => 'string', :default => nil)
|
22
|
+
@connection.stub(:columns_for).and_return([col])
|
23
|
+
end
|
24
|
+
it "should return a translation" do
|
25
|
+
Mongify::Translation.load(@connection).should be_a(Mongify::Translation)
|
26
|
+
end
|
27
|
+
it "should have 1 table" do
|
28
|
+
Mongify::Translation.load(@connection).tables.should have(1).table
|
29
|
+
end
|
30
|
+
it "should have 1 column for the table" do
|
31
|
+
Mongify::Translation.load(@connection).tables.first.columns.should have(1).column
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
context "parsed content" do
|
37
|
+
context "tables" do
|
38
|
+
it "should have 3 tables" do
|
39
|
+
@translation.should have(3).tables
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should setup 'comments'" do
|
43
|
+
table = @translation.tables.find{|t| t.name == 'comments'}
|
44
|
+
table.should_not be_nil
|
45
|
+
table.options.keys.should_not be_empty
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
context "add_table" do
|
51
|
+
before(:each) do
|
52
|
+
@table = Mongify::Database::Table.new("users")
|
53
|
+
@translation = Mongify::Translation.new()
|
54
|
+
end
|
55
|
+
it "should work" do
|
56
|
+
lambda { @translation.add_table(@table) }.should change{@translation.tables.count}.by(1)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Mongify::UI do
|
4
|
+
before(:each) do
|
5
|
+
@ui = Mongify::UI
|
6
|
+
@config = Mongify::Configuration
|
7
|
+
@out = StringIO.new
|
8
|
+
@in = StringIO.new
|
9
|
+
@config.out_stream = @out
|
10
|
+
@config.in_stream = @in
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should add puts to out stream" do
|
14
|
+
@ui.puts "hello"
|
15
|
+
@out.string.should == "hello\n"
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should add print to out stream without newline" do
|
19
|
+
@ui.print "hello"
|
20
|
+
@out.string.should == "hello"
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should fetch gets from in stream" do
|
24
|
+
@in.puts "bar"
|
25
|
+
@in.rewind
|
26
|
+
@ui.gets.should == "bar\n"
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should gets should return empty string if no input" do
|
30
|
+
@config.in_stream = nil
|
31
|
+
@ui.gets.should == ""
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should request text input" do
|
35
|
+
@in.puts "bar"
|
36
|
+
@in.rewind
|
37
|
+
@ui.request("foo").should == "bar"
|
38
|
+
@out.string.should == "foo"
|
39
|
+
end
|
40
|
+
|
41
|
+
it "should ask for yes/no and return true when yes" do
|
42
|
+
@ui.should_receive(:request).with('foo? [yn] ').and_return('y')
|
43
|
+
@ui.ask("foo?").should be_true
|
44
|
+
end
|
45
|
+
|
46
|
+
it "should ask for yes/no and return false when no" do
|
47
|
+
@ui.stub(:request).and_return('n')
|
48
|
+
@ui.ask("foo?").should be_false
|
49
|
+
end
|
50
|
+
|
51
|
+
it "should ask for yes/no and return false for any input" do
|
52
|
+
@ui.stub(:request).and_return('aklhasdf')
|
53
|
+
@ui.ask("foo?").should be_false
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should add WARNING to a warn message" do
|
57
|
+
@ui.warn "hello"
|
58
|
+
@out.string.should == "WARNING: hello\n"
|
59
|
+
end
|
60
|
+
|
61
|
+
context "abort" do
|
62
|
+
it "should abort program execution" do
|
63
|
+
Kernel.should_receive(:abort)
|
64
|
+
@ui.abort "hacker!"
|
65
|
+
end
|
66
|
+
|
67
|
+
it "should output message" do
|
68
|
+
Kernel.stub(:abort)
|
69
|
+
@ui.abort "hacker!"
|
70
|
+
@out.string.should == "PROGRAM HALT: hacker!\n"
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Mongify do
|
4
|
+
describe :root do
|
5
|
+
it "should be settable" do
|
6
|
+
Mongify.root = Dir.pwd
|
7
|
+
Mongify.root.should == Dir.pwd
|
8
|
+
end
|
9
|
+
|
10
|
+
it "should raise error if not defined" do
|
11
|
+
Mongify.root = nil
|
12
|
+
lambda { Mongify.root }.should raise_error(Mongify::RootMissing)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/spec/spec.opts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--colour
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'yaml'
|
3
|
+
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
4
|
+
require 'mongify'
|
5
|
+
require 'mongify/cli'
|
6
|
+
|
7
|
+
begin
|
8
|
+
require 'bundler'
|
9
|
+
Bundler.setup
|
10
|
+
rescue LoadError
|
11
|
+
puts "Need to install bundler 1.0. 'gem install bundler'"
|
12
|
+
end
|
13
|
+
|
14
|
+
require 'rspec/core'
|
15
|
+
|
16
|
+
Dir['./spec/support/**/*.rb'].map {|f| require f}
|
17
|
+
|
18
|
+
::CONNECTION_CONFIG = ConfigReader.new(File.dirname(File.expand_path(__FILE__)) + '/support/database.yml')
|
19
|
+
|
20
|
+
Mongify.root = File.dirname(File.dirname(__FILE__))
|
21
|
+
|
22
|
+
::DATABASE_PRINT = File.read(File.dirname(File.expand_path(__FILE__)) + '/support/database_output.txt')
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class ConfigReader
|
2
|
+
def initialize(filepath)
|
3
|
+
if File.exists?(filepath)
|
4
|
+
config = YAML.load_file(filepath)
|
5
|
+
#puts ">>> READING #{filepath}"
|
6
|
+
config.each { |key, value| instance_variable_set("@#{key}", value) }
|
7
|
+
else
|
8
|
+
raise ">>> Can't find #{filepath} -- unable to read config file <<<"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def responses_to?(key)
|
13
|
+
instance_variable_get("@#{key}") ? instance_variable_get("@#{key}") : super(key)
|
14
|
+
end
|
15
|
+
|
16
|
+
def method_missing(meth, *args, &blk)
|
17
|
+
value = instance_variable_get("@#{meth}")
|
18
|
+
return value if value
|
19
|
+
super(meth, args, blk)
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
sqlite:
|
2
|
+
adapter: sqlite3
|
3
|
+
database: spec/tmp/test.sqlite
|
4
|
+
|
5
|
+
mysql:
|
6
|
+
adapter: mysql
|
7
|
+
database: mongify_test
|
8
|
+
username: root
|
9
|
+
password: passw0rd
|
10
|
+
host: localhost
|
11
|
+
port: 3306
|
12
|
+
|
13
|
+
mongo:
|
14
|
+
adapter: mongo
|
15
|
+
database: mongify_test
|
16
|
+
host: localhost
|
17
|
+
port: 27017
|
@@ -0,0 +1,27 @@
|
|
1
|
+
table "users" do
|
2
|
+
column "id", :key
|
3
|
+
column "first_name", :string
|
4
|
+
column "last_name", :string
|
5
|
+
column "created_at", :datetime
|
6
|
+
column "updated_at", :datetime
|
7
|
+
end
|
8
|
+
|
9
|
+
table "posts" do
|
10
|
+
column "id", :key
|
11
|
+
column "title", :string
|
12
|
+
column "owner_id", :integer, :references => "owners"
|
13
|
+
column "body", :text
|
14
|
+
column "published_at", :datetime
|
15
|
+
column "created_at", :datetime
|
16
|
+
column "updated_at", :datetime
|
17
|
+
end
|
18
|
+
|
19
|
+
table "comments" do
|
20
|
+
column "id", :key
|
21
|
+
column "body", :text
|
22
|
+
column "post_id", :integer, :references => "posts"
|
23
|
+
column "user_id", :integer, :references => "users"
|
24
|
+
column "created_at", :datetime
|
25
|
+
column "updated_at", :datetime
|
26
|
+
end
|
27
|
+
|
@@ -0,0 +1,91 @@
|
|
1
|
+
require 'active_record'
|
2
|
+
class GenerateDatabase
|
3
|
+
def self.mysql_connection
|
4
|
+
@sql_connection ||= Mongify::Database::SqlConnection.new( :adapter => CONNECTION_CONFIG.mysql['adapter'],
|
5
|
+
:host => CONNECTION_CONFIG.mysql['host'],
|
6
|
+
:port => CONNECTION_CONFIG.mysql['port'],
|
7
|
+
:username => CONNECTION_CONFIG.mysql['username'],
|
8
|
+
:password => CONNECTION_CONFIG.mysql['password'],
|
9
|
+
:database => CONNECTION_CONFIG.mysql['database']
|
10
|
+
)
|
11
|
+
end
|
12
|
+
def self.sqlite_connection
|
13
|
+
@db_path = File.join(File.dirname(File.dirname(File.dirname(File.expand_path(__FILE__)))), CONNECTION_CONFIG.sqlite['database'])
|
14
|
+
|
15
|
+
@sqlite_connecton ||= Mongify::Database::SqlConnection.new(:adapter => CONNECTION_CONFIG.sqlite['adapter'], :database => @db_path)
|
16
|
+
end
|
17
|
+
def self.sqlite(include_data=true)
|
18
|
+
puts ">\n\n>>sqlite_connection.database: #{sqlite_connection.database} :: Exists? #{File.exists?(sqlite_connection.database)}"
|
19
|
+
puts ("DELETING>>>>") && File.delete(sqlite_connection.database) if File.exists?(sqlite_connection.database)
|
20
|
+
|
21
|
+
conn = sqlite_connection.connection
|
22
|
+
|
23
|
+
#SETUP TABLES
|
24
|
+
conn.create_table(:users) do |t|
|
25
|
+
t.string :first_name, :last_name
|
26
|
+
t.timestamps
|
27
|
+
end
|
28
|
+
|
29
|
+
conn.create_table(:posts) do |t|
|
30
|
+
t.string :title
|
31
|
+
t.integer :owner_id
|
32
|
+
t.text :body
|
33
|
+
t.datetime :published_at
|
34
|
+
t.timestamps
|
35
|
+
end
|
36
|
+
|
37
|
+
conn.create_table(:comments) do |t|
|
38
|
+
t.text :body
|
39
|
+
t.integer :post_id
|
40
|
+
t.integer :user_id
|
41
|
+
t.timestamps
|
42
|
+
end
|
43
|
+
|
44
|
+
if include_data
|
45
|
+
|
46
|
+
#Users
|
47
|
+
[
|
48
|
+
{:first_name => 'Timmy', :last_name => 'Zuza'},
|
49
|
+
{:first_name => 'Bob', :last_name => 'Smith'},
|
50
|
+
{:first_name => 'Joe', :last_name => 'Franklin'}
|
51
|
+
].each do |values|
|
52
|
+
conn.insert("INSERT INTO users (first_name, last_name, created_at, updated_at) VALUES ('#{values[:first_name]}', '#{values[:last_name]}', '#{Time.now.to_s(:db)}', '#{Time.now.to_s(:db)}')")
|
53
|
+
end
|
54
|
+
|
55
|
+
#Posts
|
56
|
+
[
|
57
|
+
{:title => 'First Post', :owner_id => 1, :body => 'First Post Body', :published_at => (Time.now - 2).to_s(:db)},
|
58
|
+
{:title => 'Second Post', :owner_id => 1, :body => 'Second Post Body', :published_at => (Time.now - 1).to_s(:db)},
|
59
|
+
{:title => 'Third Post', :owner_id => 2, :body => 'Thrid Post Body', :published_at => (Time.now).to_s(:db)},
|
60
|
+
].each do |v|
|
61
|
+
conn.insert("INSERT INTO posts (title, owner_id, body, published_at, created_at, updated_at)
|
62
|
+
VALUES ('#{v[:title]}', #{v[:owner_id]}, '#{v[:body]}', '#{v[:published_at]}', '#{Time.now.to_s(:db)}', '#{Time.now.to_s(:db)}')")
|
63
|
+
end
|
64
|
+
|
65
|
+
#Comments
|
66
|
+
[
|
67
|
+
{:post_id => 1, :user_id => 1, :body => 'First Comment Body'},
|
68
|
+
{:post_id => 2, :user_id => 1, :body => 'Second Comment Body'},
|
69
|
+
{:post_id => 2, :user_id => 2, :body => 'Thrid Comment Body'}
|
70
|
+
].each do |v|
|
71
|
+
conn.insert("INSERT INTO comments (body, post_id, user_id, created_at, updated_at)
|
72
|
+
VALUES ('#{v[:body]}', #{v[:post_id]}, #{v[:user_id]}, '#{Time.now.to_s(:db)}', '#{Time.now.to_s(:db)}')")
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
76
|
+
|
77
|
+
sqlite_connection.database
|
78
|
+
end
|
79
|
+
|
80
|
+
def self.clear_mongodb
|
81
|
+
mongo_connection.connection.drop_database mongo_connection.database
|
82
|
+
end
|
83
|
+
|
84
|
+
def self.mongo_connection
|
85
|
+
@mongodb_connection ||= Mongify::Database::NoSqlConnection.new(:host => CONNECTION_CONFIG.mongo['host'],
|
86
|
+
:port => CONNECTION_CONFIG.mongo['port'],
|
87
|
+
:database => CONNECTION_CONFIG.mongo['database'],
|
88
|
+
:username => CONNECTION_CONFIG.mongo['username'],
|
89
|
+
:password => CONNECTION_CONFIG.mongo['password'])
|
90
|
+
end
|
91
|
+
end
|
metadata
ADDED
@@ -0,0 +1,370 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mongify
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 23
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Andrew Kalek
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-01-15 00:00:00 -05:00
|
19
|
+
default_executable: mongify
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: activerecord
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 23
|
30
|
+
segments:
|
31
|
+
- 2
|
32
|
+
- 3
|
33
|
+
- 10
|
34
|
+
version: 2.3.10
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: activesupport
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 23
|
46
|
+
segments:
|
47
|
+
- 2
|
48
|
+
- 3
|
49
|
+
- 10
|
50
|
+
version: 2.3.10
|
51
|
+
type: :runtime
|
52
|
+
version_requirements: *id002
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: mongo
|
55
|
+
prerelease: false
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
hash: 25
|
62
|
+
segments:
|
63
|
+
- 1
|
64
|
+
- 1
|
65
|
+
- 5
|
66
|
+
version: 1.1.5
|
67
|
+
type: :runtime
|
68
|
+
version_requirements: *id003
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: bson_ext
|
71
|
+
prerelease: false
|
72
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
hash: 25
|
78
|
+
segments:
|
79
|
+
- 1
|
80
|
+
- 1
|
81
|
+
- 5
|
82
|
+
version: 1.1.5
|
83
|
+
type: :runtime
|
84
|
+
version_requirements: *id004
|
85
|
+
- !ruby/object:Gem::Dependency
|
86
|
+
name: net-ssh
|
87
|
+
prerelease: false
|
88
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
hash: 3
|
94
|
+
segments:
|
95
|
+
- 2
|
96
|
+
- 0
|
97
|
+
version: "2.0"
|
98
|
+
type: :runtime
|
99
|
+
version_requirements: *id005
|
100
|
+
- !ruby/object:Gem::Dependency
|
101
|
+
name: rspec
|
102
|
+
prerelease: false
|
103
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
104
|
+
none: false
|
105
|
+
requirements:
|
106
|
+
- - ">="
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
hash: 3
|
109
|
+
segments:
|
110
|
+
- 2
|
111
|
+
- 0
|
112
|
+
version: "2.0"
|
113
|
+
type: :development
|
114
|
+
version_requirements: *id006
|
115
|
+
- !ruby/object:Gem::Dependency
|
116
|
+
name: rcov
|
117
|
+
prerelease: false
|
118
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
119
|
+
none: false
|
120
|
+
requirements:
|
121
|
+
- - ">="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
hash: 41
|
124
|
+
segments:
|
125
|
+
- 0
|
126
|
+
- 9
|
127
|
+
- 9
|
128
|
+
version: 0.9.9
|
129
|
+
type: :development
|
130
|
+
version_requirements: *id007
|
131
|
+
- !ruby/object:Gem::Dependency
|
132
|
+
name: cucumber
|
133
|
+
prerelease: false
|
134
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
135
|
+
none: false
|
136
|
+
requirements:
|
137
|
+
- - ">="
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
hash: 31
|
140
|
+
segments:
|
141
|
+
- 0
|
142
|
+
- 10
|
143
|
+
version: "0.10"
|
144
|
+
type: :development
|
145
|
+
version_requirements: *id008
|
146
|
+
- !ruby/object:Gem::Dependency
|
147
|
+
name: mocha
|
148
|
+
prerelease: false
|
149
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
150
|
+
none: false
|
151
|
+
requirements:
|
152
|
+
- - ">="
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
hash: 43
|
155
|
+
segments:
|
156
|
+
- 0
|
157
|
+
- 9
|
158
|
+
- 8
|
159
|
+
version: 0.9.8
|
160
|
+
type: :development
|
161
|
+
version_requirements: *id009
|
162
|
+
- !ruby/object:Gem::Dependency
|
163
|
+
name: yard
|
164
|
+
prerelease: false
|
165
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
166
|
+
none: false
|
167
|
+
requirements:
|
168
|
+
- - ">="
|
169
|
+
- !ruby/object:Gem::Version
|
170
|
+
hash: 13
|
171
|
+
segments:
|
172
|
+
- 0
|
173
|
+
- 5
|
174
|
+
- 3
|
175
|
+
version: 0.5.3
|
176
|
+
type: :development
|
177
|
+
version_requirements: *id010
|
178
|
+
- !ruby/object:Gem::Dependency
|
179
|
+
name: watchr
|
180
|
+
prerelease: false
|
181
|
+
requirement: &id011 !ruby/object:Gem::Requirement
|
182
|
+
none: false
|
183
|
+
requirements:
|
184
|
+
- - ">="
|
185
|
+
- !ruby/object:Gem::Version
|
186
|
+
hash: 7
|
187
|
+
segments:
|
188
|
+
- 0
|
189
|
+
- 6
|
190
|
+
version: "0.6"
|
191
|
+
type: :development
|
192
|
+
version_requirements: *id011
|
193
|
+
- !ruby/object:Gem::Dependency
|
194
|
+
name: sqlite3-ruby
|
195
|
+
prerelease: false
|
196
|
+
requirement: &id012 !ruby/object:Gem::Requirement
|
197
|
+
none: false
|
198
|
+
requirements:
|
199
|
+
- - ">="
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
hash: 9
|
202
|
+
segments:
|
203
|
+
- 1
|
204
|
+
- 3
|
205
|
+
version: "1.3"
|
206
|
+
type: :development
|
207
|
+
version_requirements: *id012
|
208
|
+
- !ruby/object:Gem::Dependency
|
209
|
+
name: mysql
|
210
|
+
prerelease: false
|
211
|
+
requirement: &id013 !ruby/object:Gem::Requirement
|
212
|
+
none: false
|
213
|
+
requirements:
|
214
|
+
- - ">="
|
215
|
+
- !ruby/object:Gem::Version
|
216
|
+
hash: 45
|
217
|
+
segments:
|
218
|
+
- 2
|
219
|
+
- 8
|
220
|
+
- 1
|
221
|
+
version: 2.8.1
|
222
|
+
type: :development
|
223
|
+
version_requirements: *id013
|
224
|
+
description: Mongify allows you to map your data from a sql database and into a mongodb document database.
|
225
|
+
email:
|
226
|
+
- andrew.kalek@anlek.com
|
227
|
+
executables:
|
228
|
+
- mongify
|
229
|
+
extensions: []
|
230
|
+
|
231
|
+
extra_rdoc_files:
|
232
|
+
- CHANGELOG.rdoc
|
233
|
+
- README.rdoc
|
234
|
+
files:
|
235
|
+
- .gitignore
|
236
|
+
- CHANGELOG.rdoc
|
237
|
+
- Gemfile
|
238
|
+
- Gemfile.lock
|
239
|
+
- LICENSE
|
240
|
+
- README.rdoc
|
241
|
+
- Rakefile
|
242
|
+
- bin/mongify
|
243
|
+
- features/options.feature
|
244
|
+
- features/print.feature
|
245
|
+
- features/process.feature
|
246
|
+
- features/step_definitions/mongify_steps.rb
|
247
|
+
- features/step_definitions/mongo_steps.rb
|
248
|
+
- features/support/env.rb
|
249
|
+
- lib/mongify.rb
|
250
|
+
- lib/mongify/cli.rb
|
251
|
+
- lib/mongify/cli/application.rb
|
252
|
+
- lib/mongify/cli/help_command.rb
|
253
|
+
- lib/mongify/cli/options.rb
|
254
|
+
- lib/mongify/cli/report.rb
|
255
|
+
- lib/mongify/cli/version_command.rb
|
256
|
+
- lib/mongify/cli/worker_command.rb
|
257
|
+
- lib/mongify/configuration.rb
|
258
|
+
- lib/mongify/database.rb
|
259
|
+
- lib/mongify/database/base_connection.rb
|
260
|
+
- lib/mongify/database/column.rb
|
261
|
+
- lib/mongify/database/no_sql_connection.rb
|
262
|
+
- lib/mongify/database/sql_connection.rb
|
263
|
+
- lib/mongify/database/table.rb
|
264
|
+
- lib/mongify/exceptions.rb
|
265
|
+
- lib/mongify/translation.rb
|
266
|
+
- lib/mongify/translation/printer.rb
|
267
|
+
- lib/mongify/translation/process.rb
|
268
|
+
- lib/mongify/ui.rb
|
269
|
+
- lib/mongify/version.rb
|
270
|
+
- mongify.gemspec
|
271
|
+
- spec/default.watch
|
272
|
+
- spec/files/base_configuration.rb
|
273
|
+
- spec/files/empty_translation.rb
|
274
|
+
- spec/files/simple_translation.rb
|
275
|
+
- spec/mongify/cli/application_spec.rb
|
276
|
+
- spec/mongify/cli/help_command_spec.rb
|
277
|
+
- spec/mongify/cli/options_spec.rb
|
278
|
+
- spec/mongify/cli/version_command_spec.rb
|
279
|
+
- spec/mongify/cli/worker_command_spec.rb
|
280
|
+
- spec/mongify/configuration_spec.rb
|
281
|
+
- spec/mongify/database/base_connection_spec.rb
|
282
|
+
- spec/mongify/database/column_spec.rb
|
283
|
+
- spec/mongify/database/no_sql_connection_spec.rb
|
284
|
+
- spec/mongify/database/sql_connection_spec.rb
|
285
|
+
- spec/mongify/database/table_spec.rb
|
286
|
+
- spec/mongify/translation/printer_spec.rb
|
287
|
+
- spec/mongify/translation/process_spec.rb
|
288
|
+
- spec/mongify/translation_spec.rb
|
289
|
+
- spec/mongify/ui_spec.rb
|
290
|
+
- spec/mongify_spec.rb
|
291
|
+
- spec/spec.opts
|
292
|
+
- spec/spec_helper.rb
|
293
|
+
- spec/support/config_reader.rb
|
294
|
+
- spec/support/database.example
|
295
|
+
- spec/support/database_output.txt
|
296
|
+
- spec/support/generate_database.rb
|
297
|
+
- spec/tmp/.gitignore
|
298
|
+
has_rdoc: true
|
299
|
+
homepage: http://github.com/anlek/mongify
|
300
|
+
licenses: []
|
301
|
+
|
302
|
+
post_install_message:
|
303
|
+
rdoc_options:
|
304
|
+
- --title
|
305
|
+
- Mongify -- SQL db to Mongo db converter
|
306
|
+
- --main
|
307
|
+
- README
|
308
|
+
- --line-numbers
|
309
|
+
- --inline-source
|
310
|
+
require_paths:
|
311
|
+
- lib
|
312
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
313
|
+
none: false
|
314
|
+
requirements:
|
315
|
+
- - ">="
|
316
|
+
- !ruby/object:Gem::Version
|
317
|
+
hash: 3
|
318
|
+
segments:
|
319
|
+
- 0
|
320
|
+
version: "0"
|
321
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
322
|
+
none: false
|
323
|
+
requirements:
|
324
|
+
- - ">="
|
325
|
+
- !ruby/object:Gem::Version
|
326
|
+
hash: 3
|
327
|
+
segments:
|
328
|
+
- 0
|
329
|
+
version: "0"
|
330
|
+
requirements: []
|
331
|
+
|
332
|
+
rubyforge_project:
|
333
|
+
rubygems_version: 1.4.1
|
334
|
+
signing_key:
|
335
|
+
specification_version: 3
|
336
|
+
summary: Translate your SQL data to MongoDB
|
337
|
+
test_files:
|
338
|
+
- features/options.feature
|
339
|
+
- features/print.feature
|
340
|
+
- features/process.feature
|
341
|
+
- features/step_definitions/mongify_steps.rb
|
342
|
+
- features/step_definitions/mongo_steps.rb
|
343
|
+
- features/support/env.rb
|
344
|
+
- spec/default.watch
|
345
|
+
- spec/files/base_configuration.rb
|
346
|
+
- spec/files/empty_translation.rb
|
347
|
+
- spec/files/simple_translation.rb
|
348
|
+
- spec/mongify/cli/application_spec.rb
|
349
|
+
- spec/mongify/cli/help_command_spec.rb
|
350
|
+
- spec/mongify/cli/options_spec.rb
|
351
|
+
- spec/mongify/cli/version_command_spec.rb
|
352
|
+
- spec/mongify/cli/worker_command_spec.rb
|
353
|
+
- spec/mongify/configuration_spec.rb
|
354
|
+
- spec/mongify/database/base_connection_spec.rb
|
355
|
+
- spec/mongify/database/column_spec.rb
|
356
|
+
- spec/mongify/database/no_sql_connection_spec.rb
|
357
|
+
- spec/mongify/database/sql_connection_spec.rb
|
358
|
+
- spec/mongify/database/table_spec.rb
|
359
|
+
- spec/mongify/translation/printer_spec.rb
|
360
|
+
- spec/mongify/translation/process_spec.rb
|
361
|
+
- spec/mongify/translation_spec.rb
|
362
|
+
- spec/mongify/ui_spec.rb
|
363
|
+
- spec/mongify_spec.rb
|
364
|
+
- spec/spec.opts
|
365
|
+
- spec/spec_helper.rb
|
366
|
+
- spec/support/config_reader.rb
|
367
|
+
- spec/support/database.example
|
368
|
+
- spec/support/database_output.txt
|
369
|
+
- spec/support/generate_database.rb
|
370
|
+
- spec/tmp/.gitignore
|