Class: Roasted::Provider::App::Parser
- Inherits:
-
Object
- Object
- Roasted::Provider::App::Parser
- Defined in:
- lib/roasted/provider/app.rb
Instance Method Summary collapse
- #accept_eula ⇒ Object
- #after_install(&block) ⇒ Object
- #checksum(checksum) ⇒ Object
- #defaults(domain) ⇒ Object
-
#initialize(app) ⇒ Parser
constructor
A new instance of Parser.
- #installs(appname, options = {}) ⇒ Object
- #license(type, options = {}, &block) ⇒ Object
- #preferences(prefs) ⇒ Object
-
#source(source, options = {}) ⇒ Object
DSL actions.
Constructor Details
#initialize(app) ⇒ Parser
Returns a new instance of Parser.
189 190 191 |
# File 'lib/roasted/provider/app.rb', line 189 def initialize(app) @app = app end |
Instance Method Details
#accept_eula ⇒ Object
204 205 206 |
# File 'lib/roasted/provider/app.rb', line 204 def accept_eula @app.accept_eula = true end |
#after_install(&block) ⇒ Object
220 221 222 |
# File 'lib/roasted/provider/app.rb', line 220 def after_install(&block) @app.hooks[:after_install] = block end |
#checksum(checksum) ⇒ Object
200 201 202 |
# File 'lib/roasted/provider/app.rb', line 200 def checksum(checksum) @app.checksum = checksum end |
#defaults(domain) ⇒ Object
216 217 218 |
# File 'lib/roasted/provider/app.rb', line 216 def defaults(domain) @app.domain = domain end |
#installs(appname, options = {}) ⇒ Object
208 209 210 |
# File 'lib/roasted/provider/app.rb', line 208 def installs(appname, = {}) @app.installs = .merge(:app => appname) end |
#license(type, options = {}, &block) ⇒ Object
212 213 214 |
# File 'lib/roasted/provider/app.rb', line 212 def license(type, = {}, &block) @app.license = {:type => type, :options => , :block => block} end |
#preferences(prefs) ⇒ Object
224 225 226 227 228 229 230 231 232 233 234 235 |
# File 'lib/roasted/provider/app.rb', line 224 def preferences(prefs) domain_exists = system("defaults domains | grep #{@app.domain} >/dev/null") if domain_exists prefs.each do |key, value| system "defaults write #{@app.domain} '#{key}' '#{value}'" end else plist = prefs.collect {|key, value| "\"#{key}\" = \"#{value}\";"}.join(" ") system "defaults write #{@app.domain} '{#{plist}}'" end end |
#source(source, options = {}) ⇒ Object
DSL actions
194 195 196 197 198 |
# File 'lib/roasted/provider/app.rb', line 194 def source(source, = {}) # version = options[:version] || :default @app.source = source @app.type = .delete(:type) end |