Sha256: fa46471e9b6726909530eb51cad66dea14e8e0cbd50eaa2782f72a0d9a27c261
Contents?: true
Size: 780 Bytes
Versions: 1
Compression:
Stored size: 780 Bytes
Contents
require 'tonic/gh_pages.rb' require 'tonic/template' require 'tonic/shell' require 'tonic/config' module Tonic class << self def activate(args) deal_with_args(args) end private def deal_with_args(args) if want_to_push?(args) Tonic::GhPages.push_pages elsif want_gh_pages? Tonic::GhPages.activate(args[0]) elsif want_to_create?(args) Tonic::Template.create args[1] else raise ArgumentError.new 'Strange argument you sent to tonic' end end def want_to_create?(args) args.size == 2 and args.first == 'new' end def want_to_push?(args) args[0] == 'push' end def wand_gh_pages? args.empty? or %w(middleman jekyll).include?(args[0]) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
tonic-0.0.3 | lib/tonic.rb |