Class: Rake::ShipitTask::Step::Twitter
- Inherits:
-
Object
- Object
- Rake::ShipitTask::Step::Twitter
- Defined in:
- lib/shipit.rb
Instance Method Summary collapse
-
#initialize(step, msg = nil) ⇒ Twitter
constructor
A new instance of Twitter.
- #prepare ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(step, msg = nil) ⇒ Twitter
Returns a new instance of Twitter.
95 96 97 |
# File 'lib/shipit.rb', line 95 def initialize(step, msg=nil) @msg = msg end |
Instance Method Details
#prepare ⇒ Object
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/shipit.rb', line 99 def prepare require "time" require "rubygems" gem "twitter4r" require "twitter" require "pit" require "pathname" @config = Pit.get("twitter.com", :require => { "login" => "login name", "password" => "password" }) @client = Twitter::Client.new(@config) raise "Twitter::Client auth failed" unless @client.authenticate?(@config["login"], @config["password"]) @description = DESCRIPTION @name = NAME @vers = VERS end |
#run ⇒ Object
119 120 121 122 |
# File 'lib/shipit.rb', line 119 def run @msg ||= "Released %s %s (%s)" % [@name, @vers, @description] @client.status(:post, @msg) end |