Shopify / measured

Encapsulate measurements and their units in Ruby and Ruby on Rails.
MIT License
337 stars 28 forks source link

Require active_support/all correctly. Bump version 0.0.10 #17

Closed kmcphillips closed 9 years ago

kmcphillips commented 9 years ago

@cyprusad @garethson

Found a require bug when working with @mdking. Requiring active_support actually doesn't include much, including many helpers that are assumed to exist:

~/s/measured(master)$ irb
irb(main):001:0> require 'measured'
=> true
irb(main):002:0> Measured::Length.new(1, :cm)
NoMethodError: undefined method `blank?' for :cm:Symbol
    from /Users/kevin/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/measured-0.0.9/lib/measured/measurable.rb:8:in `initialize'
    from (irb):2:in `new'
    from (irb):2
    from /Users/kevin/.rbenv/versions/2.1.1/bin/irb:11:in `<main>'
kmcphillips commented 9 years ago

Had to fix a test. Active Support includes some overrides for to_s so it slightly modified the inspect output: https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/big_decimal/conversions.rb

garethson commented 9 years ago

:ship: