social_share_hub 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,12 +1,16 @@
1
1
  # SocialShareHub
2
2
 
3
- TODO: Write a gem description
3
+ SocialShareHub is a gem that can easy your share process without authenticating. It support Sina Weibo, QQ Weibo, Renren, Douban.
4
+
5
+ ## Screenshorts
6
+
7
+ ![img][1]
4
8
 
5
9
  ## Installation
6
10
 
7
11
  Add this line to your application's Gemfile:
8
12
 
9
- gem 'social_share_hub'
13
+ gem 'social_share_hub', '~> 0.0.3'
10
14
 
11
15
  And then execute:
12
16
 
@@ -16,9 +20,41 @@ Or install it yourself as:
16
20
 
17
21
  $ gem install social_share_hub
18
22
 
23
+
24
+ Then you need to run a generate script to add the SocialShareHub configuration file by:
25
+
26
+ $ rails g social_share_hub:install
27
+
28
+ The configuration file will be this:
29
+
30
+ ``` ruby
31
+ SocialShareHub.configure do |config|
32
+ config.allowed_sites = %w(weibo douban qq renren)
33
+ end
34
+ ```
35
+
19
36
  ## Usage
20
37
 
21
- TODO: Write usage instructions here
38
+ You have to add mandatory asset files in your javascript and css files:
39
+
40
+ `app/assets/javascripts/application.js`
41
+
42
+ ``` ruby
43
+ //= require social_share_hub
44
+ ```
45
+
46
+
47
+ `app/assets/stylesheets/application.css`
48
+
49
+ ``` ruby
50
+ *= require social_share_hub
51
+ ```
52
+
53
+ Using helper to render social share links defined in your configuration file:
54
+
55
+ ``` ruby
56
+ <%= social_share_link("Your title", "/Path-to-your-image.png") %>
57
+ ```
22
58
 
23
59
  ## Contributing
24
60
 
@@ -27,3 +63,5 @@ TODO: Write usage instructions here
27
63
  3. Commit your changes (`git commit -am 'Added some feature'`)
28
64
  4. Push to the branch (`git push origin my-new-feature`)
29
65
  5. Create new Pull Request
66
+
67
+ [1]: https://github.com/jerryshen/social_share_hub/blob/master/screenshorts/social_share_hub.png "screenshort"
@@ -17,5 +17,9 @@ module SocialShareHub
17
17
  html << "</div>"
18
18
  raw html.join("\n")
19
19
  end
20
+
21
+ def social_share_link(title, img_path)
22
+ social_share_hub_tag(title, image: request.protocol + request.host_with_port + img_path)
23
+ end
20
24
  end
21
25
  end
@@ -1,3 +1,3 @@
1
1
  module SocialShareHub
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: social_share_hub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-26 00:00:00.000000000 Z
12
+ date: 2012-06-29 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description: Social Share Hub
15
15
  email:
@@ -42,6 +42,7 @@ files:
42
42
  - lib/social_share_hub/helper.rb
43
43
  - lib/social_share_hub/railtie.rb
44
44
  - lib/social_share_hub/version.rb
45
+ - screenshorts/social_share_hub.png
45
46
  - social_share_hub.gemspec
46
47
  homepage: ''
47
48
  licenses: []
@@ -63,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
64
  version: '0'
64
65
  requirements: []
65
66
  rubyforge_project:
66
- rubygems_version: 1.8.16
67
+ rubygems_version: 1.8.10
67
68
  signing_key:
68
69
  specification_version: 3
69
70
  summary: Social Share Hub, quick share buttons for social websites