Sha256: 5d0d6b6073324d2fdf968d619dc8bb1a0b2e39f0db3722145cabd80ec01a6895

Contents?: true

Size: 434 Bytes

Versions: 10

Compression:

Stored size: 434 Bytes

Contents

class InitCommand
  def initialize(options)
    @options = options
  end

  def run
    path = File.join(Dir.pwd, CARTRCFILE)
    if File.exist?(path)
      raise AppError.new, "File #{path} already exists"
    else
      File.write(path, file_contents)
    end
  end

  private

  def file_contents
    <<~EOS
      Configuration.setup do |c|
        c.server = "http://localhost:#{SERVER_DEFAULT_PORT}/"
      end
    EOS
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
carthage_remote_cache-0.0.13 lib/commands/init_command.rb
carthage_remote_cache-0.0.12 lib/commands/init_command.rb
carthage_remote_cache-0.0.11 lib/commands/init_command.rb
carthage_remote_cache-0.0.10 lib/commands/init_command.rb
carthage_remote_cache-0.0.9 lib/commands/init_command.rb
carthage_remote_cache-0.0.8 lib/commands/init_command.rb
carthage_remote_cache-0.0.7 lib/commands/init_command.rb
carthage_remote_cache-0.0.6 lib/commands/init_command.rb
carthage_remote_cache-0.0.5 lib/commands/init_command.rb
carthage_remote_cache-0.0.4 lib/commands/init_command.rb