Class: Contentful::Bootstrap::Commands::UpdateSpace
- Defined in:
- lib/contentful/bootstrap/commands/update_space.rb
Instance Attribute Summary collapse
-
#json_template ⇒ Object
readonly
Returns the value of attribute json_template.
Attributes inherited from Base
#no_input, #options, #quiet, #space, #token
Instance Method Summary collapse
-
#initialize(token, space_id, options = {}) ⇒ UpdateSpace
constructor
A new instance of UpdateSpace.
- #run ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(token, space_id, options = {}) ⇒ UpdateSpace
Returns a new instance of UpdateSpace.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/contentful/bootstrap/commands/update_space.rb', line 11 def initialize(token, space_id, = {}) @json_template = .fetch(:json_template, nil) @mark_processed = .fetch(:mark_processed, false) @skip_content_types = .fetch(:skip_content_types, false) @no_publish = .fetch(:no_publish, false) @quiet = .fetch(:quiet, false) @environment = .fetch(:environment, 'master') super(token, space_id, ) end |
Instance Attribute Details
#json_template ⇒ Object (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
#run ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/contentful/bootstrap/commands/update_space.rb', line 22 def run if @json_template.nil? output 'JSON Template not found. Exiting!' exit(1) end output "Updating Space '#{@space}'" update_space = fetch_space update_json_template(update_space) output output "Successfully updated Space #{@space}" update_space end |