wunderbar 1.0.10 → 1.0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c171f3bd768e21db2c12b3776ef414db16cb8cc5
4
- data.tar.gz: cbaf1ab1828fd54e0cada61c139520aaa54248d0
3
+ metadata.gz: 960b2286efaf87963603361c6a1f3dc15eb86956
4
+ data.tar.gz: 5af237e03df44700a049ee82e7d93dc7d3f271ab
5
5
  SHA512:
6
- metadata.gz: 19d3bd9f11bd83e2309b0f96ea379d26460b6617f103bdb658adb982af065ecd55b0edb55711b033ae22f6f88522bbcbf808579e4abfd45a7717820460f6ef6a
7
- data.tar.gz: b62899679bc94e9edcaf613b5b0dbc5a36493885942c1b350ee8ba98e9402ce2f200e3bb0813205bf00b25ee5b9da8d74a6a2706513b77ac34fe710a945dea16
6
+ metadata.gz: 09984eb6693c92d4f1e0694e593d7985444af1d30f579e0090e5bac7fce793148e0365918ddf81ed8a69b9729e2ca5ca2024a83a3ba27f645cbed3f47ea9fdec
7
+ data.tar.gz: 8a0a622ae748183d9a99eb00c5bbd3881c73506694102cf411ef592e3e28e005f36cbaf017c1c67e1faf87ed6f8fc5435e7c122b65620407a5be4b335525c87c
@@ -7,6 +7,43 @@
7
7
 
8
8
  require 'listen'
9
9
 
10
+ #
11
+ # support for excluding files/directories from triggering restart.
12
+ #
13
+ # Usage:
14
+ #
15
+ # module Wunderbar::Listen
16
+ # EXCLUDE = ['file', 'dir']
17
+ # end
18
+ #
19
+ module Wunderbar
20
+ module Listen
21
+ EXCLUDE = [] unless defined? EXCLUDE
22
+
23
+ EXCLUDE.each_with_index do |filename, index|
24
+ EXCLUDE[index] = File.realpath(filename)
25
+ end
26
+
27
+ # add a path to the exclude list
28
+ def self.exclude(*files)
29
+ files.each do |file|
30
+ file = File.realpath(file)
31
+ EXCLUDE << file unless EXCLUDE.include? file
32
+ end
33
+ end
34
+
35
+ # check to see if all of the files are excluded
36
+ def self.exclude?(files)
37
+ files.all? do |file|
38
+ file = File.realpath(file) if File.exist? file
39
+ EXCLUDE.any? do |exclude|
40
+ file == exclude or file.start_with? exclude + '/'
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
46
+
10
47
  $HOME = ENV['HOME']
11
48
 
12
49
  pids = `lsof -t -i tcp:9292`.split
@@ -29,6 +66,8 @@ dirs.each {|dir| puts "Watching #{dir}"}
29
66
  puts unless dirs.empty?
30
67
 
31
68
  listener = Listen.to(*dirs) do |modified, added, removed|
69
+ next if Wunderbar::Listen.exclude? modified+added+removed
70
+
32
71
  puts
33
72
  modified.each {|file| puts "#{file} modified"}
34
73
  added.each {|file| puts "#{file} added"}
@@ -81,7 +81,21 @@ class Wunderbar::XmlMarkup
81
81
 
82
82
  if script.attrs[:src]
83
83
  src = script.attrs[:src]
84
- src = File.join(base, src) unless base.empty?
84
+
85
+ if not base.empty?
86
+ src = File.join(base, src)
87
+ elsif @_scope.env['PATH_INFO']
88
+ # evaluate src relative to PATH_INFO
89
+ path = @_scope.env['PATH_INFO'].split('/')
90
+ path.shift
91
+ path.pop
92
+ while src.start_with? '../' and not path.empty?
93
+ src = src.sub('../', '')
94
+ path.pop
95
+ end
96
+ src = File.join(path.join('/'), src) unless path.empty?
97
+ end
98
+
85
99
  name = File.expand_path(src, @_scope.settings.public_folder.untaint)
86
100
  name.untaint unless src.tainted?
87
101
  if File.exist? name
@@ -121,7 +135,7 @@ class Wunderbar::XmlMarkup
121
135
  nodes.each {|node| node.parent = target}
122
136
  target.children += nodes
123
137
  rescue ExecJS::ProgramError => e
124
- STDERR.puts e
138
+ Wunderbar.error e
125
139
  target.children << builder._pre(e.message).node?
126
140
  end
127
141
 
@@ -145,10 +159,9 @@ get %r{^/([-\w]+)\.js$} do |script|
145
159
  begin
146
160
  js = Wunderbar::Asset.convert(file)
147
161
  pass unless js
148
- rescue
149
- # if conversion fails, use Wunderbar's error recovery
150
- _js :"#{script}"
151
- return
162
+ rescue Exception => e
163
+ Wunderbar.error e.to_s
164
+ return [500, {'Content-type' => 'text/plain'}, "*** ERROR ***\n\n#{e}"]
152
165
  end
153
166
 
154
167
  response.headers['SourceMap'] = "#{script}.js.map"
@@ -240,7 +240,7 @@ Tilt.register 'xhtml.rb', Wunderbar::Template::Xhtml
240
240
  helpers Wunderbar::SinatraHelpers
241
241
 
242
242
  if Dir.exist? settings.public_folder
243
- Wunderbar::Asset.root = File.join(settings.public_folder, 'assets')
243
+ Wunderbar::Asset.root = File.join(settings.public_folder, 'assets').untaint
244
244
  end
245
245
 
246
246
  Wunderbar::Asset.virtual = true
@@ -2,7 +2,7 @@ module Wunderbar
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 1
4
4
  MINOR = 0
5
- TINY = 10
5
+ TINY = 11
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/wunderbar.gemspec CHANGED
@@ -1,21 +1,20 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: wunderbar 1.0.10 ruby lib
3
2
 
4
3
  Gem::Specification.new do |s|
5
4
  s.name = "wunderbar"
6
- s.version = "1.0.10"
5
+ s.version = "1.0.11"
7
6
 
8
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
- s.require_paths = ["lib"]
10
8
  s.authors = ["Sam Ruby"]
11
- s.date = "2015-12-11"
9
+ s.date = "2015-12-18"
12
10
  s.description = " Wunderbar makes it easy to produce valid HTML5, wellformed XHTML, Unicode\n (utf-8), consistently indented, readable applications.'\n"
13
11
  s.email = "rubys@intertwingly.net"
14
- s.files = ["COPYING", "README.md", "lib/wunderbar", "lib/wunderbar.rb", "lib/wunderbar/angularjs", "lib/wunderbar/angularjs.rb", "lib/wunderbar/angularjs/resource.rb", "lib/wunderbar/angularjs/route.rb", "lib/wunderbar/asset.rb", "lib/wunderbar/backtick.rb", "lib/wunderbar/bootstrap", "lib/wunderbar/bootstrap.rb", "lib/wunderbar/bootstrap/theme.rb", "lib/wunderbar/builder.rb", "lib/wunderbar/cgi-methods.rb", "lib/wunderbar/coderay.rb", "lib/wunderbar/coffeescript.rb", "lib/wunderbar/cssproxy.rb", "lib/wunderbar/environment.rb", "lib/wunderbar/eventsource.rb", "lib/wunderbar/html-methods.rb", "lib/wunderbar/installation.rb", "lib/wunderbar/job-control.rb", "lib/wunderbar/jquery", "lib/wunderbar/jquery.rb", "lib/wunderbar/jquery/filter.rb", "lib/wunderbar/jquery/stupidtable.rb", "lib/wunderbar/listen.rb", "lib/wunderbar/logger.rb", "lib/wunderbar/markdown.rb", "lib/wunderbar/marked.rb", "lib/wunderbar/node.rb", "lib/wunderbar/pagedown.rb", "lib/wunderbar/polymer.rb", "lib/wunderbar/rack.rb", "lib/wunderbar/rails.rb", "lib/wunderbar/react.rb", "lib/wunderbar/script.rb", "lib/wunderbar/server.rb", "lib/wunderbar/sinatra.rb", "lib/wunderbar/underscore.rb", "lib/wunderbar/vendor", "lib/wunderbar/vendor/Markdown.Converter.js", "lib/wunderbar/vendor/angular-resource.min.js", "lib/wunderbar/vendor/angular-route.min.js", "lib/wunderbar/vendor/angular.min.js", "lib/wunderbar/vendor/bootstrap-theme.min.css", "lib/wunderbar/vendor/bootstrap.min.css", "lib/wunderbar/vendor/bootstrap.min.js", "lib/wunderbar/vendor/eventsource.min.js", "lib/wunderbar/vendor/jquery-1.11.2.min.js", "lib/wunderbar/vendor/marked.min.js", "lib/wunderbar/vendor/polymer-v0.0.20131003.min.js", "lib/wunderbar/vendor/react-dom-0.14.3.min.js", "lib/wunderbar/vendor/react-with-addons-0.14.3.min.js", "lib/wunderbar/vendor/stupidtable.min.js", "lib/wunderbar/vendor/underscore-min.js", "lib/wunderbar/version.rb", "lib/wunderbar/websocket.rb", "wunderbar.gemspec"]
12
+ s.files = ["wunderbar.gemspec", "README.md", "COPYING", "lib/wunderbar", "lib/wunderbar/angularjs", "lib/wunderbar/angularjs/resource.rb", "lib/wunderbar/angularjs/route.rb", "lib/wunderbar/angularjs.rb", "lib/wunderbar/asset.rb", "lib/wunderbar/backtick.rb", "lib/wunderbar/bootstrap", "lib/wunderbar/bootstrap/theme.rb", "lib/wunderbar/bootstrap.rb", "lib/wunderbar/builder.rb", "lib/wunderbar/cgi-methods.rb", "lib/wunderbar/coderay.rb", "lib/wunderbar/coffeescript.rb", "lib/wunderbar/cssproxy.rb", "lib/wunderbar/environment.rb", "lib/wunderbar/eventsource.rb", "lib/wunderbar/html-methods.rb", "lib/wunderbar/installation.rb", "lib/wunderbar/job-control.rb", "lib/wunderbar/jquery", "lib/wunderbar/jquery/filter.rb", "lib/wunderbar/jquery/stupidtable.rb", "lib/wunderbar/jquery.rb", "lib/wunderbar/listen.rb", "lib/wunderbar/logger.rb", "lib/wunderbar/markdown.rb", "lib/wunderbar/marked.rb", "lib/wunderbar/node.rb", "lib/wunderbar/pagedown.rb", "lib/wunderbar/polymer.rb", "lib/wunderbar/rack.rb", "lib/wunderbar/rails.rb", "lib/wunderbar/react.rb", "lib/wunderbar/script.rb", "lib/wunderbar/server.rb", "lib/wunderbar/sinatra.rb", "lib/wunderbar/underscore.rb", "lib/wunderbar/vendor", "lib/wunderbar/vendor/angular-resource.min.js", "lib/wunderbar/vendor/angular-route.min.js", "lib/wunderbar/vendor/angular.min.js", "lib/wunderbar/vendor/bootstrap-theme.min.css", "lib/wunderbar/vendor/bootstrap.min.css", "lib/wunderbar/vendor/bootstrap.min.js", "lib/wunderbar/vendor/eventsource.min.js", "lib/wunderbar/vendor/jquery-1.11.2.min.js", "lib/wunderbar/vendor/Markdown.Converter.js", "lib/wunderbar/vendor/marked.min.js", "lib/wunderbar/vendor/polymer-v0.0.20131003.min.js", "lib/wunderbar/vendor/react-dom-0.14.3.min.js", "lib/wunderbar/vendor/react-with-addons-0.14.3.min.js", "lib/wunderbar/vendor/stupidtable.min.js", "lib/wunderbar/vendor/underscore-min.js", "lib/wunderbar/version.rb", "lib/wunderbar/websocket.rb", "lib/wunderbar.rb"]
15
13
  s.homepage = "http://github.com/rubys/wunderbar"
16
14
  s.licenses = ["MIT"]
15
+ s.require_paths = ["lib"]
17
16
  s.required_ruby_version = Gem::Requirement.new(">= 1.9.3")
18
- s.rubygems_version = "2.4.5.1"
17
+ s.rubygems_version = "2.0.14"
19
18
  s.summary = "HTML Generator and CGI application support"
20
19
 
21
20
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wunderbar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.10
4
+ version: 1.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Ruby
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-11 00:00:00.000000000 Z
11
+ date: 2015-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  description: |2
@@ -32,16 +32,16 @@ executables: []
32
32
  extensions: []
33
33
  extra_rdoc_files: []
34
34
  files:
35
- - COPYING
35
+ - wunderbar.gemspec
36
36
  - README.md
37
- - lib/wunderbar.rb
38
- - lib/wunderbar/angularjs.rb
37
+ - COPYING
39
38
  - lib/wunderbar/angularjs/resource.rb
40
39
  - lib/wunderbar/angularjs/route.rb
40
+ - lib/wunderbar/angularjs.rb
41
41
  - lib/wunderbar/asset.rb
42
42
  - lib/wunderbar/backtick.rb
43
- - lib/wunderbar/bootstrap.rb
44
43
  - lib/wunderbar/bootstrap/theme.rb
44
+ - lib/wunderbar/bootstrap.rb
45
45
  - lib/wunderbar/builder.rb
46
46
  - lib/wunderbar/cgi-methods.rb
47
47
  - lib/wunderbar/coderay.rb
@@ -52,9 +52,9 @@ files:
52
52
  - lib/wunderbar/html-methods.rb
53
53
  - lib/wunderbar/installation.rb
54
54
  - lib/wunderbar/job-control.rb
55
- - lib/wunderbar/jquery.rb
56
55
  - lib/wunderbar/jquery/filter.rb
57
56
  - lib/wunderbar/jquery/stupidtable.rb
57
+ - lib/wunderbar/jquery.rb
58
58
  - lib/wunderbar/listen.rb
59
59
  - lib/wunderbar/logger.rb
60
60
  - lib/wunderbar/markdown.rb
@@ -69,7 +69,6 @@ files:
69
69
  - lib/wunderbar/server.rb
70
70
  - lib/wunderbar/sinatra.rb
71
71
  - lib/wunderbar/underscore.rb
72
- - lib/wunderbar/vendor/Markdown.Converter.js
73
72
  - lib/wunderbar/vendor/angular-resource.min.js
74
73
  - lib/wunderbar/vendor/angular-route.min.js
75
74
  - lib/wunderbar/vendor/angular.min.js
@@ -78,6 +77,7 @@ files:
78
77
  - lib/wunderbar/vendor/bootstrap.min.js
79
78
  - lib/wunderbar/vendor/eventsource.min.js
80
79
  - lib/wunderbar/vendor/jquery-1.11.2.min.js
80
+ - lib/wunderbar/vendor/Markdown.Converter.js
81
81
  - lib/wunderbar/vendor/marked.min.js
82
82
  - lib/wunderbar/vendor/polymer-v0.0.20131003.min.js
83
83
  - lib/wunderbar/vendor/react-dom-0.14.3.min.js
@@ -86,7 +86,7 @@ files:
86
86
  - lib/wunderbar/vendor/underscore-min.js
87
87
  - lib/wunderbar/version.rb
88
88
  - lib/wunderbar/websocket.rb
89
- - wunderbar.gemspec
89
+ - lib/wunderbar.rb
90
90
  homepage: http://github.com/rubys/wunderbar
91
91
  licenses:
92
92
  - MIT
@@ -97,17 +97,17 @@ require_paths:
97
97
  - lib
98
98
  required_ruby_version: !ruby/object:Gem::Requirement
99
99
  requirements:
100
- - - ">="
100
+ - - '>='
101
101
  - !ruby/object:Gem::Version
102
102
  version: 1.9.3
103
103
  required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  requirements:
105
- - - ">="
105
+ - - '>='
106
106
  - !ruby/object:Gem::Version
107
107
  version: '0'
108
108
  requirements: []
109
109
  rubyforge_project:
110
- rubygems_version: 2.4.5.1
110
+ rubygems_version: 2.0.14
111
111
  signing_key:
112
112
  specification_version: 4
113
113
  summary: HTML Generator and CGI application support