guard-zeus 2.0.0.pre.alpha.pre.69 → 2.0.0.pre.alpha.pre.74

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTIxMzFhOTc3MmVmY2I2YjljMTNmMGMyMTc0YzVlNDNkNGY3N2Q2NQ==
4
+ ZTYyOTcyNWUwOTBiZGEwOTYxYzlhNzM3OTk2MTJlNmNlZDcxYTk0Mw==
5
5
  data.tar.gz: !binary |-
6
- MWZmN2Q0M2YzODNmNTczZWZhNmE3NDM3MDFhMDRmYTAxZTQ3MWRlZA==
6
+ NzlkMmIyMjAwOTZkYjQ0MzhkMmEzOWZjM2QyNzQ3MjQwMWMyMjA2Mg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDg2NWZkNDhkYzgxNzUxNGIxN2UyZTllMWUxMGExOTY4MmE4NjU0YTcyNGUw
10
- ZjI0ZjQyMTUyYjdmODA3MTcxMzcwODlmN2QxN2FkMjdjYTY3MjM1NzAzZTQw
11
- YzJkMDVhODY3ZTFjN2M0ZjhhYjI4YTEwZWI3ZTNkMDQyMjFkOGI=
9
+ Njc3ZGUxMTljMmQ3OGQ1NTAzNzZhYzkxNDY2OGYyNDIyNmE4ZGViYWI5MTFm
10
+ MDIyOGI1MTk0M2M1MDdlNjRiNmE2NDQ4YjVhNGEzMTM0OTI4ZjI0YTlmYjc4
11
+ MzVkZTJiZDU2ZTkyZjE0M2QzZDgwNzg4NjAxMjE2ZDQ2OWVjNmQ=
12
12
  data.tar.gz: !binary |-
13
- MTU0MDQxYzhiMjQyOGRiMDFjYjNhMDRjZWUyMmY3ZWU0YzM5NTJhZWZhYTY1
14
- OGQwNmNmM2M5MjY4NWM0ZmQwODlmMjFiNWRkMWY3ZTIzYjU4MDEwMWNmMTQ2
15
- MzVlZmYyZDU1OWIzMGJjMzJkOGFiNzMwZjkwNzQ3MTE1ZTg1MjM=
13
+ NjAwYzA0NjcwZGVmZTExZjJlNmQwNTliYTUxY2RhZDhlZDAyZGJhMTI2NmRi
14
+ MWIyYjIzYzE5ZDYxYmU0ZjcyNTFjNGY3ZGY2MjI1OGU4YWJiZDA5OGUzNTY5
15
+ Yjc4ZDVlYTJhYzY2OGUzYTZkZjAyZjkwOWI1NzAxMGNmNGJiMTk=
data/lib/guard/zeus.rb CHANGED
@@ -1,25 +1,23 @@
1
- require 'guard'
2
- require 'guard/plugin'
1
+ require 'guard/compat/plugin'
3
2
 
4
3
  module Guard
5
4
  class Zeus < Plugin
6
-
7
5
  autoload :Runner, 'guard/zeus/runner'
8
6
  attr_accessor :runner
9
7
 
10
- def initialize(options={})
8
+ def initialize(options = {})
11
9
  super
12
10
  @runner = Runner.new(options)
13
11
  end
14
12
 
15
13
  def start
16
14
  runner.kill_zeus
17
- runner.launch_zeus("Start")
15
+ runner.launch_zeus('Start')
18
16
  end
19
17
 
20
18
  def reload
21
19
  runner.kill_zeus
22
- runner.launch_zeus("Reload")
20
+ runner.launch_zeus('Reload')
23
21
  end
24
22
 
25
23
  def run_all
@@ -33,6 +31,5 @@ module Guard
33
31
  def stop
34
32
  runner.kill_zeus
35
33
  end
36
-
37
34
  end
38
35
  end
@@ -3,14 +3,17 @@ require 'socket'
3
3
  require 'tempfile'
4
4
  require 'digest/md5'
5
5
 
6
+ require 'guard/compat/plugin'
7
+
6
8
  module Guard
7
- class Zeus
9
+ class Zeus < Plugin
8
10
  class Runner
9
11
  attr_reader :options
10
12
 
11
13
  def initialize(options = {})
12
- @options = {:run_all => true}.merge(options)
13
- UI.info "Guard::Zeus Initialized"
14
+ @zeus_pid = nil
15
+ @options = { run_all: true }.merge(options)
16
+ Compat::UI.info 'Guard::Zeus Initialized'
14
17
  end
15
18
 
16
19
  def kill_zeus
@@ -18,7 +21,7 @@ module Guard
18
21
  end
19
22
 
20
23
  def launch_zeus(action)
21
- UI.info "#{action}ing Zeus", :reset => true
24
+ Compat::UI.info "#{action}ing Zeus", reset: true
22
25
 
23
26
  # check for a current .zeus.sock
24
27
  if File.exist? sockfile
@@ -42,7 +45,7 @@ module Guard
42
45
  if rspec?
43
46
  run(['rspec'])
44
47
  elsif test_unit?
45
- run(Dir['test/**/*_test.rb']+Dir['test/**/test_*.rb'])
48
+ run(Dir['test/**/*_test.rb'] + Dir['test/**/test_*.rb'])
46
49
  end
47
50
  end
48
51
 
@@ -73,7 +76,7 @@ module Guard
73
76
  end
74
77
 
75
78
  def sockfile
76
- File.join(Dir.pwd, ".zeus.sock")
79
+ File.join(Dir.pwd, '.zeus.sock')
77
80
  end
78
81
 
79
82
  def spawn_zeus(cmd, options = '')
@@ -93,10 +96,10 @@ module Guard
93
96
  end
