nrb 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,40 +0,0 @@
1
- module Nrb
2
- module Commands
3
- class InsideGroup < Thor::Group
4
- include Thor::Actions
5
-
6
- def self.warning
7
- 'NOTE: Available inside a NinjaRuby project' unless Nrb.inside?
8
- end
9
-
10
- def self.desc_with_warning(description)
11
- self.desc [description, warning].compact.join('. ')
12
- end
13
-
14
- def self.source_root
15
- File.expand_path('..', __dir__)
16
- end
17
-
18
- def check_inside?
19
- return if Nrb.inside?
20
- klass_name = self.class.to_s.split('::').last
21
- say "You need to be inside a NinjaRuby folder to run the #{klass_name} command."
22
- exit
23
- end
24
-
25
- private
26
-
27
- def require_main_file
28
- assumed_file_name = "#{Nrb.root.split('/').last}.rb"
29
- assumed_file_path = File.join(Nrb.root, assumed_file_name)
30
-
31
- if File.exist?(assumed_file_path)
32
- require File.join(Nrb.root, assumed_file_name)
33
- else
34
- say 'Could not load file :(.'
35
- exit
36
- end
37
- end
38
- end
39
- end
40
- end