<commit_before>require "state_transition/version"
require "state_transition/deep_copy"

module StateTransition
  class StateMachine
    if RUBY_VERSION >= "2.1.0"
      using DeepCopy
    end

    attr_reader :current, :define_actions

    def initialize(data = nil)
      @state_list = Hash.new{|hash, key| hash[key] = {}}
      @callbacks = {}
      @define_actions = []

      begin
        @current = data[:initial] 
      rescue 
        raise StandardError, "StateMachine: Not define first state."
      end

      @current = data[:initial]

      create_move_action(data[:actions] || [])
      create_callbacks(data[:callbacks] || [])
    end<commit_msg>Version under 2.1 is not move.<commit_after>require "state_transition/version"
require "state_transition/deep_copy"

module StateTransition
  class StateMachine
    using DeepCopy

    attr_reader :current, :define_actions

    def initialize(data = nil)
      @state_list = Hash.new{|hash, key| hash[key] = {}}
      @callbacks = {}
      @define_actions = []

      begin
        @current = data[:initial] 
      rescue 
        raise StandardError, "StateMachine: Not define first state."
      end

      @current = data[:initial]

      create_move_action(data[:actions] || [])
      create_callbacks(data[:callbacks] || [])
    end
{'fraction_non_alphanumeric': 0.11248073959938366, 'fraction_numerical': 0.003852080123266564, 'mean_word_length': 2.9483282674772036, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '5289252', 'n_tokens_mistral': 394, 'n_tokens_neox': 377, 'n_words': 86}