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.


Done
On 7/16/14, 2:59 PM, Jason Frey wrote:
>
> In lib/binary_struct.rb:
>
> >    def self.get_size(definition)
> >      size = 0
> >      definition.each_slice(2) do |format, _|
> > -      type, count = format[0, 1], format[1..-1]
> > -      count = count.empty? ? 1 : count.to_i
> > +      type, count        = format[0, 1], format[1..-1]
> > +      modifier, modcount = count[0, 1], count[1..-1]
> > +      if validate_definition_entry_modifier(modifier)
> > +        count = modcount.empty? ? 1 : modcount.to_i
> > +      else
> > +        count = count.empty? ? 1 : count.to_i
> > +      end
>
> To prevent duplication can this |if| just be
>
> count  =  modcount  if  validate_definition_entry_modifier(modifier)
> count  =  count.empty?  ?  1  :  count.to_i
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/ManageIQ/binary_struct/pull/3/files#r15019961>.
>

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