<commit_before>class Jeweler
  module Gemspec
    # Generates a date for stuffing in the gemspec
    def date
      date = DateTime.now
      "#{date.year}-#{date.month}-#{date.day}"
    end


    # Writes out the gemspec
    def write_gemspec
      @gemspec.date = self.date
      File.open(gemspec_path, 'w') do |f|
        f.write @gemspec.to_ruby
      end
      puts "Generated #{gemspec_path}."
    end
    
    # Validates the gemspec in an environment similar to how GitHub would build
    # it. See http://gist.github.com/16215
    def validate_gemspec
      begin
        # Snippet borrowed from http://gist.github.com/16215
        data = File.read(gemspec_path)
      
        spec = nil
        if data !~ %r{!ruby/object:Gem::Specification}
          Thread.new { spec = eval("$SAFE = 3\n#{data}", binding, gemspec_path) }.join
        else
          spec = YAML.load(data)
        end
        
        puts "#{gemspec_path} is valid."
      rescue Exception => e
        puts "#{gemspec_path} is invalid. See the backtrace for more details."
        raise
      end
    end
    
  protected
    def gemspec_path
      File.join(@base_dir, "#{@gemspec.name}.gemspec")
    end
  end
end<commit_msg>Made Jeweler#date protected.<commit_after>class Jeweler
  module Gemspec
    # Writes out the gemspec
    def write_gemspec
      @gemspec.date = self.date
      File.open(gemspec_path, 'w') do |f|
        f.write @gemspec.to_ruby
      end
      puts "Generated #{gemspec_path}."
    end
    
    # Validates the gemspec in an environment similar to how GitHub would build
    # it. See http://gist.github.com/16215
    def validate_gemspec
      begin
        # Snippet borrowed from http://gist.github.com/16215
        data = File.read(gemspec_path)
      
        spec = nil
        if data !~ %r{!ruby/object:Gem::Specification}
          Thread.new { spec = eval("$SAFE = 3\n#{data}", binding, gemspec_path) }.join
        else
          spec = YAML.load(data)
        end
        
        puts "#{gemspec_path} is valid."
      rescue Exception => e
        puts "#{gemspec_path} is invalid. See the backtrace for more details."
        raise
      end
    end
    
  protected
    def gemspec_path
      File.join(@base_dir, "#{@gemspec.name}.gemspec")
    end
    
    # Generates a date for stuffing in the gemspec
    def date
      date = DateTime.now
      "#{date.year}-#{date.month}-#{date.day}"
    end
  end
end
{'fraction_non_alphanumeric': 0.10245901639344263, 'fraction_numerical': 0.009016393442622951, 'mean_word_length': 2.055068836045056, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6053884', 'n_tokens_mistral': 795, 'n_tokens_neox': 785, 'n_words': 211}