From cca9e3a7da3bcf82cd42d7b94df4d3effa7f12d9 Mon Sep 17 00:00:00 2001 From: Benoit Garret Date: Thu, 23 Jun 2011 15:32:23 +0200 Subject: [PATCH 1/2] Move lib/paiement_cic_helper to lib/paiement_cic/form_helper --- README.markdown | 2 +- init.rb | 2 +- lib/paiement_cic.rb | 2 ++ lib/{paiement_cic_helper.rb => paiement_cic/form_helper.rb} | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) rename lib/{paiement_cic_helper.rb => paiement_cic/form_helper.rb} (98%) diff --git a/README.markdown b/README.markdown index 5dbbd6d..a117aba 100644 --- a/README.markdown +++ b/README.markdown @@ -32,7 +32,7 @@ script/plugin install git://github.com/novelys/paiementcic.git ### in order controller : - helper :paiement_cic + helper :'paiement_cic/form' ### in the payment by card view : diff --git a/init.rb b/init.rb index a4d18c5..3ae6e16 100644 --- a/init.rb +++ b/init.rb @@ -1,2 +1,2 @@ require "paiement_cic" -require "paiement_cic_helper" +require "paiement_cic/form_helper" diff --git a/lib/paiement_cic.rb b/lib/paiement_cic.rb index 487a4dc..90c5af5 100644 --- a/lib/paiement_cic.rb +++ b/lib/paiement_cic.rb @@ -14,6 +14,8 @@ class String end class PaiementCic + autoload :FormHelper, "paiement_cic/form_helper" + @@version = "3.0" # clé extraite grâce à extract2HmacSha1.html fourni par le Crédit Mutuel cattr_accessor :version diff --git a/lib/paiement_cic_helper.rb b/lib/paiement_cic/form_helper.rb similarity index 98% rename from lib/paiement_cic_helper.rb rename to lib/paiement_cic/form_helper.rb index 7cec90e..a171310 100644 --- a/lib/paiement_cic_helper.rb +++ b/lib/paiement_cic/form_helper.rb @@ -1,5 +1,5 @@ ## refactor this -module PaiementCicHelper +module PaiementCic::FormHelper def paiement_cic_hidden_fields(order, price, order_transaction, options = {}) oa = PaiementCic.config(price, order_transaction.reference) From 7be9c5f2d85e208fbbdb9d7d9cfe332cb889b936 Mon Sep 17 00:00:00 2001 From: Benoit Garret Date: Thu, 23 Jun 2011 15:36:40 +0200 Subject: [PATCH 2/2] Gemify the plugin --- .gitignore | 1 + README.markdown | 6 +++++- lib/paiement_cic/version.rb | 3 +++ paiement_cic.gemspec | 16 ++++++++++++++++ 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 lib/paiement_cic/version.rb create mode 100644 paiement_cic.gemspec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c111b33 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.gem diff --git a/README.markdown b/README.markdown index a117aba..d2a3a23 100644 --- a/README.markdown +++ b/README.markdown @@ -9,7 +9,11 @@ It's a Ruby on Rails port of the connexion kits published by the bank. ## INSTALL -script/plugin install git://github.com/novelys/paiementcic.git + script/plugin install git://github.com/novelys/paiementcic.git + +or, in your Gemfile + + gem 'paiement_cic', :git => 'git://github.com/novelys/paiementcic.git', :branch => 'gem' ## USAGE diff --git a/lib/paiement_cic/version.rb b/lib/paiement_cic/version.rb new file mode 100644 index 0000000..b97e9ab --- /dev/null +++ b/lib/paiement_cic/version.rb @@ -0,0 +1,3 @@ +class PaiementCic + VERSION = "0.1" +end diff --git a/paiement_cic.gemspec b/paiement_cic.gemspec new file mode 100644 index 0000000..bf33c84 --- /dev/null +++ b/paiement_cic.gemspec @@ -0,0 +1,16 @@ +# encoding: utf-8 +$:.push File.expand_path("../lib", __FILE__) +require "paiement_cic/version" + +Gem::Specification.new do |s| + s.name = "paiement_cic" + s.version = PaiementCic::VERSION + s.platform = Gem::Platform::RUBY + s.authors = ["Novelys Team"] + s.homepage = "https://github.com/novelys/paiementcic" + s.summary = %q{CIC / Crédit Mutuel credit card payment toolbox} + s.description = %q{Paiement CIC is a gem to ease credit card payment with the CIC / Crédit Mutuel banks system. It's a Ruby on Rails port of the connexion kits published by the bank.} + + s.files = `git ls-files`.split("\n") + s.require_paths = ["lib"] +end