• This repository has been archived on 25/Jan/2018
  • Stars
    star
    162
  • Rank 232,284 (Top 5 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 10 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Gem to generate VIPER modules to use them in your Objective-C/Swift projects.

Viper Module Generator

⚠️ 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 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

.objc
+-- DataManager
|   +-- VIPERDataManager.h
|   +-- VIPERDataManager.m
+-- Interactor
|   +-- VIPERInteractor.h
|   +-- VIPERInteractor.m
+-- Presenter
|   +-- VIPERPresenter.h
|   +-- VIPERPresenter.m
+-- ViewController
|   +-- VIPERViewController.h
|   +-- VIPERViewController.m
+-- WireFrame
|   +-- VIPERWireFrame.h
|   +-- VIPERWireFrame.m
+-- Protocols
|   +-- VIPERProtocols.h
.swift
+-- DataManager
|   +-- VIPERDataManager.swift
+-- Interactor
|   +-- VIPERInteractor.swift
+-- Presenter
|   +-- VIPERPresenter.swift
+-- ViewController
|   +-- VIPERViewController.swift
+-- WireFrame
|   +-- VIPERWireFrame.swift
+-- Protocols
|   +-- VIPERProtocols.swift

How to install vipergen ?

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

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

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:

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:
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

More Repositories

1

teambox

This is the legacy version of Teambox - the award-winning collaboration solution, inspired by Basecamp, Yammer and Twitter.
Ruby
1,864
star
2

react-native-auto-updater

A library to manage dynamic updates to React Native apps. Available as an NPM Package for iOS and Android.
Objective-C
1,509
star
3

gockerize

Package golang service into minimal docker containers.
Shell
666
star
4

free-file-icons

Platform-agnostic icons for audio, image, programming and office files.
611
star
5

scrum-poker-cards

588
star
6

backbone-redux

Easy way to keep your backbone collections and redux store in sync.
JavaScript
191
star
7

ssmp

Stupid-Simple Messaging Protocol.
122
star
8

lipwig

Golang implementation of the Stupid-Simple Messaging Protocol.
Go
98
star
9

departure

Percona's pt-online-schema-change runner for ActiveRecord migrations.
Ruby
86
star
10

SimplePagedView

A UIPageViewController replacement built to be as simple as possible
Swift
75
star
11

immortal

Make any ActiveRecord model paranoid by just including Immortal, and instead of being deleted from the database, the object will just marked as 'deleted' with a boolean field in the database.
Ruby
60
star
12

openjdk-trim

Tool to trim unneeded classes from an OpenJDK build.
Shell
47
star
13

react-native-quick-look

React Native Component for iOS QuickLook Framework.
Objective-C
37
star
14

aerofs-docker

Ready-to-use cloud-config file for the AeroFS appliance.
Shell
34
star
15

jssmp

Java implementation of the Stupid-Simple Messaging Protocol
Java
25
star
16

planning-time-android

Redbooth's planning poker app for Android.
Java
21
star
17

jnotify

Java bindings for native notification libraries.
C++
20
star
18

ssmperf

Load testing tool for SSMP servers.
Go
18
star
19

nps-surveys

Rails engine to add NPS surveys to your application.
Ruby
17
star
20

teambox-ruby-client

Ruby gem to access Teambox API
Ruby
16
star
21

npm-shrinkwrap-check

Util to check that package.json and npm-shrinkwrap.json are in sync.
JavaScript
14
star
22

fastqrcode

Fast and robust Python bindings for libqrencode.
C
11
star
23

redbooth-ruby

This is a Ruby wrapper for Redbooth's API.
Ruby
10
star
24

gerrit-slack-hooks

Make noise in Slack for Gerrit actions.
Shell
9
star
25

classy-immutable

Immutable instances of ES6 classes.
JavaScript
9
star
26

zendesk-elasticsearch

Index Zendesk tickets in Elasticsearch for easy searching.
Ruby
9
star
27

growl-java-bindings

Objective-C
8
star
28

rubocop-migrations

Ruby
5
star
29

aerofs-sdk-python

An AeroFS Private Cloud API SDK written in Python.
Python
4
star
30

SimpleNotificationBar

Swift
4
star
31

https-pushstate-server

A simple static file server that works with HTML5 Pushstate and HTTPS.
JavaScript
3
star
32

zendesk-help-center-backer

Back your Zendesk Help Center in git. Modify articles locally, and deploy directly to Zendesk.
Python
3
star
33

valkyrie

Golang implementation of the Zephyr relay protocol.
Go
3
star
34

aerofs-sdk-csharp

An AeroFS Private Cloud API SDK written in C#.
C#
2
star
35

retrace-server

Fast and simple TCP Server around Proguard's Retrace tool.
Java
2
star
36

fake-consul

Fakes a consul server. Usecase is for feature specs using Diplomat client
Ruby
2
star
37

api-docs

API v3 Documentation (depreciated).
CSS
2
star
38

aerofs-sdk-golang

An AeroFS Private Cloud API SDK written in Golang.
Go
1
star
39

aeroup

Secure AeroFS upload service. Send link, receive file.
JavaScript
1
star
40

switchboard

A service to perform real-time transcription and translation of audio streams.
Go
1
star
41

rbo-auth2-manager

AFOAuth2Manager in a Framework
Objective-C
1
star
42

freshdesk-help-center-backer

Back your Freshdesk Help Center in git. Modify articles locally, and deploy directly to Freshdesk.
Python
1
star