Skip to content

Instantly share code, notes, and snippets.

@jugyo
Created July 31, 2009 03:41
Show Gist options
  • Save jugyo/159073 to your computer and use it in GitHub Desktop.
Save jugyo/159073 to your computer and use it in GitHub Desktop.
diff --git a/lib/plugins/defaults/retweet.rb b/lib/plugins/defaults/retweet.rb
index 560128a..cb3debc 100644
--- a/lib/plugins/defaults/retweet.rb
+++ b/lib/plugins/defaults/retweet.rb
@@ -1,18 +1,18 @@
# -*- coding: utf-8 -*-
config.plugins.retweet.set_default(:format, '<%= comment %>RT @<%=s.user.screen_name%>: <%=s.text%>')
-config.plugins.retweet.set_default(:block_protected, true)
module Termtter::Client
def self.post_retweet(s, comment = nil)
- if config.plugins.retweet.block_protected && s.user.protected
- puts "#{s.user.screen_name} is protected."
- else
- comment += ' ' unless comment.nil?
- text = ERB.new(config.plugins.retweet.format).result(binding)
- Termtter::API.twitter.update(text)
- puts "=> #{text}"
+ if s.user.protected &&
+ !confirm("#{s.user.screen_name} is protected! Are you sure?", false)
+ return
end
+
+ comment += ' ' unless comment.nil?
+ text = ERB.new(config.plugins.retweet.format).result(binding)
+ Termtter::API.twitter.update(text)
+ puts "=> #{text}"
end
register_command(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment