viperaptor 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/viperaptor/cli/gen_command.rb +4 -0
- data/lib/viperaptor/helpers/rambafile.rb +23 -11
- data/lib/viperaptor/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ad2f1f1236c489a2da07d3f32fe6f83c00229fec6aeb6e9d88069c8f721a8ab
|
4
|
+
data.tar.gz: 5dca6caf4e2ba5050c6ae5770e88abb79019a7e90d06e551f5289e02e5e8d68a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e071d663481b3ff80bbb44723247f7f8b807001105b8473c8b09c7f14fb6615aec6d1d93f9ec6c90b3afe46bc275164593daf8aaae5317dff2a80a8a5377a9ca
|
7
|
+
data.tar.gz: b7de98cd987e5259f037669908769e80f786c82d607d4608c54683b1dc02f4e65b6411b0b3eca15b809865bb7a6a62a22ebc6f9f451872db606dc4fc571fc241
|
@@ -17,6 +17,7 @@ module Viperaptor::CLI
|
|
17
17
|
desc 'gen [MODULE_NAME] [TEMPLATE_NAME]', 'Creates a new VIPER module with a given name from a specific template'
|
18
18
|
method_option :description, :aliases => '-d', :desc => 'Provides a full description to the module'
|
19
19
|
method_option :author, :desc => 'Specifies the author name for generated module'
|
20
|
+
method_option :rambafile, :desc => 'Specifies Rambafile to use'
|
20
21
|
method_option :project_targets, :desc => 'Specifies project targets for adding new module files'
|
21
22
|
method_option :project_file_path, :desc => 'Specifies a location in the filesystem for new files'
|
22
23
|
method_option :project_group_path, :desc => 'Specifies a location in Xcode groups for new files'
|
@@ -27,6 +28,9 @@ module Viperaptor::CLI
|
|
27
28
|
method_option :test_path, :desc => 'Specifies a location (both in the filesystem and Xcode) for new test files'
|
28
29
|
method_option :custom_parameters, :type => :hash, :default => {}, :desc => 'Specifies extra parameters in format `key1:value1 key2:value2` for usage during code generation'
|
29
30
|
def gen(module_name = nil, template_name = nil)
|
31
|
+
|
32
|
+
Rambafile.use(options[:rambafile])
|
33
|
+
|
30
34
|
does_rambafile_exist = Rambafile.exist
|
31
35
|
|
32
36
|
unless does_rambafile_exist
|
@@ -16,6 +16,10 @@ module Viperaptor
|
|
16
16
|
|
17
17
|
class Rambafile
|
18
18
|
|
19
|
+
def self.use(name)
|
20
|
+
@@rambafile_name = name
|
21
|
+
end
|
22
|
+
|
19
23
|
def self.exist
|
20
24
|
Dir[RAMBAFILE_NAME + "*"].count > 0
|
21
25
|
end
|
@@ -29,23 +33,31 @@ module Viperaptor
|
|
29
33
|
|
30
34
|
if @@rambafile == nil
|
31
35
|
|
32
|
-
|
36
|
+
if @@rambafile_name == nil
|
37
|
+
|
38
|
+
files = Dir[RAMBAFILE_NAME + "*"]
|
39
|
+
|
40
|
+
if files.count == 0
|
41
|
+
puts("No Rambafile found".red)
|
42
|
+
exit
|
43
|
+
end
|
44
|
+
|
45
|
+
if files.count == 1
|
46
|
+
@@rambafile_name = files[0]
|
47
|
+
else
|
48
|
+
prompt = TTY::Prompt.new
|
49
|
+
choices = files.sort
|
50
|
+
@@rambafile_name = prompt.select("Select Rambafile?", choices, per_page: choices.count)
|
51
|
+
end
|
33
52
|
|
34
|
-
if files.count == 0
|
35
|
-
puts("No Rambafile found".red)
|
36
|
-
exit
|
37
53
|
end
|
38
54
|
|
39
|
-
if
|
40
|
-
@@
|
55
|
+
if @@rambafile_name.start_with?(RAMBAFILE_NAME)
|
56
|
+
@@rambafile_name_suffix = @@rambafile_name[RAMBAFILE_NAME.length..-1]
|
41
57
|
else
|
42
|
-
|
43
|
-
choices = files.sort
|
44
|
-
@@rambafile_name = prompt.select("Select Rambafile?", choices, per_page: choices.count)
|
58
|
+
@@rambafile_name_suffix = "_" + @@rambafile_name
|
45
59
|
end
|
46
60
|
|
47
|
-
@@rambafile_name_suffix = @@rambafile_name[RAMBAFILE_NAME.length..-1]
|
48
|
-
|
49
61
|
self.validate
|
50
62
|
@@rambafile = YAML.load_file(@@rambafile_name)
|
51
63
|
self.load_defaults
|
data/lib/viperaptor/version.rb
CHANGED