motion-social 0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +29 -0
- data/lib/motion-social.rb +8 -0
- data/lib/project/motion-social.rb +40 -0
- metadata +61 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 72b225d248790ffdbf76ce77cc31e6aff5c92461
|
4
|
+
data.tar.gz: 1809d424c64ef8cd3640d58e06e58d3038fcb0da
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b45be93b4cc4ea7d5318664b74cb294efd2e05bffa44c0c645418c5aabf8d6c0bc9076d680c258c2c5ab3bc63cde46bbfa6793f02bb3e426abefda667d024961
|
7
|
+
data.tar.gz: 07474f0304a4063ad1069a70bfdb4803d4d5a7d079f394097d9c11aa66d7779f87e3133872d11807f092a648ca4c88f7fcacfd7a1477175c91bdea7ade141c3b
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# motion-social
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'motion-social'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install motion-social
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
@@ -0,0 +1,8 @@
|
|
1
|
+
unless defined?(Motion::Project::Config)
|
2
|
+
raise "This file must be required within a RubyMotion project Rakefile."
|
3
|
+
end
|
4
|
+
|
5
|
+
lib_dir_path = File.dirname(File.expand_path(__FILE__))
|
6
|
+
Motion::Project::App.setup do |app|
|
7
|
+
app.files.unshift(Dir.glob(File.join(lib_dir_path, "project/**/*.rb")))
|
8
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module MontionSocial
|
2
|
+
module Sharing
|
3
|
+
# Usage:
|
4
|
+
# include MotionSocial::Sharing
|
5
|
+
#
|
6
|
+
# define the following methods:
|
7
|
+
#
|
8
|
+
# def sharing_message
|
9
|
+
# def sharing_url
|
10
|
+
# def controller
|
11
|
+
#
|
12
|
+
def postToTwitter(sender)
|
13
|
+
if SLComposeViewController.isAvailableForServiceType(SLServiceTypeTwitter)
|
14
|
+
tweetSheet = SLComposeViewController.composeViewControllerForServiceType(SLServiceTypeTwitter)
|
15
|
+
tweetSheet.setInitialText(sharing_message)
|
16
|
+
url = NSURL.alloc.initWithString(sharing_url)
|
17
|
+
tweetSheet.addURL(url)
|
18
|
+
controller.presentViewController(tweetSheet,animated:true, completion:nil)
|
19
|
+
else
|
20
|
+
error_message_for("Twitter")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def postToFacebook(sender)
|
25
|
+
if SLComposeViewController.isAvailableForServiceType(SLServiceTypeFacebook)
|
26
|
+
sheet = SLComposeViewController.composeViewControllerForServiceType(SLServiceTypeFacebook)
|
27
|
+
sheet.setInitialText(sharing_message)
|
28
|
+
url = NSURL.alloc.initWithString(sharing_url)
|
29
|
+
sheet.addURL(url)
|
30
|
+
controller.presentViewController(sheet,animated:true,completion:nil)
|
31
|
+
else
|
32
|
+
error_message_for("Facebook")
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def error_message_for(service)
|
37
|
+
App.alert("You don't have #{service} configured. Please go to your phone's settings and configure it.")
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
metadata
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: motion-social
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.1'
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ivan Acosta-Rubio
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-09-26 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
description: RubyMotion Wrapper around the Social Framework
|
28
|
+
email:
|
29
|
+
- ivan@bakedweb.net
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- README.md
|
35
|
+
- lib/motion-social.rb
|
36
|
+
- lib/project/motion-social.rb
|
37
|
+
homepage: ''
|
38
|
+
licenses:
|
39
|
+
- ''
|
40
|
+
metadata: {}
|
41
|
+
post_install_message:
|
42
|
+
rdoc_options: []
|
43
|
+
require_paths:
|
44
|
+
- lib
|
45
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - '>='
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0'
|
50
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
requirements: []
|
56
|
+
rubyforge_project:
|
57
|
+
rubygems_version: 2.0.5
|
58
|
+
signing_key:
|
59
|
+
specification_version: 4
|
60
|
+
summary: RubyMotion Wrapper around the Social Framework
|
61
|
+
test_files: []
|