百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
V

viper-module-generator

> 编程语言
开源

使用 Gem 生成 VIPER 模块,以在 Objective-C/Swift 项目中使用它们。

159 stars0 点赞3 次浏览
访问官网GitHub

工具介绍

使用 Gem 生成 VIPER 模块,以在 Objective-C/Swift 项目中使用它们。

Viper Module Generator

:warning: This project is no longer maintained.

Gem to generate VIPER modules to use them in your Objective-C/Swift projects The implementation scheme returned by this generator is hardly inspired in the example and post of Objc.io, http://www.objc.io/issue-13/viper.html .

  • Features
    • Changelog
    • Expected in version 0.2
  • Viper files structure
  • How to install vipergen
  • How to generate a VIPER module with a given name?
  • Developer tips
    • Update the gem
    • Add a new template
  • Resources

Features

  • Generates the module in Swift and Objective-C
  • Ready to be installed as a gem https://rubygems.org/gems/VIPERGen

Changelog 0.1.6

  • Added templates command to know which templates are available
  • YAML file in each template with the information about the template (more scalable)

Changelog 0.1

  • Added default template
  • Fully components tested

Expected in version 0.2

  • Example project of Redbooth login with notifications
  • FetchedResultsController template
  • Default template in Swift
  • Login template
  • Integrate with XCode as a plugin (http://nshipster.com/xcode-plugins/)

Viper files structure

…

How to install vipergen ?

You can install it easily as using the gem. With ruby installed in your OSX execute:

bash
sudo gem install vipergen

If everything were right, you should have now the vipergem command available in your system console

How to generate a VIPER module with a given name?

You have just to execute the following command

bash
vipergen generate MyFirstViperModule --path=~/myproject/shared

And then the files structure will be automatically created. Don't forget to add this folder to your project dragging it into the XCode/Appcode inspector

Developer tips

Update the gem

When the gem is updated it has to be reported to the gem repository. I followed this tutorial http://amaras-tech.co.uk/article/43/Creating_executable_gems that basically says that once you have your gem ready execute:

bash
gem build vipergen.gemspec
gem install vipergen-0.1.gem
gem push vipergen-0.1.gem

Then you'll be asked for your credentials in order to make the update in the repo (http://guides.rubygems.org/publishing/)

Add a new template

Are you interested in VIPER and you would like to contribute with this gem adding new templates? Feel free to do it. It's pretty easy. You've just to:

  • Create a folder inside templates with the name of your template
  • You'll have to create inside the templates in both languages, Swift and Objective-C (get inspired from existing templates)
  • Use the word VIPER where you want the name to be replaced in.
  • Remember to add the file viperspec.yml with the description of your template as below:
yaml
author: pepi
author_email: [email protected]
template_description: Default template with the simplest structure using VIPER
updated_at: 2014-08-24
  • Report it as a PR in this repo updating the gem version in Gemspec.

Resources

  • Rspec documentation: http://rubydoc.info/gems/rspec-expectations/frames
  • XCode Plugins: http://nshipster.com/xcode-plugins/
  • XCodeProj gem (to modify project groups structure): https://github.com/CocoaPods/Xcodeproj
  • Thor, powerful Ruby library for command line: http://whatisthor.com/

Issues· 5 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Ruby

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言