opt_out 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 77f442b3944b927911e963b0472863fb94db4247
4
+ data.tar.gz: e79920d2bce5ef47f1f03dcf925a0bc34ab32c6b
5
+ SHA512:
6
+ metadata.gz: a506253cfe81ae40a5f2ee15db9eb4f8545fec1af749c350f63910735fa249d92c9cd49fc30d0502a0179c71c762d08ff85e6c0d7fa1f34101dd8ef2f4ba74c3
7
+ data.tar.gz: d425777fa774b3560469b80b617b776c8c4b7707904ffae28be0fc2d2f1daa562a656b9cc929ae5b3edc74a898420b797f6dbb4e29aa9ed243664d6683676792
@@ -0,0 +1,9 @@
1
+ # CHANGELOG
2
+
3
+ ## 1.1.0
4
+
5
+ * fix memory adapter duplicate subscribes #1 chrishunt
6
+
7
+ ## 1.0.0
8
+
9
+ * initial public release
@@ -9,7 +9,7 @@ module OptOut
9
9
  class MemoryAdapter < AbstractAdapter
10
10
  # Subscribe `user_id` to `list_id`. Returns nothing.
11
11
  def subscribe(list_id, user_id)
12
- store[list_id].delete(user_id) and return
12
+ store.fetch(list_id, {}).delete(user_id) and return
13
13
  end
14
14
 
15
15
  def unsubscribe(list_id, user_id)
@@ -1,3 +1,3 @@
1
1
  module OptOut
2
- VERSION = '1.0.0'
2
+ VERSION = '1.1.0'
3
3
  end
@@ -51,6 +51,11 @@ module AdapterTests
51
51
  assert OptOut.subscribed?('newsletters', '5')
52
52
  end
53
53
 
54
+ def test_subscribe_when_already_subscribed
55
+ OptOut.subscribe('newsletters', '5')
56
+ assert OptOut.subscribed?('newsletters', '5')
57
+ end
58
+
54
59
  def test_resubscribe
55
60
  OptOut.unsubscribe('newsletters', '5')
56
61
  OptOut.subscribe('newsletters', '5')
metadata CHANGED
@@ -1,62 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opt_out
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
5
- prerelease:
4
+ version: 1.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Jerry Cheung
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-08-09 00:00:00.000000000 Z
11
+ date: 2013-09-17 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: redis
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: activerecord
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: sqlite3
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  description: Track newsletter unsubscriptions
@@ -67,6 +60,7 @@ extensions: []
67
60
  extra_rdoc_files: []
68
61
  files:
69
62
  - .gitignore
63
+ - CHANGELOG.md
70
64
  - Gemfile
71
65
  - LICENSE
72
66
  - README.md
@@ -86,27 +80,26 @@ files:
86
80
  homepage: https://github.com/jch/opt_out
87
81
  licenses:
88
82
  - MIT
83
+ metadata: {}
89
84
  post_install_message:
90
85
  rdoc_options: []
91
86
  require_paths:
92
87
  - lib
93
88
  required_ruby_version: !ruby/object:Gem::Requirement
94
- none: false
95
89
  requirements:
96
- - - ! '>='
90
+ - - '>='
97
91
  - !ruby/object:Gem::Version
98
92
  version: '0'
99
93
  required_rubygems_version: !ruby/object:Gem::Requirement
100
- none: false
101
94
  requirements:
102
- - - ! '>='
95
+ - - '>='
103
96
  - !ruby/object:Gem::Version
104
97
  version: '0'
105
98
  requirements: []
106
99
  rubyforge_project:
107
- rubygems_version: 1.8.23
100
+ rubygems_version: 2.0.3
108
101
  signing_key:
109
- specification_version: 3
102
+ specification_version: 4
110
103
  summary: Utilities for managing user unsubscribes from lists
111
104
  test_files:
112
105
  - test/active_record_adapter_test.rb