Module: TeutonGet

Defined in:
lib/teuton-get.rb,
lib/teuton-get/version.rb,
lib/teuton-get/writer/format.rb

Defined Under Namespace

Classes: Format

Constant Summary collapse

NAME =
"teuton-get"
EXECUTABLE =
"teutonget"
VERSION =
"0.3.1"
HOMEPAGE =
"https://github.com/teuton-software/#{NAME}"

Class Method Summary collapse

Class Method Details

.create_info(testpath) ⇒ Object



12
13
14
15
# File 'lib/teuton-get.rb', line 12

def self.create_info(testpath)
  # Create metadata for local user teuton test
  LocalInfo.new.user_created(testpath)
end

.create_repo(dirpath) ⇒ Object



17
18
19
20
# File 'lib/teuton-get.rb', line 17

def self.create_repo(dirpath)
  # Create metadata for local user teuton repository
  LocalRepo.default.create(dirpath)
end

.downloadObject



22
23
24
25
# File 'lib/teuton-get.rb', line 22

def self.download(...)
  # Download teuton test from remote
  Downloader.new.run(...)
end

.initObject



27
28
29
30
31
# File 'lib/teuton-get.rb', line 27

def self.init
  # Create Teuton Repo config file
  RepoConfig.default.create
  refresh # Auto repo refresh
end

.refreshObject



33
34
35
36
# File 'lib/teuton-get.rb', line 33

def self.refresh
  # Refresh Teuton Repo Data
  RepoData.default.refresh
end

.search(filter, options) ⇒ Object



46
47
48
49
50
51
52
53
54
55
56
# File 'lib/teuton-get.rb', line 46

def self.search(filter, options)
  searcher = Searcher.default
  search = searcher.get(filter)
  exit 1 if search.results.size.zero?

  if options["format"] == "json"
    search.show_json
  else
    search.show_screen
  end
end

.show_infoObject



42
43
44
# File 'lib/teuton-get.rb', line 42

def self.show_info(...)
  ShowInfo.new.call(...)
end

.show_repo_listObject



38
39
40
# File 'lib/teuton-get.rb', line 38

def self.show_repo_list(...)
  RepoConfig.default.show_list(...)
end