Right now there is some confusion regarding the rubies. Blizzard lists them as giving a flat bonus (which is true in most cases) despite the damage range which you can see in the tool tip in game. Attack speed seem not to modify the bonus of the rubies in most cases.
Let's say you have a 1-hand axe with 17-31 damage with an empty socket and no other bonuses. This axe would give you a DPS of 31.2 since axes allow base speed of 1.3 attacks per second:
Mean damage (D) = (17+31)/2 = 24
Attack speed (S) = 1.3
DPS = D • S = 31.2
A perfect ruby gives a flat +11 damage as you can see in Blizzard's item database. In game, you will see a bonus of 11-22 damage but for now you can consider this wrong for all rubies. Just take the minimum damage as flat bonus.
With a perfect ruby the increased DPS of your weapon would be 45.5:
Perfect ruby damage bonus (B) = 11
DPS = (D + B) • S = 45.5
Sometimes you may observe strange increases of your damage which differ from the flat bonus the rubies should give and which may be linked to the attack speed. But with this formula you will have at least a good approximation of the DPS after socketing.
12-12
), and one based on maximum Ruby effectiveness (i.e.12-24
). You should be able to compare those two numbers and get a feel for the range of difference involved.