strongself / generamba Goto Github PK
View Code? Open in Web Editor NEWThis codegenerator is too brilliant to be real!
License: MIT License
This codegenerator is too brilliant to be real!
License: MIT License
Im templates there are a lot of duplicated code, for example:
//
// {{ module_info.name }}{{ module_info.file_name }}
// {{ module_info.project_name }}
//
// Created by {{ developer.name }} on {{ date }}.
// Copyright {{ year }} {{ developer.company }}. All rights reserved.
//
Some tests files also need the same imports:
import Quick // https://github.com/Quick/Quick/blob/master/Documentation/QuickExamplesAndGroups.md
import Nimble // https://github.com/Quick/Nimble
It would be great, if we could use some partials to generate duplicated parts of templates.
The user should be able install templates from the local folders. It will look like generamba template install 'MyTemplate' --local ~/Templates/MyTemplate
.
After this command Generamba should look for the .gemspec
file in the corresponding folder, validate it, modify the Rambafile
and move this template to the project folder.
The fields of a .rambaspec file should be properly documented. Besides it, we lack the proper documentation about template creation.
This command should look for all of the matches in the names of templates from our shared catalog.
Generamba uses Settingslogic
gem for interpreting the Rambafile
. It's very inconvenient, non-intuitive looks like a code smell and bad design decision. We can simply replace it with the built-in YAML
parser, just as we do with .rambaspec
files.
Hello,
I need some more clarifications and examples on generamba gen usage with additional parameters. For example, it's unclear if I provide custom --module-path generamba will or will not create subfolder / subgroup with MODULE_NAME.
'Template structure' section of Wiki is incomplete
Currently the user isn't able to use a specific file or group path when generating new modules. The only workaround is to temporary modify a Rambafile
.
We should provide a more convinient way - by using special options:
generamba gen MyModule rviper_controller -f GenerambaSandbox -g GenerambaSandbox/OtherGroup
I think of the following list:
-f
for specifying a file path-g
for specifying a group path-p
for specifying the same path for filesystem and Xcode groupsWhen i use this option I expect that generamba will create MyModuleName
folder in Module/Path/
but it put module content in Module/Path/
instead
For example:
generamba gen SomeModule some_template --module_path UserStories/Main/
Expected result is: UserStories/Main/SomeModule
contains my module files appropriate template
Actual result is: UserStories/Main/
contains my module files
Rambafile should be documented properly, the purpose of some of its fields is unclear.
Should be or will be great at least
If Rambafile
has invalid content, generamba gen
produces a non-informative output. We should validate its content before the actual code generation and produce informative error messages.
Some templates heavily rely on third-party dependencies, integrated either via cocoapods
or via carthage
. We should check the Podfile/Cartfile for such dependencies and warn the user if some of them are missing.
Guys, here in gemspec dependency is 'git', '1.2.9.1'
But I already have git version 2.5.4
. Isn't it enough for Generamba?
Hello!
Thanks for generamba :)
I'm getting an error when i'm trying to generate my module with the generamba:
error.txt
Here is my rambafile (.txt added to upload it to github):
Rambafile.txt
Here is my template's rambaspec:
ica_module.rambaspec.txt
Looks like it is trying to process test files and i don't have any or something like that.
Code-files are generated correctly, though.
When you run 'generamba setup' you are asked to select target for your modules (same thing for tests):
Select the appropriate target for adding your MODULES (type the index):
But, since now we have support for multiple targets via editing Rambafile, it would be nice to be able to do it during setup.
Sometimes one of the questions produced by generamba setup
command is splitted in parts. This question is about choosing Xcode targets.
All of the files - code and tests, ignore the file_path
properties from Rambafile
and use group_path
for it.
When somebody skips the generamba setup
phase, his author name is not written to the user_preferences.yml
file - and isn't included in the generated files. We should always check it in the generamba gen
command.
Now not so clear how will dependency section works, I guess it will add in Podfile/Cartfile automatically, but will much better if it will described in docs
Needs investigation
This issue relates to #17 . The .rambaspec
file should contain all of the required dependencies declarations.
There are a lot of hardcoded keys in the code - Rambafile
keys, directories etc. All of them should be placed in the corresponding constants file, e.g. constants.rb
.
When regenerate module with name already exists
steps:
generamba gen RootNavigation bl_viper_default_gt
and again
generamba gen RootNavigation bl_viper_default_gt
Currently when you provide an empty value to some of the generamba setup
questions it reslults into an key with empty value in the generated Rambafile
. We can use liquid support of conditional statements to fix it.
Generamba should ask the user, if he wants to use the same file path, as group path. Only if he chooses no
, we should ask him for all of these paths.
Besides it, the naming is unclear - file_path
and group_path
are not obvious.
It seems that sometimes during a generamba setup
a wrong test target is written to the Rambafile
. The problem needs investigation.
A couple of users asked to implement the ability of specifying custom template catalog urls somewhere in the Rambafile (just like cocoapods do).
Bring some colors to the output of Generamba commands.
It might be -paramName paramvalue
or something like this, also would be great if it supports arrays
for example I have two templates which different only few lines, one of them contain method instantiation from SB and second one initialization from XIB and I can set -initMethod SB
or -initMethod XIB
appropriate but applied to one template
if run "generamba gen MyModule" twice, generator creates 2 references to the same file in project.pbxproj
Generamba should be more user-friendly - so it should help with creating new templates too. I see it in the following way: generamba template create
starts the series of questions - the template name, the author name, etc, and then it generates a .gemspec
file and a default file structure.
Steps:
ER: Files created and included in project's target
AR: Files created and included in project but didn't include in target
Rambafile contains not only project-specific information, but also user-related: the author name.
It should either be moved to some other location, or always detected in the runtime.
Genegramba should produce something more informative than just a stack trace.
My ruby is version ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
.
I've installed the gem with gem install generamba
. Then as described here I did generamba setup
and after answering several questions, I've got the Rambafile
.
When I tried generamba template install
I've got this error message:
/Users/xxx/.rvm/gems/ruby-2.2.2/gems/generamba-0.7.1/lib/generamba/template/processor/template_processor.rb:21:in `install_templates': undefined method `map' for nil:NilClass (NoMethodError)
from /Users/xxx/.rvm/gems/ruby-2.2.2/gems/generamba-0.7.1/lib/generamba/cli/template/template_install_command.rb:14:in `install'
from /Users/xxx/.rvm/gems/ruby-2.2.2/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from /Users/xxx/.rvm/gems/ruby-2.2.2/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /Users/xxx/.rvm/gems/ruby-2.2.2/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
from /Users/xxx/.rvm/gems/ruby-2.2.2/gems/thor-0.19.1/lib/thor/invocation.rb:115:in `invoke'
from /Users/xxx/.rvm/gems/ruby-2.2.2/gems/thor-0.19.1/lib/thor.rb:235:in `block in subcommand'
from /Users/xxx/.rvm/gems/ruby-2.2.2/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from /Users/xxx/.rvm/gems/ruby-2.2.2/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /Users/xxx/.rvm/gems/ruby-2.2.2/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
from /Users/xxx/.rvm/gems/ruby-2.2.2/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
from /Users/xxx/.rvm/gems/ruby-2.2.2/gems/generamba-0.7.1/bin/generamba:5:in `<top (required)>'
from /Users/xxx/.rvm/gems/ruby-2.2.2/bin/generamba:23:in `load'
from /Users/xxx/.rvm/gems/ruby-2.2.2/bin/generamba:23:in `<main>'
from /Users/xxx/.rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `eval'
from /Users/xxx/.rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `<main>'
Actually the error means that there are no templates, and in Rambafile, there are:
### Templates
templates:
#- {name: local_template_name, local: 'absolute/file/path'}
#- {name: remote_template_name, git: 'https://github.com/igrekde/remote_template'}
#- {name: catalog_template_name}
Its ok, but shouldn't it say that there are no templates to install instead of throwing an error?
P.S. None of the provided templates can be used as is.
We should translate all of the documentation into English.
Add new command to Generamba
convert input_file [--output output_file] [--parser parser] [parser_arguments]
It will convert one file types into another with one command.
This can be used to convert Objective-C files into Swift, CoreData model to classes with Mogenerator and Project Brief into application.
Parser can be any Ruby, Bash script or console application.
ERROR: Error installing generamba: generamba requires Ruby version >= 2.2.
Repo is: https://github.com/BrainLayer/bl_viper_uivc
Rambafile:
### Templates
templates:
- {name: bl_viper_uivc, git: https://github.com/BrainLayer/bl_viper_uivc}
Error:
.rbenv/versions/2.2.3/lib/ruby/2.2.0/psych.rb:370:in `parse': (Rambafile): found unexpected ':' while scanning a plain scalar at line 36 column 30 (Psych::SyntaxError)
When generamba asks you for Podfile path during setup it is unclear that you have to type 'Podfile' by default. Solutions?
Rambafile:
....
templates:
- {name: bl_viper_uivc, path: /Volumes/DataStore/Projects/GenerambaTemplates/bl_viper_uivc}
error:
Cannot find bl_viper_uivc.rambaspec in the template catalog. Try another name. (StandardError)
It should use a relative filepath
It may seem stupid question, but I can't find any docs about if it supports swift.
if Rambafile contains:
# The file path for new modules
project_file_path:
# The Xcode group path to new modules
project_group_path:
then we have this error
rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/generamba-0.7.1/lib/generamba/code_generation/code_module.rb:33:in `initialize': no implicit conversion of nil into String (TypeError)
from /Users/maksimbazarov/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/generamba-0.7.1/lib/generamba/code_generation/code_module.rb:33:in `new'
from /Users/maksimbazarov/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/generamba-0.7.1/lib/generamba/code_generation/code_module.rb:33:in `initialize'
from /Users/maksimbazarov/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/generamba-0.7.1/lib/generamba/cli/gen_command.rb:40:in `new'
from /Users/maksimbazarov/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/generamba-0.7.1/lib/generamba/cli/gen_command.rb:40:in `gen'
from /Users/maksimbazarov/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from /Users/maksimbazarov/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /Users/maksimbazarov/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
from /Users/maksimbazarov/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
from /Users/maksimbazarov/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/generamba-0.7.1/bin/generamba:5:in `<top (required)>'
from /Users/maksimbazarov/.rbenv/versions/2.2.3/bin/generamba:23:in `load'
from /Users/maksimbazarov/.rbenv/versions/2.2.3/bin/generamba:23:in `<main>'
May be it is ok, and should be, but would be great have error message instead
This command should list all of the templates available in our shared catalog.
After merging #14 the default template from the lib
templates` folder should be moved to Rambler catalog repository.
This issue relates to #17 . Generamba should ask user for these paths during generamba setup
.
The user should be able to install Generamba templates from the remote git repository. It will look like generamba template install 'MyTemplate' --remote https://github.com/rambler-ios/rambler-viper-controller
.
It will be better to add module's sources to test target automatically.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.