build and install a local gem

master
Tom Vaughan 2012-08-20 10:52:29 -07:00
parent 27c36891ac
commit 10a7c6084a
5 changed files with 74 additions and 54 deletions

View File

@ -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

View File

@ -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

View 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

View File

@ -0,0 +1,6 @@
module Middleman
module Deploy
PACKAGE = "middleman-deploy"
VERSION = "0.0.1"
end
end

View File

@ -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")