lib/vernacular.rb in vernacular-0.0.1 vs lib/vernacular.rb in vernacular-0.0.2

- old
+ new

@@ -36,23 +36,25 @@ def clear Dir.glob(File.join(iseq_dir, '**/*.yarb')) { |path| File.delete(path) } end def configure - return if @configured - @modifiers = [] yield self hash = ConfigurationHash.new(modifiers).hash @iseq_dir = File.expand_path(File.join('../.iseq', hash), __dir__) FileUtils.mkdir_p(iseq_dir) unless File.directory?(iseq_dir) class << RubyVM::InstructionSequence prepend ::Vernacular::InstructionSequenceMixin end + end - @configured = true + # Use every available pre-configured modifier + def give_me_all_the_things! + @modifiers = + Modifiers.constants.map { |constant| Modifiers.const_get(constant).new } end def iseq_path_for(source_path) source_path.gsub(/[^A-Za-z0-9\._-]/) { |c| '%02x' % c.ord } .gsub('.rb', '.yarb')