<commit_before>module Luban
  module Deployment
    module Packages
      class Rubygems < Luban::Deployment::Package::Base
        protected

        def self.get_latest_version; RubygemsUpdate.get_latest_version; end

        def setup_provision_tasks
          super
          provision_tasks[:install].switch :install_doc, "Install Rubygems document"
        end

        class Installer < Luban::Deployment::Package::Installer
          def install_doc?
            task.opts.install_doc
          end

          def package_path
            parent.package_path
          end

          def install_path
            parent.install_path
          end
          
          define_executable 'gem'
          
          def ruby_executable
            parent.ruby_executable
          end

          def src_file_extname
            @src_file_extname ||= 'tgz'
          end

          def source_repo
            @source_repo ||= "https://rubygems.org"
          end

          def source_url_root
            @source_url_root ||= "rubygems"
          end

          def installed?
            return false unless file?(gem_executable)
            match?("#{gem_executable} -v", package_version)
          end

          protected

          def configure_build_options
            super
            unless install_doc?
              @configure_opts.push('--no-rdoc', '--no-ri')
            end
          end

          def validate
            if parent.nil?
              abort "Aborted! Parent package for Rubygems MUST be provided."
            end
            unless parent.is_a?(Ruby::Installer)
              abort "Aborted! Parent package for Rubygems MUST be an instance of #{Ruby::Installer.name}"
            end
          end

          def configure_package!
            test(ruby_executable, 
                 "setup.rb config #{configure_opts.reject(&:empty?).join(' ')} >> #{install_log_file_path} 2>&1")
          end

          def make_package!
            test(ruby_executable, 
                 "setup.rb setup >> #{install_log_file_path} 2>&1")
          end

          def install_package!
            test(ruby_executable, 
                 "setup.rb install >> #{install_log_file_path} 2>&1")
          end<commit_msg>Disabled document generation for Rubygems<commit_after>module Luban
  module Deployment
    module Packages
      class Rubygems < Luban::Deployment::Package::Base
        protected

        def self.get_latest_version; RubygemsUpdate.get_latest_version; end

        def setup_provision_tasks
          super
          provision_tasks[:install].switch :install_doc, "Install Rubygems document"
        end

        class Installer < Luban::Deployment::Package::Installer
          def install_doc?
            task.opts.install_doc
          end

          def package_path
            parent.package_path
          end

          def install_path
            parent.install_path
          end
          
          define_executable 'gem'
          
          def ruby_executable
            parent.ruby_executable
          end

          def src_file_extname
            @src_file_extname ||= 'tgz'
          end

          def source_repo
            @source_repo ||= "https://rubygems.org"
          end

          def source_url_root
            @source_url_root ||= "rubygems"
          end

          def installed?
            return false unless file?(gem_executable)
            match?("#{gem_executable} -v", package_version)
          end

          protected

          def configure_build_options
            super
            unless install_doc?
              @configure_opts.push('--no-rdoc', '--no-ri')
            end
          end

          def validate
            if parent.nil?
              abort "Aborted! Parent package for Rubygems MUST be provided."
            end
            unless parent.is_a?(Ruby::Installer)
              abort "Aborted! Parent package for Rubygems MUST be an instance of #{Ruby::Installer.name}"
            end
          end

          def configure_package!
            test(ruby_executable, 
                 "setup.rb config >> #{install_log_file_path} 2>&1")
          end

          def make_package!
            test(ruby_executable, 
                 "setup.rb setup >> #{install_log_file_path} 2>&1")
          end

          def install_package!
            test(ruby_executable, 
                 "setup.rb install #{configure_opts.reject(&:empty?).join(' ')} >> #{install_log_file_path} 2>&1")
          end
{'fraction_non_alphanumeric': 0.07348384240814519, 'fraction_numerical': 0.0026560424966799467, 'mean_word_length': 1.5516657255787691, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 21, 'https://': 2, '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': '3735777', 'n_tokens_mistral': 1219, 'n_tokens_neox': 1160, 'n_words': 271}