guard-jasmine 1.9.2 → 1.9.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.
@@ -87,7 +87,7 @@ module Guard
87
87
  def run_jasmine_spec(file, options)
88
88
  suite = jasmine_suite(file, options)
89
89
  Formatter.info("Run Jasmine suite at #{ suite }")
90
- IO.popen("#{ phantomjs_command(options) } \"#{ suite }\" #{ options[:timeout] } #{ options[:specdoc] } #{ options[:focus] } #{ options[:console] } #{ options[:errors] }")
90
+ IO.popen("#{ phantomjs_command(options) } \"#{ suite }\" #{ options[:timeout] } #{ options[:specdoc] } #{ options[:focus] } #{ options[:console] } #{ options[:errors] }", 'r:UTF-8')
91
91
  end
92
92
 
93
93
  # Get the PhantomJS binary and script to execute.
@@ -32,8 +32,10 @@ module Guard
32
32
  timeout = options[:server_timeout]
33
33
 
34
34
  case server
35
- when :webrick, :mongrel, :thin, :unicorn
35
+ when :webrick, :mongrel, :thin
36
36
  start_rack_server(server, options)
37
+ when :unicorn
38
+ start_unicorn_server(options)
37
39
  when :jasmine_gem
38
40
  start_rake_server(port, 'jasmine')
39
41
  else
@@ -58,6 +60,7 @@ module Guard
58
60
  # will simply start a server that uses the `config.ru`
59
61
  # in the current directory.
60
62
  #
63
+ # @param [Symbol] server the server name
61
64
  # @param [Hash] options the server options
62
65
  # @option options [Symbol] server the rack server to use
63
66
  # @option options [String] server_env the Rails environment
@@ -79,6 +82,28 @@ module Guard
79
82
  ::Guard::UI.error "Cannot start Rack server: #{ e.message }"
80
83
  end
81
84
 
85
+ # Start the Rack server of the current project. This
86
+ # will simply start a server that uses the `config.ru`
87
+ # in the current directory.
88
+ #
89
+ # @param [Hash] options the server options
90
+ # @option options [String] server_env the Rails environment
91
+ # @option options [Number] port the server port
92
+ #
93
+ def start_unicorn_server(options)
94
+ environment = options[:server_env]
95
+ port = options[:port]
96
+
97
+ ::Guard::UI.info "Guard::Jasmine starts Unicorn test server on port #{ port } in #{ environment } environment."
98
+
99
+ self.process = ChildProcess.build('unicorn_rails', '-E', environment.to_s, '-p', port.to_s)
100
+ self.process.io.inherit! if ::Guard.respond_to?(:options) && ::Guard.options && ::Guard.options[:verbose]
101
+ self.process.start
102
+
103
+ rescue => e
104
+ ::Guard::UI.error "Cannot start Unicorn server: #{ e.message }"
105
+ end
106
+
82
107
  # Start the Jasmine gem server of the current project.
83
108
  #
84
109
  # @param [Number] port the server port
@@ -1,6 +1,6 @@
1
1
  module Guard
2
2
  module JasmineVersion
3
3
  # Guard::Jasmine version that is used for the Gem specification
4
- VERSION = '1.9.2'
4
+ VERSION = '1.9.3'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-jasmine
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.2
4
+ version: 1.9.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-19 00:00:00.000000000 Z
12
+ date: 2012-10-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: guard
@@ -139,7 +139,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
139
139
  version: '0'
140
140
  segments:
141
141
  - 0
142
- hash: 554078327649863952
142
+ hash: 1974588860096635221
143
143
  required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  none: false
145
145
  requirements: