Salesforce.com Inc agreed to buy Heroku, a privately held cloud-platform company, for $212 million in cash, to expand into the fast growing social media and mobile space.

San Francisco-based Heroku, founded in 2007, hosts applications written in the Ruby programing language that is considered light and coder-friendly and is being increasingly used to develop mobile and social applications.

The acquisition will allow Salesforce to provide its third-party apps development customers an alternative to its Java platform.

Salesforce shares rose more than 3 percent to a year high.

The deal will allow Salesforce to give its clients a wider choice in terms of platform on which they want their software to run on, said Chief Marketing Officer Kendall Collins.

The acquisition gives us more breadth in the developer community that we are approaching, it (Ruby) is a more modern language than Java, Salesforce co-founder Parker Harris said.

A lot of new companies are choosing Ruby over Java. So it is also the evolution of technology and keeping pace with it.

Salesforce will also issue $27 million in stock to Heroku employees and pay $10 million in cash for unvested Heroku shares as part of the deal.

Salesforce is trying to create a platform to host enterprise and social media applications to extend its lead over Microsoft and IBM, said Trip Chowdhry, an analyst at Global Equities Research.

In terms of market share ... the next battleground is going to be at the platform level and at that level these acquisitions are catered for Salesforce to position itself in providing platform as a service (PaaS), Chowdhry said.

Chowdhry expects Salesforce to continue making acquisitions in the PaaS segment and said the company could make an acquisition every quarter.

That (further acquisitions) is something we will be looking at as we look for market demand for other languages and other platforms, Salesforce's Collins said.

The deal is expected to close in the fiscal fourth quarter ending January 31.

Shares of San Francisco-based Salesforce were up 3.2 percent at $149.96 in afternoon trade the New York Stock Exchange. They touched a year high of $150.34 earlier in the session on Wednesday.

The shares have risen 26 percent in value since the company posted strong third-quarter results on November 18.

(Reporting by Himank Sharma and Siddharth Cavale; Editing by Roshni Menon and Gopakumar Warrier)