My development stories in Pittsburgh

A San Francisco Developer Returning to Her Pittsburgh Homeland

Ruby & Rails Community in Pittsburgh, PA

Every week, I get an email from a junior developer requesting my thoughts on the Ruby and Rails scene in Pittsburgh, PA. As a working RoR developer/RoR mentor and a loud and proud Pittsburgher, I love to see Ruby and RoR being utilized by the community. 

With the exciting announcement of Railsconf landing in Pittsburgh in 2018, it was time to pour as much as I know about the Ruby and Rails community here into one place. 

Pittsburgh is still an enterprise programming language town. When I asked a local recruiter which languages he sees the most demand for, he quickly answered, “.NET, Java and C”. It is difficult to be a junior developer in Pittsburgh but even more so if you are only comfortable with Ruby. I was fortunate that I had progressed to the intermediate level before I moved back. Ruby still has an imprint here, as you can see for the list below.

Note: I’m absolutely sure I will miss something so please comment below or tweet at me (@BrittJMartin) with any edits you would like to make.

Companies that Use Ruby

  • 4Moms
  • Openarc’s Consulting Division
  • Showclix
  • Branding Brand
  • Wombat Security
  • Think Through Math
  • Philips Respironics
  • Companies that Use Ruby & Rails

Pittsburgh Cultural Trust

  • Stitchfix
  • Modcloth
  • Workdesq
  • Jetpack Workflow
  • Rivers Agile
  • AE Dreams
  • UPMC
  • Netbeez
  • IBM
  • Forever
  • LUMA Institute
  • Local Programs that Teach Ruby or Rails

How to Add a Slack Notifier with Slack-Notifier and Sidekiq

Recently, my boss had the brilliant idea to route the request to a private Slack channel when our Ruby on Rails website processed a customer’s contact form. It’s ideal for spotting specific website issues and to stay tuned to our patrons interacting with our site.

I came across the excellent slack-notifier gem. I bundled in: 

gem "slack-notifier"
gem "json"

Time to add in a custom incoming webhook in Slack. Incoming Webhooks are a simple way to post messages from external sources into Slack. They make use of normal HTTP requests with a JSON payload that includes the message text and some options. Once you have the Slack URL, I added it to our Figaro application.yml as SLACK.

Next step is to add an initializer for Slack in config/initializers/slack.rb.

require 'slack-notifier'

SLACK = Slack::Notifier.new "#{ENV['SLACK']}"

We’re already proud Sidekiq users. Processing the Slack message was ideal for a background worker so let’s build a SlackNotifierWorker. 

require 'json'

class SlackNotifierWorker
  include Sidekiq::Worker
  queue_name = "default"
  sidekiq_options queue: queue_name

  def perform(hash={})
    notification = {
        "username": "csibot",
        "icon_emoji": ":loudspeaker:",
        "fields": [
            {
                "title": "Organization",
                "value": "#{hash['org']}"
            },
            {
                "title": "Path",
                "value": "#{hash['site_id']}"
            },
            {
                "title": "Category",
                "value": "#{hash['category']}"
            },
            {
                "title": "Notes",
                "value": "#{(hash['notes'])}"
            }
        ]
    }

    SLACK.ping notification
  end

end

Remember to set the queue (default since it is not critical), emoji icon (important!) and to utilize Slack’s nifty message formatter. 

Our last step is to trigger the SlackNotifierWorker during the flow of a user submitting a contact form. 

SlackNotifierWorker.perform_async(org: @org, notes: @notes, category: category_string, site_id: site.id)