wordbot 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c5fa93326eb4d212f2bb997d415642c7ee5dc14b
4
- data.tar.gz: eb4ffb556bfa002cde260a06d79e2a440f9e43fc
3
+ metadata.gz: f129a69132774c91c47e2a2bc9e1dcb64736f66b
4
+ data.tar.gz: 596fc000f8ff1d25aef7d22386c1c08b23356652
5
5
  SHA512:
6
- metadata.gz: 17cf1bba2a6c23b1166274eb75863684e909576c741a69c217e221092de48168d383da7ab1f833e7f80e808e76089d2da50d535d3086ac17102ca73984374212
7
- data.tar.gz: 39436873f852445e03ff8752a3f26fdf4c605e98aceae63a683a4f26ff9a19a477ea942ddbc1c340cdb7e890c8bdaa694d44691dcdf61347ce94313d635e8c0a
6
+ metadata.gz: 41b54151d9c222dec3f0f81c8f2a64577d8ee4da0fc48849eb186005c9f24ba0316fb6da2db85f6d05c2779b88f25f8e23b9590c745e8d841b311cd36a9f527b
7
+ data.tar.gz: 51551a5f46fbcceb752cc7b98059b5d2ea0aa21bec01e44fc8c04cfc42083fbc29fe89dcec68ef6f814f2a585bfa016699790c9e102cff239e1d6acdbe677de8
@@ -1,4 +1,6 @@
1
1
  require 'thor'
2
+ require 'twitter'
3
+ require 'yaml'
2
4
 
3
5
  require 'wordbot/bot'
4
6
  require 'wordbot/version'
@@ -13,6 +13,22 @@ module Wordbot
13
13
  def generate *words
14
14
  puts Wordbot::Bot.mutilate words.join ' '
15
15
  end
16
+ map %w(-g --generate) => :generate
17
+
18
+ desc 'tweet', 'Tweet the mutilated text'
19
+ def tweet *words
20
+ yaml = YAML.load File.open "#{ENV['HOME']}/.wordbotrc"
21
+ client = Twitter::REST::Client.new do |config|
22
+ config.consumer_key = yaml['twitter']['consumer']['key']
23
+ config.consumer_secret = yaml['twitter']['consumer']['secret']
24
+ config.access_token = yaml['twitter']['oauth']['token']
25
+ config.access_token_secret = yaml['twitter']['oauth']['secret']
26
+ end
27
+
28
+ tweet = Wordbot::Bot.mutilate words.join ' '
29
+ client.update tweet
30
+ end
31
+ map %w(-t --tweet) => :tweet
16
32
  end
17
33
  end
18
34
  end
@@ -1,3 +1,3 @@
1
1
  module Wordbot
2
- VERSION = "0.0.3"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ['lib']
20
20
 
21
21
  spec.add_dependency 'thor', '~> 0.19'
22
+ spec.add_dependency 'twitter', '~> 5.0'
22
23
 
23
24
  spec.add_development_dependency 'bundler', '~> 1.7'
24
25
  spec.add_development_dependency 'rake', '~> 10.0'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wordbot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - pikesley
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.19'
27
+ - !ruby/object:Gem::Dependency
28
+ name: twitter
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '5.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '5.0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement