migr8 0.4.0 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -287,6 +287,16 @@ TODO
287
287
  Changes
288
288
  -------
289
289
 
290
+ ### Release 0.4.2 (2014-02-05) ###
291
+
292
+ * [bugfix] re-packaging gem file
293
+
294
+
295
+ ### Release 0.4.1 (2014-02-05) ###
296
+
297
+ * [bugfix] Fix to allow migration file which contains no vars.
298
+
299
+
290
300
  ### Release 0.4.0 (2013-11-28) ###
291
301
 
292
302
  * [enhance] RubyGems package available.
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  project = "migr8"
4
- release = ENV['RELEASE'] || "0.4.0"
4
+ release = ENV['RELEASE'] || "0.4.2"
5
5
  copyright = "copyright(c) 2013 kuwata-lab.com all rights reserved"
6
6
  license = "MIT License"
7
7
 
data/bin/migr8.rb CHANGED
@@ -1,7 +1,8 @@
1
+ #!/usr/bin/env ruby
1
2
  # -*- coding: utf-8 -*-
2
3
 
3
4
  ###
4
- ### $Release: 0.4.0 $
5
+ ### $Release: 0.4.2 $
5
6
  ### $Copyright: copyright(c) 2013 kuwata-lab.com all rights reserved $
6
7
  ### $License: MIT License $
7
8
  ###
data/lib/migr8.rb CHANGED
@@ -4,7 +4,7 @@
4
4
  ###
5
5
  ### migr8.py -- DB schema version management tool
6
6
  ###
7
- ### $Release: 0.4.0 $
7
+ ### $Release: 0.4.2 $
8
8
  ### $Copyright: copyright(c) 2013 kuwata-lab.com all rights reserved $
9
9
  ### $License: MIT License $
10
10
  ###
@@ -16,7 +16,7 @@ require 'etc'
16
16
 
17
17
  module Migr8
18
18
 
19
- RELEASE = "$Release: 0.4.0 $".split()[1]
19
+ RELEASE = "$Release: 0.4.2 $".split()[1]
20
20
 
21
21
  DEBUG = false
22
22
 
@@ -2167,7 +2167,7 @@ END
2167
2167
  d.each do |k, v|
2168
2168
  dict[k] = expand_value(v, dict)
2169
2169
  end
2170
- end
2170
+ end if vars
2171
2171
  return dict
2172
2172
  end
2173
2173
 
@@ -2566,6 +2566,16 @@ TODO
2566
2566
  Changes
2567
2567
  -------
2568
2568
 
2569
+ ### Release 0.4.2 (2014-02-05) ###
2570
+
2571
+ * [bugfix] re-packaging gem file
2572
+
2573
+
2574
+ ### Release 0.4.1 (2014-02-05) ###
2575
+
2576
+ * [bugfix] Fix to allow migration file which contains no vars.
2577
+
2578
+
2569
2579
  ### Release 0.4.0 (2013-11-28) ###
2570
2580
 
2571
2581
  * [enhance] RubyGems package available.
data/migr8.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/ruby
2
2
 
3
3
  ###
4
- ### $Release: 0.4.0 $
4
+ ### $Release: 0.4.2 $
5
5
  ### $License: MIT License $
6
6
  ### $Copyright: copyright(c) 2013 kuwata-lab.com all rights reserved $
7
7
  ###
@@ -14,7 +14,7 @@ spec = Gem::Specification.new do |s|
14
14
  s.author = "makoto kuwata"
15
15
  s.email = "kwa(at)kuwata-lab.com"
16
16
  s.rubyforge_project = 'migr8'
17
- s.version = "$Release: 0.4.0 $".split()[1]
17
+ s.version = "$Release: 0.4.2 $".split()[1]
18
18
  s.platform = Gem::Platform::RUBY
19
19
  s.homepage = "https://github.com/kwatch/migr8/tree/ruby-release"
20
20
  s.summary = "database schema version management tool"
data/test/Util_test.rb CHANGED
@@ -7,6 +7,49 @@ require 'migr8'
7
7
  Oktest.scope do
8
8
 
9
9
 
10
+ topic Migr8::Util::Expander do
11
+
12
+
13
+ topic '.expand_vars()' do
14
+
15
+ spec "returns Hash object, even when arg is nil." do
16
+ ok {Migr8::Util::Expander.expand_vars([{}])} == {}
17
+ ok {Migr8::Util::Expander.expand_vars([{'x'=>123}])} == {'x'=>123}
18
+ ok {Migr8::Util::Expander.expand_vars([])} == {}
19
+ ok {Migr8::Util::Expander.expand_vars(nil)} == {}
20
+ end
21
+
22
+ spec "expands variables in Hash object." do
23
+ vars = [
24
+ {'table' => 'users'},
25
+ {'column' => 'name'},
26
+ {'index' => '${table}_${column}_idx'},
27
+ ]
28
+ expanded = {
29
+ 'table' => 'users',
30
+ 'column' => 'name',
31
+ 'index' => 'users_name_idx',
32
+ }
33
+ ok {Migr8::Util::Expander.expand_vars(vars)} == expanded
34
+ end
35
+
36
+ spec "raises error when unknown variable name exists." do
37
+ vars = [
38
+ {'table' => 'users'},
39
+ #{'column' => 'name'},
40
+ {'index' => '${table}_${column}_idx'},
41
+ ]
42
+ expected = Migr8::Util::Expander::UnknownVariableError
43
+ pr = proc { Migr8::Util::Expander.expand_vars(vars) }
44
+ ok {pr}.raise?(expected, '${column}: no such variable.')
45
+ end
46
+
47
+ end
48
+
49
+
50
+ end
51
+
52
+
10
53
  topic Migr8::Util::CommandOptionDefinition do
11
54
 
12
55
  klass = Migr8::Util::CommandOptionDefinition
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: migr8
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-28 00:00:00.000000000 Z
12
+ date: 2014-02-05 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: ! 'Migr8.rb is a database schema version management tool.
15
15