Module: Gitomator::Console

Defined in:
lib/gitomator/console.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.contextObject



11
12
13
# File 'lib/gitomator/console.rb', line 11

def self.context()
  @context
end

.context=(context) ⇒ Object



7
8
9
# File 'lib/gitomator/console.rb', line 7

def self.context=(context)
  @context = context
end

Instance Method Details

#delete_repo(repo_name) ⇒ Object



32
33
34
# File 'lib/gitomator/console.rb', line 32

def delete_repo(repo_name)
  gitomator_context.hosting.delete_repo(repo_name)
end

#delete_team(team_name) ⇒ Object



42
43
44
# File 'lib/gitomator/console.rb', line 42

def delete_team(team_name)
  gitomator_context.hosting.delete_team(team_name)
end

#gitomator_contextObject



21
22
23
# File 'lib/gitomator/console.rb', line 21

def gitomator_context
  Gitomator::Console::context
end

#gitomator_versionObject

Convenience Console Functions =====================


17
18
19
# File 'lib/gitomator/console.rb', line 17

def gitomator_version
  Gitomator::VERSION
end

#list_team_members(team_name) ⇒ Object



47
48
49
50
# File 'lib/gitomator/console.rb', line 47

def list_team_members(team_name)
  gitomator_context.hosting
    .search_users('', { team_name: team_name }).map {|u| u.username}
end

#search_repos(query) ⇒ Object




28
29
30
# File 'lib/gitomator/console.rb', line 28

def search_repos(query)
  gitomator_context.hosting.search_repos(query).map {|r| r.full_name}
end

#search_teams(query) ⇒ Object



38
39
40
# File 'lib/gitomator/console.rb', line 38

def search_teams(query)
  gitomator_context.hosting.search_teams(query).map {|t| t.name}
end