From 27c36891ac838084860a16a3b0665b0daa43a714 Mon Sep 17 00:00:00 2001 From: Tom Vaughan Date: Sun, 19 Aug 2012 21:38:16 -0700 Subject: [PATCH] initial import --- Gemfile | 4 ++++ Rakefile | 12 ++++++++++ features/support/env.rb | 4 ++++ lib/middleman-deploy.rb | 49 ++++++++++++++++++++++++++++++++++++++ lib/middleman_extension.rb | 1 + middleman-deploy.gemspec | 24 +++++++++++++++++++ 6 files changed, 94 insertions(+) create mode 100644 Gemfile create mode 100644 Rakefile create mode 100644 features/support/env.rb create mode 100644 lib/middleman-deploy.rb create mode 100644 lib/middleman_extension.rb create mode 100644 middleman-deploy.gemspec diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..88e935c --- /dev/null +++ b/Gemfile @@ -0,0 +1,4 @@ +source :rubygems + +# Specify your gem's dependencies in middleman-deploy.gemspec +gemspec \ No newline at end of file diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..e683baf --- /dev/null +++ b/Rakefile @@ -0,0 +1,12 @@ +require 'bundler' +Bundler::GemHelper.install_tasks + +require 'cucumber/rake/task' + +Cucumber::Rake::Task.new(:cucumber, 'Run features that should pass') do |t| + t.cucumber_opts = "--color --tags ~@wip --strict --format #{ENV['CUCUMBER_FORMAT'] || 'Fivemat'}" +end + +require 'rake/clean' + +task :test => ["cucumber"] \ No newline at end of file diff --git a/features/support/env.rb b/features/support/env.rb new file mode 100644 index 0000000..089772c --- /dev/null +++ b/features/support/env.rb @@ -0,0 +1,4 @@ +PROJECT_ROOT_PATH = File.dirname(File.dirname(File.dirname(__FILE__))) +require "middleman-core" +require "middleman-core/step_definitions" +require File.join(PROJECT_ROOT_PATH, 'lib', 'middleman-deploy') \ No newline at end of file diff --git a/lib/middleman-deploy.rb b/lib/middleman-deploy.rb new file mode 100644 index 0000000..bcfa8bd --- /dev/null +++ b/lib/middleman-deploy.rb @@ -0,0 +1,49 @@ +# 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 + + +# 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 \ No newline at end of file diff --git a/lib/middleman_extension.rb b/lib/middleman_extension.rb new file mode 100644 index 0000000..233dc74 --- /dev/null +++ b/lib/middleman_extension.rb @@ -0,0 +1 @@ +require "middleman-deploy" \ No newline at end of file diff --git a/middleman-deploy.gemspec b/middleman-deploy.gemspec new file mode 100644 index 0000000..aa436e2 --- /dev/null +++ b/middleman-deploy.gemspec @@ -0,0 +1,24 @@ +# -*- encoding: utf-8 -*- +$:.push File.expand_path("../lib", __FILE__) + +Gem::Specification.new do |s| + s.name = "middleman-deploy" + s.version = "0.0.1" + 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.files = `git ls-files`.split("\n") + s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") + s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } + s.require_paths = ["lib"] + + # The version of middleman-core your extension depends on + s.add_runtime_dependency("middleman-core", [">= 3.0.0"]) + + # Additional dependencies + # s.add_runtime_dependency("gem-name", "gem-version") +end