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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0f55dc1153ea4d74761fef740480a6e025f3e876
4
- data.tar.gz: 5c3ac6c25dcc32d903a39f5d081fb0ded24a7fd3
3
+ metadata.gz: d97565d2e47ab5dc5fea5da0d0841dc8cdf4b4e1
4
+ data.tar.gz: 653ad97e76ee7facecc8073b5ae562a5ae6ed4b2
5
5
  SHA512:
6
- metadata.gz: 1f78c7dde7508ba91f22c8e50cdc44cb4fa78ef8888698cde2a2f87eff56fa2ad2f95a33d8a46965a46ce433bda9cbfc624ba4484eee45e6459a28c6eb206be0
7
- data.tar.gz: 3957b20c533ebaab7112d6ca0f9044a82b5434f5afcf65ef57393103eef633112c8335667aab1266edd367af07564bfe4e8363813d17509e4e170ad2dc32166b
6
+ metadata.gz: eaeb8d1dc2caf225db7791e676083dcf27362243df85d2f0c56b8e405dc4832b1dd5e6c8aec9e49bb9e6fcbaaf2f360172a49ed3f6c857f028cb89d600442be9
7
+ data.tar.gz: 3103362b255c6a292619f4418335fb2faf6b8cdeeee189a8a48926bb2f7dff9a1c15019a93574051c74976797a0c34d1d1de9660828d6a5106b36e34dd9aa4d8
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.2
1
+ 2.0.0
@@ -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"
@@ -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
- names = name ? [name] : models
33
- names.each { |name|
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 ArguementError, "Name required."
49
+ fail ArgumentError, "Name required."
59
50
  end
60
51
  @files = Dir.glob("#{name}/migrates/*.sql")
61
52
  end
@@ -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: 1.0.2
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