<commit_before>#!/usr/bin/env ruby

require 'yaml'

def project
  @project ||= (
    index = YAML.load_file('.index')
    Struct.new('Project', *index.keys).new(*index.values)
  )
end

state :manifest_outofdate do
  ! system "mast --quiet --recent"
end

# Mast handles manifest updates.
rule manifest_outofdate do
  sh "mast -u"
end

state :need_shomen do
  files = `mast -b --no-head`.split("\n")
  doc_file = "doc/#{project.name}-#{project.version}.json"
  ! FileUtils.uptodate?(doc_file, files)
end

rule need_shomen do
  cmd = "shomen-yard > doc/#{project.name}-#{project.version}.json"
  sh cmd
end

desc "Generate shomen documentation"
task :shomen => [:say_hi] do
  cmd = "shomen yard > docs/#{project.name}-#{project.version}.json"
  puts cmd #sh cmd
end

task :say_hi do
  puts "Hi!"
end

task :test do
  puts "Write some tests!!!"
end<commit_msg>Remove tasks from Fires own rules file. [admin]<commit_after>#!/usr/bin/env ruby

require 'yaml'

def project
  @project ||= (
    index = YAML.load_file('.index')
    Struct.new('Project', *index.keys).new(*index.values)
  )
end

rule true do
  puts "Fire Rules!"
end

# Mast handles manifest updates.
state :manifest_outofdate do
  ! system "mast --quiet --verify"
end

desc "update manifest"
rule manifest_outofdate do
  sh "mast -u"
end

desc "run demonstratons"
book :test
rule '{demo/**/*.md,lib/**/*.rb}' do
  sh "qed -Ilib"
end

state :need_shomen do
  files = `mast -b --no-head`.split("\n")
  doc_file = "doc/#{project.name}-#{project.version}.json"
  ! FileUtils.uptodate?(doc_file, files)
end

desc "generate shomen documentation"
book :doc
rule need_shomen do
  cmd = "shomen-yard > doc/#{project.name}-#{project.version}.json"
  sh cmd
end

{'fraction_non_alphanumeric': 0.15555555555555556, 'fraction_numerical': 0.0, 'mean_word_length': 3.8197183098591547, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '3881629', 'n_tokens_mistral': 636, 'n_tokens_neox': 634, 'n_words': 169}