Class: GitCleanser::SmartThing

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

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ SmartThing

Returns a new instance of SmartThing.



3
4
5
6
7
8
9
# File 'lib/git_cleanser/smart_thing.rb', line 3

def initialize(config)
  @config = config
  @compiled_files = sh(@config['compiled_files_command']).split
  @ignored_and_untracked_files = git_ls_files(:ignored, :other)
  @ignored_but_tracked_files = git_ls_files(:ignored)
  @all_files = Dir['**/*']
end

Instance Method Details

#generated_but_not_ignoredObject



11
12
13
# File 'lib/git_cleanser/smart_thing.rb', line 11

def generated_but_not_ignored
  @compiled_files - @ignored_and_untracked_files
end

#ignored_but_not_generatedObject



15
16
17
# File 'lib/git_cleanser/smart_thing.rb', line 15

def ignored_but_not_generated
  @ignored_and_untracked_files - @compiled_files
end

#ignored_but_trackedObject



19
20
21
# File 'lib/git_cleanser/smart_thing.rb', line 19

def ignored_but_tracked
  @ignored_but_tracked_files
end

#uncompiledObject



23
24
25
# File 'lib/git_cleanser/smart_thing.rb', line 23

def uncompiled
  @all_files - @compiled_files
end