cimas 0.1.3 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/cimas.rb CHANGED
@@ -1,5 +1,32 @@
1
- require "cimas/cli/command"
2
- require "cimas/version"
1
+ require "pathname"
3
2
 
4
3
  module Cimas
4
+ # Ownership marker cimas writes into every file it generates and
5
+ # detects when deciding whether a file is cimas-managed (orphan
6
+ # cleanup). One definition — sync and cleanup must agree on it.
7
+ GENERATED_HEADER_MARKER = "Auto-generated by Cimas"
8
+ GENERATED_HEADER = [
9
+ "# #{GENERATED_HEADER_MARKER}: Do not edit it manually!",
10
+ "# See https://github.com/metanorma/cimas",
11
+ ].join("\n").freeze
12
+
13
+ # Autoload paths are absolute (resolved from __dir__) so a plain
14
+ # `require_relative` boot from exe/cimas works from any cwd, without
15
+ # $LOAD_PATH setup.
16
+ autoload :VERSION, File.expand_path("cimas/version", __dir__)
17
+ autoload :Repository, File.expand_path("cimas/repository", __dir__)
18
+ autoload :Patch, File.expand_path("cimas/patch", __dir__)
19
+ autoload :OrphanFiles, File.expand_path("cimas/orphan_files", __dir__)
20
+ autoload :WorkingCopy, File.expand_path("cimas/working_copy", __dir__)
21
+ autoload :GitHub, File.expand_path("cimas/github", __dir__)
22
+ autoload :ReleasePreflight, File.expand_path("cimas/release_preflight", __dir__)
23
+ autoload :Cli, File.expand_path("cimas/cli", __dir__)
24
+
25
+ def self.root
26
+ File.dirname(__dir__)
27
+ end
28
+
29
+ def self.root_path
30
+ Pathname.new(Cimas.root)
31
+ end
5
32
  end