Add support for Big and Little Endian modifiers

This pull request also fixes encoding issues in existing tests caused by upgrading ruby from 1.8.7 to 1.9.3.
@Fryguy, @chessbyte please review.


Yea I hate to say it but this was another case of attempting to fix the 
"void context" warning.  I'll undo the badness....
On 7/16/14, 3:11 PM, Jason Frey wrote:
>
> In spec/endian_spec.rb:
>
> > +                                    "long" => 3_683_797_248,
> > +                                    :short => 18_688,
> > +                                    "bc"   => "BC",
> > +                                    "none" => ""}
> > +  BIG_ENDIAN_STRUCT_DECODED_HASH = {:quad  => 20_709_143_206_541_055,
> > +                                    "long" => 4_821_723,
> > +                                    :short => 73,
> > +                                    "none" => "",
> > +                                    "bc"   => "BC"}
> > +
> > +  it('.new') { ->() { BinaryStruct.new }.should_not raise_error }
> > +  it('.new with big definition') { ->() { BinaryStruct.new(BIG_STRUCT_DEF) }.should_not raise_error }
> > +  it('.new with little definition') { ->() { BinaryStruct.new(LIL_STRUCT_DEF) }.should_not raise_error }
> > +  it('.new with big definition with *') { ->() { BinaryStruct.new(BIG_STRUCT_DEF_STAR) }.should_not raise_error }
> > +  it('.new with little definition with *') { ->() { BinaryStruct.new(LIL_STRUCT_DEF_STAR) }.should_not raise_error }
> > +  it '.new with another big endian BinaryStruct should ==' do
>
> This string doesn't read like English when run as a standalone spec 
> because of the "should ==" at the end. Plus, it's hard to 
> differentiate it from the next |it|. In this case you are essentially 
> doing two tests on the same stuff, so you can probably just put them 
> in the same it. Maybe something like
>
> it  '.new with another big endian BinaryStruct'  do
>    s   =  BinaryStruct.new(BIG_STRUCT_DEF)
>    s2  =  BinaryStruct.new(s)
>    s2.should  ==  s
>    s2.should_not  equal(s)
> end
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/ManageIQ/binary_struct/pull/3/files#r15020670>.
>

-- 
Jerry Keselman
Red Hat Virtualization R&D
jerryk@redhat.com | p. 212 530 7873