Module: T1k
- Defined in:
- lib/t1k/trackers/pivotal.rb,
lib/t1k.rb,
lib/t1k/command.rb,
lib/t1k/tracker.rb,
lib/t1k/version.rb,
lib/t1k/constants.rb,
lib/t1k/repository.rb,
lib/t1k/commands/hack.rb,
lib/t1k/commands/init.rb,
lib/t1k/commands/ship.rb,
lib/t1k/commands/sink.rb,
lib/t1k/trackers/none.rb,
lib/t1k/commands/branch.rb,
lib/t1k/commands/commit.rb,
lib/t1k/trackers/trello.rb,
lib/t1k/commands/validate.rb,
lib/t1k/repositories/github.rb,
lib/t1k/commands/pull_request.rb,
lib/t1k/repositories/bitbucket.rb
Overview
Defined Under Namespace
Modules: Commands, Repositories, Trackers
Classes: CLI, Repository, Tracker
Constant Summary
collapse
- VERSION =
"4.2.3"
- T1000 =
"T1000"
- @@repository =
T1k::Repository
- @@tracker =
T1k::Tracker
- @@tthousand_path =
Pathname.pwd + T1000
Class Method Summary
collapse
Class Method Details
.hack(url_card) ⇒ Object
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# File 'lib/t1k.rb', line 45
def self.hack url_card
card = tracker.get_card(url_card)
existent_issue_match = card.name.match /^\[#CARD([0-9]*)\]/
existent_issue_number = existent_issue_match[1] if existent_issue_match.present?
issue_url = existent_issue_number.present? ? repository.get_issue(existent_issue_number)
: repository.create_issue(card.name)
issue_number = repository.get_issue_number(issue_url)
tracker.update_card(card, issue_number) if existent_issue_number.nil?
puts "Card ##{issue_number.code} created and tracked"
issue_number.code
end
|
.path_to_resources ⇒ Object
61
62
63
|
# File 'lib/t1k.rb', line 61
def self.path_to_resources
File.join(File.dirname(File.expand_path(__FILE__)), '../resources')
end
|
.setup {|_self| ... } ⇒ Object
41
42
43
|
# File 'lib/t1k.rb', line 41
def self.setup &block
yield(self) if block_given?
end
|
.setup_credentials ⇒ Object
65
66
67
68
69
70
71
72
73
74
|
# File 'lib/t1k.rb', line 65
def self.setup_credentials
eval(File.read(@@tthousand_path)) if File.exists? @@tthousand_path
Repository.instance_eval do
@@adapter = self.default_repository
class << self
delegate :create_issue, :get_issue, :get_issue_number, to: @@adapter
end
end
end
|