Sha256: 2f7535192a6bbea21a0d2dcf5680a05eba4d2c73abd9780d3f053e059f1fa4e2
Contents?: true
Size: 1.39 KB
Versions: 70
Compression:
Stored size: 1.39 KB
Contents
module Octopress module Ink module Commands class Init def self.process_command(p) p.command(:init) do |c| c.syntax "init <PATH> [options]" c.description "Add Octopress Ink scaffolding to an existing gem based plugin." c.option "theme", "--theme", "Plugin will be a theme." c.action do |args, options| if args.empty? raise "Please provide a plugin name, e.g. my_awesome_plugin." else @options = options @options['path'] = args[0] init_plugin end end end end def self.init_plugin settings = New.gem_settings(@options['path']) settings[:type] = @options['theme'] ? 'theme' : 'plugin' New.add_asset_dirs(settings) New.add_demo_files(settings) puts "\nTo finish setting up your Octopress Ink plugin:\n".bold puts "1. Add gem requirements to your gemspec:\n\n" puts New.dependencies(settings).sub("\n\n", "\n").yellow puts "2. Add an Octopress Ink plugin to your gem, making changes as necessary:\n\n" template = <<-HERE require "octopress-ink" Octopress::Ink.add_plugin({ #{New.indent(New.plugin_config(settings))} }) HERE puts template.yellow end end end end end
Version data entries
70 entries across 70 versions & 1 rubygems