mailkick 0.1.0 → 0.1.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: 2ceddc58f9f600bae3a7d185763f7ef36e1f369e
4
- data.tar.gz: 83f27d1562f61034bcb2370db0ca2fa7fe6b7f5e
3
+ metadata.gz: 35835a6f8e9f1d62977205c3b4b381dc13baecf7
4
+ data.tar.gz: 528cb1cf61a126560de37a2b6dabccc6bc56283a
5
5
  SHA512:
6
- metadata.gz: dbf8ce2d36210c93295a26b0ba813fe51ca0a4c978b38263fe33e2fac0bd78229e96974e06c16eb6ca769611f4694159f0e69737ae629bd8b8c4969c03d8fb84
7
- data.tar.gz: e21bb468323465d717abf90114460de7450e4448ab5cb9bcfa8e8d5d7a806b279c9f9731d8d4fd5043a8fc9e14b3b8eee1287494cff3f90451c0b08873e53d3a
6
+ metadata.gz: 635af4e2bfdb8d2dab9c70f2f7f9d5a88c903d42882b9234455d3bc82c7896bd5bb7521a7209b714b2795e7798ad01a2d5f7db40da99ba9cdd00d4c2560931e2
7
+ data.tar.gz: dd7bc1dad73ea07ebead206ceba06a48b5a9989f2691f911f238cc2ba33355bc67c5ea8c08885ccae184acbe01062bcbb40a3075924f9e924ba1fd0acdab203a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.1.1
2
+
3
+ - Fixed tokens with `+` in them
4
+
1
5
  ## 0.1.0
2
6
 
3
7
  - Fixed secret token for Rails 4.1
@@ -7,12 +7,12 @@ module Mailkick
7
7
 
8
8
  def unsubscribe
9
9
  Mailkick.opt_out(@options)
10
- redirect_to subscription_path(params[:id])
10
+ redirect_to subscription_path(url_token)
11
11
  end
12
12
 
13
13
  def subscribe
14
14
  Mailkick.opt_in(@options)
15
- redirect_to subscription_path(params[:id])
15
+ redirect_to subscription_path(url_token)
16
16
  end
17
17
 
18
18
  protected
@@ -41,14 +41,20 @@ module Mailkick
41
41
  helper_method :opted_out?
42
42
 
43
43
  def subscribe_url
44
- subscribe_subscription_path(params[:id])
44
+ subscribe_subscription_path(url_token)
45
45
  end
46
46
  helper_method :subscribe_url
47
47
 
48
48
  def unsubscribe_url
49
- unsubscribe_subscription_path(params[:id])
49
+ unsubscribe_subscription_path(url_token)
50
50
  end
51
51
  helper_method :unsubscribe_url
52
52
 
53
+ private
54
+
55
+ def url_token
56
+ @url_token ||= CGI::escape(params[:id])
57
+ end
58
+
53
59
  end
54
60
  end
@@ -5,7 +5,7 @@ module Mailkick
5
5
  initializer "mailkick" do |app|
6
6
  Mailkick.discover_services
7
7
  secrets = app.respond_to?(:secrets) ? app.secrets : app.config
8
- Mailkick.secret_token = secrets.respond_to?(:secret_key_base) ? secrets.secret_key_base : secrets.secret_token
8
+ Mailkick.secret_token ||= secrets.respond_to?(:secret_key_base) ? secrets.secret_key_base : secrets.secret_token
9
9
  ActiveSupport.on_load :action_mailer do
10
10
  helper Mailkick::UrlHelper
11
11
  end
@@ -20,7 +20,7 @@ module Mailkick
20
20
 
21
21
  parts = message.parts.any? ? message.parts : [message]
22
22
  parts.each do |part|
23
- part.body.raw_source.gsub!(/%7B%7BMAILKICK_TOKEN%7D%7D/, token)
23
+ part.body.raw_source.gsub!(/%7B%7BMAILKICK_TOKEN%7D%7D/, CGI::escape(token))
24
24
  end
25
25
  end
26
26
 
@@ -1,3 +1,3 @@
1
1
  module Mailkick
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailkick
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-31 00:00:00.000000000 Z
11
+ date: 2015-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -90,9 +90,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
90
  version: '0'
91
91
  requirements: []
92
92
  rubyforge_project:
93
- rubygems_version: 2.2.2
93
+ rubygems_version: 2.4.5
94
94
  signing_key:
95
95
  specification_version: 4
96
96
  summary: Email subscriptions made easy
97
97
  test_files: []
98
- has_rdoc: