<commit_before>module Ember
  module Generators
    module GeneratorHelpers

      def ember_path
        if options[:ember_path]
          options[:ember_path]
        elsif configuration.ember_path
          configuration.ember_path
        elsif rails_engine?
          "app/assets/javascripts/#{engine_name}"
        else
          "app/assets/javascripts"
        end
      end

      def rails_engine?
        defined?(ENGINE_PATH)
      end

      def engine_name
        ENGINE_PATH.split('/')[-2]
      end

      def application_name
        if options[:app_name]
          options[:app_name]
        elsif configuration.app_name
          configuration.app_name
        elsif rails_engine?
          engine_name
        elsif defined?(::Rails) && ::Rails.application
          ::Rails.application.class.name.split('::').first
        else
          "App"
        end
      end

      def class_name
        (class_path + [file_name]).map!{ |m| m.camelize }.join()
      end

      def handlebars_template_path
        File.join(class_path, file_name).gsub(/^\//, '')
      end

      def engine_extension
        @engine_extension ||= "js.#{options[:javascript_engine]}".sub('js.js','js')
      end

      def configuration
        ::Rails.configuration.ember
      end
    end
  end
end<commit_msg>Fixed bootstrap generator for Rails engines.<commit_after>module Ember
  module Generators
    module GeneratorHelpers

      def ember_path
        if options[:ember_path]
          options[:ember_path]
        elsif configuration.ember_path
          configuration.ember_path
        elsif rails_engine?
          "app/assets/javascripts/#{engine_name}"
        else
          "app/assets/javascripts"
        end
      end

      def rails_engine?
        defined?(ENGINE_PATH)
      end

      def engine_name
        ENGINE_PATH.split('/')[-2]
      end

      def application_name
        if options[:app_name]
          options[:app_name]
        elsif configuration.app_name
          configuration.app_name
        elsif rails_engine?
          engine_name
        elsif defined?(::Rails) && ::Rails.application
          ::Rails.application.class.name.split('::').first
        else
          "App"
        end
      end

      def class_name
        (class_path + [file_name]).map!{ |m| m.camelize }.join()
      end

      def handlebars_template_path
        File.join(class_path, file_name).gsub(/^\//, '')
      end

      def engine_extension
        @engine_extension ||= "js.#{options[:javascript_engine]}".sub('js.js','js')
      end

      def configuration
        if defined?(::Rails) && ::Rails.configuration
          ::Rails.configuration.ember
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.09746230231702832, 'fraction_numerical': 0.000735564545788893, 'mean_word_length': 1.9215896885069816, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7046765', 'n_tokens_mistral': 798, 'n_tokens_neox': 778, 'n_words': 154}