Class: Contentful::Bootstrap::Commands::UpdateSpace

Inherits:
Base
  • Object
show all
Defined in:
lib/contentful/bootstrap/commands/update_space.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#space, #token

Instance Method Summary collapse

Methods included from Support

#silence_stderr

Constructor Details

#initialize(token, space_id, json_template = nil, mark_processed = false, trigger_oauth = true, skip_content_types = false) ⇒ UpdateSpace

Returns a new instance of UpdateSpace.



11
12
13
14
15
16
# File 'lib/contentful/bootstrap/commands/update_space.rb', line 11

def initialize(token, space_id, json_template = nil, mark_processed = false, trigger_oauth = true, skip_content_types = false)
  super(token, space_id, trigger_oauth)
  @json_template = json_template
  @mark_processed = mark_processed
  @skip_content_types = skip_content_types
end

Instance Attribute Details

#json_templateObject (readonly)

Returns the value of attribute json_template.



10
11
12
# File 'lib/contentful/bootstrap/commands/update_space.rb', line 10

def json_template
  @json_template
end

Instance Method Details

#runObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/contentful/bootstrap/commands/update_space.rb', line 18

def run
  if @json_template.nil?
    puts 'JSON Template not found. Exiting!'
    exit(1)
  end

  puts "Updating Space '#{@space}'"

  update_space = fetch_space

  update_json_template(update_space)

  puts
  puts "Successfully updated Space #{@space}"

  update_space
end