Skip to content

Commit

Permalink
add notifier & notify on build done
Browse files Browse the repository at this point in the history
  • Loading branch information
hungtatai committed Jul 4, 2013
1 parent 357f9da commit 227fa0f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/compile_version.rb
@@ -1,5 +1,5 @@
module CompileVersion
REVISION = 'c96dde9536'
COMPILE_TIME = '201307010430'
REVISION = '357f9dad43'
COMPILE_TIME = '201307041614'
UPDATE_URL = ''
end
1 change: 1 addition & 0 deletions src/main.rb
Expand Up @@ -78,6 +78,7 @@
require "sass_patch.rb"
require "the_hold_uploader.rb"
require "project_builder.rb"
require "notifier"
rescue ExecJS::RuntimeUnavailable => e
raise "Please install Node.js first\n https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager"
end
Expand Down
13 changes: 13 additions & 0 deletions src/notifier.rb
@@ -0,0 +1,13 @@

require "terminal-notifier"

class Notifier

@@default_options = {:title => "Fire.app"}

def self.notify(msg, options = {})
options = @@default_options.merge(options)
TerminalNotifier.notify(msg, options) #if org.jruby.platform.Platform::IS_MAC
end

end
6 changes: 4 additions & 2 deletions src/ui/tray.rb
Expand Up @@ -361,7 +361,7 @@ def build_project_handler

App.try do
build_path = Compass.configuration.fireapp_build_path || "build_#{Time.now.strftime('%Y%m%d%H%M%S')}"

build_path = Pathname.new(build_path).realpath.to_s

# -- original setting --
original_line_comments = Tray.instance.compass_project_config.line_comments
Expand All @@ -380,7 +380,7 @@ def build_project_handler

# -- init report --
report_window = App.report('Start build project!') do
Swt::Program.launch(Pathname.new(build_path).realpath.to_s)
Swt::Program.launch(build_path)
end if Tray.instance.compass_project_config.fireapp_always_report_on_build

# -- build project --
Expand All @@ -400,6 +400,8 @@ def build_project_handler
Tray.instance.update_config( "sass_options", sass_options.inspect )

clean_project

Notifier.notify("Done!", {:execute => "open #{build_path}"}) if !Tray.instance.compass_project_config.fireapp_always_report_on_build
end


Expand Down

0 comments on commit 227fa0f

Please sign in to comment.