Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Merge requests
  • !8149

Closed
Created Oct 23, 2014 by Administrator@rootOwner
  • Report abuse
Report abuse

Use send only where necessary

  • Overview 25
  • Commits 1
  • Changes 22

Created by: cirosantilli

Prefer public_send if methods are public, and method calls if the method is a constant symbol.

public_send mentioned in bbatsov: https://github.com/bbatsov/ruby-style-guide#prefer-public-send

Under app and lib:

find . -iname "*.rb" | xargs perl -lapi -e 's/\.send\b/.public_send/'

but some manual refactor was also done in addition.

Exceptions:

  • self.send and just send. I moved self.send to just send for uniformity and to avoid hound barks. In those cases, the call can access private methods, so it does not matter.
  • at lib/redcarpet/render/gitlab_html there is an h.send which causes problems is replaced... seems like we are using something we shouldn't.
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: github/fork/cirosantilli/send-only-when-necessary