Sha256: 66d607c25f5422c0385d60049209ab8402c5b5431b0b1020f79e768cbadd65c8
Contents?: true
Size: 792 Bytes
Versions: 2
Compression:
Stored size: 792 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?(args) 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 want_gh_pages?(args) args.empty? or %w(middleman jekyll).include?(args[0]) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
tonic-0.0.6 | lib/tonic.rb |
tonic-0.0.4 | lib/tonic.rb |