make sure the gems inside the bundler misc group are called right after the mounter + new version of the mounter (1.4.3) + return a non-success shell code if the push command does not manage to create a site

did committed Sep 20, 2014
commit 2de80a5e9d3da9bcf92183e60e307ee3f110313b
Showing 4 changed files with 12 additions and 10 deletions
Gemfile +1 -1
@@ @@ -7,7 +7,7 @@ gemspec
# gem 'locomotivecms-liquid', path: '../gems/liquid', require: false
# gem 'locomotivecms-solid', path: '../gems/solid', require: false
# gem 'locomotivecms_mounter', path: '../gems/mounter', require: false
- gem 'locomotivecms_mounter', github: 'locomotivecms/mounter', ref: '6025c4a', require: false
+ # gem 'locomotivecms_mounter', github: 'locomotivecms/mounter', ref: '6025c4a', require: false
gem 'rb-fsevent', '~> 0.9.1'
locomotive/wagon.rb b/lib/locomotive/wagon.rb +8 -8
@@ @@ -73,8 +73,6 @@ module Locomotive
#
def self.serve(path, options)
if reader = self.require_mounter(path, true)
- Bundler.require 'misc'
-
use_listen = !options[:disable_listen]
if options[:force]
@@ @@ -160,8 +158,6 @@ module Locomotive
reader.mounting_point.site.domains = connection_info['domains'] if connection_info['domains']
reader.mounting_point.site.subdomain = connection_info['subdomain'] if connection_info['subdomain']
- require 'bundler'
- Bundler.require 'misc'
writer = Locomotive::Mounter::Writer::Api.instance
resources = self.validate_resources(options[:resources], writer.writers)
@@ @@ -182,9 +178,7 @@ module Locomotive
# @param [ Hash ] options The options passed to the pull process
#
def self.pull(path, connection_info, options = {})
- self.require_mounter(path)
-
- Bundler.require 'misc' unless options[:disable_misc]
+ self.require_mounter(path, false, options[:disable_misc])
connection_info[:uri] = "#{connection_info.delete(:host)}/locomotive/api"
@@ @@ -244,16 +238,22 @@ module Locomotive
#
# @param [ String ] path The path to the local site
# @param [ Boolean ] get_reader Tell if it builds an instance of the reader.
+ # @param [ Boolean ] require_misc Tell if it requires the gems inside the misc bundler group
#
# @param [ Object ] An instance of the reader is the get_reader parameter has been set.
#
- def self.require_mounter(path, get_reader = false)
+ def self.require_mounter(path, get_reader = false, require_misc = true)
Locomotive::Wagon::Logger.setup(path, false)
require 'locomotive/mounter'
Locomotive::Mounter.logger = Locomotive::Wagon::Logger.instance.logger
+ if require_misc
+ require 'bundler'
+ Bundler.require 'misc'
+ end
+
if get_reader
begin
reader = Locomotive::Mounter::Reader::FileSystem.instance
locomotive/wagon/cli.rb b/lib/locomotive/wagon/cli.rb +2 -0
@@ @@ -290,6 +290,8 @@ module Locomotive
self.print_exception(e, options[:verbose])
exit(1)
end
+ else
+ exit(1)
end
end
end
locomotivecms_wagon.gemspec +1 -1
@@ @@ -35,7 +35,7 @@ Gem::Specification.new do |gem|
gem.add_dependency 'httmultiparty', '0.3.10'
gem.add_dependency 'will_paginate', '~> 3.0.3'
- # gem.add_dependency 'locomotivecms_mounter', '~> 1.4.1'
+ gem.add_dependency 'locomotivecms_mounter', '~> 1.4.3'
gem.add_dependency 'faker', '~> 0.9.5'