jsus 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,4 +1,7 @@
1
1
  = Jsus Changelog
2
+ == Version 0.3.1
3
+ * Added wildcard support for Jsus::Middleware
4
+
2
5
  == Version 0.3.0
3
6
  * Added Jsus::Middleware for rack middleware stuff. Yay!
4
7
 
data/Rakefile CHANGED
@@ -37,6 +37,7 @@ require 'cucumber'
37
37
  require 'cucumber/rake/task'
38
38
 
39
39
  Cucumber::Rake::Task.new(:features) do |t|
40
+ t.cucumber_opts = %w{--exclude compression\.feature} if RUBY_PLATFORM =~ /java/
40
41
  end
41
42
 
42
43
  task :default => [:spec, :features]
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{jsus}
8
- s.version = "0.3.0"
8
+ s.version = "0.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Mark Abramov"]
12
- s.date = %q{2011-05-17}
12
+ s.date = %q{2011-05-19}
13
13
  s.default_executable = %q{jsus}
14
14
  s.description = %q{Javascript packager and dependency resolver}
15
15
  s.email = %q{markizko@gmail.com}
@@ -19,15 +19,15 @@ module Jsus
19
19
  #
20
20
  # Examples:
21
21
  #
22
- # GET /javascripts/jsus/Mootools.Core+Mootools.More
22
+ # GET /javascripts/jsus/require/Mootools.Core+Mootools.More
23
23
  # merges packages named Mootools.Core and Mootools.More with all the
24
24
  # dependencies and outputs the result.
25
25
  #
26
- # GET /javascripts/jsus/Mootools.More~Mootools.Core
26
+ # GET /javascripts/jsus/require/Mootools.More~Mootools.Core
27
27
  # returns package Mootools.More with all the dependencies MINUS any of
28
28
  # Mootools.Core dependencies.
29
29
  #
30
- # GET /javascripts/jsus/Mootools.Core:Class+Mootools.More:Fx
30
+ # GET /javascripts/jsus/require/Mootools.Core:Class+Mootools.More:Fx
31
31
  # same thing but for source files providing Mootools.Core/Class and
32
32
  # Mootools.More/Fx
33
33
  #
@@ -128,9 +128,16 @@ module Jsus
128
128
  package.include_dependencies!
129
129
  package.linked_external_dependencies.to_a + package.source_files.to_a
130
130
  elsif source_file = pool.lookup(source_file_or_package)
131
- pool.lookup_dependencies(source_file) << source_file
131
+ pool.lookup_dependencies(source_file).to_a << source_file
132
132
  else
133
- []
133
+ # Try using arg as mask
134
+ mask = source_file_or_package.to_s
135
+ if !(mask =~ /^\s*$/) && !(source_files = pool.provides_tree.glob(mask)).empty?
136
+ source_files.map {|source| get_associated_files(source) }.flatten
137
+ else
138
+ # No dice
139
+ []
140
+ end
134
141
  end
135
142
  end # get_associated_files
136
143
 
@@ -177,6 +177,34 @@ describe Jsus::Middleware do
177
177
  body.index("script: Color.js").should > body.index("script: Core.js")
178
178
  end
179
179
  end
180
+
181
+
182
+ describe "using wildcard /javascripts/jsus/require/Package:Input.*.js" do
183
+ let(:path) { "/javascripts/jsus/require/Package:Input.*.js" }
184
+
185
+ it "should be successful" do
186
+ get(path).should be_successful
187
+ end
188
+
189
+ it "should respond with type text/javascript" do
190
+ get(path).content_type.should == "text/javascript"
191
+ end
192
+
193
+ it "should respond with generated content" do
194
+ get(path).body.should include("script: Input.Color.js")
195
+ end
196
+
197
+ it "should include dependencies by default" do
198
+ get(path).body.should include("script: Color.js")
199
+ get(path).body.should include("script: Core.js")
200
+ end
201
+
202
+ it "should preserve correct order" do
203
+ body = get(path).body
204
+ body.index("script: Color.js").should < body.index("script: Input.Color.js")
205
+ body.index("script: Color.js").should > body.index("script: Core.js")
206
+ end
207
+ end
180
208
  end
181
209
 
182
210
  describe "for invalid paths" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsus
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 0
10
- version: 0.3.0
9
+ - 1
10
+ version: 0.3.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Mark Abramov
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-17 00:00:00 +04:00
18
+ date: 2011-05-19 00:00:00 +04:00
19
19
  default_executable: jsus
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency