blade 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 036f656e11ef4e58b8754e1fa79f3dd2b201ec6d
4
- data.tar.gz: 861f57df946610dcf07e195476e316b8a665e73c
3
+ metadata.gz: f3b7b89ebef6e891ac308f65cf9935faf057482f
4
+ data.tar.gz: bfa25e592269250f945798b9403331a741486fa8
5
5
  SHA512:
6
- metadata.gz: 89495488ab78a6b6d95a745573530abcdb18f4e2c23fd42f7e52865a15ae0802e2234bd201e50240475a4150201531bc67432006851da299119ed70761424a99
7
- data.tar.gz: 31ced33e906e14e7bc223aa72466634e28740edb2c2348f450f9c2c7317768eb75c7355814efd4139f5c8071823b5a5bc538435daa1e7b9420bd0ed2dceebb97
6
+ metadata.gz: ff881b9e9aca8302fe4a646588b9cc31bad686a867b4ad42772c6d38bef819d02d43e293e6af75a349426d4e0705141228014c70b86bd1805849206d3bab3a66
7
+ data.tar.gz: c386316e4c95d86ddbb2e55e2e71852ef5e8db88429b6c26c08b5c12eafca99c8747d4d3623cee6c9d83984321806069c7b1e5988dc114bef4e9fe3e52af9275
@@ -1,12 +1,15 @@
1
1
  @Blade =
2
- suiteDidBegin: (details) ->
3
- publish("/tests", event: "begin", total: details.total)
2
+ suiteDidBegin: ({total}) ->
3
+ event = "begin"
4
+ publish("/tests", {event, total})
4
5
 
5
- testDidEnd: (details) ->
6
- publish("/tests", event: "result", result: details.pass, name: details.name, message: details.message)
6
+ testDidEnd: ({name, status, message}) ->
7
+ event = "result"
8
+ publish("/tests", {event, name, status, message})
7
9
 
8
- suiteDidEnd: (details) ->
9
- publish("/tests", event: "end", total: details.total)
10
+ suiteDidEnd: ({total}) ->
11
+ event = "end"
12
+ publish("/tests", {event, total})
10
13
 
11
14
  publish = (channel, data = {}) ->
12
15
  client.publish(channel, copy(data, {session_id})) if session_id?
@@ -83,14 +83,14 @@ module Blade
83
83
 
84
84
  private
85
85
  def handle_exit
86
- %w( INT ).each do |signal|
87
- trap(signal) { stop }
88
- end
89
-
90
86
  at_exit do
91
87
  stop
92
88
  exit $!.status if $!.is_a?(SystemExit)
93
89
  end
90
+
91
+ %w( INT ).each do |signal|
92
+ trap(signal) { exit(1) }
93
+ end
94
94
  end
95
95
 
96
96
  def load_config_file!
@@ -24,7 +24,7 @@ class Blade::CombinedTestResults
24
24
  end
25
25
 
26
26
  def failed?
27
- statuses.include?("failed")
27
+ states.include?("failed")
28
28
  end
29
29
 
30
30
  private
@@ -36,7 +36,7 @@ class Blade::CombinedTestResults
36
36
  all_test_results.map(&:total).compact
37
37
  end
38
38
 
39
- def statuses
40
- all_test_results.map(&:status)
39
+ def states
40
+ all_test_results.map(&:state)
41
41
  end
42
42
  end
@@ -13,8 +13,8 @@ module Blade::CI
13
13
 
14
14
  private
15
15
  def process_result(details)
16
- if details.has_key?("pass")
17
- log details["pass"] ? "." : "F"
16
+ if details.has_key?("status")
17
+ log details["status"] == "pass" ? "." : "F"
18
18
  end
19
19
 
20
20
  if details["completed"]
@@ -6,16 +6,16 @@ class Blade::Runner::Tab < Blade::Model
6
6
  extend Forwardable
7
7
  def_delegators "Blade::Runner", :create_window
8
8
 
9
- attr_reader :window, :status_window, :content_window
9
+ attr_reader :window, :state_window, :content_window
10
10
 
11
11
  def install(options = {})
12
12
  top = options[:top]
13
13
  @window = create_window(top: top, height: 3)
14
14
 
15
15
  top = @window.begy + @window.maxy + 1
16
- @status_window = create_window(top: top, height: 1)
16
+ @state_window = create_window(top: top, height: 1)
17
17
 
18
- top = @status_window.begy + @status_window.maxy + 1
18
+ top = @state_window.begy + @state_window.maxy + 1
19
19
  @content_window = create_window(top: top)
20
20
  @content_window.scrollok(true)
21
21
  end
