Skip to content

Instantly share code, notes, and snippets.

@rodrigopinto
Created February 22, 2019 19:33
Show Gist options
  • Save rodrigopinto/d192384b3b36c74640014b3e0d1824b4 to your computer and use it in GitHub Desktop.
Save rodrigopinto/d192384b3b36c74640014b3e0d1824b4 to your computer and use it in GitHub Desktop.
require "can_use"
# Example using default envinronment and feature? block
CanUse.configure do |config|
config.file = "config/features.yaml"
end
CanUse.feature?("show_puts") do
puts "It is diplaying"
end
###############################
# Example using envinronment and if
CanUse.configure do |config|
config.file = "config/features.yaml"
config.environment = "production"
end
if CanUse.feature?("show_puts")
puts "IT WON'T BE DISPLAYED"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment