coyote 0.2.6 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/Manifest CHANGED
@@ -1,7 +1,9 @@
1
1
  Manifest
2
2
  README.md
3
3
  Rakefile
4
+ assets/coyote-icon.psd
4
5
  bin/coyote
6
+ config/coyote-icon.png
5
7
  config/coyote.yaml
6
8
  lib/coyote.rb
7
9
  lib/coyote/closure_compiler.rb
@@ -12,6 +14,7 @@ lib/coyote/fs_listeners/linux.rb
12
14
  lib/coyote/fs_listeners/polling.rb
13
15
  lib/coyote/fs_listeners/windows.rb
14
16
  lib/coyote/generator.rb
17
+ lib/coyote/notification.rb
15
18
  lib/coyote/output.rb
16
19
  test/javascript/application.js
17
20
  test/javascript/application/controller.js
data/Rakefile CHANGED
@@ -2,13 +2,16 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('coyote', '0.2.6') do |p|
5
+ $: << File.expand_path(File.dirname(__FILE__) + "/lib")
6
+ require 'coyote'
7
+
8
+ Echoe.new(Coyote::APP_NAME.downcase, Coyote::VERSION) do |p|
6
9
  p.description = "An intelligent command-line tool for combining and compressing JavaScript files."
7
10
  p.summary = "Coyote selectively concatenates your JS files, combining them into a single file with the option of running the output through the Google Closure Compiler. Coyote automatically observes your directories and source files for changes and will recompile and save on the fly for easy development."
8
11
  p.url = "http://github.com/imulus/coyote"
9
12
  p.author = "Imulus"
10
- p.email = "casey.ohara@imulus.com"
13
+ p.email = "developer@imulus.com"
11
14
  p.ignore_pattern = ["tmp/*", "script/*", "test/*"]
12
- p.development_dependencies = ["term-ansicolor >=1.0.5"]
13
- p.runtime_dependencies = ["term-ansicolor >=1.0.5"]
15
+ p.development_dependencies = ["term-ansicolor >=1.0.5", "rb-appscript >=0.6.1"]
16
+ p.runtime_dependencies = ["term-ansicolor >=1.0.5", "rb-appscript >=0.6.1"]
14
17
  end
Binary file
Binary file
data/coyote.gemspec CHANGED
@@ -2,17 +2,17 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{coyote}
5
- s.version = "0.2.6"
5
+ s.version = "0.3.0"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Imulus"]
9
- s.date = %q{2011-05-20}
9
+ s.date = %q{2011-05-22}
10
10
  s.default_executable = %q{coyote}
11
11
  s.description = %q{An intelligent command-line tool for combining and compressing JavaScript files.}
12
- s.email = %q{casey.ohara@imulus.com}
12
+ s.email = %q{developer@imulus.com}
13
13
  s.executables = ["coyote"]
