<commit_before>module MobileRailsJqm
  module Generators
    class InstallGenerator < Rails::Generators::Base
      source_root File.expand_path('../templates', __FILE__)
      desc <<DESC
Description:
    Creates jQuery mobile layout, stylesheet, and javascript file.
DESC
      def manifest
        if options[:haml]
          template "mobile.mobile.haml", "app/views/layouts/mobile.mobile.haml"
        else
          template "mobile.mobile.haml", "app/views/layouts/mobile.mobile.haml"
        end
        copy_file "mobile.css", "app/assets/stylesheets/mobile.css"
        copy_file "mobile.js", "app/assets/javascripts/mobile.js"
      end

      protected

        def add_options!(opt)
          opt.separator ''
          opt.separator 'Options:'
          opt.on("--haml", "Generate HAML for view, and SASS for stylesheet.") { |v| options[:haml] = v }
        end
    end
  end
end<commit_msg>add precompile jquery mobile assets into production environment file<commit_after>module MobileRailsJqm
  module Generators
    class InstallGenerator < Rails::Generators::Base
      source_root File.expand_path('../templates', __FILE__)
      desc <<DESC
Description:
    Creates jQuery mobile layout, stylesheet, and javascript file.
DESC
      def manifest
        if options[:haml]
          template "mobile.mobile.haml", "app/views/layouts/mobile.mobile.haml"
        else
          template "mobile.mobile.haml", "app/views/layouts/mobile.mobile.haml"
        end
        copy_file "mobile.css", "app/assets/stylesheets/mobile.css"
        copy_file "mobile.js", "app/assets/javascripts/mobile.js"
        
        inject_into_file 'config/environments/production.rb', :after => "Application.configure do" do
          "\n\n # Added by mobile_rails_jqm, precompile jQuery Related assets in production."+
          "\n  config.assets.precompile += %w(mobile.css mobile.js)\n" 
        end
      end

      protected

        def add_options!(opt)
          opt.separator ''
          opt.separator 'Options:'
          opt.on("--haml", "Generate HAML for view, and SASS for stylesheet.") { |v| options[:haml] = v }
        end
    end
  end
end
{'fraction_non_alphanumeric': 0.10812064965197216, 'fraction_numerical': 0.0, 'mean_word_length': 2.5636363636363635, 'pattern_counts': {'":': 0, '<': 9, '<?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': '4818516', 'n_tokens_mistral': 640, 'n_tokens_neox': 618, 'n_words': 154}