Sha256: a47ecb9b26efee7e3cc20608e8ae6189390d9592d67073f33d7805ccad139057

Contents?: true

Size: 514 Bytes

Versions: 7

Compression:

Stored size: 514 Bytes

Contents

module Stastic::Command
  class Rename < Base
    attr_accessor :new_name

    def initialize(args = [])
      case args.size
      when 1
        self.new_name = args.first
      else
        raise(Stastic::Command::InvalidOptions)
      end
    end

    def index
      print "Changing Site Name... "
      response = with_valid_site do
        Stastic::Client.rename(Stastic::Config.site_id, new_name)
      end
      Stastic::Config.update(:name => response["name"])
      puts "Success\n"
    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
stastic-0.2.6 lib/stastic/commands/rename.rb
stastic-0.2.5 lib/stastic/commands/rename.rb
stastic-0.2.4 lib/stastic/commands/rename.rb
stastic-0.2.3 lib/stastic/commands/rename.rb
stastic-0.2.2 lib/stastic/commands/rename.rb
stastic-0.2.1 lib/stastic/commands/rename.rb
stastic-0.2.0 lib/stastic/commands/rename.rb