Class: OpenehrRails::ReleaseCheck

Inherits:
Object
  • Object
show all
Defined in:
lib/openehr_rails/release_check.rb

Overview

Backs the release:check rake task (lib/tasks/release_check.rake). Not required by lib/openehr_rails.rb -- this is a release-time dev tool, not something a host app needs on every boot.

Guards the specific pitfall this project's own history has actually hit: git add -A some/dir stages the directory but not a sibling some/dir.rb file, so a commit can silently ship a gem whose require 'some/dir' finds nothing at runtime. This repo has exactly that layout twice (lib/openehr_rails.rb + lib/openehr_rails/, lib/openehr-rails.rb + lib/openehr-rails/), discovered the hard way earlier in this project's history.

Defined Under Namespace

Classes: Failure

Instance Method Summary collapse

Constructor Details

#initialize(root: Dir.pwd) ⇒ ReleaseCheck

Returns a new instance of ReleaseCheck.



22
23
24
# File 'lib/openehr_rails/release_check.rb', line 22

def initialize(root: Dir.pwd)
  @root = root
end

Instance Method Details

#failuresObject



26
27
28
29
30
31
32
# File 'lib/openehr_rails/release_check.rb', line 26

def failures
  [
    *clean_working_tree_failures,
    *sibling_pair_failures,
    *gemspec_failures
  ]
end

#ok?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/openehr_rails/release_check.rb', line 34

def ok?
  failures.empty?
end