14
- s.extra_rdoc_files = ["README.md", "bin/coyote", "lib/coyote.rb", "lib/coyote/closure_compiler.rb", "lib/coyote/config_reader.rb", "lib/coyote/fs_listener.rb", "lib/coyote/fs_listeners/darwin.rb", "lib/coyote/fs_listeners/linux.rb", "lib/coyote/fs_listeners/polling.rb", "lib/coyote/fs_listeners/windows.rb", "lib/coyote/generator.rb", "lib/coyote/output.rb"]
15
- s.files = ["Manifest", "README.md", "Rakefile", "bin/coyote", "config/coyote.yaml", "lib/coyote.rb", "lib/coyote/closure_compiler.rb", "lib/coyote/config_reader.rb", "lib/coyote/fs_listener.rb", "lib/coyote/fs_listeners/darwin.rb", "lib/coyote/fs_listeners/linux.rb", "lib/coyote/fs_listeners/polling.rb", "lib/coyote/fs_listeners/windows.rb", "lib/coyote/generator.rb", "lib/coyote/output.rb", "test/javascript/application.js", "test/javascript/application/controller.js", "test/javascript/application/interface.js", "test/javascript/init.js", "test/javascript/jquery/jquery.js", "test/javascript/jquery/plugins/jquery.cookie.js", "test/javascript/jquery/plugins/jquery.cycle.all.min.js", "test/javascript/jquery/plugins/jquery.query.js", "coyote.gemspec"]
14
+ s.extra_rdoc_files = ["README.md", "bin/coyote", "lib/coyote.rb", "lib/coyote/closure_compiler.rb", "lib/coyote/config_reader.rb", "lib/coyote/fs_listener.rb", "lib/coyote/fs_listeners/darwin.rb", "lib/coyote/fs_listeners/linux.rb", "lib/coyote/fs_listeners/polling.rb", "lib/coyote/fs_listeners/windows.rb", "lib/coyote/generator.rb", "lib/coyote/notification.rb", "lib/coyote/output.rb"]
15
+ s.files = ["Manifest", "README.md", "Rakefile", "assets/coyote-icon.psd", "bin/coyote", "config/coyote-icon.png", "config/coyote.yaml", "lib/coyote.rb", "lib/coyote/closure_compiler.rb", "lib/coyote/config_reader.rb", "lib/coyote/fs_listener.rb", "lib/coyote/fs_listeners/darwin.rb", "lib/coyote/fs_listeners/linux.rb", "lib/coyote/fs_listeners/polling.rb", "lib/coyote/fs_listeners/windows.rb", "lib/coyote/generator.rb", "lib/coyote/notification.rb", "lib/coyote/output.rb", "test/javascript/application.js", "test/javascript/application/controller.js", "test/javascript/application/interface.js", "test/javascript/init.js", "test/javascript/jquery/jquery.js", "test/javascript/jquery/plugins/jquery.cookie.js", "test/javascript/jquery/plugins/jquery.cycle.all.min.js", "test/javascript/jquery/plugins/jquery.query.js", "coyote.gemspec"]
16
16
  s.homepage = %q{http://github.com/imulus/coyote}
17
17
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Coyote", "--main", "README.md"]
18
18
  s.require_paths = ["lib"]
@@ -25,13 +25,19 @@ Gem::Specification.new do |s|
25
25
 
26
26
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
27
27
  s.add_runtime_dependency(%q<term-ansicolor>, [">= 1.0.5"])
28
+ s.add_runtime_dependency(%q<rb-appscript>, [">= 0.6.1"])
28
29
  s.add_development_dependency(%q<term-ansicolor>, [">= 1.0.5"])
30
+ s.add_development_dependency(%q<rb-appscript>, [">= 0.6.1"])
29
31
  else
30
32
  s.add_dependency(%q<term-ansicolor>, [">= 1.0.5"])
33
+ s.add_dependency(%q<rb-appscript>, [">= 0.6.1"])
31
34
  s.add_dependency(%q<term-ansicolor>, [">= 1.0.5"])
35
+ s.add_dependency(%q<rb-appscript>, [">= 0.6.1"])
32
36
  end
33
37
  else
34
38
  s.add_dependency(%q<term-ansicolor>, [">= 1.0.5"])
39
+ s.add_dependency(%q<rb-appscript>, [">= 0.6.1"])
35
40
  s.add_dependency(%q<term-ansicolor>, [">= 1.0.5"])
41
+ s.add_dependency(%q<rb-appscript>, [">= 0.6.1"])
36
42
  end
37
43
  end
data/lib/coyote.rb CHANGED
@@ -5,12 +5,15 @@ require 'coyote/fs_listener'
5
5
  require 'coyote/generator'
6
6
  require 'coyote/output'
7
7
  require 'coyote/closure_compiler'
8
+ require 'coyote/notification'
8
9
 
9
10
  include Term::ANSIColor
10
11
 
11
12
  module Coyote
12
- VERSION = "0.2.6"
13
+ APP_NAME = "Coyote"
14
+ VERSION = "0.3.0"
13
15
  ROOT_PATH = Dir.pwd
14
16
  CONFIG_PATH = File.expand_path(File.dirname(__FILE__) + "/../config")
15
17
  CONFIG_FILENAME = "coyote.yaml"
18
+ CONFIG_ICON = "coyote-icon.png"
16
19
  end
@@ -57,7 +57,6 @@ module Coyote
57
57
  required.push match.last.strip.to_s.gsub(/\.js/, '').gsub(/(\"|\')/, '')
58
58
  end
59
59
  end
60
- #puts required
61
60
  return required
62
61
  end
63
62
 
@@ -42,6 +42,7 @@ module Coyote
42
42
  output_file.write(generated)
43
43
  end
44
44
  print "Coyote generated at #{Coyote::CONFIG_FILENAME}\n\n".green
45
+ Coyote::Notification.new "Coyote generated at #{Coyote::CONFIG_FILENAME}\n\n"
45
46
  end
46
47
  end
47
48
  end
@@ -0,0 +1,40 @@
1
+ require 'appscript'
2
+
3
+ module Coyote
4
+ class Notification
5
+ include Appscript
6
+
7
+ attr_accessor :growl, :application, :icon, :default_notifications, :notifications
8
+
9
+ def initialize(message)
10
+ @growl = app("GrowlHelperApp");
11
+
12
+ if @growl.is_running?
13
+ register
14
+ notify message
15
+ end
16
+ end
17
+
18
+ # register Coyote as an application with Growl
19
+ def register
20
+ @application = Coyote::APP_NAME
21
+ @icon = "#{Coyote::CONFIG_PATH}/#{Coyote::CONFIG_ICON}"
22
+ @default_notifications = ["Coyote Success"]
23
+ @notifications = ["Coyote Success", "Coyote Failure"]
24
+ @growl.register(:as_application => @application, :all_notifications => @notifications, :default_notifications => @default_notifications)
25
+ end
26
+
27
+ # trigger a growl notification
28
+ def notify(message)
29
+ options = { :title => @application,
30
+ :description => message,
31
+ :application_name => @application,
32
+ :image_from_location => @icon,
33
+ :sticky => false,
34
+ :priority => 0,
35
+ :with_name => notifications.first }
36
+ @growl.notify options
37
+ end
38
+
39
+ end
40
+ end
data/lib/coyote/output.rb CHANGED
@@ -43,6 +43,9 @@ module Coyote
43
43
 
44
44
  @output_file.write(@input)
45
45
  print "Saved to #{@output_filename} \n\n".green
46
+
47
+ Coyote::Notification.new "Successfully saved to #{@output_filename}"
48
+
46
49
  @output_file.close
47
50
  end
48
51
 
@@ -58,9 +61,12 @@ module Coyote
58
61
  # compress output
59
62
  def compress
60
63
  print "Compiling #{@output_filename}...\n".yellow
64
+ Coyote::Notification.new "Compiling #{@output_filename}..."
65
+
61
66
  compiler = ClosureCompiler.new.compile(@input)
62
67
  if compiler.success?
63
68
  @input = compiler.compiled_code
69
+ add_file_comments
64
70
  elsif compiler.file_too_big?
65
71
  print "Input code too big for API, creating uncompiled file\n".red
66
72
  elsif compiler.errors
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: coyote
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.6
5
+ version: 0.3.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Imulus
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-05-20 00:00:00 -06:00
13
+ date: 2011-05-22 00:00:00 -06:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -25,18 +25,40 @@ dependencies:
25
25
  type: :runtime
26
26
  version_requirements: *id001
27
27
  - !ruby/object:Gem::Dependency
28
- name: term-ansicolor
28
+ name: rb-appscript
29
29
  prerelease: false
30
30
  requirement: &id002 !ruby/object:Gem::Requirement
31
+ none: false
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: 0.6.1
36
+ type: :runtime
37
+ version_requirements: *id002
38
+ - !ruby/object:Gem::Dependency
39
+ name: term-ansicolor
40
+ prerelease: false
41
+ requirement: &id003 !ruby/object:Gem::Requirement
31
42
  none: false
32
43
  requirements:
33
44
  - - ">="
34
45
  - !ruby/object:Gem::Version
35
46
  version: 1.0.5
36
47
  type: :development
37
- version_requirements: *id002
48
+ version_requirements: *id003
49
+ - !ruby/object:Gem::Dependency
50
+ name: rb-appscript
51
+ prerelease: false
52
+ requirement: &id004 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: 0.6.1
58
+ type: :development
59
+ version_requirements: *id004
38
60
  description: An intelligent command-line tool for combining and compressing JavaScript files.
39
- email: casey.ohara@imulus.com
61
+ email: developer@imulus.com
40
62
  executables:
41
63
  - coyote
42
64
  extensions: []
@@ -53,12 +75,15 @@ extra_rdoc_files:
53
75
  - lib/coyote/fs_listeners/polling.rb
54
76
  - lib/coyote/fs_listeners/windows.rb
55
77
  - lib/coyote/generator.rb
78
+ - lib/coyote/notification.rb
56
79
  - lib/coyote/output.rb
57
80
  files:
58
81
  - Manifest
59
82
  - README.md
60
83
  - Rakefile
84
+ - assets/coyote-icon.psd
61
85
  - bin/coyote
86
+ - config/coyote-icon.png
62
87
  - config/coyote.yaml
63
88
  - lib/coyote.rb
64
89
  - lib/coyote/closure_compiler.rb
@@ -69,6 +94,7 @@ files:
69
94
  - lib/coyote/fs_listeners/polling.rb
70
95
  - lib/coyote/fs_listeners/windows.rb
71
96
  - lib/coyote/generator.rb
97
+ - lib/coyote/notification.rb
72
98
  - lib/coyote/output.rb
73
99
  - test/javascript/application.js
74
100
  - test/javascript/application/controller.js