pry-send_tweet.rb 0.1.0 → 0.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1517c7ca5b22d7f09cb20d666b53348e14491ec68408d4cfe3f83e4e988d82b1
4
- data.tar.gz: d6bef3e2137532533ca59487903585dc5b19684958f865b307b7884574ff7384
3
+ metadata.gz: c578f34e335ebbefdebc48fd2c8455bb01e5254e9f2b885e8247c68cb790c97f
4
+ data.tar.gz: 5cc2b991ef40b6cde0355de9d703732ca635b7275bb93ab15c2fb6717fe222aa
5
5
  SHA512:
6
- metadata.gz: b0472c1acd9e0d955fe51d21e9241bc5bb4beb1ac4776a9676659e0bbafdce74d187bcafbbd5557382ac6c6c24ba8edf6a082ae5eda29c98de1cb71f3f2d7eb7
7
- data.tar.gz: 60ae7dd6b3d7fd06facf4be61fa32ca0ee4bc91183cfd2836bc5292ef4d8554ef6cf1afbd12e74225489053948ab10e1be56e80264bd40076630c033b2659458
6
+ metadata.gz: b45804086d9a4920edcc32ef1c1a043a044f58770cf910907795c95010c71fc4931a26b9da7d3d566f0ed4eb222208bf93f0525f1397ac6e2a606c9e25c7ca68
7
+ data.tar.gz: d409b2daccb1492dbab618b1577e92192e899c2e12021c2334ab1c7605a715cbe745093387ea1390f7bcef5b9a863f22f5e1231912ce59cdc50e2d0ea2ea05b0
data/README.md CHANGED
@@ -29,13 +29,24 @@ end
29
29
 
30
30
  ## Usage
31
31
 
32
+ __1.__
33
+
34
+ Sending a tweet:
35
+
32
36
  [1] pry(main)> send-tweet Hello twitter, speaking from #pry
33
37
  https://twitter.com/xxx/status/xxx
34
38
 
39
+ __2.__
40
+
41
+ Sending a tweet, with eval'ed ruby:
42
+
43
+ [2] pry(main)> send-tweet #{rand(100)}
44
+ https://twitter.com/xxx/status/xxx
45
+
35
46
  ## Install
36
47
 
37
48
  gem install pry-send_tweet.rb
38
49
 
39
50
  ## License
40
51
 
41
- MIT
52
+ [MIT](./LICENSE.txt)
@@ -1,3 +1,4 @@
1
+ require 'pry' if not defined?(Pry::ClassCommand)
1
2
  Pry.commands.add_command Class.new(Pry::ClassCommand) {
2
3
  require 'twitter'
3
4
  match 'send-tweet'
@@ -14,6 +15,12 @@ Pry.commands.add_command Class.new(Pry::ClassCommand) {
14
15
  end
15
16
 
16
17
  def client
18
+ if _pry_.config.twitter == nil
19
+ raise Pry::CommandError, "_pry_.config.twitter is nil!\n" \
20
+ "Please set the required keys and tokens to send " \
21
+ "tweets using Twitters API. \n" \
22
+ "Visit https://github.com/r-obert/pry-send_tweet.rb#readme to learn how."
23
+ end
17
24
  @client ||= begin
18
25
  Twitter::REST::Client.new {|config|
19
26
  config.consumer_key = _pry_.config.twitter.consumer_key
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "pry-send_tweet.rb"
3
- spec.version = "0.1.0"
3
+ spec.version = "0.2.0"
4
4
  spec.authors = ["Robert Gleeson"]
5
5
  spec.email = "trebor.g@protonmail.com"
6
6
  spec.summary = "pry-send_tweet.rb adds a Pry command that can send tweets using your personal twitter account."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pry-send_tweet.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Gleeson