summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjessib <jessib@leap.se>2013-03-07 12:17:13 -0800
committerAzul <azul@leap.se>2013-07-17 10:46:25 +0200
commit2e59c7131a08acab4944b18ba4b8d82daa402c4f (patch)
tree28d33392410b4619ad553fb75f1d056584445fa5
parent97bd0ba4b35481216b2a1592065c70562c81c2d5 (diff)
Start to branch using braintree to process credit card payments.
-rw-r--r--DEVELOP.md3
-rw-r--r--Gemfile1
-rw-r--r--README.md1
-rw-r--r--billing/Gemfile23
-rw-r--r--billing/Rakefile38
-rw-r--r--billing/leap_web_billing.gemspec20
-rw-r--r--billing/lib/leap_web_billing/engine.rb11
-rw-r--r--lib/leap_web.rb1
-rw-r--r--lib/tasks/task_helper.rb2
9 files changed, 98 insertions, 2 deletions
diff --git a/DEVELOP.md b/DEVELOP.md
index e19b827..a35ce06 100644
--- a/DEVELOP.md
+++ b/DEVELOP.md
@@ -10,12 +10,13 @@ Some tips on modifying the views:
Leap Web consists of different Engines. They live in their own subdirectory and are included through bundler via their path. This way changes to the engines immediately affect the server as if they were in the main `app` directory.
-Currently Leap Web consists of 4 Engines:
+Currently Leap Web consists of 5 Engines:
* [core](https://github.com/leapcode/leap_web/blob/master/core) - ships some dependencies that are used accross all engines. This might be removed at some point.
* [users](https://github.com/leapcode/leap_web/blob/master/users) - user registration and authorization
* [certs](https://github.com/leapcode/leap_web/blob/master/certs) - Cert distribution for the EIP client
* [help](https://github.com/leapcode/leap_web/blob/master/help) - Help ticket management
+* [billing](https://github.com/leapcode/leap_web/blob/master/billing) - Billing System
## Creating a new engine ##
diff --git a/Gemfile b/Gemfile
index 56cbf62..1db3c22 100644
--- a/Gemfile
+++ b/Gemfile
@@ -10,6 +10,7 @@ gem "leap_web_core", :path => 'core'
gem 'leap_web_users', :path => 'users'
gem 'leap_web_certs', :path => 'certs'
gem 'leap_web_help', :path => 'help'
+gem 'leap_web_billing', :path => 'billing'
# To use debugger
gem 'debugger', :platforms => :mri_19
diff --git a/README.md b/README.md
index 8e59c76..cfdad33 100644
--- a/README.md
+++ b/README.md
@@ -7,6 +7,7 @@ LEAP Web
* Admin interface to manage users.
* Client certificate distribution and renewal.
* User support help tickets.
+* Billing
This web application is written in Ruby on Rails 3, using CouchDB as the backend data store.
diff --git a/billing/Gemfile b/billing/Gemfile
new file mode 100644
index 0000000..68ea51b
--- /dev/null
+++ b/billing/Gemfile
@@ -0,0 +1,23 @@
+source "http://rubygems.org"
+
+eval(File.read(File.dirname(__FILE__) + '/../common_dependencies.rb'))
+eval(File.read(File.dirname(__FILE__) + '/../ui_dependencies.rb'))
+
+# We require leap_web_core from here so we can use the path option.
+gem "leap_web_core", :path => '../core'
+
+# Declare your gem's dependencies in billing.gemspec.
+# Bundler will treat runtime dependencies like base dependencies, and
+# development dependencies will be added by default to the :development group.
+gemspec
+
+# jquery-rails is used by the dummy application
+#gem "jquery-rails"
+
+# Declare any dependencies that are still in development here instead of in
+# your gemspec. These might include edge Rails or gems from your path or
+# Git. Remember to move these dependencies to your gemspec before releasing
+# your gem to rubygems.org.
+
+# To use debugger
+# gem 'debugger'
diff --git a/billing/Rakefile b/billing/Rakefile
new file mode 100644
index 0000000..1dcfb25
--- /dev/null
+++ b/billing/Rakefile
@@ -0,0 +1,38 @@
+#!/usr/bin/env rake
+begin
+ require 'bundler/setup'
+rescue LoadError
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
+end
+begin
+ require 'rdoc/task'
+rescue LoadError
+ require 'rdoc/rdoc'
+ require 'rake/rdoctask'
+ RDoc::Task = Rake::RDocTask
+end
+
+RDoc::Task.new(:rdoc) do |rdoc|
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = 'Billing'
+ rdoc.options << '--line-numbers'
+ rdoc.rdoc_files.include('README.rdoc')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
+
+
+
+
+Bundler::GemHelper.install_tasks
+
+require 'rake/testtask'
+
+Rake::TestTask.new(:test) do |t|
+ t.libs << 'lib'
+ t.libs << 'test'
+ t.pattern = 'test/**/*_test.rb'
+ t.verbose = false
+end
+
+
+task :default => :test
diff --git a/billing/leap_web_billing.gemspec b/billing/leap_web_billing.gemspec
new file mode 100644
index 0000000..c3b4bdd
--- /dev/null
+++ b/billing/leap_web_billing.gemspec
@@ -0,0 +1,20 @@
+$:.push File.expand_path("../lib", __FILE__)
+
+require File.expand_path('../../lib/leap_web/version.rb', __FILE__)
+
+# Describe your gem and declare its dependencies:
+Gem::Specification.new do |s|
+ s.name = "leap_web_billing"
+ s.version = LeapWeb::VERSION
+ s.authors = ["Jessib"]
+ s.email = ["jessib@leap.se"]
+ s.homepage = "http://www.leap.se"
+ s.summary = "Billing for LeapWeb"
+ s.description = "Billing System for a Leap provider"
+
+ s.files = Dir["{app,config,db,lib}/**/*"] + ["Rakefile", "Readme.md"]
+ s.test_files = Dir["test/**/*"]
+
+ s.add_dependency "leap_web_core", LeapWeb::VERSION
+ s.add_dependency "braintree-rails", "~> 0.4.5"
+end
diff --git a/billing/lib/leap_web_billing/engine.rb b/billing/lib/leap_web_billing/engine.rb
new file mode 100644
index 0000000..acf63b0
--- /dev/null
+++ b/billing/lib/leap_web_billing/engine.rb
@@ -0,0 +1,11 @@
+# thou shall require all your dependencies in an engine.
+require "leap_web_core"
+require "leap_web_core/ui_dependencies"
+
+require "braintree-rails"
+
+module LeapWebBilling
+ class Engine < ::Rails::Engine
+
+ end
+end
diff --git a/lib/leap_web.rb b/lib/leap_web.rb
index 31294dc..71be1b1 100644
--- a/lib/leap_web.rb
+++ b/lib/leap_web.rb
@@ -1,3 +1,4 @@
require 'leap_web_core'
require 'leap_web_certs'
require 'leap_web_users'
+require 'leap_web_billing'
diff --git a/lib/tasks/task_helper.rb b/lib/tasks/task_helper.rb
index 26e60bc..81dcbe4 100644
--- a/lib/tasks/task_helper.rb
+++ b/lib/tasks/task_helper.rb
@@ -2,7 +2,7 @@ require File.expand_path('../../../lib/leap_web/version', __FILE__)
module TaskHelper
- ENGINES = %w(users certs help)
+ ENGINES = %w(users certs help billing)
def putsys(cmd)
puts cmd