coyote 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +3 -3
- data/coyote.gemspec +7 -1
- data/lib/coyote/output.rb +20 -8
- metadata +25 -3
data/Rakefile
CHANGED
|
@@ -2,13 +2,13 @@ require 'rubygems'
|
|
|
2
2
|
require 'rake'
|
|
3
3
|
require 'echoe'
|
|
4
4
|
|
|
5
|
-
Echoe.new('coyote', '0.2.
|
|
5
|
+
Echoe.new('coyote', '0.2.2') do |p|
|
|
6
6
|
p.description = "A command-line tool for combining and compressing JS files"
|
|
7
7
|
p.summary = "Coyote is a command-line tool for combining and compressing JS files. It uses YAML for configuration and the Google Closure Compiler to compilation and compression."
|
|
8
8
|
p.url = "http://github.com/caseyohara/coyote"
|
|
9
9
|
p.author = "Casey O'Hara"
|
|
10
10
|
p.email = "casey.ohara@imulus.com"
|
|
11
11
|
p.ignore_pattern = ["tmp/*", "script/*"]
|
|
12
|
-
p.development_dependencies = ["closure-compiler >=1.1.1"]
|
|
13
|
-
p.runtime_dependencies = ["closure-compiler >=1.1.1"]
|
|
12
|
+
p.development_dependencies = ["closure-compiler >=1.1.1", "term-ansicolor >=1.0.5"]
|
|
13
|
+
p.runtime_dependencies = ["closure-compiler >=1.1.1", "term-ansicolor >=1.0.5"]
|
|
14
14
|
end
|
data/coyote.gemspec
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Gem::Specification.new do |s|
|
|
4
4
|
s.name = %q{coyote}
|
|
5
|
-
s.version = "0.2.
|
|
5
|
+
s.version = "0.2.2"
|
|
6
6
|
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
|
8
8
|
s.authors = ["Casey O'Hara"]
|
|
@@ -24,13 +24,19 @@ Gem::Specification.new do |s|
|
|
|
24
24
|
|
|
25
25
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
|
26
26
|
s.add_runtime_dependency(%q<closure-compiler>, [">= 1.1.1"])
|
|
27
|
+
s.add_runtime_dependency(%q<term-ansicolor>, [">= 1.0.5"])
|
|
27
28
|
s.add_development_dependency(%q<closure-compiler>, [">= 1.1.1"])
|
|
29
|
+
s.add_development_dependency(%q<term-ansicolor>, [">= 1.0.5"])
|
|
28
30
|
else
|
|
29
31
|
s.add_dependency(%q<closure-compiler>, [">= 1.1.1"])
|
|
32
|
+
s.add_dependency(%q<term-ansicolor>, [">= 1.0.5"])
|
|
30
33
|
s.add_dependency(%q<closure-compiler>, [">= 1.1.1"])
|
|
34
|
+
s.add_dependency(%q<term-ansicolor>, [">= 1.0.5"])
|
|
31
35
|
end
|
|
32
36
|
else
|
|
33
37
|
s.add_dependency(%q<closure-compiler>, [">= 1.1.1"])
|
|
38
|
+
s.add_dependency(%q<term-ansicolor>, [">= 1.0.5"])
|
|
34
39
|
s.add_dependency(%q<closure-compiler>, [">= 1.1.1"])
|
|
40
|
+
s.add_dependency(%q<term-ansicolor>, [">= 1.0.5"])
|
|
35
41
|
end
|
|
36
42
|
end
|
data/lib/coyote/output.rb
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
module Coyote
|
|
2
2
|
class Output
|
|
3
|
-
|
|
4
|
-
attr_accessor :input, :output_file, :output_filename
|
|
5
|
-
|
|
6
|
-
def initialize(output_filename)
|
|
3
|
+
|
|
4
|
+
attr_accessor :input, :input_files, :output_file, :output_filename
|
|
5
|
+
|
|
6
|
+
def initialize(output_filename)
|
|
7
7
|
@output_filename = output_filename
|
|
8
8
|
@output_file = File.open(@output_filename, 'w+')
|
|
9
|
+
@input_files = []
|
|
9
10
|
@input = ""
|
|
10
11
|
print "\n----- Creating #{@output_filename}\n".bold
|
|
11
12
|
end
|
|
12
13
|
|
|
13
14
|
# open file, add contents to output
|
|
14
15
|
def append(filename)
|
|
16
|
+
@input_files.push(filename)
|
|
15
17
|
File.open(filename, 'r') do |file|
|
|
16
18
|
@input += "/***** #{filename} *****/\n"
|
|
17
19
|
@input += file.read
|
|
@@ -22,16 +24,26 @@ module Coyote
|
|
|
22
24
|
|
|
23
25
|
# save output to file
|
|
24
26
|
def save
|
|
27
|
+
add_file_comments
|
|
25
28
|
@output_file.write(@input)
|
|
26
29
|
print "Saved to #{@output_filename} \n\n".green
|
|
27
30
|
end
|
|
28
|
-
|
|
31
|
+
|
|
32
|
+
def add_file_comments
|
|
33
|
+
file_comments = "// Compressed using Coyote\n\n// Files included:\n"
|
|
34
|
+
@input_files.each do |file|
|
|
35
|
+
file_comments += "// #{file}\n"
|
|
36
|
+
end
|
|
37
|
+
file_comments += "\n\n\n"
|
|
38
|
+
@input = file_comments + @input
|
|
39
|
+
end
|
|
40
|
+
|
|
29
41
|
# compress output
|
|
30
42
|
def compress
|
|
31
43
|
print "Compiling #{@output_filename}...\n"
|
|
32
44
|
@input = Closure::Compiler.new.compile(@input)
|
|
33
|
-
end
|
|
45
|
+
end
|
|
34
46
|
end
|
|
35
47
|
end
|
|
36
|
-
|
|
37
|
-
|
|
48
|
+
|
|
49
|
+
|
metadata
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: coyote
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease:
|
|
5
|
-
version: 0.2.
|
|
5
|
+
version: 0.2.2
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
8
8
|
- Casey O'Hara
|
|
@@ -24,16 +24,38 @@ dependencies:
|
|
|
24
24
|
type: :runtime
|
|
25
25
|
version_requirements: *id001
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
|
-
name:
|
|
27
|
+
name: term-ansicolor
|
|
28
28
|
prerelease: false
|
|
29
29
|
requirement: &id002 !ruby/object:Gem::Requirement
|
|
30
|
+
none: false
|
|
31
|
+
requirements:
|
|
32
|
+
- - ">="
|
|
33
|
+
- !ruby/object:Gem::Version
|
|
34
|
+
version: 1.0.5
|
|
35
|
+
type: :runtime
|
|
36
|
+
version_requirements: *id002
|
|
37
|
+
- !ruby/object:Gem::Dependency
|
|
38
|
+
name: closure-compiler
|
|
39
|
+
prerelease: false
|
|
40
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
|
30
41
|
none: false
|
|
31
42
|
requirements:
|
|
32
43
|
- - ">="
|
|
33
44
|
- !ruby/object:Gem::Version
|
|
34
45
|
version: 1.1.1
|
|
35
46
|
type: :development
|
|
36
|
-
version_requirements: *
|
|
47
|
+
version_requirements: *id003
|
|
48
|
+
- !ruby/object:Gem::Dependency
|
|
49
|
+
name: term-ansicolor
|
|
50
|
+
prerelease: false
|
|
51
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
|
52
|
+
none: false
|
|
53
|
+
requirements:
|
|
54
|
+
- - ">="
|
|
55
|
+
- !ruby/object:Gem::Version
|
|
56
|
+
version: 1.0.5
|
|
57
|
+
type: :development
|
|
58
|
+
version_requirements: *id004
|
|
37
59
|
description: A command-line tool for combining and compressing JS files
|
|
38
60
|
email: casey.ohara@imulus.com
|
|
39
61
|
executables:
|