Class: Maid::App

Inherits:
Thor
  • Object
show all
Defined in:
lib/maid/app.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.sample_rules_pathObject



10
11
12
# File 'lib/maid/app.rb', line 10

def self.sample_rules_path
  File.join(File.dirname(Maid::Maid::DEFAULTS[:rules_path]), 'rules.sample.rb')
end

Instance Method Details

#cleanObject



18
19
20
21
22
23
24
# File 'lib/maid/app.rb', line 18

def clean
  maid = Maid::Maid.new(maid_options(options))
  unless options.silent? || options.noop?
    say "Logging actions to #{maid.log_device.inspect}"
  end
  maid.clean
end

#sampleObject



32
33
34
35
36
37
38
39
# File 'lib/maid/app.rb', line 32

def sample
  path = self.class.sample_rules_path

  FileUtils.mkdir_p(File.dirname(path))
  File.open(path, 'w').puts(File.read(File.join(File.dirname(__FILE__), 'rules.sample.rb')))

  say "Sample rules created at #{path.inspect}", :green
end

#versionObject



27
28
29
# File 'lib/maid/app.rb', line 27

def version
  say Maid::VERSION
end