rake-confirm 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/lib/rake/confirm.rb +4 -8
- data/lib/rake/confirm/railtie.rb +9 -0
- data/lib/rake/confirm/tasks/confirm.rake +0 -4
- data/lib/rake/confirm/tasks/rails/confirm.rake +3 -0
- data/lib/rake/confirm/version.rb +1 -1
- data/spec/rake_confirm_spec.rb +1 -8
- metadata +13 -11
data/Gemfile
CHANGED
data/lib/rake/confirm.rb
CHANGED
@@ -1,11 +1,7 @@
|
|
1
1
|
require 'rake/confirm/version'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
load "rake/confirm/tasks/confirm.rake"
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
3
|
+
load 'rake/confirm/tasks/confirm.rake'
|
4
|
+
|
5
|
+
if defined?(::Rails::Railtie)
|
6
|
+
require 'rake/confirm/railtie'
|
11
7
|
end
|
@@ -5,10 +5,6 @@ task :confirm do
|
|
5
5
|
abort if ask.downcase != Rails.root.basename.to_s
|
6
6
|
end
|
7
7
|
|
8
|
-
%w(db:drop db:fixtures:load db:rollback db:migrate db:schema:load db:seed db:setup).each do |name|
|
9
|
-
Rake::Task[name].enhance([:confirm])
|
10
|
-
end
|
11
|
-
|
12
8
|
# https://github.com/heroku/heroku/blob/master/lib/heroku/helpers.rb
|
13
9
|
def ask
|
14
10
|
$stdin.gets.to_s.strip
|
data/lib/rake/confirm/version.rb
CHANGED
data/spec/rake_confirm_spec.rb
CHANGED
@@ -10,13 +10,6 @@ describe "Rake::Confirm" do
|
|
10
10
|
let(:not_confirmed_tasks){ %w(db:create db:migrate:status db:schema:dump db:structure:dump db:version) }
|
11
11
|
|
12
12
|
before(:each) do
|
13
|
-
# stub for rake/confirm.rb
|
14
|
-
module Rails
|
15
|
-
class Railtie
|
16
|
-
::Rails::Railtie.stub!(:rake_tasks)
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
13
|
# # inject dummy tasks
|
21
14
|
confirmed_tasks.each do |t|
|
22
15
|
Rake::Task.define_task(t)
|
@@ -28,7 +21,7 @@ describe "Rake::Confirm" do
|
|
28
21
|
|
29
22
|
# delayed loading because 'task' is evaluated before stubbing
|
30
23
|
require 'rake-confirm'
|
31
|
-
load
|
24
|
+
load "rake/confirm/tasks/rails/confirm.rake"
|
32
25
|
end
|
33
26
|
|
34
27
|
@confirmed_tasks.each do |t|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rake-confirm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- SHIBATA Hiroshi
|
@@ -15,10 +15,10 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-08-21 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
|
-
|
21
|
+
name: rake
|
22
22
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
23
23
|
none: false
|
24
24
|
requirements:
|
@@ -28,11 +28,11 @@ dependencies:
|
|
28
28
|
segments:
|
29
29
|
- 0
|
30
30
|
version: "0"
|
31
|
-
requirement: *id001
|
32
|
-
name: rake
|
33
31
|
type: :runtime
|
34
|
-
|
32
|
+
requirement: *id001
|
35
33
|
prerelease: false
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: rspec
|
36
36
|
version_requirements: &id002 !ruby/object:Gem::Requirement
|
37
37
|
none: false
|
38
38
|
requirements:
|
@@ -42,9 +42,9 @@ dependencies:
|
|
42
42
|
segments:
|
43
43
|
- 0
|
44
44
|
version: "0"
|
45
|
-
requirement: *id002
|
46
|
-
name: rspec
|
47
45
|
type: :development
|
46
|
+
requirement: *id002
|
47
|
+
prerelease: false
|
48
48
|
description: Confirmation for destructive Rails task.
|
49
49
|
email:
|
50
50
|
- shibata.hiroshi@gmail.com
|
@@ -62,7 +62,9 @@ files:
|
|
62
62
|
- Rakefile
|
63
63
|
- lib/rake-confirm.rb
|
64
64
|
- lib/rake/confirm.rb
|
65
|
+
- lib/rake/confirm/railtie.rb
|
65
66
|
- lib/rake/confirm/tasks/confirm.rake
|
67
|
+
- lib/rake/confirm/tasks/rails/confirm.rake
|
66
68
|
- lib/rake/confirm/version.rb
|
67
69
|
- rake-confirm.gemspec
|
68
70
|
- spec/rake_confirm_spec.rb
|
@@ -95,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
97
|
requirements: []
|
96
98
|
|
97
99
|
rubyforge_project:
|
98
|
-
rubygems_version: 1.8.
|
100
|
+
rubygems_version: 1.8.24
|
99
101
|
signing_key:
|
100
102
|
specification_version: 3
|
101
103
|
summary: Confirmation for destructive Rails task.
|