Top Level Namespace

Defined Under Namespace

Modules: Avo, Generators, Rails

Constant Summary collapse

STYLES =
%w[outline filled].freeze

Instance Method Summary collapse

Instance Method Details

#find_docs(repo_root, marker) ⇒ Object

A docs checkout is any clone of the marker's repo that has the docs path in it. Look next to and above this checkout so the script works from whatever layout a machine or CI runner happens to use.



26
27
28
29
30
31
32
33
34
# File 'lib/avo/skills/bin/docs_drift.rb', line 26

def find_docs(repo_root, marker)
  search = ["#{repo_root}/..", "#{repo_root}/../..", "#{repo_root}/../../.."]
  candidates = search.flat_map { |base| Dir.glob("#{base}/*") }.uniq.sort
  candidates.find do |dir|
    next false if dir == repo_root || !Dir.exist?("#{dir}/.git") || !Dir.exist?("#{dir}/#{marker["docs_path"]}")

    git(dir, "remote", "get-url", "origin").include?(marker["repo"])
  end
end

#git(dir, *args) ⇒ Object



21
# File 'lib/avo/skills/bin/docs_drift.rb', line 21

def git(dir, *args) = `git -C '#{dir}' #{args.join(" ")}`.strip

#icons_rootObject



21
22
23
24
25
26
27
28
29
# File 'lib/avo/skills/avo-menu-icons/scripts/list_icons.rb', line 21

def icons_root
  spec = Gem::Specification.find_all_by_name("avo-icons").max_by(&:version)
  abort "avo-icons gem not found. It is a dependency of avo — run `bundle install`." if spec.nil?

  root = File.join(spec.gem_dir, "lib", "assets", "svgs", "tabler")
  abort "avo-icons #{spec.version} has no tabler icons at #{root}" unless Dir.exist?(root)

  root
end

#names_for(root, style) ⇒ Object



31
32
33
# File 'lib/avo/skills/avo-menu-icons/scripts/list_icons.rb', line 31

def names_for(root, style)
  Dir.glob(File.join(root, style, "*.svg")).map { |p| File.basename(p, ".svg") }.sort
end

#🥑Object



224
225
226
# File 'lib/avo.rb', line 224

def 🥑
  Avo
end