viperaptor 2.0.0 → 2.0.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 04c78b517567b2c0c13908a460b62ab9864a77ef76249e2307d52fe0dd6135f3
4
- data.tar.gz: f7fcd96e19a87f3c45240b2113a8c05ce112b57e1e624e1706f4d5644b4b9779
3
+ metadata.gz: 1ad2f1f1236c489a2da07d3f32fe6f83c00229fec6aeb6e9d88069c8f721a8ab
4
+ data.tar.gz: 5dca6caf4e2ba5050c6ae5770e88abb79019a7e90d06e551f5289e02e5e8d68a
5
5
  SHA512:
6
- metadata.gz: 3a231c6f53c9b10a5c742322b471ded32153182120aec1412259cce52278140f1277c9890c1a7e32a91b85e244fd552c37324ba4eaa8ff0accb7272224b4f678
7
- data.tar.gz: 88f25b617ca1ccd48b00056edf5cb41fc311001e8eb9fcd0bcff463cc2442a201845353da5eaf5da2b0c41f138cd028e2be43a64a4f7c8cd5aa259fcf9aa8941
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
- files = Dir[RAMBAFILE_NAME + "*"]
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 files.count == 1
40
- @@rambafile_name = files[0]
55
+ if @@rambafile_name.start_with?(RAMBAFILE_NAME)
56
+ @@rambafile_name_suffix = @@rambafile_name[RAMBAFILE_NAME.length..-1]
41
57
  else
42
- prompt = TTY::Prompt.new
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
@@ -1,5 +1,5 @@
1
1
  module Viperaptor
2
- VERSION = '2.0.0'
2
+ VERSION = '2.0.1'
3
3
  RELEASE_DATE = '11.01.2021'
4
4
  RELEASE_LINK = "https://github.com/ladeiko/Viperaptor/releases/tag/#{VERSION}"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: viperaptor
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siarhei Ladzeika