class FeatureflowGenerator

Public Instance Methods

create_initializer_file() click to toggle source
# File lib/generators/featureflow_generator.rb, line 11
  def create_initializer_file
    unless /^srv-env-[a-f0-9]{32}$/ =~ api_key
      raise Thor::Error, "Invalid featureflow environment api key #{api_key.inspect}\nYou can find your environment api key on your featureflow dashboard at https://[APP-NAME].featureflow.io/"
    end

    initializer "featureflow.rb" do
      <<-EOF
Featureflow.configure(
  api_key: #{api_key.inspect}
)
      EOF
    end
  end