Class: Smooster::Deploy::Setting
- Inherits:
-
Object
- Object
- Smooster::Deploy::Setting
- Includes:
- ActiveModel::Model, ActiveModel::Serializers::JSON
- Defined in:
- lib/smooster/deploy/setting.rb
Instance Attribute Summary collapse
-
#formatblock ⇒ Object
Returns the value of attribute formatblock.
-
#images ⇒ Object
Returns the value of attribute images.
-
#rss ⇒ Object
Returns the value of attribute rss.
Class Method Summary collapse
Instance Attribute Details
#formatblock ⇒ Object
Returns the value of attribute formatblock.
7 8 9 |
# File 'lib/smooster/deploy/setting.rb', line 7 def formatblock @formatblock end |
#images ⇒ Object
Returns the value of attribute images.
7 8 9 |
# File 'lib/smooster/deploy/setting.rb', line 7 def images @images end |
#rss ⇒ Object
Returns the value of attribute rss.
7 8 9 |
# File 'lib/smooster/deploy/setting.rb', line 7 def rss @rss end |
Class Method Details
.read_config ⇒ Object
9 10 11 12 13 |
# File 'lib/smooster/deploy/setting.rb', line 9 def self.read_config if File.exists?("#{Smooster::Application.instance.base_dir}/site_config.yml") YAML.load(File.read("#{Smooster::Application.instance.base_dir}/site_config.yml")) end end |
.upload ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/smooster/deploy/setting.rb', line 15 def self.upload begin response = RestClient.post "#{Smooster::Application.instance.api_url()}/#{Smooster::Application.instance.site_id()}/configure", {:configs => self.read_config}, {"Authorization" => 'Token token="'+ Smooster::Application.instance.api_key() +'"', "Accept" => 'application/vnd.smoosterid.v2'} data = JSON.parse(response) rescue => e Smooster::Application.instance.logger.error "Error settings!: #{e} / #{e.backtrace.inspect}" puts "The settings failed to be updated".colorize(:red) end end |