chores_kit 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f4053eb5fcc4a8164b279a8b02d90e26591d0de4d9323e7b5fb72b60191ddf80
4
- data.tar.gz: 83d2a4bd1e7733959a93e6ef7c692df30ce32522d90a8f7f15c7bb10e2c14ae6
3
+ metadata.gz: 57e00f3e3593a294b34065a8b782ce8b372b731c2144f1bde908b6b09045dcb7
4
+ data.tar.gz: 23f17d66edd7779450dbcc775bc62690efde2ae323b4f8ad5bca317e59cd72c9
5
5
  SHA512:
6
- metadata.gz: b589b5d8b022d16b092d6baa1005593ce11e7a0d7d60dd5e2e9ba4bbdb9c05e7091e2896bb7d1c2e31bfb43e188cc67ab1f315fe04afda4865c949f062aa4827
7
- data.tar.gz: e92606e0da19c34defb5b17b1c2372cbb169dbfbe62f40bcdfb3605c8c1f2a5b62e973c5f533f4e81e5f3ac5e947b989cb617429ee26d208ce05ae4f1d491e1c
6
+ metadata.gz: 6a0b9107cb1cbc7ef7027d2ab85c5f7f3903c7050267b471e790a2e263ba3ebfa528ca83c6be9de5fb72f750b136021cd6f1bd723263a35af72723d1c4dc15d7
7
+ data.tar.gz: 1aaca6ff7a5a524af95fe57298130f520362d40cab85f7db08e6206cd9d00f712e03ffb8bd6afb40e1e789953c2cef096b6b624c6d1feef92a2eb31b0667418a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- chores_kit (0.2.1)
4
+ chores_kit (0.2.2)
5
5
  as-duration (~> 0.1.1)
6
6
  dag (~> 0.0.9)
7
7
 
@@ -53,6 +53,9 @@ module ChoresKit
53
53
  def task(options, &block)
54
54
  name, params = *options
55
55
 
56
+ raise "Couldn't create task without a name" if name.nil?
57
+ raise "Couldn't create task without a block" unless block_given?
58
+
56
59
  @dag.add_vertex(task: Task.new(name, params, &block))
57
60
  end
58
61
 
@@ -62,7 +65,12 @@ module ChoresKit
62
65
  end
63
66
 
64
67
  # After-run callbacks
65
- def notify(conditions, &block)
68
+ def notify(*options, &block)
69
+ raise "Couldn't create notifications without a block" unless block_given?
70
+
71
+ conditions = *options
72
+ conditions = DEFAULT_NOTIFICATIONS if options.empty?
73
+
66
74
  conditions.each do |condition|
67
75
  notification = Notification.new(condition)
68
76
  notification.instance_eval(&block)
@@ -1,3 +1,3 @@
1
1
  module ChoresKit
2
- VERSION = '0.2.1'.freeze
2
+ VERSION = '0.2.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chores_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lennard Timm
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-14 00:00:00.000000000 Z
11
+ date: 2018-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: as-duration