fluent-migrator-command-runner 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ require 'fluent-migrator-command-runner/runner'
2
+ require 'fig_newton'
3
+
4
+ module FluentMigratorCommandRunner
5
+
6
+
7
+ end
@@ -0,0 +1,21 @@
1
+
2
+ module FluentMigratorCommandRunner
3
+
4
+ class CommandBuilder
5
+
6
+ def self.build (configuration, task, profile = nil, tag=nil)
7
+ connection_string = build_connection_string(configuration[:connection_information])
8
+ command = "#{configuration[:path_to_migrator]} --conn \"#{connection_string}\" /provider oracle --assembly \"#{configuration[:path_to_migration_assembly]}\" /task #{task}"
9
+ command += " --tag #{tag}" if tag
10
+ command += " --profile=#{profile}" if profile
11
+ command
12
+ end
13
+
14
+ private
15
+
16
+ def self.build_connection_string(configuration)
17
+ "DATA SOURCE=#{configuration['database']};user id=#{configuration['username']};password=#{configuration['password']}"
18
+ end
19
+
20
+ end
21
+ end
@@ -0,0 +1,23 @@
1
+ require_relative 'command_builder'
2
+
3
+ module FluentMigratorCommandRunner
4
+ class Runner
5
+
6
+ def initialize(overrides = {})
7
+ defaults = {
8
+ :path_to_migrator => FigNewton.path_to_migrator_exe,
9
+ :path_to_migration_assembly => FigNewton.path_to_migration_assembly,
10
+ :connection_information => FigNewton.database.to_hash
11
+ }
12
+ @configuration = defaults.merge(overrides)
13
+ end
14
+
15
+ def migrate_database(profile = nil, tag = nil)
16
+ command = CommandBuilder.build(@configuration, 'migrate', profile, tag)
17
+ Kernel.system command
18
+ end
19
+
20
+ end
21
+ end
22
+
23
+
metadata ADDED
@@ -0,0 +1,65 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fluent-migrator-command-runner
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Mosaic
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-08-22 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: fig_newton
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ description: Build and Execute Fluent Migrator Commands
31
+ email: mosaic.development@sherwin.com
32
+ executables: []
33
+ extensions: []
34
+ extra_rdoc_files: []
35
+ files:
36
+ - lib/fluent-migrator-command-runner.rb
37
+ - lib/fluent-migrator-command-runner/runner.rb
38
+ - lib/fluent-migrator-command-runner/command_builder.rb
39
+ homepage: ''
40
+ licenses:
41
+ - MIT
42
+ post_install_message:
43
+ rdoc_options: []
44
+ require_paths:
45
+ - lib
46
+ required_ruby_version: !ruby/object:Gem::Requirement
47
+ none: false
48
+ requirements:
49
+ - - ! '>='
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ required_rubygems_version: !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ! '>='
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
58
+ requirements: []
59
+ rubyforge_project:
60
+ rubygems_version: 1.8.28
61
+ signing_key:
62
+ specification_version: 3
63
+ summary: ''
64
+ test_files: []
65
+ has_rdoc: