<commit_before>Feature: Rails
  Background:
    Given a new Rails app
    And I add figaro as a dependency
    And I bundle
    And I create "lib/tasks/hello.rake" with:
      """
      task :hello => :environment do
        puts ["Hello", ENV["HELLO"]].compact.join(", ") << "!"
      end
      """

  Scenario: Has no application.yml
    When I run "bundle exec rake hello"
    Then the output should be "Hello!"

  Scenario: Has application.yml without requested key
    When I create "config/application.yml" with:
      """
      GOODBYE: Ruby Tuesday
      """
    And I run "bundle exec rake hello"
    Then the output should be "Hello!"

  Scenario: Has blank application.yml
    When I create "config/application.yml" with:
      """
      """
    And I run "bundle exec rake hello"
    Then the output should be "Hello!"

  Scenario: Has commented application.yml
    When I create "config/application.yml" with:
      """
      # Comment
      """
    And I run "bundle exec rake hello"
    Then the output should be "Hello!"

  Scenario: Has application.yml with requested key
    When I create "config/application.yml" with:
      """
      HELLO: world
      """
    And I run "bundle exec rake hello"
    Then the output should be "Hello, world!"

  Scenario: Generator creates and ignores application.yml file
    When I run "bundle exec rails generate figaro:install"
    Then "config/application.yml" should exist
    And ".gitignore" should contain "/config/application.yml"

  Scenario: Generator only creates application.yml if not using Git
    Given I run "rm .gitignore"
    When I run "bundle exec rails generate figaro:install"
    Then "config/application.yml" should exist
    But ".gitignore" should not exist

  Scenario: Rake task attempts to configure Heroku
    Given the "heroku" command is:
      """
      #!/usr/bin/env ruby
      puts "Attempted: heroku #{ARGV.join(" ")}"
      """
    And I create "config/application.yml" with:
      """
      FOO: bar
      """
    When I run "bundle exec rake figaro:heroku"
    Then the output should be "Attempted: heroku config:add FOO=bar"

  Scenario: Rake task attempts to configure a specific Heroku app
    Given the "heroku" command is:
      """
      #!/usr/bin/env ruby
      puts "Attempted: heroku #{ARGV.join(" ")}"
      """
    And I create "config/application.yml" with:
      """
      FOO: bar
      """
    When I run "bundle exec rake figaro:heroku[my-app]"
    Then the output should be "Attempted: heroku config:add FOO=bar --app my-app"<commit_msg>Remove "bundle exec" from the Rails feature<commit_after>Feature: Rails
  Background:
    Given a new Rails app
    And I add figaro as a dependency
    And I bundle
    And I create "lib/tasks/hello.rake" with:
      """
      task :hello => :environment do
        puts ["Hello", ENV["HELLO"]].compact.join(", ") << "!"
      end
      """

  Scenario: Has no application.yml
    When I run "rake hello"
    Then the output should be "Hello!"

  Scenario: Has application.yml without requested key
    When I create "config/application.yml" with:
      """
      GOODBYE: Ruby Tuesday
      """
    And I run "rake hello"
    Then the output should be "Hello!"

  Scenario: Has blank application.yml
    When I create "config/application.yml" with:
      """
      """
    And I run "rake hello"
    Then the output should be "Hello!"

  Scenario: Has commented application.yml
    When I create "config/application.yml" with:
      """
      # Comment
      """
    And I run "rake hello"
    Then the output should be "Hello!"

  Scenario: Has application.yml with requested key
    When I create "config/application.yml" with:
      """
      HELLO: world
      """
    And I run "rake hello"
    Then the output should be "Hello, world!"

  Scenario: Generator creates and ignores application.yml file
    When I run "rails generate figaro:install"
    Then "config/application.yml" should exist
    And ".gitignore" should contain "/config/application.yml"

  Scenario: Generator only creates application.yml if not using Git
    Given I run "rm .gitignore"
    When I run "rails generate figaro:install"
    Then "config/application.yml" should exist
    But ".gitignore" should not exist

  Scenario: Rake task attempts to configure Heroku
    Given the "heroku" command is:
      """
      #!/usr/bin/env ruby
      puts "Attempted: heroku #{ARGV.join(" ")}"
      """
    And I create "config/application.yml" with:
      """
      FOO: bar
      """
    When I run "rake figaro:heroku"
    Then the output should be "Attempted: heroku config:add FOO=bar"

  Scenario: Rake task attempts to configure a specific Heroku app
    Given the "heroku" command is:
      """
      #!/usr/bin/env ruby
      puts "Attempted: heroku #{ARGV.join(" ")}"
      """
    And I create "config/application.yml" with:
      """
      FOO: bar
      """
    When I run "rake figaro:heroku[my-app]"
    Then the output should be "Attempted: heroku config:add FOO=bar --app my-app"
{'fraction_non_alphanumeric': 0.10195141377937077, 'fraction_numerical': 0.0, 'mean_word_length': 2.605886575735822, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6474029', 'n_tokens_mistral': 1535, 'n_tokens_neox': 1457, 'n_words': 565}