build and install a local gem
This commit is contained in:
parent
27c36891ac
commit
10a7c6084a
19
Rakefile
19
Rakefile
|
@ -9,4 +9,21 @@ end
|
|||
|
||||
require 'rake/clean'
|
||||
|
||||
task :test => ["cucumber"]
|
||||
task :test => ["cucumber"]
|
||||
|
||||
require "middleman-deploy/pkg-info"
|
||||
|
||||
PACKAGE = "#{Middleman::Deploy::PACKAGE}"
|
||||
VERSION = "#{Middleman::Deploy::VERSION}"
|
||||
|
||||
task :build do
|
||||
system "gem build #{PACKAGE}.gemspec"
|
||||
end
|
||||
|
||||
task :install => :build do
|
||||
system "gem install pkg/#{PACKAGE}-#{VERSION}"
|
||||
end
|
||||
|
||||
task :release => :build do
|
||||
system "gem push pkg/#{PACKAGE}-#{VERSION}"
|
||||
end
|
||||
|
|
|
@ -1,49 +1,6 @@
|
|||
# Require core library
|
||||
require "middleman-core"
|
||||
|
||||
# Extension namespace
|
||||
module MyExtension
|
||||
class << self
|
||||
|
||||
# Called when user `activate`s your extension
|
||||
def registered(app, options={})
|
||||
# Setup extension-specific config
|
||||
app.set :config_variable, false
|
||||
|
||||
# Include class methods
|
||||
# app.extend ClassMethods
|
||||
|
||||
# Include instance methods
|
||||
# app.send :include, InstanceMethods
|
||||
|
||||
app.after_configuration do
|
||||
# Do something
|
||||
|
||||
# config_variable is now either the default or the user's
|
||||
# setting from config.rb
|
||||
end
|
||||
end
|
||||
alias :included :registered
|
||||
end
|
||||
|
||||
# module ClassMethods
|
||||
# def a_class_method
|
||||
# end
|
||||
# end
|
||||
|
||||
# module InstanceMethods
|
||||
# def an_instance_method
|
||||
# end
|
||||
# end
|
||||
|
||||
::Middleman::Extensions.register(:deploy) do
|
||||
require "middleman-deploy/extension"
|
||||
::Middleman::Deploy
|
||||
end
|
||||
|
||||
|
||||
# Register extensions which can be activated
|
||||
# Make sure we have the version of Middleman we expect
|
||||
# ::Middleman::Extensions.register(:extension_name) do
|
||||
#
|
||||
# # Return the extension module
|
||||
# ::MyExtension
|
||||
#
|
||||
# end
|
39
lib/middleman-deploy/extension.rb
Normal file
39
lib/middleman-deploy/extension.rb
Normal file
|
@ -0,0 +1,39 @@
|
|||
# Require core library
|
||||
require "middleman-core"
|
||||
|
||||
# Extension namespace
|
||||
module MyExtension
|
||||
class << self
|
||||
|
||||
# Called when user `activate`s your extension
|
||||
def registered(app, options={})
|
||||
# Setup extension-specific config
|
||||
app.set :config_variable, false
|
||||
|
||||
# Include class methods
|
||||
# app.extend ClassMethods
|
||||
|
||||
# Include instance methods
|
||||
# app.send :include, InstanceMethods
|
||||
|
||||
app.after_configuration do
|
||||
# Do something
|
||||
|
||||
# config_variable is now either the default or the user's
|
||||
# setting from config.rb
|
||||
end
|
||||
end
|
||||
alias :included :registered
|
||||
end
|
||||
|
||||
# module ClassMethods
|
||||
# def a_class_method
|
||||
# end
|
||||
# end
|
||||
|
||||
# module InstanceMethods
|
||||
# def an_instance_method
|
||||
# end
|
||||
# end
|
||||
|
||||
end
|
6
lib/middleman-deploy/pkg-info.rb
Normal file
6
lib/middleman-deploy/pkg-info.rb
Normal file
|
@ -0,0 +1,6 @@
|
|||
module Middleman
|
||||
module Deploy
|
||||
PACKAGE = "middleman-deploy"
|
||||
VERSION = "0.0.1"
|
||||
end
|
||||
end
|
|
@ -1,15 +1,16 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
$:.push File.expand_path("../lib", __FILE__)
|
||||
require "middleman-deploy/pkg-info"
|
||||
|
||||
Gem::Specification.new do |s|
|
||||
s.name = "middleman-deploy"
|
||||
s.version = "0.0.1"
|
||||
s.name = Middleman::Deploy::PACKAGE
|
||||
s.version = Middleman::Deploy::VERSION
|
||||
s.platform = Gem::Platform::RUBY
|
||||
# s.authors = ["Your Name"]
|
||||
# s.email = ["email@example.com"]
|
||||
# s.homepage = "http://example.com"
|
||||
# s.summary = %q{A short summary of your extension}
|
||||
# s.description = %q{A longer description of your extension}
|
||||
s.authors = ["Tom Vaughan"]
|
||||
s.email = ["thomas.david.vaughan@gmail.com"]
|
||||
s.homepage = "http://flavors.me/tvaughan"
|
||||
s.summary = %q{Deploy a middleman built site over rsync.}
|
||||
s.description = %q{Deploy a middleman built site over rsync.}
|
||||
|
||||
s.files = `git ls-files`.split("\n")
|
||||
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
||||
|
|
Loading…
Reference in a new issue