Module: WTT::Core
- Defined in:
- lib/wtt/core.rb,
lib/wtt/core/paths.rb,
lib/wtt/core/mapper.rb,
lib/wtt/core/tracer.rb,
lib/wtt/core/storage.rb,
lib/wtt/core/version.rb,
lib/wtt/core/selector.rb,
lib/wtt/core/meta_data.rb,
lib/wtt/core/anchor_task.rb,
lib/wtt/core/trace_service.rb,
lib/wtt/core/matchers/exact_matcher.rb,
lib/wtt/core/matchers/fuzzy_matcher.rb,
lib/wtt/core/matchers/touch_matcher.rb
Overview
Functionality core to WTT belongs here
Defined Under Namespace
Modules: Matchers
Classes: AnchorTasks, Mapper, MetaData, Selector, Storage, TraceService, Tracer
Constant Summary
collapse
- VERSION =
'0.1.17'.freeze
Class Method Summary
collapse
Class Method Details
.anchor_drop(sha = nil) ⇒ Object
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/wtt/core.rb', line 21
def self.anchor_drop(sha = nil)
begin
repo = Rugged::Repository.discover('.')
sha ||= repo.head.target_id
storage = WTT::Core::Storage.new repo
meta = WTT::Core::MetaData.new(storage)
meta.anchored_commit = sha
meta.write!
puts "WTT now anchored to #{sha}"
rescue Exception => ex
puts "Exception thrown while dropping anchor: #{ex.message}"
end
end
|
.anchor_raise ⇒ Object
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# File 'lib/wtt/core.rb', line 37
def self.anchor_raise
begin
repo = Rugged::Repository.discover('.')
storage = WTT::Core::Storage.new repo
meta = WTT::Core::MetaData.new(storage)
meta.anchored_commit = nil
meta.write!
puts 'WTT now unanchored'
rescue Exception => ex
puts "Exception thrown while raising anchor: #{ex.message}"
end
end
|
.create_core_tasks ⇒ Object
17
18
19
|
# File 'lib/wtt/core.rb', line 17
def self.create_core_tasks
AnchorTasks.new
end
|
.rake_root ⇒ Object
8
9
10
|
# File 'lib/wtt/core/paths.rb', line 8
def rake_root
@@root_dir ||= Rake.application.find_rakefile_location[1].freeze
end
|
.rake_root=(dir) ⇒ Object
12
13
14
|
# File 'lib/wtt/core/paths.rb', line 12
def rake_root=(dir)
@@root_dir = dir
end
|
.wtt_root ⇒ Object
16
17
18
|
# File 'lib/wtt/core/paths.rb', line 16
def wtt_root
"#{rake_root}/.wtt".freeze
end
|