Code Monkey home page Code Monkey logo

gem_patching's Introduction

gem_patching

gem_patching provides a mechanism for marking blocks of code as patches for specific versions of a specific gem. If the targeted gem is updated and it’s version does not match the targeted version any more, an exception is raised, notifying developers to evaluate whether the patch is still needed for the new version:

# cucumber_patch.rb
Gem.patching('cucumber', '0.8.0') do
  # your code patching cucumber '0.8.0'
end
# this will raise the following exception if cucumber is updated:
# Attempt to apply patch targeting version '0.8.0' of 'cucumber', but active version is '0.8.1'

Installation

gem install gem_patching

Copyright © 2010 Ingo Weiss, released under the MIT license

gem_patching's People

Contributors

ingoweiss avatar

Stargazers

Aleks avatar Pascal Jungblut avatar Angus H. avatar Benedikt Deicke avatar Robin Böning avatar  avatar Gun.io Robot avatar Michael Schiller avatar Konstantin Haase avatar Schmidt avatar Nicolas Blanco avatar  avatar Szymon Nowak avatar  avatar Joshua Hull avatar Thomas Marek avatar Fronx avatar John Barnette avatar Hugo Baraúna avatar Sven Fuchs avatar Colin Schlueter avatar Garret Alfert avatar Ed Allen avatar Saimon Moore avatar Michael Bumann avatar

Watchers

 avatar

Forkers

guniorobot

gem_patching's Issues

Idiom and API Use

Neat idea. As a RubyGems maintainer, a few things you might want to tweak come to mind:

  • This isn't the normal file structure or gem name for a RubyGems (or any other well-behaved gem) plugin. If you'd like to follow our standard naming convention, the gem would be called gem-patching (dash, not underscore) and the code would live in lib/rubygems/patching.rb.
  • Consider changing the patching method's signature to patching(name, *requirements), using those arguments to create a Gem::Dependency, and using Gem.available? to check for your gem. This would allow use of all of RubyGems' normal version specifiers.
  • Consider showing a warning when the patch isn't going to be applied rather than raising an error.

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.