pntfr 0.5.0 → 0.5.1

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
  SHA1:
3
- metadata.gz: e851e22201a25b2535b8da2b6543a752483553c7
4
- data.tar.gz: 0b725ce8bc511327f58078de1cde59fd0961462e
3
+ metadata.gz: 155bd001219b0ae71b13a93d84e11bd6dcc2fb4d
4
+ data.tar.gz: 60619eb1816e9f0296913de087e7a07465ec7161
5
5
  SHA512:
6
- metadata.gz: 65725eb135334b436031f3f36bd1353497d62dab244f7da49dfbd2cf59e2aa72ced7993f55269969bdeacdd93fdd34c384bac500cffcc71a034a33a0bcda9876
7
- data.tar.gz: 82f8acb3146919185317497b33171cfe9654775dbfce95b055490de196f149ef537b5191ade9042152fb04251290d776d41b513a53a8ffa885546468128acade
6
+ metadata.gz: 45e32abce7a6d7cf38ab4f5b1b2cd809263322ecffbbeb56f35ce0c555d8fef89367f9ebde6ebf46caa8ea9982b2f806a1e558874d4b1971aa1a7611a8bdc45b
7
+ data.tar.gz: 6b43d884c55d5d9d5705dfb9afa6eb6f15659f8f5675fc5d60f02188f2d821a219cca2f9d6aa44aa7fed115939965e7d20773b62de79dfe9ecedf8dd45fca35a
data/README.md CHANGED
@@ -46,8 +46,8 @@ end
46
46
  ## Sending messages
47
47
  Pntfr suposes you have device objects, or other kind of model, with `platform` and `push_id` attributes.
48
48
  Also, and optionally, a `num_notifs` integer attribute will be automagically managed to
49
- monitor Apple's badge in notifications (for device objects with an `increment` method
50
- (like ActiveRecord;) will use `increment(:num_notifs)`, for non ActiveRecord like
49
+ monitor Apple's badge in notifications (for device objects with an `increment!` method
50
+ (like ActiveRecord;) will use `increment!(:num_notifs)`, for non ActiveRecord like
51
51
  device objects `num_notifs+= 1` will be used).
52
52
 
53
53
  In order to avoid having to create a different message for each platform Pntfr
@@ -19,8 +19,8 @@ module Pntfr
19
19
  if !notification[:badge].nil?
20
20
  device.num_notifs= notification[:badge]
21
21
  else
22
- if device.methods.include?(:increment)
23
- device.increment(:num_notifs)
22
+ if device.methods.include?(:increment!)
23
+ device.increment!(:num_notifs)
24
24
  else
25
25
  device.num_notifs+= 1
26
26
  end
data/lib/pntfr/version.rb CHANGED
@@ -2,6 +2,10 @@
2
2
  # Let's follow Semantic Versioning: http://semver.org/
3
3
  #
4
4
  module Pntfr
5
+ #
6
+ # PATCH v0.5.1
7
+ # - Use increment! instead of increment when incrementing badge on a device object
8
+ # that quacks like ActiveRecord.
5
9
  #
6
10
  # MINOR v0.5.0
7
11
  # - Badge control now can use ActiveRecord's increment method.
@@ -18,5 +22,5 @@ module Pntfr
18
22
  # - Allow overriding general configuration credentials when instantiating each
19
23
  # Notifier (on both platforms).
20
24
  # - Internal refactoring.
21
- VERSION = '0.5.0'
25
+ VERSION = '0.5.1'
22
26
  end
data/test/pntfr/device.rb CHANGED
@@ -6,7 +6,7 @@ Pntfr::Device= Struct.new(:platform, :push_id)
6
6
  Pntfr::IosDevice= Struct.new(:platform, :push_id, :num_notifs)
7
7
  # A device class that quacks like ActiveRecord with num_notifs which will be autoincremented on each sent msg
8
8
  class Pntfr::ArIosDevice < Pntfr::IosDevice
9
- def increment(attr_name, by=1)
9
+ def increment!(attr_name, by=1)
10
10
  self.send("#{attr_name}=", by)
11
11
  end
12
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pntfr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - oliver