cogbot 0.1.0 → 0.1.1

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: b9d9664ca1646112e9628e26f234fb7bc8cb9b0b
4
- data.tar.gz: 2c92dcb9512880d86e566194d2b3c8d2286137e7
3
+ metadata.gz: e507f5555aea13239fa0c558da83b0adaff0769c
4
+ data.tar.gz: bcb41ab67f0dec2678ab884d5eff810907afbf94
5
5
  SHA512:
6
- metadata.gz: fa98c1e6cc7752dd1290e419bec6c2315edf8d723ae46240e7175735617013fa9ffed686fc9ac0d8d78135a28849d2bc7074e93cfaaf4ebe15248e4e473dd79e
7
- data.tar.gz: d0c2f578b43faf796f32c74f38d8301f3309d2234bcb07d811172b494319c440f77dfd04d07ea85f3e9f4f698add1d2d2d1d8629fd879b1e763bf3d47a7c0bd7
6
+ metadata.gz: ad328acddaf1f81bed239d03e5c1f7d052a820ec1569ca2092ff0f6512b7201bba96eb35c5c27a8e207fff2e7ddae05bf9a3846961ac04dff8da5df1a1360d02
7
+ data.tar.gz: a8604ada50f361692af7a5f097f2564e0f4f4cf552e2a018f1213acb63411aa6d4c852033e373626e1d21c9acd865e80412a90d5e172cbf825c379d496d5a1db
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  Cogbot Changelog
2
2
  ===================
3
3
 
4
+ ## v0.1.1 - 2015-01-28
5
+ - avoid disclose local path in nmanager plugin when plugin not found
6
+ - fix setup message config.yaml to cogbot.yaml
7
+
4
8
  ## v0.1.0 - 2015-01-08
5
9
  - upgrade dependency to cinch 2.0.6 to 2.2.2
6
10
  - upgrade other gems as well
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cogbot (0.1.0)
4
+ cogbot (0.1.1)
5
5
  cinch (~> 2.2.2)
6
6
  daemons (~> 1.1.9)
7
7
  eventmachine (~> 1.0.4)
@@ -19,43 +19,43 @@ GEM
19
19
  addressable (2.3.6)
20
20
  awesome_print (1.6.1)
21
21
  buftok (0.2.0)
22
- cinch (2.2.2)
22
+ cinch (2.2.3)
23
23
  coderay (1.1.0)
24
24
  daemons (1.1.9)
25
25
  docile (1.1.5)
26
26
  equalizer (0.0.9)
27
27
  eventmachine (1.0.4)
28
28
  eventmachine_httpserver (0.2.1)
29
- faraday (0.9.0)
29
+ faraday (0.9.1)
30
30
  multipart-post (>= 1.2, < 3)
31
- flog (4.3.0)
31
+ flog (4.3.1)
32
32
  ruby_parser (~> 3.1, > 3.1.0)
33
33
  sexp_processor (~> 4.4)
34
34
  fortune_gem (0.0.8)
35
35
  http (0.6.3)
36
36
  http_parser.rb (~> 0.6.0)
37
37
  http_parser.rb (0.6.0)
38
- json (1.8.1)
38
+ json (1.8.2)
39
39
  memoizable (0.4.2)
40
40
  thread_safe (~> 0.3, >= 0.3.1)
41
41
  method_source (0.8.2)
42
42
  mini_portile (0.6.2)
43
- minitest (5.5.0)
43
+ minitest (5.5.1)
44
44
  minitest-ci (3.0.3)
45
45
  minitest (~> 5.0, >= 5.0.6)
46
46
  multi_json (1.10.1)
47
47
  multipart-post (2.0.0)
48
48
  naught (1.0.0)
49
- nokogiri (1.6.5)
49
+ nokogiri (1.6.6.2)
50
50
  mini_portile (~> 0.6.0)
51
51
  pry (0.10.1)
52
52
  coderay (~> 1.1.0)
53
53
  method_source (~> 0.8.1)
54
54
  slop (~> 3.4)
55
55
  rake (10.4.2)
56
- ruby_parser (3.6.3)
56
+ ruby_parser (3.6.4)
57
57
  sexp_processor (~> 4.1)
58
- sexp_processor (4.4.4)
58
+ sexp_processor (4.4.5)
59
59
  simple_oauth (0.3.1)
60
60
  simplecov (0.9.1)
