class Chemlab::CLI::Stubber

This class is dedicated to stubbing Page Libraries

Public Class Methods

libraries() click to toggle source
# File lib/chemlab/cli/stubber.rb, line 11
def libraries
  @libraries ||= []
end
stub_all(path) click to toggle source

Generate all stubs in a particular path

# File lib/chemlab/cli/stubber.rb, line 16
def stub_all(path)
  Array(path).each do |p|
    p = File.expand_path(p)

    PageLibrary.new(p).generate_stub if File.file?(p)
    Dir["#{p}/**/*.rb"].each do |f|
      next if File.basename(f).include?('.stub.')

      PageLibrary.new(f).generate_stub
    end
  end
end