generamba-mp 0.0.5 → 1.4.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 +4 -4
- data/generamba.gemspec +4 -4
- data/lib/generamba/cli/cli.rb +1 -1
- data/lib/generamba/cli/gen_command.rb +9 -15
- data/lib/generamba/code_generation/code_module.rb +2 -4
- data/lib/generamba/helpers/xcodeproj_helper.rb +3 -9
- data/lib/generamba/module_generator.rb +4 -11
- metadata +4 -12
- data/.DS_Store +0 -0
- data/.vscode/launch.json +0 -64
- data/lib/generamba/tools/liquid-camelcase.rb +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b1d6586562fa645d9ab438d6ea44e40be1d255e
|
4
|
+
data.tar.gz: 88e83c9d0795a185e1ebee70e81995d485d37188
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd909e848bacfc266e48a9c59005c10c3ce764c054e3bacf45a8e46f238bfbd0736c57843499124e166a7f6a8b309792a9f00297ae4c01da64962e43b34786fc
|
7
|
+
data.tar.gz: 58a9fb53d5f4d1db27d11fe5d09e5cc31631daefd6dcfeceeabbd2baa34c24f63827e5ebd936a38d91a3e13876d983c7e662eef58cf1e3582ebeb719aa0e75a9
|
data/generamba.gemspec
CHANGED
@@ -5,13 +5,13 @@ require 'generamba/version'
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = 'generamba-mp'
|
8
|
-
spec.version =
|
9
|
-
spec.authors = ['
|
8
|
+
spec.version = Generamba::VERSION
|
9
|
+
spec.authors = ['Marton Pito']
|
10
10
|
spec.email = 'martonpito@gmail.com'
|
11
11
|
|
12
|
-
spec.summary = '
|
12
|
+
spec.summary = 'Generamba forked for own modifications.'
|
13
13
|
spec.description = 'Generamba is a powerful and easy-to-use Xcode code generator. It provides a project-based configuration, flexible templates system, the ability to generate code and tests simultaneously.'
|
14
|
-
spec.homepage = 'https://github.com/
|
14
|
+
spec.homepage = 'https://github.com/Hunartimon/Generamba'
|
15
15
|
spec.license = 'MIT'
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
data/lib/generamba/cli/cli.rb
CHANGED
@@ -8,9 +8,9 @@ require 'generamba/cli/version_command.rb'
|
|
8
8
|
require 'generamba/cli/setup_username_command.rb'
|
9
9
|
require 'generamba/cli/thor_extension.rb'
|
10
10
|
require 'generamba/cli/template/template_group.rb'
|
11
|
-
require 'generamba/tools/liquid-camelcase.rb'
|
12
11
|
|
13
12
|
module Generamba::CLI
|
14
13
|
class Application < Thor
|
14
|
+
|
15
15
|
end
|
16
16
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'thor'
|
2
|
-
require 'liquid'
|
3
2
|
require 'generamba/helpers/print_table.rb'
|
4
3
|
require 'generamba/helpers/rambafile_validator.rb'
|
5
4
|
require 'generamba/helpers/xcodeproj_helper.rb'
|
@@ -59,20 +58,15 @@ module Generamba::CLI
|
|
59
58
|
DependencyChecker.check_all_required_dependencies_has_in_cartfile(template.dependencies, code_module.cartfile_path)
|
60
59
|
|
61
60
|
project = XcodeprojHelper.obtain_project(code_module.xcodeproj_path)
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
else
|
72
|
-
break
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
61
|
+
module_group_already_exists = XcodeprojHelper.module_with_group_path_already_exists(project, code_module.project_group_path)
|
62
|
+
|
63
|
+
if module_group_already_exists
|
64
|
+
replace_exists_module = yes?("#{module_name} module already exists. Replace? (yes/no)")
|
65
|
+
|
66
|
+
unless replace_exists_module
|
67
|
+
return
|
68
|
+
end
|
69
|
+
end
|
76
70
|
|
77
71
|
generator = Generamba::ModuleGenerator.new
|
78
72
|
generator.generate_module(module_name, code_module, template)
|
@@ -81,8 +81,7 @@ module Generamba
|
|
81
81
|
file_path = group_path unless file_path
|
82
82
|
|
83
83
|
variable_value = file_path.gsub(SLASH_REGEX, '')
|
84
|
-
variable_value = Pathname.new(variable_value)
|
85
|
-
puts("setup_file_and_group_paths variable_value: #{variable_value}")
|
84
|
+
variable_value = Pathname.new(variable_value).join(@name)
|
86
85
|
instance_variable_set("@#{variable_name}", variable_value)
|
87
86
|
end
|
88
87
|
|
@@ -92,8 +91,7 @@ module Generamba
|
|
92
91
|
group_path = file_path unless group_path
|
93
92
|
|
94
93
|
variable_value = group_path.gsub(SLASH_REGEX, '')
|
95
|
-
variable_value = Pathname.new(variable_value)
|
96
|
-
puts("setup_file_and_group_paths variable_value: #{variable_value}")
|
94
|
+
variable_value = Pathname.new(variable_value).join(@name)
|
97
95
|
instance_variable_set("@#{variable_name}", variable_value)
|
98
96
|
end
|
99
97
|
end
|
@@ -24,8 +24,6 @@ module Generamba
|
|
24
24
|
file_path = file_path.join(file_group_path) if file_group_path
|
25
25
|
file_path = file_path.join(file_name) if file_name
|
26
26
|
|
27
|
-
puts "add_file_to_project_and_targets file_path: #{file_path}"
|
28
|
-
|
29
27
|
module_group = self.retrieve_group_or_create_if_needed(group_path, dir_path, file_group_path, project, true)
|
30
28
|
xcode_file = module_group.new_file(File.absolute_path(file_path))
|
31
29
|
|
@@ -48,7 +46,6 @@ module Generamba
|
|
48
46
|
#
|
49
47
|
# @return [void]
|
50
48
|
def self.add_group_to_project(project, group_path, dir_path, directory_name)
|
51
|
-
puts "add_group_to_project: group_path: #{group_path}, dir_path: #{dir_path}, directory_name: #{directory_name} "
|
52
49
|
self.retrieve_group_or_create_if_needed(group_path, dir_path, directory_name, project, true)
|
53
50
|
end
|
54
51
|
|
@@ -75,11 +72,9 @@ module Generamba
|
|
75
72
|
# @return [Void]
|
76
73
|
def self.clear_group(project, targets_name, group_path)
|
77
74
|
module_group = self.retrieve_group_or_create_if_needed(group_path, nil, nil, project, false)
|
78
|
-
puts "clear_group: group_path: #{group_path} module_group: #{module_group}"
|
79
75
|
return unless module_group
|
80
76
|
|
81
77
|
files_path = self.files_path_from_group(module_group, project)
|
82
|
-
puts "clear_group: group_path: #{group_path} files_path: #{files_path}"
|
83
78
|
return unless files_path
|
84
79
|
|
85
80
|
files_path.each do |file_path|
|
@@ -110,16 +105,15 @@ module Generamba
|
|
110
105
|
#
|
111
106
|
# @return [PBXGroup]
|
112
107
|
def self.retrieve_group_or_create_if_needed(group_path, dir_path, file_group_path, project, create_group_if_not_exists)
|
113
|
-
|
114
108
|
group_names = path_names_from_path(group_path)
|
115
109
|
group_components_count = group_names.count
|
116
110
|
group_names += path_names_from_path(file_group_path) if file_group_path
|
117
|
-
|
111
|
+
|
118
112
|
final_group = project
|
119
113
|
|
120
114
|
group_names.each_with_index do |group_name, index|
|
121
115
|
next_group = final_group[group_name]
|
122
|
-
|
116
|
+
|
123
117
|
unless next_group
|
124
118
|
return nil unless create_group_if_not_exists
|
125
119
|
|
@@ -132,7 +126,7 @@ module Generamba
|
|
132
126
|
|
133
127
|
final_group = next_group
|
134
128
|
end
|
135
|
-
|
129
|
+
|
136
130
|
final_group
|
137
131
|
end
|
138
132
|
|
@@ -55,22 +55,12 @@ module Generamba
|
|
55
55
|
def process_files_if_needed(files, code_module, template, project, targets, group_path, dir_path, processed_groups = [])
|
56
56
|
# It's possible that current project doesn't test targets configured, so it doesn't need to generate tests.
|
57
57
|
# The same is for files property - a template can have only test or project files
|
58
|
-
puts "process_files_if_needed: group_path: #{group_path}\n dir_path: #{dir_path}\n"
|
59
58
|
if targets.count == 0 || files == nil || files.count == 0 || dir_path == nil || group_path == nil
|
60
59
|
return
|
61
60
|
end
|
62
61
|
|
62
|
+
XcodeprojHelper.clear_group(project, targets, group_path) unless processed_groups.include? group_path
|
63
63
|
files.each do |file|
|
64
|
-
|
65
|
-
file_group = File.dirname(file[TEMPLATE_NAME_KEY])
|
66
|
-
file_group = nil if file_group == '.'
|
67
|
-
|
68
|
-
unless processed_groups.include? File.join(group_path, "/", file_group)
|
69
|
-
# puts "process_files_if_needed: file_group: #{File.join(group_path, "/", file_group)}"
|
70
|
-
XcodeprojHelper.clear_group(project, targets, File.join(group_path, "/", file_group))
|
71
|
-
processed_groups.push(File.join(group_path, "/", file_group))
|
72
|
-
end
|
73
|
-
|
74
64
|
unless file[TEMPLATE_FILE_PATH_KEY]
|
75
65
|
directory_name = file[TEMPLATE_NAME_KEY].gsub(/^\/|\/$/, '')
|
76
66
|
file_group = dir_path.join(directory_name)
|
@@ -81,6 +71,9 @@ module Generamba
|
|
81
71
|
next
|
82
72
|
end
|
83
73
|
|
74
|
+
file_group = File.dirname(file[TEMPLATE_NAME_KEY])
|
75
|
+
file_group = nil if file_group == '.'
|
76
|
+
|
84
77
|
module_info = ModuleInfoGenerator.new(code_module)
|
85
78
|
|
86
79
|
# Generating the content of the code file and it's name
|
metadata
CHANGED
@@ -1,18 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: generamba-mp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Egor Tolstoy
|
8
|
-
- Andrey Zarembo
|
9
|
-
- Beniamin Sarkisyan
|
10
|
-
- Aleksandr Sychev
|
11
7
|
- Marton Pito
|
12
8
|
autorequire:
|
13
9
|
bindir: bin
|
14
10
|
cert_chain: []
|
15
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-14 00:00:00.000000000 Z
|
16
12
|
dependencies:
|
17
13
|
- !ruby/object:Gem::Dependency
|
18
14
|
name: thor
|
@@ -183,12 +179,10 @@ executables:
|
|
183
179
|
extensions: []
|
184
180
|
extra_rdoc_files: []
|
185
181
|
files:
|
186
|
-
- ".DS_Store"
|
187
182
|
- ".codeclimate.yml"
|
188
183
|
- ".gitignore"
|
189
184
|
- ".rspec"
|
190
185
|
- ".travis.yml"
|
191
|
-
- ".vscode/launch.json"
|
192
186
|
- CHANGELOG.md
|
193
187
|
- Gemfile
|
194
188
|
- LICENSE.txt
|
@@ -248,10 +242,9 @@ files:
|
|
248
242
|
- lib/generamba/template/installer/template_installer_factory.rb
|
249
243
|
- lib/generamba/template/processor/template_declaration.rb
|
250
244
|
- lib/generamba/template/processor/template_processor.rb
|
251
|
-
- lib/generamba/tools/liquid-camelcase.rb
|
252
245
|
- lib/generamba/tools/string-colorize.rb
|
253
246
|
- lib/generamba/version.rb
|
254
|
-
homepage: https://github.com/
|
247
|
+
homepage: https://github.com/Hunartimon/Generamba
|
255
248
|
licenses:
|
256
249
|
- MIT
|
257
250
|
metadata: {}
|
@@ -274,6 +267,5 @@ rubyforge_project:
|
|
274
267
|
rubygems_version: 2.5.2
|
275
268
|
signing_key:
|
276
269
|
specification_version: 4
|
277
|
-
summary:
|
278
|
-
and flexible template system.
|
270
|
+
summary: Generamba forked for own modifications.
|
279
271
|
test_files: []
|
data/.DS_Store
DELETED
Binary file
|
data/.vscode/launch.json
DELETED
@@ -1,64 +0,0 @@
|
|
1
|
-
{
|
2
|
-
// Use IntelliSense to learn about possible attributes.
|
3
|
-
// Hover to view descriptions of existing attributes.
|
4
|
-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
5
|
-
"version": "0.2.0",
|
6
|
-
"configurations": [
|
7
|
-
{
|
8
|
-
"name": "Debug Local File",
|
9
|
-
"type": "Ruby",
|
10
|
-
"request": "launch",
|
11
|
-
"cwd": "${workspaceRoot}",
|
12
|
-
"program": "${workspaceRoot}/bin/generamba"
|
13
|
-
},
|
14
|
-
{
|
15
|
-
"name": "Listen for rdebug-ide",
|
16
|
-
"type": "Ruby",
|
17
|
-
"request": "attach",
|
18
|
-
"cwd": "${workspaceRoot}",
|
19
|
-
"remoteHost": "127.0.0.1",
|
20
|
-
"remotePort": "1234",
|
21
|
-
"remoteWorkspaceRoot": "${workspaceRoot}"
|
22
|
-
},
|
23
|
-
{
|
24
|
-
"name": "Rails server",
|
25
|
-
"type": "Ruby",
|
26
|
-
"request": "launch",
|
27
|
-
"cwd": "${workspaceRoot}",
|
28
|
-
"program": "${workspaceRoot}/bin/rails",
|
29
|
-
"args": [
|
30
|
-
"server"
|
31
|
-
]
|
32
|
-
},
|
33
|
-
{
|
34
|
-
"name": "RSpec - all",
|
35
|
-
"type": "Ruby",
|
36
|
-
"request": "launch",
|
37
|
-
"cwd": "${workspaceRoot}",
|
38
|
-
"program": "${workspaceRoot}/bin/rspec",
|
39
|
-
"args": [
|
40
|
-
"-I",
|
41
|
-
"${workspaceRoot}"
|
42
|
-
]
|
43
|
-
},
|
44
|
-
{
|
45
|
-
"name": "RSpec - active spec file only",
|
46
|
-
"type": "Ruby",
|
47
|
-
"request": "launch",
|
48
|
-
"cwd": "${workspaceRoot}",
|
49
|
-
"program": "${workspaceRoot}/bin/rspec",
|
50
|
-
"args": [
|
51
|
-
"-I",
|
52
|
-
"${workspaceRoot}",
|
53
|
-
"${file}"
|
54
|
-
]
|
55
|
-
},
|
56
|
-
{
|
57
|
-
"name": "Cucumber",
|
58
|
-
"type": "Ruby",
|
59
|
-
"request": "launch",
|
60
|
-
"cwd": "${workspaceRoot}",
|
61
|
-
"program": "${workspaceRoot}/bin/cucumber"
|
62
|
-
}
|
63
|
-
]
|
64
|
-
}
|