distil 0.12.3 → 0.12.4

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -14,6 +14,7 @@ begin
14
14
  gemspec.executables= ['distil']
15
15
  gemspec.extensions= ['vendor/extconf.rb']
16
16
  gemspec.add_dependency('json', '>= 1.4.3')
17
+ gemspec.add_dependency('rubyzip', '>=0.9.4')
17
18
  end
18
19
 
19
20
  Jeweler::GemcutterTasks.new
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.12.3
1
+ 0.12.4
data/bin/distil CHANGED
@@ -65,4 +65,6 @@ end
65
65
 
66
66
  args.each { |cmd|
67
67
  project.send cmd
68
+ exit 1 if project.total_error_count > 0
69
+ exit 1 if project.warnings_are_errors && project.total_warning_count > 0
68
70
  }
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.3"
8
+ s.version = "0.12.4"
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-27}
12
+ s.date = %q{2010-07-29}
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"]
@@ -750,11 +750,14 @@ Gem::Specification.new do |s|
750
750
 
751
751
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
752
752
  s.add_runtime_dependency(%q<json>, [">= 1.4.3"])
753
+ s.add_runtime_dependency(%q<rubyzip>, [">= 0.9.4"])
753
754
  else
754
755
  s.add_dependency(%q<json>, [">= 1.4.3"])
756
+ s.add_dependency(%q<rubyzip>, [">= 0.9.4"])
755
757
  end
756
758
  else
757
759
  s.add_dependency(%q<json>, [">= 1.4.3"])
760
+ s.add_dependency(%q<rubyzip>, [">= 0.9.4"])
758
761
  end
759
762
  end
760
763
 
data/distil.tmproj CHANGED
@@ -3,7 +3,7 @@
3
3
  <plist version="1.0">
4
4
  <dict>
5
5
  <key>currentDocument</key>
6
- <string>lib/distil/product.rb</string>
6
+ <string>lib/distil/project/remote-project.rb</string>
7
7
  <key>documents</key>
8
8
  <array>
9
9
  <dict>
@@ -21,19 +21,19 @@
21
21
  <integer>270</integer>
22
22
  <key>metaData</key>
23
23
  <dict>
24
- <key>lib/distil/product.rb</key>
24
+ <key>Rakefile</key>
25
25
  <dict>
26
26
  <key>caret</key>
27
27
  <dict>
28
28
  <key>column</key>
29
- <integer>7</integer>
29
+ <integer>48</integer>
30
30
  <key>line</key>
31
- <integer>79</integer>
31
+ <integer>16</integer>
32
32
  </dict>
33
33
  <key>firstVisibleColumn</key>
34
34
  <integer>0</integer>
35
35
  <key>firstVisibleLine</key>
36
- <integer>42</integer>
36
+ <integer>0</integer>
37
37
  </dict>
38
38
  <key>lib/distil/product/concatenated.rb</key>
39
39
  <dict>
@@ -49,42 +49,42 @@
49
49
  <key>firstVisibleLine</key>
50
50
  <integer>2</integer>
51
51
  </dict>
52
- <key>lib/distil/project.rb</key>
52
+ <key>lib/distil/product/javascript-product.rb</key>
53
53
  <dict>
54
54
  <key>caret</key>
55
55
  <dict>
56
56
  <key>column</key>
57
- <integer>4</integer>
57
+ <integer>69</integer>
58
58
  <key>line</key>
59
- <integer>21</integer>
59
+ <integer>118</integer>
60
60
  </dict>
61
61
  <key>firstVisibleColumn</key>
62
62
  <integer>0</integer>
63
63
  <key>firstVisibleLine</key>
64
- <integer>0</integer>
64
+ <integer>75</integer>
65
65
  </dict>
66
- <key>lib/distil/project/distil-project.rb</key>
66
+ <key>lib/distil/project/external-project.rb</key>
67
67
  <dict>
68
68
  <key>caret</key>
69
69
  <dict>
70
70
  <key>column</key>
71
- <integer>7</integer>
71
+ <integer>0</integer>
72
72
  <key>line</key>
