pagoda 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/pagoda/helpers.rb +9 -9
- data/lib/pagoda/version.rb +1 -1
- metadata +2 -2
data/lib/pagoda/helpers.rb
CHANGED
@@ -19,9 +19,9 @@ module Pagoda
|
|
19
19
|
def display(msg="", newline=true, level=1)
|
20
20
|
indent = build_indent(level)
|
21
21
|
if newline
|
22
|
-
puts("#{indent}#{msg}".green)
|
22
|
+
(running_on_windows?) ? puts("#{indent}#{msg}") : puts("#{indent}#{msg}".green)
|
23
23
|
else
|
24
|
-
print("#{indent}#{msg}".green)
|
24
|
+
(running_on_windows?) ? print("#{indent}#{msg}") : print("#{indent}#{msg}".green)
|
25
25
|
STDOUT.flush
|
26
26
|
end
|
27
27
|
end
|
@@ -59,7 +59,7 @@ module Pagoda
|
|
59
59
|
gets.strip
|
60
60
|
end
|
61
61
|
|
62
|
-
def confirm(message="Are you sure you wish to continue? (y/n)?"
|
62
|
+
def confirm(message="Are you sure you wish to continue? (y/n)?", level=1)
|
63
63
|
return true if args.include? "-f"
|
64
64
|
case message
|
65
65
|
when Array
|
@@ -67,14 +67,14 @@ module Pagoda
|
|
67
67
|
iteration = 0
|
68
68
|
message.each do |m|
|
69
69
|
if iteration == count - 1
|
70
|
-
display("#{m} ".blue, false, level)
|
70
|
+
(running_on_windows?) ? display("#{m} ", false, level) : display("#{m} ".blue, false, level)
|
71
71
|
else
|
72
|
-
display("#{m} ".blue, true, level)
|
72
|
+
(running_on_windows?) ? display("#{m} ", false, level) : display("#{m} ".blue, true, level)
|
73
73
|
end
|
74
74
|
iteration += 1
|
75
75
|
end
|
76
76
|
when String
|
77
|
-
display("#{message} ".blue, false, level)
|
77
|
+
(running_on_windows?) ? display("#{message} ", false, level) : display("#{message} ".blue, false, level)
|
78
78
|
end
|
79
79
|
ask.downcase == 'y'
|
80
80
|
end
|
@@ -84,12 +84,12 @@ module Pagoda
|
|
84
84
|
STDERR.puts
|
85
85
|
case msg
|
86
86
|
when Array
|
87
|
-
STDERR.puts("#{indent}** Error:".red)
|
87
|
+
(running_on_windows?) ? STDERR.puts("#{indent}** Error:") : STDERR.puts("#{indent}** Error:".red)
|
88
88
|
msg.each do |m|
|
89
|
-
STDERR.puts("#{indent}** #{m}".red)
|
89
|
+
(running_on_windows?) ? STDERR.puts("#{indent}** #{m}") : STDERR.puts("#{indent}** #{m}".red)
|
90
90
|
end
|
91
91
|
when String
|
92
|
-
STDERR.puts("#{indent}** Error: #{
|
92
|
+
(running_on_windows?) ? STDERR.puts("#{indent}** Error:") : STDERR.puts("#{indent}** Error:".red)
|
93
93
|
end
|
94
94
|
STDERR.puts
|
95
95
|
exit 1 if exit
|
data/lib/pagoda/version.rb
CHANGED