61
61
  docile (~> 1.1.0)
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Cogbot
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/cogbot.svg)](http://badge.fury.io/rb/cogbot)
4
+
3
5
  Cogbot is an irc bot written in ruby based on [Cinch bot framework](https://github.com/cinchrb/cinch).
4
6
 
5
7
  It has been in service at [Code Green](http://codegreenit.com) from 2012 to 2013 and his stability
@@ -25,6 +27,17 @@ At first launch:
25
27
  you will be prompted to create a configuration file in ~/.cogbot/cogbot.yml
26
28
  When this is done you can launch again and it will just run according to your configuration.
27
29
 
30
+ ## Development
31
+
32
+ git clone git@github.com:mose/cogbot.git
33
+ cd cogbot/
34
+ bundle install --path vendor
35
+ bundle exec ruby -Ilib bin/cogbot start
36
+
37
+ To reload plugins while developing, you can issue, on a channel where your bot is sitting:
38
+
39
+ .m reload myplugin
40
+
28
41
  ## Contributing
29
42
 
30
43
  1. Fork it
@@ -42,4 +55,4 @@ When this is done you can launch again and it will just run according to your co
42
55
 
43
56
  MIT license
44
57
 
45
- Copyright (c) 2012-13 mose at Code Green
58
+ Copyright (c) 2012-15 mose at mose
data/lib/cogbot/setup.rb CHANGED
@@ -35,7 +35,7 @@ module Cogbot
35
35
  default = YAML::load_file(File.join(ROOT_DIR,'config','cogbot.yml.defaults'))
36
36
  main = {}
37
37
  puts "You don't have a configuration file yet,"
38
- puts "let's make one in ~/.cogbot/config.yml"
38
+ puts "let's make one in ~/.cogbot/cogbot.yml"
39
39
  puts
40
40
  puts "Please answer those few questions"
41
41
 
@@ -1,3 +1,3 @@
1
1
  module Cogbot
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/plugins/manager.rb CHANGED
@@ -23,7 +23,7 @@ module Cinch
23
23
 
24
24
  file_name = "#{ROOT_DIR}/plugins/#{mapping.downcase}.rb"
25
25
  unless File.exist?(file_name)
26
- m.reply "Could not load #{plugin} because #{file_name} does not exist."
26
+ m.reply "Could not load #{plugin} because #{File.basename(file_name)} does not exist."
27
27
  return
28
28
  end
29
29
 
data/plugins/tweet.rb CHANGED
@@ -1,4 +1,8 @@
1
+ # doc on https://github.com/sferik/twitter
2
+ # get tokens on https://apps.twitter.com
3
+
1
4
  require 'twitter'
5
+ require 'awesome_print'
2
6
 
3
7
  module Cinch
4
8
  module Plugins
@@ -13,34 +17,36 @@ Tweet makes the bot can query twittter API
13
17
  .t search <term> : searches the public timelines
14
18
  EOT
15
19
 
16
- =begin
17
- Twitter.configure do |c|
18
- c.consumer_key = @bot.config.options.cogconf['tweet']['consumer_key']
19
- c.consumer_secret = @bot.config.options.cogconf['tweet']['consumer_secret']
20
- c.oauth_token = @bot.config.options.cogconf['tweet']['oauth_token']
21
- c.oauth_token_secret = @bot.config.options.cogconf['tweet']['oauth_token_secret']
22
- end
23
- =end
20
+ def client
21
+ @_client ||= Twitter::REST::Client.new do |c|
22
+ c.consumer_key = @bot.config.options['cogconf']['tweet']['consumer_key']
23
+ c.consumer_secret = @bot.config.options['cogconf']['tweet']['consumer_secret']
24
+ c.access_token = @bot.config.options['cogconf']['tweet']['access_token']
25
+ c.access_token_secret = @bot.config.options['cogconf']['tweet']['access_token_secret']
26
+ end
27
+ end
24
28
 
25
29
  def new(bot)
26
30
  @bot = bot
27
31
  end
28
32
 
29
- def exec(command,args)
33
+ def exec(command, args)
30
34
  back = ''
31
35
  #back += "command: #{command} / args: #{args}\n"
32
36
  begin
33
37
  case command
34
38
  when 'search'
35
- Twitter.search(args, { :lang => 'en', :rpp => '3' }).each do|status|
36
- back += status.full_text + "\n"
39
+ client.search(args).take(3).each do |status|
40
+ back += Format(:bold, :underline, :yellow, "@#{status.user.screen_name}") + " " + status.text + "\n"
37
41
  end
38
42
  else
39
- back += Twitter.send(command,args.split(','))
43
+ back += "Usage: .t search <term> : searches the public timelines"
44
+ #back += Twitter.send(command,args.split(','))
40
45
  end
41
46
  rescue Exception => e
42
47
  back += "Bad request\n"
43
48
  back += e.inspect
49
+ back += e.backtrace.join("\n")
44
50
  end
45
51
  return back
46
52
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cogbot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - mose
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-08 00:00:00.000000000 Z
11
+ date: 2015-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cinch