distil 0.11.5 → 0.11.6

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.11.5
1
+ 0.11.6
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.11.5"
8
+ s.version = "0.11.6"
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-06-16}
12
+ s.date = %q{2010-06-18}
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"]
@@ -21,6 +21,7 @@ Gem::Specification.new do |s|
21
21
  "bin/distil",
22
22
  "distil.gemspec",
23
23
  "lib/distil.rb",
24
+ "lib/distil/browser.rb",
24
25
  "lib/distil/configurable.rb",
25
26
  "lib/distil/configurable/file-set.rb",
26
27
  "lib/distil/configurable/interpolated.rb",
@@ -0,0 +1,34 @@
1
+ class Browser
2
+ def supported?; true; end
3
+ def setup ; end
4
+ def open(url) ; end
5
+ def teardown ; end
6
+
7
+ def host
8
+ require 'rbconfig'
9
+ Config::CONFIG['host']
10
+ end
11
+
12
+ def macos?
13
+ host.include?('darwin')
14
+ end
15
+
16
+ def windows?
17
+ host.include?('mswin')
18
+ end
19
+
20
+ def linux?
21
+ host.include?('linux')
22
+ end
23
+
24
+ def open(url)
25
+ case
26
+ when macos?
27
+ `open #{url}`
28
+ when windows?
29
+ `start #{url}`
30
+ else
31
+ puts "I don't know how to open a browser for #{url} on your system"
32
+ end
33
+ end
34
+ end
@@ -63,6 +63,25 @@ module Distil
63
63
  @projects_by_name[name]
64
64
  end
65
65
 
66
+ def launch
67
+ build if !up_to_date
68
+
69
+ require 'webrick'
70
+ config= {
71
+ :Port => 8888
72
+ }
73
+
74
+ server= WEBrick::HTTPServer.new(config)
75
+ server.mount("/", WEBrick::HTTPServlet::FileHandler, output_folder)
76
+
77
+ ['INT', 'TERM'].each { |signal|
78
+ trap(signal){ server.shutdown}
79
+ }
80
+ b= Browser.new
81
+ b.open("http://localhost:8888/")
82
+ server.start
83
+ end
84
+
66
85
  def build
67
86
  FileUtils.mkdir_p(output_folder)
68
87
  load_distileries
@@ -93,6 +112,10 @@ module Distil
93
112
  }
94
113
  end
95
114
 
115
+ def up_to_date
116
+ targets.all? { |target| target.up_to_date }
117
+ end
118
+
96
119
  def build_targets
97
120
  targets.each { |target|
98
121
  target.build
data/lib/distil/target.rb CHANGED
@@ -200,6 +200,10 @@ module Distil
200
200
  @asset_aliases[full_path] || asset_file.relative_to_folder(source_folder)
201
201
  end
202
202
 
203
+ def up_to_date
204
+ products.all? { |p| p.up_to_date }
205
+ end
206
+
203
207
  def build
204
208
  puts "\n#{name}:\n\n"
205
209
 
data/lib/distil.rb CHANGED
@@ -61,6 +61,7 @@ def replace_tokens(string, params)
61
61
  }
62
62
  end
63
63
 
64
+ require 'distil/browser'
64
65
  require 'distil/error-reporter'
65
66
  require 'distil/configurable'
66
67
  require 'distil/source-file'
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 11
8
- - 5
9
- version: 0.11.5
8
+ - 6
9
+ version: 0.11.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jeff Watkins
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-06-16 00:00:00 -07:00
17
+ date: 2010-06-18 00:00:00 -07:00
18
18
  default_executable: distil
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -46,6 +46,7 @@ files:
46
46
  - bin/distil
47
47
  - distil.gemspec
48
48
  - lib/distil.rb
49
+ - lib/distil/browser.rb
49
50
  - lib/distil/configurable.rb
50
51
  - lib/distil/configurable/file-set.rb
51
52
  - lib/distil/configurable/interpolated.rb