nrb 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +16 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +1100 -0
- data/.travis.yml +1 -1
- data/Guardfile +12 -0
- data/README.md +96 -6
- data/Rakefile +1 -1
- data/lib/nrb.rb +16 -5
- data/lib/nrb/cli.rb +5 -5
- data/lib/nrb/commands/all.rb +11 -0
- data/lib/nrb/commands/base/base.rb +30 -0
- data/lib/nrb/commands/base/inside.rb +19 -0
- data/lib/nrb/commands/base/resource.rb +23 -0
- data/lib/nrb/commands/concerns/resource_generator.rb +30 -0
- data/lib/nrb/commands/console.rb +8 -6
- data/lib/nrb/commands/destroy.rb +9 -32
- data/lib/nrb/commands/generate.rb +11 -33
- data/lib/nrb/commands/script.rb +47 -29
- data/lib/nrb/commands/starter.rb +2 -4
- data/lib/nrb/errors.rb +4 -0
- data/lib/nrb/templates/Gemfile.tt +1 -3
- data/lib/nrb/templates/config/boot.rb.tt +4 -4
- data/lib/nrb/templates/config/nrb.rb.tt +2 -2
- data/lib/nrb/templates/script.rb.tt +0 -2
- data/lib/nrb/version.rb +1 -1
- data/nrb.gemspec +9 -4
- metadata +107 -28
- data/lib/nrb/commands/inside_group.rb +0 -40
@@ -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
|