<commit_before>require 'hiera/backend/eyaml/subcommand'
require 'hiera/backend/eyaml'

class Hiera
  module Backend
    module Eyaml
      module Subcommands

        class Version < Subcommand

          def self.options
            []
          end

          def self.description
            "show version information"
          end

          def self.execute

            puts <<-EOS
Version info

hiera-eyaml (core): #{Eyaml::VERSION}
#{Plugins.plugins.collect {|plugin| 
  plugin.name.split("hiera-eyaml-").last
}.collect {|plugin|
  "    hiera-eyaml-#{plugin} (gem): " + Encryptor.find(plugin)::VERSION.to_s
}.join("\n")}
EOS
          end

        end

      end
    end
  end
end<commit_msg>Fix for version to be backwards compatible with plugins<commit_after>require 'hiera/backend/eyaml/subcommand'
require 'hiera/backend/eyaml'

class Hiera
  module Backend
    module Eyaml
      module Subcommands

        class Version < Subcommand

          def self.options
            []
          end

          def self.description
            "show version information"
          end

          def self.execute
            plugin_versions = {}

            puts <<-EOS
Version info

hiera-eyaml (core): #{Eyaml::VERSION}
EOS

            Plugins.plugins.each do |plugin|
              plugin_shortname = plugin.name.split("hiera-eyaml-").last
              plugin_version = begin
                Encryptor.find(plugin_shortname)::VERSION.to_s
              rescue
                "unknown (is plugin compatible with eyaml 2.0+ ?)"
              end
              puts "    hiera-eyaml-#{plugin_shortname} (gem): #{plugin_version}"
            end

            nil
            
          end

        end

      end
    end
  end
end
{'fraction_non_alphanumeric': 0.08850574712643679, 'fraction_numerical': 0.0011494252873563218, 'mean_word_length': 1.6992248062015505, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, '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': '6262990', 'n_tokens_mistral': 503, 'n_tokens_neox': 489, 'n_words': 120}