minitest-macos-notification 0.0.1 → 0.0.2

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: 99360b46bcb6cd67808339e616f31c95e5284a94
4
- data.tar.gz: b18060bd6a75d294220528124240d305baa8c8c4
3
+ metadata.gz: 6a5e1b2f0e08fd26a8c95eb8fac6e6e3a2db8557
4
+ data.tar.gz: ddbaa6c25982886f8ddf42818249a7ef51c4fc7c
5
5
  SHA512:
6
- metadata.gz: 2dcf8ecbb158d49c776a00086dfd96e8ef326906ecccfd899b8e8c162d405640238dae3274e27bbc1616f5e9d04055b6ea9961fa4254c23cd3c689a0976b4288
7
- data.tar.gz: 7a4625917b267c733d5be9502fa0185804763d67dde9c278d9ac25bc27d0d01eb4143c4fcd9c5810e67d5d9be3f78c20ca8ffba6875a59b60880fdbf96642bb2
6
+ metadata.gz: bf68ac87c76e31ca59c85225d3bd19e748efdb32092cb956beee05261c3ba53565aad179cc2683afff0b4e7df28cc09e72b6d892018d772dcb547408de86cafd
7
+ data.tar.gz: 4d423f5bb61355dd6368b12a644c507e56adda1e3a83b7a9c698d16ebf92c64410c9bda8d061b4b1708cb07d8e093ab1340054546acad9ca40ced82b4ae6f5f0
data/.gitignore CHANGED
@@ -6,3 +6,4 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ /.byebug_history
data/Gemfile.lock CHANGED
@@ -1,9 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- minitest-macos-notification (0.0.1)
4
+ minitest-macos-notification (0.0.2)
5
5
  minitest (~> 5.0)
6
6
  minitest-reporters (~> 1.1)
7
+ os (~> 1.0)
7
8
  terminal-notifier (~> 2.0)
8
9
 
9
10
  GEM
@@ -19,6 +20,7 @@ GEM
19
20
  builder
20
21
  minitest (>= 5.0)
21
22
  ruby-progressbar
23
+ os (1.0.0)
22
24
  rake (10.5.0)
23
25
  ruby-progressbar (1.9.0)
24
26
  terminal-notifier (2.0.0)
data/README.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  Simple macOS notification reporter for Minitest Reporters, based on the [minitest-osx](https://github.com/tombell/minitest-osx) gem.
4
4
 
5
+ [![Gem Version](https://badge.fury.io/rb/minitest-macos-notification.svg)](http://badge.fury.io/rb/minitest-macos-notification)
6
+ [![Build Status](https://travis-ci.org/sleepingstu/minitest-macos-notification.svg?branch=master)](https://travis-ci.org/sleepingstu/minitest-macos-notification)
7
+
5
8
  ## Installation
6
9
 
7
10
  Add this line to your application's Gemfile:
@@ -12,11 +15,15 @@ gem "minitest-macos-notification"
12
15
 
13
16
  And then execute:
14
17
 
15
- $ bundle
18
+ ```sh
19
+ bundle
20
+ ```
16
21
 
17
22
  Or install it yourself as:
18
23
 
19
- $ gem install minitest-macos-notification
24
+ ```sh
25
+ gem install minitest-macos-notification
26
+ ```
20
27
 
21
28
  ## Usage
22
29
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Minitest
4
4
  module MacosNotification
5
- VERSION = "0.0.1"
5
+ VERSION = "0.0.2"
6
6
  end
7
7
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "minitest/reporters"
4
+ require "os"
4
5
  require "terminal-notifier"
5
6
 
6
7
  module Minitest
@@ -8,11 +9,18 @@ module Minitest
8
9
  class MacosNotificationReporter < BaseReporter
9
10
  def report
10
11
  super
11
- text = format("%d failures, %d errors, %d skips in %ss", failures, errors, skips, total_time)
12
+ show_notification if OS.mac?
13
+ end
14
+
15
+ private
16
+
17
+ def show_notification
18
+ text = "#{total_count} tests, #{failures} failures, #{errors} errors, #{skips} skips in #{total_time}"
12
19
  title = options[:title] || "Minitest"
13
- subtitle = (passed? ? "Successful \u{1f497}" : "Failed \u{1f4a9}")
20
+ subtitle = (passed? ? "\u{1F49A} Success" : "\u{1F494} Failed")
21
+ group = title.downcase.tr(" ", "-")
14
22
 
15
- TerminalNotifier.notify(text, title: title, subtitle: subtitle)
23
+ TerminalNotifier.notify(text, title: title, subtitle: subtitle, group: group)
16
24
  end
17
25
  end
18
26
  end
@@ -25,6 +25,7 @@ Gem::Specification.new do |spec|
25
25
 
26
26
  spec.add_dependency "minitest", "~> 5.0"
27
27
  spec.add_dependency "minitest-reporters", "~> 1.1"
28
+ spec.add_dependency "os", "~> 1.0"
28
29
  spec.add_dependency "terminal-notifier", "~> 2.0"
29
30
 
30
31
  spec.add_development_dependency "bundler", "~> 1.16"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-macos-notification
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stuart
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-04-03 00:00:00.000000000 Z
11
+ date: 2018-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: os
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: terminal-notifier
43
57
  requirement: !ruby/object:Gem::Requirement