duck_duck_duck 1.0.2 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/duck_duck_duck.gemspec +0 -1
- data/lib/duck_duck_duck.rb +3 -12
- data/specs/duck_duck_duck.rb +10 -31
- metadata +1 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d97565d2e47ab5dc5fea5da0d0841dc8cdf4b4e1
|
4
|
+
data.tar.gz: 653ad97e76ee7facecc8073b5ae562a5ae6ed4b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eaeb8d1dc2caf225db7791e676083dcf27362243df85d2f0c56b8e405dc4832b1dd5e6c8aec9e49bb9e6fcbaaf2f360172a49ed3f6c857f028cb89d600442be9
|
7
|
+
data.tar.gz: 3103362b255c6a292619f4418335fb2faf6b8cdeeee189a8a48926bb2f7dff9a1c15019a93574051c74976797a0c34d1d1de9660828d6a5106b36e34dd9aa4d8
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
2.0.0
|
data/duck_duck_duck.gemspec
CHANGED
@@ -23,7 +23,6 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.require_paths = ["lib"]
|
24
24
|
|
25
25
|
spec.add_development_dependency "pry" , "~> 0.9"
|
26
|
-
spec.add_development_dependency "rake" , "~> 10.3"
|
27
26
|
spec.add_development_dependency "bundler" , "~> 1.5"
|
28
27
|
spec.add_development_dependency "bacon" , "~> 1.2.0"
|
29
28
|
spec.add_development_dependency "Bacon_Colored" , "~> 0.1"
|
data/lib/duck_duck_duck.rb
CHANGED
@@ -29,21 +29,12 @@ class Duck_Duck_Duck
|
|
29
29
|
eval <<-EOF, nil, __FILE__, __LINE__ + 1
|
30
30
|
def #{meth} name = nil
|
31
31
|
migrate_schema
|
32
|
-
|
33
|
-
|
34
|
-
new(name).#{meth}
|
35
|
-
}
|
32
|
+
puts "=== #{meth}: \#{name}"
|
33
|
+
new(name).#{meth}
|
36
34
|
end
|
37
35
|
EOF
|
38
36
|
}
|
39
37
|
|
40
|
-
private # ======================================
|
41
|
-
|
42
|
-
def models
|
43
|
-
@models ||= Dir.glob("*/migrates").
|
44
|
-
map { |dir| File.basename File.dirname(dir) }
|
45
|
-
end
|
46
|
-
|
47
38
|
end # === class self ===
|
48
39
|
|
49
40
|
# ===============================================
|
@@ -55,7 +46,7 @@ class Duck_Duck_Duck
|
|
55
46
|
def initialize *args
|
56
47
|
@name, @action, @sub_action = args
|
57
48
|
if !@name
|
58
|
-
fail
|
49
|
+
fail ArgumentError, "Name required."
|
59
50
|
end
|
60
51
|
@files = Dir.glob("#{name}/migrates/*.sql")
|
61
52
|
end
|
data/specs/duck_duck_duck.rb
CHANGED
@@ -35,6 +35,16 @@ end
|
|
35
35
|
|
36
36
|
# === Specs ==================================================================
|
37
37
|
|
38
|
+
describe :initialize do
|
39
|
+
|
40
|
+
it "fails if no name is given" do
|
41
|
+
should.raise(ArgumentError) {
|
42
|
+
Duck_Duck_Duck.new
|
43
|
+
}.message.should.match /Name required/
|
44
|
+
end # === it fails if no name is given
|
45
|
+
|
46
|
+
end # === describe :initialize
|
47
|
+
|
38
48
|
describe "create" do
|
39
49
|
|
40
50
|
before {
|
@@ -115,36 +125,5 @@ describe 'down model' do
|
|
115
125
|
|
116
126
|
end # === describe down model
|
117
127
|
|
118
|
-
describe "up" do
|
119
|
-
|
120
|
-
before { reset }
|
121
|
-
|
122
|
-
it "migrates all models" do
|
123
|
-
Exit_0("duck_duck_duck up")
|
124
|
-
get("SELECT * FROM #{schema.inspect} ORDER BY name").
|
125
|
-
should == [
|
126
|
-
{:name=>'0010_model',:version=>50},
|
127
|
-
{:name=>'0020_model',:version=>30},
|
128
|
-
{:name=>'0030_model',:version=>30}
|
129
|
-
]
|
130
|
-
end
|
131
|
-
|
132
|
-
end # describe up
|
133
|
-
|
134
|
-
describe 'down' do
|
135
|
-
|
136
|
-
before { reset }
|
137
|
-
|
138
|
-
it "migrates down all models" do
|
139
|
-
Exit_0("duck_duck_duck up")
|
140
|
-
Exit_0("duck_duck_duck down")
|
141
|
-
get("SELECT * FROM #{schema.inspect} ORDER BY name").
|
142
|
-
should == [
|
143
|
-
{:name=>'0010_model',:version=>0},
|
144
|
-
{:name=>'0020_model',:version=>0},
|
145
|
-
{:name=>'0030_model',:version=>0}
|
146
|
-
]
|
147
|
-
end
|
148
128
|
|
149
|
-
end # === describe down
|
150
129
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: duck_duck_duck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- da99
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.9'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '10.3'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '10.3'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: bundler
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|