Class: StoryboardLint::StoryboardScanner

Inherits:
Object
  • Object
show all
Defined in:
lib/storyboardlint.rb

Instance Method Summary collapse

Constructor Details

#initialize(src_root) ⇒ StoryboardScanner

Returns a new instance of StoryboardScanner.



11
12
13
14
15
16
17
18
# File 'lib/storyboardlint.rb', line 11

def initialize(src_root)
  if !File.directory?(src_root)
    raise ArgumentError, "The directory '#{src_root}' does not exist."
  end
  
  @src_root = src_root
  @scan_performed = false    
end

Instance Method Details

#custom_class_namesObject



49
50
51
52
# File 'lib/storyboardlint.rb', line 49

def custom_class_names
  scan_files
  @custom_class_names
end

#reuse_idsObject



44
45
46
47
# File 'lib/storyboardlint.rb', line 44

def reuse_ids
  scan_files
  @reuse_ids
end

#segue_idsObject



34
35
36
37
# File 'lib/storyboardlint.rb', line 34

def segue_ids
  scan_files
  @segue_ids
end

#storyboard_filesObject



20
21
22
23
24
25
# File 'lib/storyboardlint.rb', line 20

def storyboard_files
  return @sb_files if @sb_files
  
  # find all storyboard files...
  @sb_files = Dir.glob(File.join(@src_root, "**/*.storyboard"))
end

#storyboard_idsObject



39
40
41
42
# File 'lib/storyboardlint.rb', line 39

def storyboard_ids
  scan_files
  @storyboard_ids
end

#xib_filesObject



27
28
29
30
31
32
# File 'lib/storyboardlint.rb', line 27

def xib_files
  return @xib_files if @xib_files
  
  # find all XIB files...
  @xib_files = Dir.glob(File.join(@src_root, "**/*.xib"))
end