94
97
  rescue Errno::ECHILD
95
98
  end
96
-
99
+
97
100
  delete_sockfile if File.exist? sockfile
98
101
 
99
- UI.info "Zeus Stopped", :reset => true
102
+ Compat::UI.info 'Zeus Stopped', reset: true
100
103
  end
101
104
 
102
105
  def test_unit?
@@ -105,8 +108,8 @@ module Guard
105
108
 
106
109
  def zeus_push_command(paths)
107
110
  cmd_parts = []
108
- cmd_parts << "bundle exec" if bundler?
109
- cmd_parts << "zeus test"
111
+ cmd_parts << 'bundle exec' if bundler?
112
+ cmd_parts << 'zeus test'
110
113
  cmd_parts << paths.join(' ')
111
114
  cmd_parts.join(' ')
112
115
  end
@@ -117,8 +120,8 @@ module Guard
117
120
 
118
121
  def zeus_serve_command
119
122
  cmd_parts = []
120
- cmd_parts << "bundle exec" if bundler?
121
- cmd_parts << "zeus start"
123
+ cmd_parts << 'bundle exec' if bundler?
124
+ cmd_parts << 'zeus start'
122
125
  cmd_parts.join(' ')
123
126
  end
124
127
 
@@ -1,12 +1,38 @@
1
1
  guard 'zeus' do
2
- # uses the .rspec file
3
- # --colour --fail-fast --format documentation --tag ~slow
4
- watch(%r{^spec/.+_spec\.rb$})
5
- watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
6
- watch(%r{^app/(.+)\.haml$}) { |m| "spec/#{m[1]}.haml_spec.rb" }
7
- watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
8
- watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/requests/#{m[1]}_spec.rb"] }
9
-
2
+ require 'ostruct'
3
+
4
+ rspec = OpenStruct.new
5
+ rspec.spec_dir = 'spec'
6
+ rspec.spec = ->(m) { "#{rspec.spec_dir}/#{m}_spec.rb" }
7
+ rspec.spec_helper = "#{rspec.spec_dir}/spec_helper.rb"
8
+
9
+ # matchers
10
+ rspec.spec_files = /^#{rspec.spec_dir}\/.+_spec\.rb$/
11
+
12
+ # Ruby apps
13
+ ruby = OpenStruct.new
14
+ ruby.lib_files = /^(lib\/.+)\.rb$/
15
+
16
+ watch(rspec.spec_files)
17
+ watch(rspec.spec_helper) { rspec.spec_dir }
18
+ watch(ruby.lib_files) { |m| rspec.spec.call(m[1]) }
19
+
20
+ # Rails example
21
+ rails = OpenStruct.new
22
+ rails.app_files = /^app\/(.+)\.rb$/
23
+ rails.views_n_layouts = /^app\/(.+(?:\.erb|\.haml|\.slim))$/
24
+ rails.controllers = %r{^app/controllers/(.+)_controller\.rb$}
25
+
26
+ watch(rails.app_files) { |m| rspec.spec.call(m[1]) }
27
+ watch(rails.views_n_layouts) { |m| rspec.spec.call(m[1]) }
28
+ watch(rails.controllers) do |m|
29
+ [
30
+ rspec.spec.call("routing/#{m[1]}_routing"),
31
+ rspec.spec.call("controllers/#{m[1]}_controller"),
32
+ rspec.spec.call("acceptance/#{m[1]}")
33
+ ]
34
+ end
35
+
10
36
  # TestUnit
11
37
  # watch(%r|^test/(.*)_test\.rb$|)
12
38
  # watch(%r|^lib/(.*)([^/]+)\.rb$|) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module ZeusVersion
3
- VERSION = "2.0.0"
3
+ VERSION = '2.0.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-zeus
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre.alpha.pre.69
4
+ version: 2.0.0.pre.alpha.pre.74
5
5
  platform: ruby
6
6
  authors:
7
7
  - jonathangreenberg
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-08-22 00:00:00.000000000 Z
13
+ date: 2014-12-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: guard
@@ -27,47 +27,47 @@ dependencies:
27
27
  - !ruby/object:Gem::Version
28
28
  version: '2.0'
29
29
  - !ruby/object:Gem::Dependency
30
- name: zeus
30
+ name: guard-compat
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - ~>
34
34
  - !ruby/object:Gem::Version
35
- version: '0'
35
+ version: '1.1'
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - ~>
41
41
  - !ruby/object:Gem::Version
42
- version: '0'
42
+ version: '1.1'
43
43
  - !ruby/object:Gem::Dependency
44
- name: bundler
44
+ name: zeus
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - ~>
48
48
  - !ruby/object:Gem::Version
49
- version: '1.0'
50
- type: :development
49
+ version: '0'
50
+ type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - ~>
55
55
  - !ruby/object:Gem::Version
56
- version: '1.0'
56
+ version: '0'
57
57
  - !ruby/object:Gem::Dependency
58
- name: rspec
58
+ name: bundler
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - ~>
62
62
  - !ruby/object:Gem::Version
63
- version: 3.0.0
63
+ version: '1.0'
64
64
  type: :development
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - ~>
69
69
  - !ruby/object:Gem::Version
70
- version: 3.0.0
70
+ version: '1.0'
71
71
  description: Guard::Zeus automatically manage zeus
72
72
  email:
73
73
  - greenberg@entryway.net
@@ -102,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
102
  version: 1.3.1
103
103
  requirements: []
104
104
  rubyforge_project:
105
- rubygems_version: 2.3.0
105
+ rubygems_version: 2.4.5
106
106
  signing_key:
107
107
  specification_version: 4
108
108
  summary: Pushes watched files to Zeus