distil 0.12.2 → 0.12.3

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.12.2
1
+ 0.12.3
data/distil.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{distil}
8
- s.version = "0.12.2"
8
+ s.version = "0.12.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jeff Watkins"]
12
- s.date = %q{2010-07-14}
12
+ s.date = %q{2010-07-27}
13
13
  s.default_executable = %q{distil}
14
14
  s.description = %q{A build tool for Javascript and CSS that takes advantage of best-of-breed helper applications Javascript Lint and JSDoc Toolkit}
15
15
  s.executables = ["distil"]
@@ -20,6 +20,7 @@ Gem::Specification.new do |s|
20
20
  "assets/distil.js",
21
21
  "bin/distil",
22
22
  "distil.gemspec",
23
+ "distil.tmproj",
23
24
  "lib/distil.rb",
24
25
  "lib/distil/browser.rb",
25
26
  "lib/distil/configurable.rb",
@@ -740,14 +741,14 @@ Gem::Specification.new do |s|
740
741
  s.homepage = %q{http://code.google.com/p/distil-js/}
741
742
  s.rdoc_options = ["--charset=UTF-8"]
742
743
  s.require_paths = ["lib"]
743
- s.rubygems_version = %q{1.3.6}
744
+ s.rubygems_version = %q{1.3.7}
744
745
  s.summary = %q{A build tool for Javascript and CSS that takes advantage of best-of-breed helper applications Javascript Lint and JSDoc Toolkit}
745
746
 
746
747
  if s.respond_to? :specification_version then
747
748
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
748
749
  s.specification_version = 3
749
750
 
750
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
751
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
751
752
  s.add_runtime_dependency(%q<json>, [">= 1.4.3"])
752
753
  else
753
754
  s.add_dependency(%q<json>, [">= 1.4.3"])
data/distil.tmproj ADDED
@@ -0,0 +1,123 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>currentDocument</key>
6
+ <string>lib/distil/product.rb</string>
7
+ <key>documents</key>
8
+ <array>
9
+ <dict>
10
+ <key>expanded</key>
11
+ <true/>
12
+ <key>name</key>
13
+ <string>distil</string>
14
+ <key>regexFolderFilter</key>
15
+ <string>!.*/(\.[^/]*|CVS|_darcs|_MTN|\{arch\}|blib|.*~\.nib|.*\.(framework|app|pbproj|pbxproj|xcode(proj)?|bundle))$</string>
16
+ <key>sourceDirectory</key>
17
+ <string></string>
18
+ </dict>
19
+ </array>
20
+ <key>fileHierarchyDrawerWidth</key>
21
+ <integer>270</integer>
22
+ <key>metaData</key>
23
+ <dict>
24
+ <key>lib/distil/product.rb</key>
25
+ <dict>
26
+ <key>caret</key>
27
+ <dict>
28
+ <key>column</key>
29
+ <integer>7</integer>
30
+ <key>line</key>
31
+ <integer>79</integer>
32
+ </dict>
33
+ <key>firstVisibleColumn</key>
34
+ <integer>0</integer>
35
+ <key>firstVisibleLine</key>
36
+ <integer>42</integer>
37
+ </dict>
38
+ <key>lib/distil/product/concatenated.rb</key>
39
+ <dict>
40
+ <key>caret</key>
41
+ <dict>
42
+ <key>column</key>
43
+ <integer>22</integer>
44
+ <key>line</key>
45
+ <integer>31</integer>
46
+ </dict>
47
+ <key>firstVisibleColumn</key>
48
+ <integer>0</integer>
49
+ <key>firstVisibleLine</key>
50
+ <integer>2</integer>
51
+ </dict>
52
+ <key>lib/distil/project.rb</key>
53
+ <dict>
54
+ <key>caret</key>
55
+ <dict>
56
+ <key>column</key>
57
+ <integer>4</integer>
58
+ <key>line</key>
59
+ <integer>21</integer>
60
+ </dict>
61
+ <key>firstVisibleColumn</key>
62
+ <integer>0</integer>
63
+ <key>firstVisibleLine</key>
64
+ <integer>0</integer>
65
+ </dict>
66
+ <key>lib/distil/project/distil-project.rb</key>
67
+ <dict>
68
+ <key>caret</key>
69
+ <dict>
70
+ <key>column</key>
71
+ <integer>7</integer>
72
+ <key>line</key>
73
+ <integer>115</integer>
74
+ </dict>
75
+ <key>firstVisibleColumn</key>
76
+ <integer>0</integer>
77
+ <key>firstVisibleLine</key>
78
+ <integer>78</integer>
79
+ </dict>
80
+ <key>lib/distil/project/external-project.rb</key>
81
+ <dict>
82
+ <key>caret</key>
83
+ <dict>
84
+ <key>column</key>
85
+ <integer>0</integer>
86
+ <key>line</key>
87
+ <integer>35</integer>
88
+ </dict>
89
+ <key>firstVisibleColumn</key>
90
+ <integer>0</integer>
91
+ <key>firstVisibleLine</key>
92
+ <integer>0</integer>
93
+ </dict>
94
+ <key>lib/distil/target.rb</key>
95
+ <dict>
96
+ <key>caret</key>
97
+ <dict>
98
+ <key>column</key>
99
+ <integer>0</integer>
100
+ <key>line</key>
101
+ <integer>204</integer>
102
+ </dict>
103
+ <key>firstVisibleColumn</key>
104
+ <integer>0</integer>
105
+ <key>firstVisibleLine</key>
106
+ <integer>174</integer>
107
+ </dict>
108
+ </dict>
109
+ <key>openDocuments</key>
110
+ <array>
111
+ <string>lib/distil/product.rb</string>
112
+ <string>lib/distil/product/concatenated.rb</string>
113
+ <string>lib/distil/project.rb</string>
114
+ <string>lib/distil/project/distil-project.rb</string>
115
+ <string>lib/distil/target.rb</string>
116
+ <string>lib/distil/project/external-project.rb</string>
117
+ </array>
118
+ <key>showFileHierarchyDrawer</key>
119
+ <false/>
120
+ <key>windowFrame</key>
121
+ <string>{{560, 300}, {1095, 878}}</string>
122
+ </dict>
123
+ </plist>
@@ -17,7 +17,16 @@ module Distil
17
17
  @up_to_date= true
18
18
 
19
19
  # Run the Y!UI Compressor
20
- system "java -jar #{COMPRESSOR} \"#{concatenated_name}\" -o \"#{filename}\""
20
+ if (!File.exist?(concatenated_name))
21
+ error("Missing source file for minify: #{concatenated_name}")
22
+ return
23
+ end
24
+
25
+ result= system "java -jar #{COMPRESSOR} \"#{concatenated_name}\" -o \"#{filename}\""
26
+ if (!result)
27
+ error("Failed to minify: #{concatenated_name}")
28
+ return
29
+ end
21
30
 
22
31
  if 'css'==extension
23
32
  buffer= File.read(filename)
@@ -7,6 +7,8 @@ module Distil
7
7
  option :compressed_name, OutputPath, "$(name).$(extension).gz", :aliases=>['compressed']
8
8
 
9
9
  option :force, false
10
+
11
+ include ErrorReporter
10
12
 
11
13
  attr_accessor :assets, :target, :join_string
12
14
  class_attr :extension
@@ -75,6 +77,10 @@ module Distil
75
77
  raise NotImplementedError.new("No write_output method has been defined for this product.")
76
78
  end
77
79
 
80
+ def clean
81
+ FileUtils.rm filename if File.exist? filename
82
+ end
83
+
78
84
  def relative_path(file)
79
85
  file=SourceFile.from_path(file) if file.is_a?(String)
80
86
 
@@ -109,6 +109,13 @@ module Distil
109
109
  return targets.all? { |target| target.up_to_date }
110
110
  end
111
111
 
112
+ def clean
113
+ # clean_external_projects
114
+ targets.each { |target|
115
+ target.clean
116
+ }
117
+ end
118
+
112
119
  def build
113
120
  build_external_projects
114
121
  build_targets
@@ -18,6 +18,9 @@ module Distil
18
18
  def build
19
19
  end
20
20
 
21
+ def clean
22
+ end
23
+
21
24
  def self.fetch_project_using_git(options = {})
22
25
  uri= options["repository"]
23
26
  path= options["path"]
data/lib/distil/target.rb CHANGED
@@ -3,7 +3,7 @@ module Distil
3
3
  class Target < Configurable
4
4
  include ErrorReporter
5
5
 
6
- attr_accessor :project, :assets
6
+ attr_accessor :project, :assets, :file_aliases
7
7
 
8
8
  option :version, String
9
9
  option :name, String
@@ -32,6 +32,7 @@ module Distil
32
32
  @probed= Set.new
33
33
  @contents= {}
34
34
  @asset_aliases= {}
35
+ @file_aliases= {}
35
36
 
36
37
  if !include_files
37
38
  self.include_files= FileSet.new
@@ -135,6 +136,10 @@ module Distil
135
136
  @files
136
137
  end
137
138
 
139
+ def add_file_alias(original, full_path)
140
+ @file_aliases[original]= full_path
141
+ end
142
+
138
143
  def symlink_assets
139
144
  folders= []
140
145
 
@@ -199,6 +204,11 @@ module Distil
199
204
  products.all? { |p| p.up_to_date }
200
205
  end
201
206
 
207
+ def clean
208
+ puts "\n#{name}:\n\n"
209
+ products.each { |p| p.clean }
210
+ end
211
+
202
212
  def build
203
213
  puts "\n#{name}:\n\n"
204
214
 
@@ -28,6 +28,7 @@ module Distil
28
28
  else
29
29
  dependency= target.find_file($1, file)
30
30
  if (dependency)
31
+ target.add_file_alias($1, dependency.full_path)
31
32
  file.add_dependency dependency
32
33
  else
33
34
  file.error "Missing import file: #{$1}", line_num
@@ -40,20 +40,17 @@ module Distil
40
40
  # tmp << "+define #{g}\n"
41
41
  # }
42
42
 
43
- # add aliases
44
- target.project.external_projects.each { |project|
45
- import_file= project.product_name(:import, 'js')
46
- next if !File.exist?(import_file)
47
- tmp << "+alias #{project.name} #{import_file}\n"
43
+ target.file_aliases.each { |original, full_path|
44
+ next if !File.exist?(full_path)
45
+ tmp << "+alias #{original} #{full_path}\n"
48
46
  }
49
-
47
+
50
48
  files.each { |f|
51
49
  next if !handles_file(f)
52
50
  tmp << "+process #{f}\n"
53
51
  }
54
52
 
55
53
  tmp.close()
56
-
57
54
  command= "#{LINT_COMMAND} -nologo -nofilelisting -conf #{tmp.path}"
58
55
 
59
56
  stdin, stdout, stderr= Open3.popen3(command)
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: distil
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 41
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 12
8
- - 2
9
- version: 0.12.2
9
+ - 3
10
+ version: 0.12.3
10
11
  platform: ruby
11
12
  authors:
12
13
  - Jeff Watkins
@@ -14,16 +15,18 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-07-14 00:00:00 -07:00
18
+ date: 2010-07-27 00:00:00 -07:00
18
19
  default_executable: distil
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: json
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
24
26
  requirements:
25
27
  - - ">="
26
28
  - !ruby/object:Gem::Version
29
+ hash: 1
27
30
  segments:
28
31
  - 1
29
32
  - 4
@@ -45,6 +48,7 @@ files:
45
48
  - assets/distil.js
46
49
  - bin/distil
47
50
  - distil.gemspec
51
+ - distil.tmproj
48
52
  - lib/distil.rb
49
53
  - lib/distil/browser.rb
50
54
  - lib/distil/configurable.rb
@@ -771,23 +775,27 @@ rdoc_options:
771
775
  require_paths:
772
776
  - lib
773
777
  required_ruby_version: !ruby/object:Gem::Requirement
778
+ none: false
774
779
  requirements:
775
780
  - - ">="
776
781
  - !ruby/object:Gem::Version
782
+ hash: 3
777
783
  segments:
778
784
  - 0
779
785
  version: "0"
780
786
  required_rubygems_version: !ruby/object:Gem::Requirement
787
+ none: false
781
788
  requirements:
782
789
  - - ">="
783
790
  - !ruby/object:Gem::Version
791
+ hash: 3
784
792
  segments:
785
793
  - 0
786
794
  version: "0"
787
795
  requirements: []
788
796
 
789
797
  rubyforge_project:
790
- rubygems_version: 1.3.6
798
+ rubygems_version: 1.3.7
791
799
  signing_key:
792
800
  specification_version: 3
793
801
  summary: A build tool for Javascript and CSS that takes advantage of best-of-breed helper applications Javascript Lint and JSDoc Toolkit