pry-send_tweet.rb 0.1.0

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
+ SHA256:
3
+ metadata.gz: 1517c7ca5b22d7f09cb20d666b53348e14491ec68408d4cfe3f83e4e988d82b1
4
+ data.tar.gz: d6bef3e2137532533ca59487903585dc5b19684958f865b307b7884574ff7384
5
+ SHA512:
6
+ metadata.gz: b0472c1acd9e0d955fe51d21e9241bc5bb4beb1ac4776a9676659e0bbafdce74d187bcafbbd5557382ac6c6c24ba8edf6a082ae5eda29c98de1cb71f3f2d7eb7
7
+ data.tar.gz: 60ae7dd6b3d7fd06facf4be61fa32ca0ee4bc91183cfd2836bc5292ef4d8554ef6cf1afbd12e74225489053948ab10e1be56e80264bd40076630c033b2659458
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright 2017
4
+ Robert Gleeson
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # pry-send_tweet.rb
2
+
3
+ pry-send_tweet.rb adds a Pry command that can send tweets using your
4
+ personal twitter account.
5
+
6
+ ## API Access
7
+
8
+ pry-send_tweet.rb sends tweets by talking to the twitter API over HTTPS.
9
+ Twitter requires the following keys and tokens to do that:
10
+
11
+ * `consumer_key`, `consumer_secret`, `access_token`, `access_token_secret`
12
+
13
+ The required keys & tokens can be created on twitter by signing up for a
14
+ developer account and then creating an "app" for your account. This can be done
15
+ at [https://developer.twitter.com](https://developer.twitter.com).
16
+
17
+ ## Configuration
18
+
19
+ ```ruby
20
+ Pry.configure do |config|
21
+ config.twitter = Pry::Config.from_hash({
22
+ consumer_key: '<consumer key>',
23
+ consumer_secret: '<consumer secret>',
24
+ access_token: '<access token>',
25
+ access_token_secret: '<access token secret>'
26
+ }, nil)
27
+ end
28
+ ```
29
+
30
+ ## Usage
31
+
32
+ [1] pry(main)> send-tweet Hello twitter, speaking from #pry
33
+ https://twitter.com/xxx/status/xxx
34
+
35
+ ## Install
36
+
37
+ gem install pry-send_tweet.rb
38
+
39
+ ## License
40
+
41
+ MIT
@@ -0,0 +1,26 @@
1
+ Pry.commands.add_command Class.new(Pry::ClassCommand) {
2
+ require 'twitter'
3
+ match 'send-tweet'
4
+ command_options argument_required: true
5
+ banner <<-BANNER
6
+ send-tweet [tweet]
7
+
8
+ Send a tweet.
9
+ BANNER
10
+
11
+ def process(*args)
12
+ tweet = client.update args.join(' ')
13
+ _pry_.output.puts tweet.url
14
+ end
15
+
16
+ def client
17
+ @client ||= begin
18
+ Twitter::REST::Client.new {|config|
19
+ config.consumer_key = _pry_.config.twitter.consumer_key
20
+ config.consumer_secret = _pry_.config.twitter.consumer_secret
21
+ config.access_token = _pry_.config.twitter.access_token
22
+ config.access_token_secret = _pry_.config.twitter.access_token_secret
23
+ }
24
+ end
25
+ end
26
+ }
@@ -0,0 +1,14 @@
1
+ Gem::Specification.new do |spec|
2
+ spec.name = "pry-send_tweet.rb"
3
+ spec.version = "0.1.0"
4
+ spec.authors = ["Robert Gleeson"]
5
+ spec.email = "trebor.g@protonmail.com"
6
+ spec.summary = "pry-send_tweet.rb adds a Pry command that can send tweets using your personal twitter account."
7
+ spec.description = spec.summary
8
+ spec.homepage = "https://github.com/r-obert/pry-send_tweet.rb"
9
+ spec.licenses = ["MIT"]
10
+ spec.require_paths = ["lib"]
11
+ spec.files = Dir["*.{md,txt,gemspec}", "lib/**/*.rb"]
12
+ spec.add_runtime_dependency "pry", "~> 0.12"
13
+ spec.add_runtime_dependency "twitter", "~> 6.0"
14
+ end
metadata ADDED
@@ -0,0 +1,77 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pry-send_tweet.rb
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Robert Gleeson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-11-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: pry
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.12'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.12'
27
+ - !ruby/object:Gem::Dependency
28
+ name: twitter
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '6.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '6.0'
41
+ description: pry-send_tweet.rb adds a Pry command that can send tweets using your
42
+ personal twitter account.
43
+ email: trebor.g@protonmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - LICENSE.txt
49
+ - README.md
50
+ - lib/pry-send_tweet.rb
51
+ - pry-send_tweet.gemspec
52
+ homepage: https://github.com/r-obert/pry-send_tweet.rb
53
+ licenses:
54
+ - MIT
55
+ metadata: {}
56
+ post_install_message:
57
+ rdoc_options: []
58
+ require_paths:
59
+ - lib
60
+ required_ruby_version: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ requirements: []
71
+ rubyforge_project:
72
+ rubygems_version: 2.7.7
73
+ signing_key:
74
+ specification_version: 4
75
+ summary: pry-send_tweet.rb adds a Pry command that can send tweets using your personal
76
+ twitter account.
77
+ test_files: []