Skip to content

Commit

Permalink
Added the ability to specify author name in Rambafile (Issue #107)
Browse files Browse the repository at this point in the history
  • Loading branch information
Egor Tolstoy committed Apr 25, 2016
1 parent 3e20489 commit f7c637e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/generamba/cli/gen_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class Application < Thor

desc 'gen [MODULE_NAME] [TEMPLATE_NAME]', 'Creates a new VIPER module with a given name from a specific template'
method_option :description, :aliases => '-d', :desc => 'Provides a full description to the module'
method_option :author, :desc => 'Specifies the author name for generated module'
method_option :module_targets, :desc => 'Specifies project targets for adding new module files'
method_option :module_file_path, :desc => 'Specifies a location in the filesystem for new files'
method_option :module_group_path, :desc => 'Specifies a location in Xcode groups for new files'
Expand Down
7 changes: 6 additions & 1 deletion lib/generamba/code_generation/code_module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ def initialize(name, description, rambafile, options)
@name = name
@description = description

@author = UserPreferences.obtain_username
if rambafile[AUTHOR_NAME_KEY] != nil
@author = rambafile[AUTHOR_NAME_KEY]
else
@author = UserPreferences.obtain_username
end

@company = rambafile[COMPANY_KEY]
@year = Time.now.year.to_s

Expand Down
1 change: 1 addition & 0 deletions lib/generamba/constants/rambafile_constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module Generamba

# Keys of Rambafile files
COMPANY_KEY = 'company'
AUTHOR_NAME_KEY = 'author'
PROJECT_NAME_KEY = 'project_name'
PROJECT_PREFIX_KEY = 'prefix'
XCODEPROJ_PATH_KEY = 'xcodeproj_path'
Expand Down

0 comments on commit f7c637e

Please sign in to comment.