andey/bestofama

View on GitHub
app/helpers/ops_helper.rb

Summary

Maintainability
A
0 mins
Test Coverage
module OpsHelper

  # Parse wikipedia url, and return mobile url
  def wikipedia_mobile(full_url)
    match = /https?:\/\/en.(.*)/.match(full_url)
    if match[1]
      return "https://en.m.#{match[1]}"
    end
  end
end