<commit_before>module PoolParty
  
  class Script
    
    def self.inflate_file(file)
      inflate open(file).read
    end
        
    def self.inflate(script, file="__SCRIPT__")
      apool = new
      apool.instance_eval script, file
      apool.inflate
    end
    
    def inflate
      pools.map {|name,pool| pool.inflate } unless pools.empty?
    end
    
    def self.to_ruby(opts={},&blk)
      blk.to_ruby(opts)
    end
    
    def self.for_save_string(in_cloud=nil)
      returning Array.new do |out|
        pools.collect {|n,pl| pl}.each do |pl|
          
          (in_cloud ? [in_cloud] : clouds.collect {|n,cl| cl }).each do |cl|
            out << <<-EOE
pool :#{pl.name} do
  cloud :#{cl.name} do
    #{cl.minimum_runnable_options.map {|o| "#{o} #{cl.send(o).respec_string}"}.join("\n")}
  end
end
            EOE
          end          
        end
      end.join("\n")
    end
    
    def self.save!(cl=nil,to_file=true)
      write_to_file_in_storage_directory(Base.default_specfile_name, for_save_string(cl)) if to_file
      for_save_string
    end
    
  end
  
end<commit_msg>Updated script to save all clouds<commit_after>module PoolParty
  
  class Script
    
    def self.inflate_file(file)
      inflate open(file).read
    end
        
    def self.inflate(script, file="__SCRIPT__")
      apool = new
      apool.instance_eval script, file
      apool.inflate
    end
    
    def inflate
      pools.map {|name,pool| pool.inflate } unless pools.empty?
    end
    
    def self.to_ruby(opts={},&blk)
      blk.to_ruby(opts)
    end
    
    def self.for_save_string
      returning Array.new do |out|
        pools.collect {|n,pl| pl}.each do |pl|
          
          clouds.collect {|n,cl| cl }.each do |cl|
            out << <<-EOE
pool :#{pl.name} do
  cloud :#{cl.name} do
    #{cl.minimum_runnable_options.map {|o| "#{o} #{cl.send(o).respec_string}"}.join("\n")}
  end
end
            EOE
          end          
        end
      end.join("\n")
    end
    
    def self.save!(to_file=true)
      write_to_file_in_storage_directory(Base.default_specfile_name, for_save_string) if to_file
      for_save_string
    end
    
  end
  
end
{'fraction_non_alphanumeric': 0.11508482347546997, 'fraction_numerical': 0.0, 'mean_word_length': 2.0389972144846795, 'pattern_counts': {'":': 0, '<': 11, '<?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': '2334033', 'n_tokens_mistral': 793, 'n_tokens_neox': 783, 'n_words': 160}