Git Product home page Git Product logo

rubygems_plugin_generator's Introduction

Rubygems plugin generator

This is a RubyGems plugin to generate RubyGems plugins.

Installation

$ gem install rubygems_plugin_generator

Usage

gem plugin <your-plugin-name>

This command should generate all the code you need to have a working RubyGems plugin. Just change the file lib/rubygems/commands/<your-command>_command.rb and you should be good to go.

Example

$ gem plugin foo

#       create  foo/foo.gemspec
#       create  foo/Gemfile
#       create  foo/lib/foo/version.rb
#       create  foo/lib/rubygems_plugin.rb
#       create  foo/lib/rubygems/commands/foo_command.rb
#       create  foo/test/foo_command_test.rb
#       create  foo/Rakefile
#       create  foo/.gitignore
# 
# *****************************************************************************************
# Please edit foo.gemspec with your plugin information.
# The file lib/rubygems/commands/foo_command.rb was created for you, there you will
# find a method called 'execute'. That's the method that will be called when someone runs
# 'gem foo'
# *****************************************************************************************

Here you have the basic structure of a RubyGems plugin that just prints a sample message ("It works!"). It also include a sample test that you can use as an inspiration to write your own. You can run the tests with rake:

$ rake test
Run options: --seed 52142

# Running:

.

Finished in 0.011959s, 83.6190 runs/s, 83.6190 assertions/s.

1 runs, 1 assertions, 0 failures, 0 errors, 0 skips

To build and install your plugin, you can use the gem commands, as you would with a normal gem:

$ gem build foo.gemspec

#   Successfully built RubyGem
#   Name: foo
#   Version: 0.1.0
#   File: foo-0.1.0.gem

$ gem install foo-0.1.0.gem

# Successfully installed foo-0.1.0
# Parsing documentation for foo-0.1.0
# Installing ri documentation for foo-0.1.0
# Done installing documentation for foo after 0 seconds
# 1 gem installed

And now you can run your plugin to see it in action:

$ gem foo

# It works!

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

rubygems_plugin_generator's People

Contributors

brianstorti avatar

Stargazers

 avatar Michael Lee Vazquez avatar Patrik Ragnarsson avatar Garblovian avatar Benjamin Fleischer avatar Martin Gotink avatar Teo Ljungberg avatar Ajaya Agrawalla avatar Eugene Maslenkov avatar Vadim Gorbunov avatar Daniel Marchlik avatar Anatoly Chernov avatar Walter Lee Davis avatar Jerry D'Antonio avatar

Watchers

 avatar James Cloos avatar  avatar  avatar

rubygems_plugin_generator's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.