Class: Ataru::CLI::Application

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/ataru/cli/application.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



9
10
11
# File 'lib/ataru/cli/application.rb', line 9

def self.source_root
  File.dirname(__FILE__)
end

Instance Method Details

#check(*filenames) ⇒ Object



42
43
44
45
46
47
48
49
50
51
# File 'lib/ataru/cli/application.rb', line 42

def check(*filenames)
  if filenames.length == 0
    filenames = Dir.glob('**/*md') - Dir.glob("vendor/**/*.md")
  end
  path = Dir.pwd + '/ataru_setup.rb'
  require path if File.exist?(path)
  Ataru::ArgumentChecker.new(filenames).each do |checked_file|
    Ataru::Application.run_test_for_file(checked_file)
  end
end

#setupObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/ataru/cli/application.rb', line 14

def setup
  create_file(File.join(Dir.pwd, "ataru_setup.rb"), "# \"Require your project source code, with the correct path\"\n\n# require 'my_fancy_lib'\n\nmodule Setup\ndef setup\n# Do some nice setup that is run before every snippet\n# If you'd like to use instance variables define them here, e.g\n#  @important_variable_i_will_use_in_my_code_snippets = true\nend\n\ndef teardown\n# Do some cleanup that is run after every snippet\nend\n\n# If you like local variables you can define methods, e.g\n# def number_of_wishes\n#  101\n# end\n\nend\n")
  puts "Well done, young Padawan!\nNow, change the created ataru_setup.rb file."
end