<commit_before>require 'pry'
module TdWidgets
  module Generators
    class ChartGenerator < Rails::Generators::Base
      include TdWidgets::PathsHelper

      source_root File.expand_path('../templates', __FILE__)

      def copy_assets
        puts "Copying assets..."
        copy_file '../../../../../vendor/assets/javascripts/chart/angular-charts.min.js', get_vendor_assets_js_path + 'angular-charts.min.js'
        copy_file '../../../../../vendor/assets/javascripts/chart/d3.min.js', get_vendor_assets_js_path + 'd3.min.js' 
      end

      def create_widget_assets
        puts "Creating widget assets..."
        directory self.get_assets_location + "widgets/chart/", self.get_assets_path + "widgets/chart/"
      end

      def create_widget_templates
        puts "Creating widget templates..."
        directory self.get_assets_location + "templates/widgets/chart/", self.get_assets_path + "templates/widgets/chart/"
      end

      def create_base
        puts "Creating base source..."
        Rails::Generators.invoke("td_widgets:shared_sources", ["--source-type=chart"])
      end

      def create_demo
        puts "Creating demo source..."
        copy_file "sources/demo.rb", get_sources_path + "chart/demo.rb"
      end
    end
  end
end<commit_msg>Moved generating assets to the end of file<commit_after>require 'pry'
module TdWidgets
  module Generators
    class ChartGenerator < Rails::Generators::Base
      include TdWidgets::PathsHelper

      source_root File.expand_path('../templates', __FILE__)


      def create_widget_assets
        puts "Creating widget assets..."
        directory self.get_assets_location + "widgets/chart/", self.get_assets_path + "widgets/chart/"
      end

      def create_widget_templates
        puts "Creating widget templates..."
        directory self.get_assets_location + "templates/widgets/chart/", self.get_assets_path + "templates/widgets/chart/"
      end

      def create_base
        puts "Creating base source..."
        Rails::Generators.invoke("td_widgets:shared_sources", ["--source-type=chart"])
      end

      def create_demo
        puts "Creating demo source..."
        copy_file "sources/demo.rb", get_sources_path + "chart/demo.rb"
      end

      def copy_assets
        puts "Copying assets..."
        copy_file '../../../../../vendor/assets/javascripts/chart/angular-charts.min.js', get_vendor_assets_js_path + 'angular-charts.min.js'
        copy_file '../../../../../vendor/assets/javascripts/chart/d3.min.js', get_vendor_assets_js_path + 'd3.min.js' 
      end

    end
  end
end
{'fraction_non_alphanumeric': 0.12495149398525417, 'fraction_numerical': 0.0015521924718665113, 'mean_word_length': 2.630985915492958, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6882660', 'n_tokens_mistral': 771, 'n_tokens_neox': 744, 'n_words': 156}