Add skeleton for OrderManagement engine

This commit is contained in:
Kristina Lim
2018-11-14 16:57:49 +08:00
committed by luisramos0
parent dcb1d9fe25
commit 0cdcd96bb5
14 changed files with 56 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ gem 'i18n-js', '~> 3.1.0'
# Patched version. See http://rubysec.com/advisories/CVE-2015-5312/.
gem 'nokogiri', '>= 1.6.7.1'
gem "order_management", path: "./engines/order_management"
gem 'web', path: './engines/web'
gem 'pg'

View File

@@ -133,6 +133,11 @@ GIT
activemodel (>= 3.0)
railties (>= 3.0)
PATH
remote: engines/order_management
specs:
order_management (0.0.1)
PATH
remote: engines/web
specs:
@@ -826,6 +831,7 @@ DEPENDENCIES
oauth2 (~> 1.4.1)
ofn-qz!
oj
order_management!
paper_trail (~> 5.2.3)
paperclip
pg

View File

@@ -118,8 +118,9 @@ Openfoodnetwork::Application.routes.draw do
get 'sitemap.xml', to: 'sitemap#index', defaults: { format: 'xml' }
# Mount Web engine routes
# Mount engine routes
mount Web::Engine, :at => '/'
mount OrderManagement::Engine, :at => '/'
# Mount Spree's routes
mount Spree::Core::Engine, :at => '/'

View File

@@ -0,0 +1,5 @@
# Order Management
This is the rails engine for the Order Management domain.
See our wiki for [more info about domains and engines in OFN](https://github.com/openfoodfoundation/openfoodnetwork/wiki/Tech-Doc:-How-OFN-is-organized-in-Domains-using-Rails-Engines).

View File

@@ -0,0 +1 @@
//= require_tree .

View File

@@ -0,0 +1,5 @@
module OrderManagement
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
end
end

View File

@@ -0,0 +1,2 @@
OrderManagement::Engine.routes.draw do
end

View File

@@ -0,0 +1,4 @@
require "order_management/engine"
module OrderManagement
end

View File

@@ -0,0 +1,5 @@
module OrderManagement
class Engine < ::Rails::Engine
isolate_namespace OrderManagement
end
end

View File

@@ -0,0 +1,3 @@
module OrderManagement
VERSION = "0.0.1".freeze
end

View File

@@ -0,0 +1,13 @@
$LOAD_PATH.push File.expand_path('lib', __dir__)
require "order_management/version"
Gem::Specification.new do |s|
s.name = "order_management"
s.version = OrderManagement::VERSION
s.authors = ["developers@ofn"]
s.summary = "Order Management domain of the OFN solution."
s.files = Dir["{app,config,db,lib}/**/*"] + ["LICENSE.txt", "Rakefile", "README.rdoc"]
s.test_files = Dir["spec/**/*"]
end

View File

@@ -0,0 +1,9 @@
ENV["RAILS_ENV"] = "test"
require "../../spec/spec_helper"
# Require factories in Spree and main application.
require 'spree/testing_support/factories'
require '../../spec/factories'
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }