tramway-profiles 1.4.0.1 → 1.4.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: 216379de324456e9cc167f3f0d0d03a4c28bf18791abf167a386dcc1738db233
4
- data.tar.gz: c6014f3d40d45e4b596d4f7fe6edb7aa9d7061d6536fd902149c5a1a7150b86c
3
+ metadata.gz: b4145d261d0aa604bcb7fd66b497dfaef037ab43e5274ee7dc76a12ee1fd9d09
4
+ data.tar.gz: d2275491d22eda25c2c21d61f6a7aaa1cdf418626d8565704afbf5b04d7905b1
5
5
  SHA512:
6
- metadata.gz: 15f4a02eb3b9c749138a4522214e486be025bbccecb390cae36631ad3db14c3bddd24e4519c1a831cd9fbcb22540daf7a45ac9658a31e238e07ba153482de1a1
7
- data.tar.gz: 3197fc0a86125df278b275e87fdf356386f0d36fc24583b2c5387fd04fefa64b87e6ce20708df42e2a1a36f03c5f0ef1d27b6801847ee798a76b5b69f3460e33
6
+ metadata.gz: 1b6fe19f14cfbccf69df677e3975ad47088f5a60d78bc26c3c07b17b5bde907b868468f3d1ae0ed7bd52c52bbf47a8bf5903b672e9d2f36a163f41c4a8cb33bc
7
+ data.tar.gz: e54ee2db7e2afc18a818c5f3e5b0cab18f7a40b2f57038855e798d04d08671af4bfd908df18667ce0a7dbc7635430baa69c7e2153695cb15dd19584acdda9df6
@@ -2,34 +2,23 @@
2
2
 
3
3
  module Tramway::Profiles::LinksHelper
4
4
  def profile_link(profile)
5
- send profile.network_name, profile.uid, profile.title
5
+ profile_link_template profile.title, profile_url(profile), profile.network_name
6
6
  end
7
7
 
8
- private
9
-
10
- def vk(uid, title)
11
- profile_link_template title, "https://vk.com/#{uid}", :vk
12
- end
8
+ DOMAINS = {
9
+ vk: 'vk.com',
10
+ facebook: 'facebook.com',
11
+ twitter: 'twitter.com',
12
+ instagram: 'instagram.com',
13
+ telegram: 'intg.me',
14
+ patreon: 'patreon.com'
15
+ }.with_indifferent_access
13
16
 
14
- def facebook(uid, title)
15
- profile_link_template title, "https://facebook.com/#{uid}", :facebook
17
+ def profile_url(profile)
18
+ "https://#{DOMAINS[profile.network_name]}/#{profile.uid}"
16
19
  end
17
20
 
18
- def twitter(uid, title)
19
- profile_link_template title, "https://twitter.com/#{uid}", :twitter
20
- end
21
-
22
- def instagram(uid, title)
23
- profile_link_template title, "https://instagram.com/#{uid}", :instagram
24
- end
25
-
26
- def telegram(uid, title)
27
- profile_link_template title, "https://intg.me/#{uid}", :telegram
28
- end
29
-
30
- def patreon(uid, title)
31
- profile_link_template title, "https://patreon.com/#{uid}", :patreon
32
- end
21
+ private
33
22
 
34
23
  def profile_link_template(title, link, icon)
35
24
  link_to link, target: '_blank' do
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Profiles
5
- VERSION = '1.4.0.1'
5
+ VERSION = '1.4.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-profiles
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0.1
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-19 00:00:00.000000000 Z
11
+ date: 2020-03-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Rails engine for social networks profiles
14
14
  email: