ghostbuster 0.2.1 → 0.2.2
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/README.md +17 -1
- data/lib/ghostbuster.rb +2 -3
- data/lib/ghostbuster/config.rb +2 -1
- data/lib/ghostbuster/version.rb +1 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -8,9 +8,19 @@ To install first `gem install ghostbuster`. Once you've done that, you can run `
|
|
8
8
|
|
9
9
|
## Usage
|
10
10
|
|
11
|
+
### Standalone
|
12
|
+
|
11
13
|
Once installed, you can simply use `ghostbuster [path/to/Ghostfile]` to run your tests.
|
12
14
|
|
13
|
-
|
15
|
+
### Rake
|
16
|
+
|
17
|
+
As well, you can install Ghostbuster to run as a rake task:
|
18
|
+
|
19
|
+
~~~~
|
20
|
+
require 'ghostbuster/install_rake'
|
21
|
+
~~~~
|
22
|
+
|
23
|
+
### Configuration via Ghostfile
|
14
24
|
|
15
25
|
Your `Ghostfile` handles your configuration. To set the pattern use:
|
16
26
|
|
@@ -48,10 +58,16 @@ To set the command for stopping your server use:
|
|
48
58
|
ghost.stop_command "./stop.sh"
|
49
59
|
~~~~
|
50
60
|
|
61
|
+
To set the location of your phantomjs binary, use:
|
51
62
|
|
63
|
+
~~~~
|
64
|
+
ghost.phantom_bin = File.join(ENV['HOME'], '.ghostbuster', 'phantomjs')
|
65
|
+
~~~~
|
52
66
|
|
53
67
|
If no Ghostfile is found, it will simply use the defaults.
|
54
68
|
|
69
|
+
### Output
|
70
|
+
|
55
71
|
You should get some output that looks something like this.
|
56
72
|
|
57
73
|
~~~~
|
data/lib/ghostbuster.rb
CHANGED
@@ -8,11 +8,10 @@ class Ghostbuster
|
|
8
8
|
autoload :Runner, 'ghostbuster/runner'
|
9
9
|
|
10
10
|
def initialize(path)
|
11
|
-
@path = File.exist?(path) ? path : '.'
|
11
|
+
@path = path && File.exist?(path) ? path : '.'
|
12
12
|
@dir = File.directory?(@path) ? @path : File.basename(@path)
|
13
13
|
@file = File.directory?(@dir) ? File.join(@dir, 'Ghostfile') : @dir
|
14
14
|
@ghost_lib = File.expand_path(File.join(File.dirname(__FILE__), "ghostbuster.coffee"))
|
15
|
-
@phantom_bin = File.join(ENV['HOME'], '.ghostbuster', 'phantomjs')
|
16
15
|
@config = Config.new(@file)
|
17
16
|
STDOUT.sync = true
|
18
17
|
end
|
@@ -25,7 +24,7 @@ class Ghostbuster
|
|
25
24
|
sleep 2
|
26
25
|
end
|
27
26
|
begin
|
28
|
-
_, status = Process.waitpid2 fork { exec("#{@phantom_bin} #{@ghost_lib} #{@config.screenshots?} #{@config.screenshot_x} #{@config.screenshot_y} #{File.expand_path(@config.screenshot_dir)} #{Dir[@config.pattern].to_a.join(' ')}") }
|
27
|
+
_, status = Process.waitpid2 fork { exec("#{@config.phantom_bin} #{@ghost_lib} #{@config.screenshots?} #{@config.screenshot_x} #{@config.screenshot_y} #{File.expand_path(@config.screenshot_dir)} #{Dir[@config.pattern].to_a.join(' ')}") }
|
29
28
|
ensure
|
30
29
|
spinner "Stopping server" do
|
31
30
|
sh @config.stop_command
|
data/lib/ghostbuster/config.rb
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
class Ghostbuster
|
2
2
|
class Config
|
3
|
-
attr_accessor :pattern, :screenshot_dir, :start_command, :stop_command
|
3
|
+
attr_accessor :pattern, :screenshot_dir, :start_command, :stop_command, :phantom_bin
|
4
4
|
attr_reader :screenshot_x, :screenshot_y
|
5
5
|
def initialize(path_to_file = nil)
|
6
6
|
@config_file = path_to_file || './Ghostfile'
|
7
7
|
@screenshot_x, @screenshot_y = 800, 2000
|
8
8
|
@pattern = "./test_*.coffee"
|
9
|
+
@phantom_bin = File.join(ENV['HOME'], '.ghostbuster', 'phantomjs')
|
9
10
|
@screenshot_dir = "."
|
10
11
|
@screenshots = true
|
11
12
|
@start_command, @stop_command = "./start.sh", "./stop.sh"
|
data/lib/ghostbuster/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ghostbuster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 2
|
10
|
+
version: 0.2.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Josh Hull
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-08-
|
18
|
+
date: 2011-08-31 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|