carlosbrando-autotest-notification 1.7.2 → 1.7.3
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/History.txt +11 -13
- data/License.txt +20 -0
- data/Manifest.txt +36 -19
- data/README.txt +138 -0
- data/Rakefile +3 -27
- data/autotest-notification.gemspec +49 -0
- data/bin/an-install +86 -5
- data/bin/an-uninstall +44 -4
- data/config/hoe.rb +75 -0
- data/config/requirements.rb +15 -0
- data/lib/autotest_notification.rb +2 -7
- data/lib/autotest_notification/buuf.rb +9 -0
- data/lib/autotest_notification/cygwin.rb +14 -0
- data/lib/autotest_notification/doom.rb +25 -0
- data/lib/autotest_notification/linux.rb +55 -0
- data/lib/autotest_notification/mac.rb +25 -0
- data/lib/autotest_notification/version.rb +9 -0
- data/lib/autotest_notification/windows.rb +11 -0
- data/script/console +2 -2
- data/script/txt2html +82 -0
- data/setup.rb +1585 -0
- data/tasks/deployment.rake +34 -0
- data/tasks/environment.rake +7 -0
- data/tasks/website.rake +17 -0
- data/test/test_autotest_notification.rb +44 -44
- data/website/index.html +86 -0
- data/website/index.txt +83 -0
- data/website/javascripts/rounded_corners_lite.inc.js +285 -0
- data/website/stylesheets/screen.css +138 -0
- data/website/template.html.erb +48 -0
- metadata +60 -34
- data/README.rdoc +0 -137
- data/lib/an_install/cli.rb +0 -79
- data/lib/an_uninstall/cli.rb +0 -46
- data/test/test_an-install_cli.rb +0 -19
- data/test/test_an-uninstall_cli.rb +0 -19
data/lib/an_install/cli.rb
DELETED
@@ -1,79 +0,0 @@
|
|
1
|
-
require 'optparse'
|
2
|
-
|
3
|
-
module AnInstall
|
4
|
-
class CLI
|
5
|
-
def self.execute(stdout, arguments=[])
|
6
|
-
|
7
|
-
# NOTE: the option -p/--path= is given as an example, and should be replaced in your application.
|
8
|
-
|
9
|
-
options = {
|
10
|
-
:path => '~',
|
11
|
-
:speaking => false,
|
12
|
-
:doom => false,
|
13
|
-
:sticky => false,
|
14
|
-
:pending => false,
|
15
|
-
:buuf => false
|
16
|
-
}
|
17
|
-
mandatory_options = %w( )
|
18
|
-
|
19
|
-
parser = OptionParser.new do |opts|
|
20
|
-
opts.banner = <<-BANNER.gsub(/^ /,'')
|
21
|
-
This application is wonderful because...
|
22
|
-
|
23
|
-
Usage: #{File.basename($0)} [options]
|
24
|
-
|
25
|
-
Options are:
|
26
|
-
BANNER
|
27
|
-
opts.separator ""
|
28
|
-
opts.on("-p", "--path=PATH", String,
|
29
|
-
"This is a sample message.",
|
30
|
-
"For multiple lines, add more strings.",
|
31
|
-
"Default: ~") { |arg| options[:path] = arg }
|
32
|
-
opts.on("-s", "--speaking",
|
33
|
-
"If a test failed, the computer will speak.",
|
34
|
-
"For all plataforms.") { options[:speaking] = true }
|
35
|
-
opts.on("-d", "--doom",
|
36
|
-
"Special Doom Edition.",
|
37
|
-
"Only for Mac.") { options[:doom] = true }
|
38
|
-
opts.on("-b", "--buuf",
|
39
|
-
"Special Buuf Images.",
|
40
|
-
"For all platforms") { options[:buuf] = true }
|
41
|
-
opts.on("--pending",
|
42
|
-
"Shows a different image when there are no errors/failures",
|
43
|
-
"but there are pending specs. Only for Mac.") { options[:pending] = true }
|
44
|
-
opts.on("--sticky",
|
45
|
-
"Keep notification on screen in case of errros/failures or pending specs.",
|
46
|
-
"Only for Mac.") { options[:sticky] = true }
|
47
|
-
opts.on("-h", "--help",
|
48
|
-
"Show this help message.") { stdout.puts opts; exit }
|
49
|
-
opts.parse!(arguments)
|
50
|
-
|
51
|
-
if mandatory_options && mandatory_options.find { |option| options[option.to_sym].nil? }
|
52
|
-
stdout.puts opts; exit
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
path = options[:path]
|
57
|
-
|
58
|
-
autotest_path = File.expand_path(path)
|
59
|
-
|
60
|
-
if File.exists?("#{autotest_path}/.autotest")
|
61
|
-
puts "\nYou Already have a .autotest file, renamed to .autotest.backup"
|
62
|
-
FileUtils.cp "#{autotest_path}/.autotest", "#{autotest_path}/.autotest.backup"
|
63
|
-
end
|
64
|
-
|
65
|
-
f = File.new("#{autotest_path}/.autotest", "w")
|
66
|
-
f.write "# ~.autotest\n"
|
67
|
-
f.write "require 'autotest_notification'\n"
|
68
|
-
f.write("SPEAKING = #{options[:speaking]}\n")
|
69
|
-
f.write("DOOM_EDITION = #{options[:doom]}\n")
|
70
|
-
f.write("BUUF = #{options[:buuf]}\n")
|
71
|
-
f.write("PENDING = #{options[:pending]}\n")
|
72
|
-
f.write("STICKY = #{options[:sticky]}\n")
|
73
|
-
f.close
|
74
|
-
|
75
|
-
puts "\nAs from now all tests will be notified automatically."
|
76
|
-
puts "" # a blank line
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
data/lib/an_uninstall/cli.rb
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
require 'optparse'
|
2
|
-
|
3
|
-
module AnUninstall
|
4
|
-
class CLI
|
5
|
-
def self.execute(stdout, arguments=[])
|
6
|
-
|
7
|
-
# NOTE: the option -p/--path= is given as an example, and should be replaced in your application.
|
8
|
-
|
9
|
-
options = {
|
10
|
-
:path => '~'
|
11
|
-
}
|
12
|
-
mandatory_options = %w( )
|
13
|
-
|
14
|
-
parser = OptionParser.new do |opts|
|
15
|
-
opts.banner = <<-BANNER.gsub(/^ /,'')
|
16
|
-
This application is wonderful because...
|
17
|
-
|
18
|
-
Usage: #{File.basename($0)} [options]
|
19
|
-
|
20
|
-
Options are:
|
21
|
-
BANNER
|
22
|
-
opts.separator ""
|
23
|
-
opts.on("-p", "--path=PATH", String,
|
24
|
-
"This is a sample message.",
|
25
|
-
"For multiple lines, add more strings.",
|
26
|
-
"Default: ~") { |arg| options[:path] = arg }
|
27
|
-
opts.on("-h", "--help",
|
28
|
-
"Show this help message.") { stdout.puts opts; exit }
|
29
|
-
opts.parse!(arguments)
|
30
|
-
|
31
|
-
if mandatory_options && mandatory_options.find { |option| options[option.to_sym].nil? }
|
32
|
-
stdout.puts opts; exit
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
path = options[:path]
|
37
|
-
|
38
|
-
autotest_file = File.expand_path(path) + "/.autotest"
|
39
|
-
if File.exist?(autotest_file)
|
40
|
-
File.delete(autotest_file)
|
41
|
-
puts "\nYou no longer receive notifications of your tests."
|
42
|
-
puts "" # a blank line
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
data/test/test_an-install_cli.rb
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), "test_helper.rb")
|
2
|
-
require 'an_install/cli'
|
3
|
-
|
4
|
-
class TestAnInstallCli < Test::Unit::TestCase
|
5
|
-
def setup
|
6
|
-
@stdout_io = StringIO.new
|
7
|
-
AnInstall::CLI.execute(@stdout_io, [])
|
8
|
-
@stdout_io.rewind
|
9
|
-
@stdout = @stdout_io.read
|
10
|
-
end
|
11
|
-
|
12
|
-
def test_not_print_default_output
|
13
|
-
assert_no_match(/To update this executable/, @stdout)
|
14
|
-
end
|
15
|
-
|
16
|
-
# def test_print_successful_message
|
17
|
-
# assert_match(/As from now all tests will be notified automatically/, @stdout)
|
18
|
-
# end
|
19
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), "test_helper.rb")
|
2
|
-
require 'an_uninstall/cli'
|
3
|
-
|
4
|
-
class TestAnUninstallCli < Test::Unit::TestCase
|
5
|
-
def setup
|
6
|
-
@stdout_io = StringIO.new
|
7
|
-
AnUninstall::CLI.execute(@stdout_io, [])
|
8
|
-
@stdout_io.rewind
|
9
|
-
@stdout = @stdout_io.read
|
10
|
-
end
|
11
|
-
|
12
|
-
def test_not_print_default_output
|
13
|
-
assert_no_match(/To update this executable/, @stdout)
|
14
|
-
end
|
15
|
-
|
16
|
-
# def test_print_successful_message
|
17
|
-
# assert_match(/You no longer receive notifications of your tests/, @stdout)
|
18
|
-
# end
|
19
|
-
end
|