Created
September 8, 2020 23:52
-
-
Save kwstannard/f932318e89b9c3d19c554bdb443ff35d to your computer and use it in GitHub Desktop.
Every line in makery ordered by line length
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[3, "end"], | |
[3, "end"], | |
[3, "end"], | |
[3, "end"], | |
[5, " end"], | |
[5, " end"], | |
[5, " end"], | |
[5, " end"], | |
[5, " end"], | |
[5, " end"], | |
[6, " end)"], | |
[7, " end"], | |
[7, " end"], | |
[7, " end"], | |
[7, " end"], | |
[7, " end"], | |
[7, " end"], | |
[7, " end"], | |
[7, " end"], | |
[11, " super"], | |
[12, " def call"], | |
[13, "module Makery"], | |
[13, "module Makery"], | |
[13, "module Makery"], | |
[13, "module Makery"], | |
[17, " makers[klass]"], | |
[17, " def self.makers"], | |
[19, " VERSION = \"0.1.0\""], | |
[20, " def self.[](klass)"], | |
[20, " self.count = 0"], | |
[21, " new(*args).call"], | |
[21, " def self.new_makers"], | |
[21, " using(Module.new do"], | |
[21, " def base(**attrs)"], | |
[21, " @base ||= attrs"], | |
[24, " def self.call(*args)"], | |
[24, "require \"makery/builder\""], | |
[24, "require \"makery/version\""], | |
[24, "require \"makery/factory\""], | |
[25, " def initialize(*args)"], | |
[26, " @makers ||= new_makers"], | |
[26, " makers[key] = callable"], | |
[27, " def evaluate_attr(attr)"], | |
[27, " def trait_attrs(traits)"], | |
[28, " self.count = count + 1"], | |
[28, " def trait(name, **attrs)"], | |
[29, " def self.[]=(key, callable)"], | |
[33, " self.traits_repository = {}"], | |
[33, " Factory = Struct.new(:klass) do"], | |
[33, " def call(*traits, **override)"], | |
[36, " alias_method :[], :evaluate_attr"], | |
[37, " traits_repository[name] = attrs"], | |
[44, " attr_accessor :count, :traits_repository"], | |
[45, " Hash.new { |h, k| h[k] = Factory.new(k) }"], | |
[45, " attrs.each_key { |k| evaluate_attr(k) }"], | |
[46, " Builder = Struct.new(:attrs, :object, :i) do"], | |
[54, " refine(Proc) { alias_method(:makery_eval, :call) }"], | |
[59, " attrs = base.merge(**trait_attrs(traits), **override)"], | |
[60, " object.send(\"\#{attr}=\", attrs[attr].makery_eval(self))"], | |
[60, " klass.new.tap {|obj| Builder.call(attrs, obj, count) }"], | |
[62, " refine(Object) { define_method(:makery_eval) {|_| self } }"], | |
[65, " traits.map { |t| traits_repository[t] }.reduce({}, &:merge)"]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment