I saw a bunch of those two-pack tourist boxes of pineapples on the baggage carousel a few weeks ago at LAX coming in from HNL with gate-check tags, which suggests to me that TSA was OK with it but the gate agents weren't. Could have been space issues as the flight was full.
Personally I'd rather be attacked with a pumpkin than a pineapple. So I'd think you're OK, to a point.