73
- <integer>115</integer>
73
+ <integer>35</integer>
74
74
  </dict>
75
75
  <key>firstVisibleColumn</key>
76
76
  <integer>0</integer>
77
77
  <key>firstVisibleLine</key>
78
- <integer>78</integer>
78
+ <integer>0</integer>
79
79
  </dict>
80
- <key>lib/distil/project/external-project.rb</key>
80
+ <key>lib/distil/project/remote-project.rb</key>
81
81
  <dict>
82
82
  <key>caret</key>
83
83
  <dict>
84
84
  <key>column</key>
85
85
  <integer>0</integer>
86
86
  <key>line</key>
87
- <integer>35</integer>
87
+ <integer>26</integer>
88
88
  </dict>
89
89
  <key>firstVisibleColumn</key>
90
90
  <integer>0</integer>
@@ -98,26 +98,56 @@
98
98
  <key>column</key>
99
99
  <integer>0</integer>
100
100
  <key>line</key>
101
- <integer>204</integer>
101
+ <integer>0</integer>
102
102
  </dict>
103
+ <key>columnSelection</key>
104
+ <false/>
103
105
  <key>firstVisibleColumn</key>
104
106
  <integer>0</integer>
105
107
  <key>firstVisibleLine</key>
106
- <integer>174</integer>
108
+ <integer>0</integer>
109
+ <key>selectFrom</key>
110
+ <dict>
111
+ <key>column</key>
112
+ <integer>0</integer>
113
+ <key>line</key>
114
+ <integer>0</integer>
115
+ </dict>
116
+ <key>selectTo</key>
117
+ <dict>
118
+ <key>column</key>
119
+ <integer>6</integer>
120
+ <key>line</key>
121
+ <integer>0</integer>
122
+ </dict>
123
+ </dict>
124
+ <key>lib/distil/task/validate-js-task.rb</key>
125
+ <dict>
126
+ <key>caret</key>
127
+ <dict>
128
+ <key>column</key>
129
+ <integer>32</integer>
130
+ <key>line</key>
131
+ <integer>48</integer>
132
+ </dict>
133
+ <key>firstVisibleColumn</key>
134
+ <integer>0</integer>
135
+ <key>firstVisibleLine</key>
136
+ <integer>23</integer>
107
137
  </dict>
108
138
  </dict>
109
139
  <key>openDocuments</key>
110
140
  <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
141
  <string>lib/distil/target.rb</string>
116
- <string>lib/distil/project/external-project.rb</string>
142
+ <string>lib/distil/product/concatenated.rb</string>
143
+ <string>lib/distil/product/javascript-product.rb</string>
144
+ <string>lib/distil/task/validate-js-task.rb</string>
145
+ <string>lib/distil/project/remote-project.rb</string>
146
+ <string>Rakefile</string>
117
147
  </array>
118
148
  <key>showFileHierarchyDrawer</key>
119
149
  <false/>
120
150
  <key>windowFrame</key>
121
- <string>{{560, 300}, {1095, 878}}</string>
151
+ <string>{{350, 0}, {1090, 878}}</string>
122
152
  </dict>
123
153
  </plist>
@@ -69,8 +69,7 @@ module Distil
69
69
  # file not found by globbing (would also find explicit reference)
70
70
  source_file= @owner.find_file(file) if @owner
71
71
  if !source_file
72
- puts "full_path=#{full_path}\nsource_folder=#{@owner.source_folder}"
73
- error("Unable to locate file: #{file}")
72
+ error("File not found: #{file}")
74
73
  return
75
74
  end
76
75
  return if (@files.include?(source_file))
@@ -4,6 +4,8 @@ module Distil
4
4
  @@warning_count=0
5
5
  @@error_count=0
6
6
  @@ignore_warnings= false
7
+ @@total_warning_count=0
8
+ @@total_error_count=0
7
9
 
8
10
  def ignore_warnings
9
11
  @@ignore_warnings
@@ -13,6 +15,14 @@ module Distil
13
15
  @@ignore_warnings=ignore
14
16
  end
15
17
 
