After some research, I came across the company mode git hub ticket,
which says that company mode uses dabbrev for plain text as backend.
dabbrev has an option to downcase things, it is turned on by default but can be turned off:
(setq company-dabbrev-downcase nil)
Now all is well.
See options dabbrev-case-fold-search and dabbrev-upcase-means-case-search:
dabbrev-case-fold-search is a variable defined in `dabbrev.el'.
Its value is case-fold-search
This variable can be risky when used as a file-local variable.
Control whether dabbrev searches should ignore case.
A value of nil means case is significant.
A value of `...
-- this is meant to be a comment but I don't have enough reputation for it --
I did a quick test with emacs -Q
I typed "showPublic" then "show M-/" and it completed as "showPublic" (emacs 24.4) so I think it might be a configuration problem.
Could you retry editing your document in context while launching emacs with the -Q option?
If the completion is ...
@Dmitry made a great point that hippie-expand will do what I'm desiring when : is considered a punctuation character.
It's obviously not ideal to just set (modify-syntax-entry ?: "." ruby-mode-syntax-table) in your init and call it a day, because then only some_action in :some_action is considered a symbol which would break expectations for other plugins. ...
Since you seem to use dabbrev without company setting following 2 variables, could help:
(setq dabbrev-case-fold-search nil
To see documentation and other possible settings you could use:
M-x customize-group <RET> dabbrev <RET>
An alternative to dabbrev would be hippie-expand
This can be done using abbrev mode:
;; Hook to go back N chars after completion.
(defun my-abbrev-back-4-no-self-insert ()
(put 'my-abbrev-back-4-no-self-insert 'no-self-insert t)
(list "$" "<m></m>" 'my-abbrev-back-4-no-self-insert ...