A plucky newsagent told this week how he foiled a suspected armed robber by brandishing a steel ruler.

Tony Earnshaw picked up the ruler, left by a customer, when he believed he was being threatened with a gun.

The raider then fled the shop empty handed.

Mr Earnshaw, 63, who runs The New Cabin in Low Street, Keighley, said: "The lad had his hand up his sleeve and he was making a movement to make me think he was armed.

"He was carrying a bag and pushed it towards me, saying he wanted money. I went round the counter and picked up the ruler, and he scarpered.

"It was his size that made me react as I did. He was only small and looked nervous."

Mr Earnshaw, who has owned the shop for 12 years, rushed outside and called out to alert passers-by.

Two men passing in a car pulled up and took the would-be robber back to the shop. Meanwhile, Mr Earnshaw had phoned the police.

At Bradford Crown Court on Tuesday, Anthony Raistrick, 20, of Temple Street, Keighley, who admitted attempted robbery, was sentenced to 15 months in a young offenders institution.

The court heard that Mr Earnshaw had just opened his shop on a Saturday morning back in December when Raistrick came in and demanded money from the till.

Prosecutor Stephen Uttley described how the plucky shopkeeper then grabbed the steel ruler from nearby and moved towards Raistrick, causing him to leave the shop.

The offender was taken back to the shop by the two passers-by, and Judge Kerry Macgill heard that he had immediately apologised for what he had done.

The passers-by, Paul Bennett and Paul Stewart, were each given awards of £150 for their public-spirited actions in detaining Raistrick, and Mr Earnshaw told police he had been determined that he didn't get any of his money.

Raistrick's barrister, Ben Crosland, stressed that his client had not in fact been carrying any kind of weapon at the time.

The court heard that Raistrick had no previous convictions and had carried out the attempted hold-up just seven days after trying to kill himself by drinking cleaning fluid.

Mr Crosland said the seeds of Raistrick's decline in 2002 had been sown when he was made redundant from his job. He revealed that his client was getting into debt because of his use of cannabis and his relationship with his girlfriend broke down when she discovered he had lied to her about his use of the drug.

"When he lost that relationship through his own fault in many respects it was a serious body blow to him," submitted Mr Crosland.

"Clearly this was a young man on the edge. He was desperate and in his desperation his judgement failed him."

Mr Crosland said Raistrick believed he might be able to resume the relationship if he could pay off some of the debts he owed, and when the opportunity arose he committed what was a rather half-hearted offence.

He conceded that his client had motioned to Mr Earnshaw as if he had something with him, but when the shopkeeper showed some backbone and brandished what Raistrick thought was a knife he fled.

Mr Crosland urged Judge Macgill to view Raistrick's personal history and circumstances at the time as exceptional, and submitted that a non-custodial sentence could be imposed.

Judge Macgill said compared to some histories Raistrick's difficulties paled into insignificance, but that he had a duty to protect the public.

He did, however, take account of the mitigation put forward on Raistrick's behalf in reducing his sentence in a young offenders institution to 15 months.

"You are now 20. It's about time you grew up and took responsibility for your own life and didn't rely on other people," he told him.