social-url 1.2.0 → 1.2.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: 87752f6be8be6cd96cf5bcff71d786ef8b8045abf66e1047b0fde61ed16c6b1c
4
- data.tar.gz: db66035474aded4c69bb8ad7523af707145907d84432119cffba26c87f5a659e
3
+ metadata.gz: ae9cbc8d49497bb8599917d937a21cc2da61999aabc53a4a1db795fa2c5e850a
4
+ data.tar.gz: 0f481c6db1389e3b09ac04b0a965175dad46b9b4a594e55a7b827f186e80b96f
5
5
  SHA512:
6
- metadata.gz: 1ee71fcfb990e760259a4cbe1bcc6f3fc60043c64447b5f717912598599d683906bc07620f122492152f607ad3a27ed2e4317fa6bc422e4117ac7b6aa41b0b77
7
- data.tar.gz: '0329c592b38c2bbeedb8a9823fae920b18733c8268d440ac503cd77b2bc6fc1ffab32f3944a7c11ba6494f29f5f01dbec2cdd6f8c837cc416cb1a5181f7a7417'
6
+ metadata.gz: e85a72c8d0a307c6125ccc118ab4456a46c8be4e5c64da89d556d5cf052d63bff99464abc2cb98c1a71fc7d20a6ad769fd3c981f5263e54a9a8f268925340e18
7
+ data.tar.gz: cbc3529fd307562a292bdb2a14faa5fa79bdb394185f0517514dae78a690ad796807423c987997cd46c427a52c1524f1027f956e6f41b3beca18191ede75f81a
@@ -22,7 +22,7 @@ module SocialUrl
22
22
  end
23
23
 
24
24
  def normalize(params)
25
- params.reject { |key, value| !value }.map do |key, value|
25
+ params.map do |key, value|
26
26
  if key == :hashtags
27
27
  [key, normalize_hashtags(value)]
28
28
  elsif value.is_a?(String)
@@ -10,7 +10,7 @@ module SocialUrl
10
10
  end
11
11
 
12
12
  def params
13
- whitelisted_params.map do |key, value|
13
+ whitelisted_params.reject { |key, value| !@original_params[key] }.map do |key, value|
14
14
  value.to_s << "=" << @original_params[key]
15
15
  end.join("&")
16
16
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SocialUrl
4
- VERSION = "1.2.0"
4
+ VERSION = "1.2.1"
5
5
  end
@@ -23,4 +23,18 @@ class SocialUrl::Networks::TwitterTest < Minitest::Test
23
23
 
24
24
  assert_equal url, SocialUrl::Networks::Twitter.new(params).url
25
25
  end
26
+
27
+ def test_url_for_bare_message
28
+ params = SocialUrl.normalize(
29
+ text: "Hello World",
30
+ url: "http://example.com",
31
+ hashtags: ["nature", "sunset", "Multi Word HashTag"]
32
+ )
33
+
34
+ url = ["https://twitter.com/intent/tweet/?text=Hello%20World",
35
+ "&url=http%3A%2F%2Fexample.com",
36
+ "&hashtags=nature,sunset,MultiWordHashTag"].join
37
+
38
+ assert_equal url, SocialUrl::Networks::Twitter.new(params).url
39
+ end
26
40
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: social-url
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Venneman