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.


As discussed - this was an attempt to eliminate the "void context" warning.
I've undone the split into two "it"s.

J
On 7/16/14, 3:01 PM, Jason Frey wrote:
>
> In spec/binary_struct_spec.rb:
>
> > @@ -102,9 +103,11 @@
> >      end
> >
> >      it '#encode' do
> > -      BinaryStruct.encode(STRUCT_DECODED_HASH, STRUCT_DEF).should == STRUCT_ENCODED_STR
> > -      # Do it twice for consistency reasons
> > -      BinaryStruct.encode(STRUCT_DECODED_HASH, STRUCT_DEF).should == STRUCT_ENCODED_STR
> > +      BinaryStruct.encode(STRUCT_DECODED_HASH, STRUCT_DEF).should == STRUCT_ENCODED_STR.force_encoding("ASCII-8BIT")
> > +    end
> > +    # Do it twice for consistency reasons
>
> Can you explain this? Since specs run out of order, technically this 
> is incorrect. To do it correctly, you should create a second spec with 
> two successive calls, or just do it twice in the same |it|.
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/ManageIQ/binary_struct/pull/3/files#r15020076>.
>

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