socials 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 243b273457869f5fa13004da01fd7261e80bd5ff
4
+ data.tar.gz: e44906d33461a5f723d1aa6e25d20ee433ad0ebe
5
+ SHA512:
6
+ metadata.gz: 8052f1f185c42ee8b76c5cf8d208c5176b53a96730e02a5db37dba0664a31ce1e831e8aab291b090c15f70cc9237197dfe57c43426dd8c6a3a0f0f20767bbb7b
7
+ data.tar.gz: d27b107bc056ea4fe3f747305d81f747739e95eeab6e1591c99fe0de4821da9937cd6032006f024faf89a32670bcf5c7287e00da38b83caa40ea059c0f866e6a
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ .idea
11
+ .idea/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.2
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ ruby '2.1.2'
2
+ #ruby=2.1.2@socials
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in socials.gemspec
6
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Ton Frameworks
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
data/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # Socials
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/socials`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'socials'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install socials
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ 1. Fork it ( https://github.com/[my-github-username]/socials/fork )
36
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
37
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
38
+ 4. Push to the branch (`git push origin my-new-feature`)
39
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "socials"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,40 @@
1
+ require 'cgi'
2
+
3
+ # ParentClass which have the attrs to create the links
4
+ class Socials::Connector
5
+ # It constructor must be reused by it children
6
+ def initialize(params={})
7
+ # SetUp, dynamically, the attrs
8
+ setup_attrs(params)
9
+ end
10
+
11
+ # Config the app for the connection
12
+ def setup() end
13
+ # Redirect the user to the SocialNetwork SignUp page
14
+ def sign_up(sign_up_hash) end
15
+ # Return a base user to sig in it out of it lib
16
+ def get_base_user() end
17
+ # Get the user Logged hash & accesses (OAuth)
18
+ def get_current_user() end
19
+ # Get the Multi logins from the user (Pages, in Facebook case)
20
+ def get_user_admin_logins() end
21
+ # Retrieve the user accepted permissions on the SocialNetwork
22
+ def get_active_permission() end
23
+ # Share in Facebook OR tweet on Twitter
24
+ def send_msg(msg, link) end
25
+ # The current user avatar link
26
+ def get_user_avatar() end
27
+ # Post on the social
28
+ def post(message, link, img) end
29
+
30
+ protected
31
+ # SetUp all attrs
32
+ def setup_attrs(params)
33
+ # Dynamic part
34
+ params.each do |key, value|
35
+ next unless key.to_s.index('[]').nil?
36
+ self.class.__send__(:attr_accessor, :"#{key}")
37
+ self.__send__("#{key}=", value)
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,20 @@
1
+ class Socials::Facebook < Socials::Connector
2
+ # Config the app for the connection
3
+ def setup() end
4
+ # Redirect the user to the SocialNetwork SignUp page
5
+ def sign_up(sign_up_hash) end
6
+ # Return a base user to sig in it out of it lib
7
+ def get_base_user() end
8
+ # Get the user Logged hash & accesses (OAuth)
9
+ def get_current_user() end
10
+ # Get the Multi logins from the user (Pages, in Facebook case)
11
+ def get_user_admin_logins() end
12
+ # Retrieve the user accepted permissions on the SocialNetwork
13
+ def get_active_permission() end
14
+ # Share in Facebook OR tweet on Twitter
15
+ def send_msg(msg, link) end
16
+ # The current user avatar link
17
+ def get_user_avatar() end
18
+ # Post on the social
19
+ def post(message, link, img) end
20
+ end
@@ -0,0 +1,20 @@
1
+ class Socials::GooglePlus < Socials::Connector
2
+ # Config the app for the connection
3
+ def setup() end
4
+ # Redirect the user to the SocialNetwork SignUp page
5
+ def sign_up(sign_up_hash) end
6
+ # Return a base user to sig in it out of it lib
7
+ def get_base_user() end
8
+ # Get the user Logged hash & accesses (OAuth)
9
+ def get_current_user() end
10
+ # Get the Multi logins from the user (Pages, in Facebook case)
11
+ def get_user_admin_logins() end
12
+ # Retrieve the user accepted permissions on the SocialNetwork
13
+ def get_active_permission() end
14
+ # Share in Facebook OR tweet on Twitter
15
+ def send_msg(msg, link) end
16
+ # The current user avatar link
17
+ def get_user_avatar() end
18
+ # Post on the social
19
+ def post(message, link, img) end
20
+ end
@@ -0,0 +1,20 @@
1
+ class Socials::Twitter < Socials::Connector
2
+ # Config the app for the connection
3
+ def setup() end
4
+ # Redirect the user to the SocialNetwork SignUp page
5
+ def sign_up(sign_up_hash) end
6
+ # Return a base user to sig in it out of it lib
7
+ def get_base_user() end
8
+ # Get the user Logged hash & accesses (OAuth)
9
+ def get_current_user() end
10
+ # Get the Multi logins from the user (Pages, in Facebook case)
11
+ def get_user_admin_logins() end
12
+ # Retrieve the user accepted permissions on the SocialNetwork
13
+ def get_active_permission() end
14
+ # Share in Facebook OR tweet on Twitter
15
+ def send_msg(msg, link) end
16
+ # The current user avatar link
17
+ def get_user_avatar() end
18
+ # Post on the social
19
+ def post(message, link, img) end
20
+ end
@@ -0,0 +1,6 @@
1
+ module Socials
2
+ MAJOR = 0
3
+ MINOR = 0
4
+ PATCH = 1
5
+ VERSION = "#{MAJOR}.#{MINOR}.#{PATCH}"
6
+ end
data/lib/socials.rb ADDED
@@ -0,0 +1,5 @@
1
+ require "socials/version"
2
+
3
+ module Socials
4
+ # Your code goes here...
5
+ end
data/socials.gemspec ADDED
@@ -0,0 +1,44 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'socials/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "socials"
8
+ spec.version = Socials::VERSION
9
+ spec.authors = ["Ilton Garcia dos Santos Silveira"]
10
+ spec.email = ["ilton_unb@hotmail.com"]
11
+
12
+ spec.summary = 'Simple OAuth SocialNetworks consumer'
13
+ spec.description = 'It is the easiest way to consume OAuth 2.0 in any Ruby based server like Rails &/or Sinatra'
14
+ spec.homepage = "http://tonfw.github.io/socials"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
+ spec.require_paths = ["lib"]
20
+
21
+ #================== GEMs to build it GEM, so its improve the development ==============================
22
+ # Base GEMs to build it gem
23
+ spec.add_development_dependency "bundler", "~> 1.7.12"
24
+ spec.add_development_dependency "rake", "~> 10.3", '>= 10.3.2'
25
+
26
+ # RSpec for tests
27
+ spec.add_development_dependency "rspec", "~> 3.1", '>= 3.1.0'
28
+ # Coverage
29
+ spec.add_development_dependency 'simplecov', '~> 0.7', '>= 0.7.1'
30
+ # Create readable attrs values
31
+ spec.add_development_dependency 'faker', '~> 1.4', '>= 1.4.2'
32
+
33
+ #================== GEMs to be used when it is called on a project ====================================
34
+ # For real user operator IP (4GeoLoc)
35
+ spec.add_dependency 'curb', "~> 0.8", '>= 0.8.6'
36
+ # HTTP REST Client
37
+ spec.add_dependency "rest-client", '~> 1.7', '>= 1.7.2'
38
+ # Easy JSON create
39
+ spec.add_dependency "multi_json", '~> 1.10', '>= 1.10.1'
40
+ # To pretty print on console
41
+ spec.add_dependency "colorize", '~> 0.7.3', '>= 0.7.3'
42
+ # To create the ShareLinks, to be DRY
43
+ spec.add_dependency "just_share", '~> 1.0.4', '>= 1.0.4'
44
+ end
metadata ADDED
@@ -0,0 +1,256 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: socials
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Ilton Garcia dos Santos Silveira
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-02-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 1.7.12
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 1.7.12
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.3'
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 10.3.2
37
+ type: :development
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - "~>"
42
+ - !ruby/object:Gem::Version
43
+ version: '10.3'
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 10.3.2
47
+ - !ruby/object:Gem::Dependency
48
+ name: rspec
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '3.1'
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: 3.1.0
57
+ type: :development
58
+ prerelease: false
59
+ version_requirements: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - "~>"
62
+ - !ruby/object:Gem::Version
63
+ version: '3.1'
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: 3.1.0
67
+ - !ruby/object:Gem::Dependency
68
+ name: simplecov
69
+ requirement: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - "~>"
72
+ - !ruby/object:Gem::Version
73
+ version: '0.7'
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: 0.7.1
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: '0.7'
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: 0.7.1
87
+ - !ruby/object:Gem::Dependency
88
+ name: faker
89
+ requirement: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - "~>"
92
+ - !ruby/object:Gem::Version
93
+ version: '1.4'
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: 1.4.2
97
+ type: :development
98
+ prerelease: false
99
+ version_requirements: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '1.4'
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: 1.4.2
107
+ - !ruby/object:Gem::Dependency
108
+ name: curb
109
+ requirement: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - "~>"
112
+ - !ruby/object:Gem::Version
113
+ version: '0.8'
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: 0.8.6
117
+ type: :runtime
118
+ prerelease: false
119
+ version_requirements: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - "~>"
122
+ - !ruby/object:Gem::Version
123
+ version: '0.8'
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ version: 0.8.6
127
+ - !ruby/object:Gem::Dependency
128
+ name: rest-client
129
+ requirement: !ruby/object:Gem::Requirement
130
+ requirements:
131
+ - - "~>"
132
+ - !ruby/object:Gem::Version
133
+ version: '1.7'
134
+ - - ">="
135
+ - !ruby/object:Gem::Version
136
+ version: 1.7.2
137
+ type: :runtime
138
+ prerelease: false
139
+ version_requirements: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - "~>"
142
+ - !ruby/object:Gem::Version
143
+ version: '1.7'
144
+ - - ">="
145
+ - !ruby/object:Gem::Version
146
+ version: 1.7.2
147
+ - !ruby/object:Gem::Dependency
148
+ name: multi_json
149
+ requirement: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - "~>"
152
+ - !ruby/object:Gem::Version
153
+ version: '1.10'
154
+ - - ">="
155
+ - !ruby/object:Gem::Version
156
+ version: 1.10.1
157
+ type: :runtime
158
+ prerelease: false
159
+ version_requirements: !ruby/object:Gem::Requirement
160
+ requirements:
161
+ - - "~>"
162
+ - !ruby/object:Gem::Version
163
+ version: '1.10'
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: 1.10.1
167
+ - !ruby/object:Gem::Dependency
168
+ name: colorize
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: 0.7.3
174
+ - - ">="
175
+ - !ruby/object:Gem::Version
176
+ version: 0.7.3
177
+ type: :runtime
178
+ prerelease: false
179
+ version_requirements: !ruby/object:Gem::Requirement
180
+ requirements:
181
+ - - "~>"
182
+ - !ruby/object:Gem::Version
183
+ version: 0.7.3
184
+ - - ">="
185
+ - !ruby/object:Gem::Version
186
+ version: 0.7.3
187
+ - !ruby/object:Gem::Dependency
188
+ name: just_share
189
+ requirement: !ruby/object:Gem::Requirement
190
+ requirements:
191
+ - - "~>"
192
+ - !ruby/object:Gem::Version
193
+ version: 1.0.4
194
+ - - ">="
195
+ - !ruby/object:Gem::Version
196
+ version: 1.0.4
197
+ type: :runtime
198
+ prerelease: false
199
+ version_requirements: !ruby/object:Gem::Requirement
200
+ requirements:
201
+ - - "~>"
202
+ - !ruby/object:Gem::Version
203
+ version: 1.0.4
204
+ - - ">="
205
+ - !ruby/object:Gem::Version
206
+ version: 1.0.4
207
+ description: It is the easiest way to consume OAuth 2.0 in any Ruby based server like
208
+ Rails &/or Sinatra
209
+ email:
210
+ - ilton_unb@hotmail.com
211
+ executables: []
212
+ extensions: []
213
+ extra_rdoc_files: []
214
+ files:
215
+ - ".gitignore"
216
+ - ".rspec"
217
+ - ".travis.yml"
218
+ - CODE_OF_CONDUCT.md
219
+ - Gemfile
220
+ - LICENSE
221
+ - README.md
222
+ - Rakefile
223
+ - bin/console
224
+ - bin/setup
225
+ - lib/socials.rb
226
+ - lib/socials/connector.rb
227
+ - lib/socials/facebook.rb
228
+ - lib/socials/google_plus.rb
229
+ - lib/socials/twitter.rb
230
+ - lib/socials/version.rb
231
+ - socials.gemspec
232
+ homepage: http://tonfw.github.io/socials
233
+ licenses:
234
+ - MIT
235
+ metadata: {}
236
+ post_install_message:
237
+ rdoc_options: []
238
+ require_paths:
239
+ - lib
240
+ required_ruby_version: !ruby/object:Gem::Requirement
241
+ requirements:
242
+ - - ">="
243
+ - !ruby/object:Gem::Version
244
+ version: '0'
245
+ required_rubygems_version: !ruby/object:Gem::Requirement
246
+ requirements:
247
+ - - ">="
248
+ - !ruby/object:Gem::Version
249
+ version: '0'
250
+ requirements: []
251
+ rubyforge_project:
252
+ rubygems_version: 2.2.2
253
+ signing_key:
254
+ specification_version: 4
255
+ summary: Simple OAuth SocialNetworks consumer
256
+ test_files: []