repost 0.3.0 → 0.3.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
  SHA256:
3
- metadata.gz: bc815d8628862bce90efaea620e728bbe5bc4361270012168bd91c3638c27dfd
4
- data.tar.gz: dd1647ded8a8b2ba1cd4e4e923a288d65ae8c02fd3c352743b55530f4ef53a7f
3
+ metadata.gz: 6114a27e75f7df1a3141808e436d8ed6e1c9bffd7842676c88da1ddd2701ab07
4
+ data.tar.gz: 597fe2588e85b5d786f58bd776cfb1416368360fc5aa35fc5df35ee73490b037
5
5
  SHA512:
6
- metadata.gz: 0e090ab38d6712ce42ce7b58a856c26df4fd4f9c7234afe559239669a8c232bfeb0840e1e2148d51fcaa8ad76669a601d1484a704087cc6597b3278333a8ecbe
7
- data.tar.gz: af0311293b5ecdd4f995680880a046cb299a5e54b47dcbf516a5c6d2358ae662d4c919ce908f2a60ccc6b79199e4c074d3299a924aabf5bec414f9b01ae9c3f0
6
+ metadata.gz: afa10ba26be16c930543283efb1af2069e69020f43edf5602fa7572737bd0763002d9d6fc39d3aea649dbab1a815ec605590bb23074bde9a32c441a379431aa2
7
+ data.tar.gz: 176ecebcdc79ffd03aa036aac4000b1c3612d392177e91f80f1b36e76442bdc1bd2c91c0542bd0c41d4f01268b319e8070b3cfefec00facc412e8c27f59934b5
@@ -1,18 +1,19 @@
1
- if defined?(Rails)
2
- class ::ActionController::Base
3
- AUTO_TOKEN_OPTIONS = ['auto', :auto].freeze
1
+ if defined?(Rails) && defined?(ActiveSupport)
2
+ ActiveSupport.on_load(:action_controller) do
3
+ class ::ActionController::Base
4
4
 
5
- def repost(url, params: {}, options: {})
6
- authenticity_token = form_authenticity_token if AUTO_TOKEN_OPTIONS.include?(options[:authenticity_token])
7
- render html: Repost::Senpai.perform(
8
- url,
9
- params: params,
10
- options: options.merge({authenticity_token: authenticity_token}.compact)
11
- ).html_safe
12
- end
5
+ def repost(url, params: {}, options: {})
6
+ authenticity_token = form_authenticity_token if ['auto', :auto].include?(options[:authenticity_token])
7
+ render html: Repost::Senpai.perform(
8
+ url,
9
+ params: params,
10
+ options: options.merge({authenticity_token: authenticity_token}.compact)
11
+ ).html_safe
12
+ end
13
13
 
14
- alias :redirect_post :repost
14
+ alias :redirect_post :repost
15
15
 
16
+ end
16
17
  end
17
18
  end
18
19
 
@@ -1,3 +1,3 @@
1
1
  module Repost
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: repost
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - YaroslavO
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-07 00:00:00.000000000 Z
11
+ date: 2019-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler