Class: Rake::ShipitTask::Step::Twitter

Inherits:
Object
  • Object
show all
Defined in:
lib/shipit.rb

Instance Method Summary collapse

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

#prepareObject



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

#runObject



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