lib/motion/project/sparkle.rb in motion-sparkle-0.0.5 vs lib/motion/project/sparkle.rb in motion-sparkle-0.0.6
- old
+ new
@@ -1,17 +1,16 @@
module Motion::Project
-
class Sparkle
SPARKLE_ROOT = "sparkle"
CONFIG_PATH = "#{SPARKLE_ROOT}/config"
RELEASE_PATH = "#{SPARKLE_ROOT}/release"
def initialize(config)
@config = config
publish :public_key, 'dsa_pub.pem'
- embed_framework
+ install_and_embed
end
def appcast
@appcast ||= Appcast.new
end
@@ -22,31 +21,25 @@
public_key value
when :base_url
appcast.base_url = value
feed_url appcast.feed_url
when :feed_base_url
- appcast.send(key.to_s + '=', value)
+ appcast.feed_base_url = value
feed_url appcast.feed_url
when :feed_filename
appcast.feed_filename = value
feed_url appcast.feed_url
when :version
version value
when :notes_base_url, :package_base_url, :notes_filename, :package_filename
- appcast.send(key.to_s + '=', value)
+ appcast.send "#{key}=", value
else
raise "Unknown Sparkle config option #{key}"
end
end
alias_method :release, :publish
- def embed_framework
- framework_path = Pathname.new File.dirname(__FILE__)
- framework_path = (framework_path.parent.parent.parent + 'vendor/Sparkle.framework').to_s
- @config.embedded_frameworks << framework_path
- end
-
def version(vstring)
@config.version = vstring.to_s
@config.short_version = vstring.to_s
end
@@ -135,10 +128,14 @@
def project_path
@project_path ||= Pathname.new(@config.project_dir)
end
+ def vendor_path
+ @vendor_path ||= Pathname.new(project_path + 'vendor/')
+ end
+
def gitignore_path
project_path + ".gitignore"
end
def sparkle_release_path
@@ -181,7 +178,6 @@
def app_file
"#{app_name}.app"
end
end
-
end