Class: Albacore::Sql::Config

Inherits:
Object
  • Object
show all
Extended by:
ConfigDSL
Includes:
CmdConfig, Logging
Defined in:
lib/albacore/task_types/sql_cmd.rb

Overview

The configuration class for SqlCmd. MSDN docs at: msdn.microsoft.com/en-us/library/ms162773.aspx

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ConfigDSL

attr_path, attr_path_accessor

Methods included from Logging

#debug, #err, #error, #fatal, #info, #puts, #trace, #warn

Methods included from CmdConfig

#add_parameter, #parameters

Constructor Details

#initializeConfig

Returns a new instance of Config.



45
46
47
48
49
50
51
52
53
54
# File 'lib/albacore/task_types/sql_cmd.rb', line 45

def initialize
  @parameters = Set.new

  w = lambda { |e| CrossPlatformCmd.which(e) ? e : nil }

  @exe = w.call( "SqlCmd" ) 

  debug { "SqlCmd using '#{@exe}'" }

end

Instance Attribute Details

#database=(value) ⇒ Object (writeonly)

this is the database for SqlCmd



34
35
36
# File 'lib/albacore/task_types/sql_cmd.rb', line 34

def database=(value)
  @database = value
end

#password=(value) ⇒ Object (writeonly)

this is the password for SqlCmd



40
41
42
# File 'lib/albacore/task_types/sql_cmd.rb', line 40

def password=(value)
  @password = value
end

#scripts=(value) ⇒ Object (writeonly)

this is the scripts for SqlCmd



43
44
45
# File 'lib/albacore/task_types/sql_cmd.rb', line 43

def scripts=(value)
  @scripts = value
end

#server=(value) ⇒ Object (writeonly)

this is the server for SqlCmd



31
32
33
# File 'lib/albacore/task_types/sql_cmd.rb', line 31

def server=(value)
  @server = value
end

#username=(value) ⇒ Object (writeonly)

this is the username for SqlCmd



37
38
39
# File 'lib/albacore/task_types/sql_cmd.rb', line 37

def username=(value)
  @username = value
end

Instance Method Details

#optsObject

gets the options specified for the task, used from the task



79
80
81
82
83
84
85
86
87
# File 'lib/albacore/task_types/sql_cmd.rb', line 79

def opts

  Map.new({
    :exe      => @exe,
    :parameters => @parameters,
    :scripts  => @scripts,
    :original_path => FileUtils.pwd
  })
end

#trusted_connectionObject



56
57
58
# File 'lib/albacore/task_types/sql_cmd.rb', line 56

def trusted_connection
  @parameters.add('-E')
end