Keep Your README Install Instructions Up To Date

Brian Cardarella

CEO & Founder

Brian Cardarella

By default, all new generated Elixir apps via mix new include a nice installation snippet in the

However, I am always forgetting to update the version constraint in the whenever I bump my app to a new version. Well, no more, after using this simple unit test:

test "README install version check" do
  app = :my_app

  app_version = "#{Application.spec(app, :vsn)}"
  readme =!("")
  [_, readme_versions] ={:#{app}, "(.+)"}/, readme)

  assert Version.match?(
         Install version constraint in does not match to current app version.
         Current App Version: #{app_version}
         Readme Install Versions: #{readme_versions}

Of course you will need to update the app value to whatever your app’s name is.


DockYard is a digital product agency offering exceptional strategy, design, full stack engineering, web app development, custom software, Ember, Elixir, and Phoenix services, consulting, and training.


Stay in the Know

Get the latest news and insights on Elixir, Phoenix, machine learning, product strategy, and more—delivered straight to your inbox.

Narwin holding a press release sheet while opening the DockYard brand kit box