share_counter 0.2.2 → 0.3.0

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: 04474c18c53565d71ffc628ca532764d3b7cee1e
4
- data.tar.gz: 6575a7b833c2969ea7ee233ecdf9da8cb356d209
3
+ metadata.gz: f98aa6a9350226175cf57c1dd5211c1cfee2915c
4
+ data.tar.gz: bf35960f6f7e67d5fa3a628289a6149832043b97
5
5
  SHA512:
6
- metadata.gz: 595cb0b4f267d54c6da34cf6bced7f91b0736d5825e1c265c83f12599fb53d709eb7e0fba9b647dfe6df83447c1acb32aa22f010a7c9f93eb85516835226a0c5
7
- data.tar.gz: d7e79ea7d9e841cfded4354ed77d71187da98210faa962fdf501ece5ecba71cf466206f8b0fed0b02d47e269cff9295dd4af9cfcd91f94b923defbf349559a9d
6
+ metadata.gz: 44d9ef6ce648d9870f1a0bd49b6a38355f229aa3ea2178df58eca58c5076e97a930cea65a2ea4071ecd286a10fb7d6a97f17feeb6b44870d129a6eabf683f1a2
7
+ data.tar.gz: ce544854516093532503798fea07ec3baca91951d0dc43ac44b4887bff291fd7d2f2c7386566b2ea2679523c4d7064d094d39a86558b034fcd0e61297a008d0f
@@ -1,3 +1,3 @@
1
1
  module ShareCounter
2
- VERSION = "0.2.2"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/share_counter.rb CHANGED
@@ -69,10 +69,18 @@ module ShareCounter
69
69
  %w(reddit twitter facebook linkedin stumbleupon pinterest)
70
70
  end
71
71
 
72
+ def self.supported_major_networks
73
+ %w(reddit twitter facebook linkedin)
74
+ end
75
+
72
76
  def self.all url
73
77
  supported_networks.inject({}) { |r, c| r[c.to_sym] = ShareCounter.send(c, url); r }
74
78
  end
75
79
 
80
+ def self.major url
81
+ supported_major_networks.inject({}) { |r, c| r[c.to_sym] = ShareCounter.send(c, url); r }
82
+ end
83
+
76
84
  def self.selected url, selections
77
85
  selections.map{|name| name.downcase}.select{|name| supported_networks.include? name.to_s}.inject({}) {
78
86
  |r, c| r[c.to_sym] = ShareCounter.send(c, url); r }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: share_counter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Davide Santangelo