class Resources::Reader

Public Instance Methods

resources() click to toggle source
# File lib/robjc/reader.rb, line 7
def resources
  @resources ||= {
    images: images,
    strings: strings,
    nibs: nibs,
    storyboards: storyboards,
    asset_catalogs: asset_catalogs
  }
end

Private Instance Methods

asset_catalogs() click to toggle source
# File lib/robjc/reader.rb, line 55
def asset_catalogs
  @asset_catalogs ||= files.select do |f|
    f.match /.xcassets$/i
  end.map do |f|
    Resources::AssetCatalogResource.new(f)
  end
end
files() click to toggle source
# File lib/robjc/reader.rb, line 19
def files
  @files ||= Dir.glob('**/*').select do |f|
    next false if f.match /^pods/i
    next false if f.match /^vendor/i
    next false if f.match /\.bundle/i
    true
  end
end
images() click to toggle source
# File lib/robjc/reader.rb, line 28
def images
  @images ||= files.select do |f|
    next false if f.match /\.xcassets/i
    f.match /\.png$/i
  end
end
nibs() click to toggle source
# File lib/robjc/reader.rb, line 43
def nibs
  @nibs ||= files.select do |f|
    f.match /\.nib$/
  end
end
storyboards() click to toggle source
# File lib/robjc/reader.rb, line 49
def storyboards
  @storyboards ||= files.select do |f|
    f.match /\.storyboard$/i
  end
end
strings() click to toggle source
# File lib/robjc/reader.rb, line 35
def strings
  @strings ||= files.select do |f|
    f.match /\.strings$/i
  end.map do |f|
    Resources::StringResource.new(f)
  end
end