power-rake 0.0.11 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/power-rake.rb +1 -27
- data/lib/power-rake/common.rb +28 -0
- data/lib/power-rake/version.rb +2 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a179240bd33cf8ecdfb30940b79dcc7d6ae576d
|
4
|
+
data.tar.gz: f99aca840d3c25c7c9e580594ca41a246b40606d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2cdc9c971cb92e21ab345f74d5717d55eb4034a96643ec933789223ace79f3fea7f89f1ad2557a19023ecf078054c9723f53b54abb4905e14f84674b61065147
|
7
|
+
data.tar.gz: 4ddca1cd225156c6d335c0e8b391f413f391eb66e270b2068065af3eff6171817379ebdf85d793827150f03f70fd4ab7aa9f9d854fd6bed6f2ddbb6aa27d28b6
|
data/lib/power-rake.rb
CHANGED
@@ -1,28 +1,2 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Prompt with control flow
|
4
|
-
# @param [String]
|
5
|
-
def continue?(message = 'Continue? (y|n)')
|
6
|
-
abort 'Aborted!' unless prompt(message).downcase == 'y'
|
7
|
-
end
|
8
|
-
|
9
|
-
# Inline message prompt
|
10
|
-
# @param [String]
|
11
|
-
def prompt(message)
|
12
|
-
print message
|
13
|
-
STDIN.gets.strip
|
14
|
-
end
|
15
|
-
|
16
|
-
# Try a system command
|
17
|
-
# @param [string]
|
18
|
-
def try(command)
|
19
|
-
system(command) || abort("Aborted! `#{command}`")
|
20
|
-
end
|
21
|
-
|
22
|
-
# Prompt before trying a system command
|
23
|
-
# @param [string]
|
24
|
-
def try?(command)
|
25
|
-
puts command
|
26
|
-
continue?
|
27
|
-
try(command)
|
28
|
-
end
|
2
|
+
Rake.application.add_import('lib/power-rake/common.rb')
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Prompt with control flow
|
4
|
+
# @param [String]
|
5
|
+
def continue?(message = 'Continue? (y|n)')
|
6
|
+
abort 'Aborted!' unless prompt(message).downcase == 'y'
|
7
|
+
end
|
8
|
+
|
9
|
+
# Inline message prompt
|
10
|
+
# @param [String]
|
11
|
+
def prompt(message)
|
12
|
+
print message
|
13
|
+
STDIN.gets.strip
|
14
|
+
end
|
15
|
+
|
16
|
+
# Try a system command
|
17
|
+
# @param [string]
|
18
|
+
def try(command)
|
19
|
+
system(command) || abort("Aborted! `#{command}`")
|
20
|
+
end
|
21
|
+
|
22
|
+
# Prompt before trying a system command
|
23
|
+
# @param [string]
|
24
|
+
def try?(command)
|
25
|
+
puts command
|
26
|
+
continue?
|
27
|
+
try(command)
|
28
|
+
end
|
data/lib/power-rake/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: power-rake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Tulino
|
@@ -31,6 +31,7 @@ extensions: []
|
|
31
31
|
extra_rdoc_files: []
|
32
32
|
files:
|
33
33
|
- lib/power-rake.rb
|
34
|
+
- lib/power-rake/common.rb
|
34
35
|
- lib/power-rake/version.rb
|
35
36
|
homepage: http://rubygems.org/gems/power-rake
|
36
37
|
licenses:
|