Module: Kennel
- Defined in:
- lib/kennel/file_cache.rb,
lib/kennel.rb,
lib/kennel/api.rb,
lib/kennel/utils.rb,
lib/kennel/syncer.rb,
lib/kennel/version.rb,
lib/kennel/progress.rb,
lib/kennel/models/base.rb,
lib/kennel/models/dash.rb,
lib/kennel/models/team.rb,
lib/kennel/models/monitor.rb,
lib/kennel/models/project.rb,
lib/kennel/github_reporter.rb,
lib/kennel/subclass_tracking.rb
Overview
cache that reads everything from a single file to avoid doing multiple disk reads while interating all definitions it also replaces updated keys and has an overall expiry to not keep deleted things forever
Defined Under Namespace
Modules: Models, SubclassTracking, Utils
Classes: Api, FileCache, GithubReporter, Progress, Syncer
Constant Summary
collapse
- VERSION =
"0.1.0"
Class Method Summary
collapse
Class Method Details
.generate ⇒ Object
22
23
24
25
26
27
28
29
|
# File 'lib/kennel.rb', line 22
def generate
FileUtils.rm_rf("generated")
generated.each do |part|
path = "generated/#{part.tracking_id.sub(":", "/")}.json"
FileUtils.mkdir_p(File.dirname(path))
File.write(path, JSON.pretty_generate(part.as_json) << "\n")
end
end
|
.plan ⇒ Object
31
32
33
|
# File 'lib/kennel.rb', line 31
def plan
syncer.plan
end
|
.report_plan_to_github ⇒ Object
40
41
42
43
|
# File 'lib/kennel.rb', line 40
def report_plan_to_github
reporter = GithubReporter.new(ENV.fetch("GITHUB_TOKEN"))
reporter.report { plan }
end
|
.update ⇒ Object
35
36
37
38
|
# File 'lib/kennel.rb', line 35
def update
syncer.plan
syncer.update if syncer.confirm
end
|