18
+ def total_error_count
19
+ @@total_error_count
20
+ end
21
+
22
+ def total_warning_count
23
+ @@total_warning_count
24
+ end
25
+
16
26
  def self.error(message, file=nil, line_number=nil)
17
27
  @@error_count+=1
18
28
  if (file && line_number)
@@ -54,6 +64,8 @@ module Distil
54
64
  def report
55
65
  puts "\n" if (@@error_count>0 || @@warning_count>0)
56
66
  puts "#{@@error_count} error(s), #{@@warning_count} warning(s)#{ignore_warnings ? " ignored" : ""}"
67
+ @@total_error_count += @@error_count
68
+ @@total_warning_count += @@warning_count
57
69
  @@error_count=0
58
70
  @@warning_count=0
59
71
  end
@@ -5,7 +5,7 @@ module Distil
5
5
  attr_reader :project_file, :targets
6
6
 
7
7
  option :ignore_warnings, false
8
-
8
+ option :warnings_are_errors, false
9
9
  option :external_projects, [], :aliases=>['external']
10
10
  option :distileries, Array, :aliases=>['distilleries', 'distilery', 'distillery']
11
11
 
@@ -19,7 +19,11 @@ module Distil
19
19
 
20
20
  if !File.exist?(@source_path)
21
21
  FileUtils.mkdir_p(source_folder)
22
- text= href.read
22
+ begin
23
+ text= href.read
24
+ rescue OpenURI::HTTPError => http_error
25
+ raise ValidationError, "Unable to fetch remote project: status=#{http_error.io.status[0]} url=#{href}"
26
+ end
23
27
  File.open(@source_path, "w") { |output|
24
28
  output.write text
25
29
  }
data/lib/distil/target.rb CHANGED
@@ -47,6 +47,10 @@ module Distil
47
47
  projects= []
48
48
  include_projects.each { |name|
49
49
  ext= project.external_project_with_name(name)
50
+ if (!ext)
51
+ raise ValidationError, "External project not found: #{name}"
52
+ end
53
+
50
54
  ext.linkage= STRONG_LINKAGE
51
55
  projects << ext
52
56
  }
@@ -36,9 +36,9 @@ module Distil
36
36
  tmp << "+define #{global_export}\n"
37
37
  end
38
38
 
39
- # additional_globals.each { |g|
40
- # tmp << "+define #{g}\n"
41
- # }
39
+ additional_globals.each { |g|
40
+ tmp << "+define #{g}\n"
41
+ }
42
42
 
43
43
  target.file_aliases.each { |original, full_path|
44
44
  next if !File.exist?(full_path)
@@ -64,15 +64,15 @@ module Distil
64
64
  summary= output.pop
65
65
  match= summary.match(/(\d+)\s+error\(s\), (\d+)\s+warning\(s\)/)
66
66
  if (match)
67
- @@error_count+= match[1].to_i
68
- @@warning_count+= match[2].to_i
67
+ @@error_count+= match[1].to_i
68
+ @@warning_count+= match[2].to_i
69
69
  end
70
70
 
71
71
  output= output.join("\n")
72
72
 
73
73
  if (!output.empty?)
74
- puts output
75
- puts
74
+ puts output
75
+ puts
76
76
  end
77
77
 
78
78
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: distil
3
3
  version: !ruby/object:Gem::Version
4
- hash: 41
4
+ hash: 39
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 12
9
- - 3
10
- version: 0.12.3
9
+ - 4
10
+ version: 0.12.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jeff Watkins
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-27 00:00:00 -07:00
18
+ date: 2010-07-29 00:00:00 -07:00
19
19
  default_executable: distil
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -34,6 +34,22 @@ dependencies:
34
34
  version: 1.4.3
35
35
  type: :runtime
36
36
  version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ name: rubyzip
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ hash: 51
46
+ segments:
47
+ - 0
48
+ - 9
49
+ - 4
50
+ version: 0.9.4
51
+ type: :runtime
52
+ version_requirements: *id002
37
53
  description: A build tool for Javascript and CSS that takes advantage of best-of-breed helper applications Javascript Lint and JSDoc Toolkit
38
54
  email:
39
55
  executables: