rutema_elements 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,5 @@
1
+ === 0.1.4 / 2008-12-05
2
+ * vsdbcmd: connection string was not specified on the command line
1
3
  === 0.1.3 / 2008-12-04
2
4
  * vsdbcmd added to SQLServer module (uses the new VS Database GDR tool)
3
5
  * refactored code that handles sqlcmd and mstest
@@ -5,6 +5,7 @@ Rakefile
5
5
  lib/rutema/elements/win32.rb
6
6
  lib/rutema/elements/general.rb
7
7
  test/test_sqlcmd.rb
8
+ test/test_vsdbcmd.rb
8
9
  test/test_get_url.rb
9
10
  test/test_standard.rb
10
11
  test/data/sample.sql
data/README.txt CHANGED
@@ -30,7 +30,7 @@ Check the RDocs for information on how to configure plus examples of usage for e
30
30
  == LICENSE:
31
31
  (The Ruby License)
32
32
 
33
- rutema_elements is copyright (c) 2008 Vassilis Rizopoulos
33
+ rutema_elements is copyright (c) 2008 - 2009 Vassilis Rizopoulos
34
34
 
35
35
  You can redistribute it and/or modify it under either the terms of the GPL
36
36
  (see COPYING.txt file), or the conditions below:
data/Rakefile CHANGED
@@ -5,7 +5,8 @@ require 'rutema/elements/general'
5
5
  require 'rubygems'
6
6
  require 'hoe'
7
7
 
8
- Hoe.new('rutema_elements', "#{Rutema::Elements::Version::STRING}") do |p|
8
+ Hoe.spec('rutema_elements') do |p|
9
+ p.version=Rutema::Elements::Version::STRING
9
10
  p.rubyforge_name = 'patir'
10
11
  p.author = "Vassilis Rizopoulos"
11
12
  p.email = "riva@braveworld.net"
@@ -9,7 +9,7 @@ module Rutema
9
9
  module Version
10
10
  MAJOR=0
11
11
  MINOR=1
12
- TINY=3
12
+ TINY=4
13
13
  STRING=[ MAJOR, MINOR, TINY ].join( "." )
14
14
  end
15
15
  module Web
@@ -91,13 +91,22 @@ module Rutema
91
91
  cfg[:dsp]||="sql"
92
92
  root_path=script_root_path(cfg,step)
93
93
  cfg[:dbschema]=adjust_with_root_path(step.dbschema,root_path,step)
94
+ #check the manifest and handle also the value from a possible attribute.
95
+ #if both are missing than it's an error
94
96
  manifest=cfg[:manifest]
95
97
  manifest=step.manifest if step.has_manifest?
96
- raise Rutema::ParserError,"No manifest file defined for #{step.step_type}" unless manifest
98
+ raise Rutema::ParserError,"No manifest file defined for #{step.step_type} (wether in the configuration or as an attribute)" unless manifest
97
99
  cfg[:manifest]=adjust_with_root_path(manifest,root_path,step)
100
+ #do the same for connection string
101
+ connection_string=cfg[:cs]
102
+ connection_string=step.connection_string if step.has_connection_string?
103
+ raise Rutema::ParserError,"No connection string defined for #{step.step_type} (wether in the configuration or as an attribute)" unless connection_string
104
+ cfg[:cs]=connection_string
105
+ #optional overrides
98
106
  if step.has_overrides?
99
107
  cfg[:overrides]=step.overrides
100
108
  end
109
+ #assign the command
101
110
  step.cmd=vsdbcmd_command(cfg)
102
111
  return step
103
112
  end
@@ -140,7 +149,7 @@ module Rutema
140
149
  path_to_util=File.expand_path(cfg[:path])
141
150
  dbschema=File.expand_path(cfg[:dbschema]).gsub("/","\\\\")
142
151
  manifest=File.expand_path(cfg[:manifest]).gsub("/","\\\\")
143
- cmdline="#{path_to_util} /a:Deploy /dsp:#{cfg[:dsp]} /dd /model:\"#{dbschema}\" /manifest:\"#{manifest}\" #{cfg[:overrides]}"
152
+ cmdline="#{path_to_util} /a:Deploy /dsp:#{cfg[:dsp]} /dd /model:\"#{dbschema}\" /manifest:\"#{manifest}\" /cs:\"#{cfg[:cs]}\" #{cfg[:overrides]}"
144
153
  @logger.debug("Parsed vsdbcmd call as '#{cmdline}'")
145
154
  #make sure the script executes at the specification directory.
146
155
  return Patir::ShellCommand.new(:cmd=>cmdline)
@@ -2,6 +2,7 @@ $:.unshift File.join(File.dirname(__FILE__),"..","lib")
2
2
  require 'test/unit'
3
3
  require 'rutema/elements/win32'
4
4
  require 'rubygems'
5
+ require 'patir/base'
5
6
  require 'mocha'
6
7
 
7
8
  class TestSqlcmd <Test::Unit::TestCase
@@ -23,8 +24,10 @@ class TestSqlcmd <Test::Unit::TestCase
23
24
  assert_raise(Rutema::ParserError) { element_vsdbcmd(step) }
24
25
  end
25
26
  def test_normal_flow
27
+ @logger=Patir.setup_logger
28
+ cfg={:configuration=>{:path=>File.join(File.dirname(__FILE__),"data/sample.dbschema"),:cs=>"connection"}}
26
29
  cmd_conf=mock()
27
- cmd_conf.expects(:vsdbcmd).returns(:configuration=>{:path=>"data/sample.dbschema"}).times(3)
30
+ cmd_conf.expects(:vsdbcmd).returns(cfg).times(3)
28
31
  @configuration=mock()
29
32
  @configuration.expects(:tools).returns(cmd_conf).times(3)
30
33
  step=mock_simple_step
@@ -33,13 +36,13 @@ class TestSqlcmd <Test::Unit::TestCase
33
36
  private
34
37
  def mock_simple_step
35
38
  step=mock()
36
- step.expects(:has_script?).returns(true)
37
39
  step.expects(:has_script_root?).returns(false)
38
40
  step.expects(:has_dbschema?).returns(true)
39
41
  step.expects(:dbschema).returns(File.join(File.dirname(__FILE__),"data","sample.dbschema"))
40
42
  step.expects(:has_manifest?).returns(true)
41
- step.expects(:manifest).returns(File.join("data","sample.dbschema"))
43
+ step.expects(:manifest).returns(File.join(File.dirname(__FILE__),"data","sample.dbschema"))
42
44
  step.expects(:has_overrides?).returns(false)
45
+ step.expects(:has_connection_string?).returns(false)
43
46
  step.expects(:cmd=)
44
47
  return step
45
48
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rutema_elements
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vassilis Rizopoulos
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-12-03 00:00:00 +01:00
12
+ date: 2009-07-16 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -40,9 +40,24 @@ dependencies:
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: 1.8.2
43
+ version: 2.3.2
44
44
  version:
45
- description: "== DESCRIPTION: Rutema Elements modules are the easiest way to add functionality to rutema parsers. Just derive your parser from the basic rutema parser and include the module of your choice class MyParser < Rutema::MinimalXMLParser include Rutema::Elements::IIS include Rutema::Elements::Standard end and voila! your parser now understands how to reset IIS, wait and fail! == FEATURES/PROBLEMS: Easy addition of extra functionality for rutema IIS, MSTest and SQLServer modules are windows specific as they use the MS commandline tools"
45
+ description: |-
46
+ == DESCRIPTION:
47
+ Rutema Elements modules are the easiest way to add functionality to rutema parsers.
48
+ Just derive your parser from the basic rutema parser and include the module of your choice
49
+
50
+ class MyParser < Rutema::MinimalXMLParser
51
+ include Rutema::Elements::IIS
52
+ include Rutema::Elements::Standard
53
+ end
54
+
55
+ and voila! your parser now understands how to reset IIS, wait and fail!
56
+
57
+ == FEATURES/PROBLEMS:
58
+ Easy addition of extra functionality for rutema
59
+
60
+ IIS, MSTest and SQLServer modules are windows specific as they use the MS commandline tools
46
61
  email: riva@braveworld.net
47
62
  executables: []
48
63
 
@@ -60,11 +75,14 @@ files:
60
75
  - lib/rutema/elements/win32.rb
61
76
  - lib/rutema/elements/general.rb
62
77
  - test/test_sqlcmd.rb
78
+ - test/test_vsdbcmd.rb
63
79
  - test/test_get_url.rb
64
80
  - test/test_standard.rb
65
81
  - test/data/sample.sql
66
82
  has_rdoc: true
67
83
  homepage:
84
+ licenses: []
85
+
68
86
  post_install_message:
69
87
  rdoc_options:
70
88
  - --main
@@ -86,13 +104,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
104
  requirements: []
87
105
 
88
106
  rubyforge_project: patir
89
- rubygems_version: 1.3.1
107
+ rubygems_version: 1.3.4
90
108
  signing_key:
91
- specification_version: 2
109
+ specification_version: 3
92
110
  summary: rutema elements provides modules that can be used with custom parsers to add elements to rutema specifications
93
111
  test_files:
94
112
  - test/test_get_url.rb
95
- - test/test_selenium.rb
96
113
  - test/test_sqlcmd.rb
97
114
  - test/test_standard.rb
98
115
  - test/test_vsdbcmd.rb
File without changes