diff --git a/lib/omniauth.rb b/lib/omniauth.rb index dc315ee..f9cfaf8 100644 --- a/lib/omniauth.rb +++ b/lib/omniauth.rb @@ -159,7 +159,7 @@ module OmniAuth if first_letter_in_uppercase word.to_s.gsub(%r{/(.?)}) { '::' + Regexp.last_match[1].upcase }.gsub(/(^|_)(.)/) { Regexp.last_match[2].upcase } else - word.first + camelize(word)[1..-1] + camelize(word).tap { |w| w[0] = w[0].downcase } end end end diff --git a/spec/omniauth_spec.rb b/spec/omniauth_spec.rb index 12f3161..8013ccb 100644 --- a/spec/omniauth_spec.rb +++ b/spec/omniauth_spec.rb @@ -148,6 +148,10 @@ describe OmniAuth do OmniAuth.config.add_camelization('oauth', 'OAuth') expect(OmniAuth::Utils.camelize(:oauth)).to eq('OAuth') end + + it 'doesn\'t uppercase the first letter when passed false' do + expect(OmniAuth::Utils.camelize('apple_jack', false)).to eq('appleJack') + end end end end