@@ -93,7 +93,7 @@ class Blade::Runner::Tab < Blade::Model
93
93
  end
94
94
 
95
95
  def dot
96
- status == "pending" ? "○" : "●"
96
+ state == "pending" ? "○" : "●"
97
97
  end
98
98
 
99
99
  def index
@@ -104,8 +104,8 @@ class Blade::Runner::Tab < Blade::Model
104
104
  Blade::Session.find(id)
105
105
  end
106
106
 
107
- def status
108
- session.test_results.status
107
+ def state
108
+ session.test_results.state
109
109
  end
110
110
 
111
111
  def active?
@@ -122,8 +122,8 @@ class Blade::Runner::Tab < Blade::Model
122
122
  self.active = true
123
123
  draw
124
124
 
125
- tabs.status_window.addstr(session.to_s)
126
- tabs.status_window.noutrefresh
125
+ tabs.state_window.addstr(session.to_s)
126
+ tabs.state_window.noutrefresh
127
127
 
128
128
  tabs.content_window.addstr(session.test_results.to_s)
129
129
  tabs.content_window.noutrefresh
@@ -135,8 +135,8 @@ class Blade::Runner::Tab < Blade::Model
135
135
  self.active = false
136
136
  draw
137
137
 
138
- tabs.status_window.clear
139
- tabs.status_window.noutrefresh
138
+ tabs.state_window.clear
139
+ tabs.state_window.noutrefresh
140
140
 
141
141
  tabs.content_window.clear
142
142
  tabs.content_window.noutrefresh
@@ -163,7 +163,7 @@ class Blade::Runner::Tab < Blade::Model
163
163
  end
164
164
 
165
165
  def color
166
- case status
166
+ case state
167
167
  when "running" then colors.yellow
168
168
  when "finished" then colors.green
169
169
  when /fail/ then colors.red
@@ -9,7 +9,8 @@ module Blade::Server
9
9
 
10
10
  def start
11
11
  Faye::WebSocket.load_adapter("thin")
12
- Rack::Server.start(app: app, Port: Blade.config.port, server: "thin")
12
+ Thin::Logging.silent = true
13
+ Thin::Server.start("localhost", Blade.config.port, app, signals: false)
13
14
  end
14
15
 
15
16
  def websocket_url(path = "")
@@ -1,5 +1,5 @@
1
1
  class Blade::TestResults
2
- attr_reader :session_id, :status, :lines, :passes, :failures, :total
2
+ attr_reader :session_id, :state, :lines, :passes, :failures, :total
3
3
 
4
4
  def initialize(session_id)
5
5
  @session_id = session_id
@@ -16,7 +16,7 @@ class Blade::TestResults
16
16
  @lines = []
17
17
  @passes = []
18
18
  @failures = []
19
- @status = "pending"
19
+ @state = "pending"
20
20
  @total = 0
21
21
  end
22
22
 
@@ -26,30 +26,29 @@ class Blade::TestResults
26
26
  case details["event"]
27
27
  when "begin"
28
28
  reset
29
- @status = "running"
29
+ @state = "running"
30
30
  @total = details["total"]
31
31
  @lines << publication[:line] = "1..#{@total}"
32
32
  when "result"
33
- pass = details["result"]
34
33
  args = details.values_at("name", "message")
35
34
 
36
- if pass
35
+ if details["status"] == "pass"
37
36
  line = Pass.new(*args).to_s
38
37
  @passes << line
39
38
  else
40
39
  line = Failure.new(*args).to_s
41
40
  @failures << line
42
- @status = "failing"
41
+ @state = "failing"
43
42
  end
44
43
  @lines << line
45
44
 
46
- publication.merge!(line: line, pass: pass)
45
+ publication.merge!(line: line, status: details["status"])
47
46
  when "end"
48
- @status = failures.any? ? "failed" : "finished"
47
+ @state = failures.any? ? "failed" : "finished"
49
48
  publication[:completed] = true
50
49
  end
51
50
 
52
- publication.merge!(status: status, session_id: session_id)
51
+ publication.merge!(state: state, session_id: session_id)
53
52
  Blade.publish("/results", publication)
54
53
  end
55
54
 
@@ -1,3 +1,3 @@
1
1
  module Blade
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blade
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javan Makhmali
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-08-30 00:00:00.000000000 Z
11
+ date: 2015-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -246,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
246
246
  version: '0'
247
247
  requirements: []
248
248
  rubyforge_project:
249
- rubygems_version: 2.4.6
249
+ rubygems_version: 2.4.5
250
250
  signing_key:
251
251
  specification_version: 4
252
252
  summary: Blade