Sha256: c39f8df45179d29b614daf793e1ecd6694299402c29e32f6ecd1496f539f3570

Contents?: true

Size: 1.15 KB

Versions: 25

Compression:

Stored size: 1.15 KB

Contents

module Octopress
  module Commands
    class Isolate < Command
      def self.init_with_program(p)
        p.command(:isolate) do |c|
          c.syntax 'isolate <POST> [options]'
          c.description "Move all posts not matching selected post to _posts/_exile. Command accepts path to post or search string."
          CommandHelpers.add_common_options c

          c.action do |args, options|
            options['path'] = args.first

            if options['path'] && !File.exist?(options['path'])
              options['path'] = CommandHelpers.select_posts(options['path'], 'isolate')
            end

            isolate_post(options)
          end
        end

        p.command(:integrate) do |c|
          c.syntax 'integrate'
          c.description "Reintegrate posts from _posts/_exile."
          CommandHelpers.add_common_options c

          c.action do |args, options|
            integrate_posts(options)
          end
        end
      end

      def self.isolate_post(options)
        Octopress::Isolate.new(options).isolate
      end

      def self.integrate_posts(options)
        Octopress::Isolate.new(options).integrate
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
octopress-3.0.12.pre.1 lib/octopress/commands/isolate.rb
octopress-3.0.11 lib/octopress/commands/isolate.rb
octopress-3.0.10 lib/octopress/commands/isolate.rb
octopress-3.0.9 lib/octopress/commands/isolate.rb
octopress-3.0.8 lib/octopress/commands/isolate.rb
octopress-3.0.7 lib/octopress/commands/isolate.rb
octopress-3.0.6 lib/octopress/commands/isolate.rb
octopress-3.0.5 lib/octopress/commands/isolate.rb
octopress-3.0.4 lib/octopress/commands/isolate.rb
octopress-3.0.3.alpha.2 lib/octopress/commands/isolate.rb
octopress-3.0.3.alpha.1 lib/octopress/commands/isolate.rb
octopress-3.0.3.alpha.0 lib/octopress/commands/isolate.rb
octopress-3.0.2 lib/octopress/commands/isolate.rb
octopress-3.0.1 lib/octopress/commands/isolate.rb
octopress-3.0.0 lib/octopress/commands/isolate.rb
octopress-3.0.0.rc.37 lib/octopress/commands/isolate.rb
octopress-3.0.0.rc.36 lib/octopress/commands/isolate.rb
octopress-3.0.0.rc.35 lib/octopress/commands/isolate.rb
octopress-3.0.0.rc.34 lib/octopress/commands/isolate.rb
octopress-3.0.0.rc.33 lib/octopress/commands/isolate.rb