jsus 0.2.1 → 0.2.2

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.2.2
3
+ * Fixed dupes in structure json files
4
+
2
5
  == Version 0.2.1
3
6
  * Started adding cucumber features for command-line utility. Look into /features
4
7
  directory for reference
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
data/jsus.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{jsus}
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
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"]
data/lib/jsus/package.rb CHANGED
@@ -81,7 +81,7 @@ module Jsus
81
81
  end
82
82
 
83
83
  # Returns an array of provided tags names including those provided by linked external dependencies.
84
- def provides_names
84
+ def provides_names
85
85
  source_files.map {|s| s.provides_names(:short => true) }.flatten |
86
86
  linked_external_dependencies.map {|d| d.provides_names }.flatten
87
87
  end
@@ -148,7 +148,8 @@ module Jsus
148
148
  # Looks up all the external dependencies in the pool.
149
149
  def include_dependencies!
150
150
  source_files.each do |source|
151
- linked_external_dependencies << pool.lookup_dependencies(source) if pool
151
+ deps = pool.lookup_dependencies(source).to_a - @source_files.to_a
152
+ linked_external_dependencies << deps if pool
152
153
  end
153
154
  end
154
155
 
@@ -239,6 +239,17 @@ module Jsus
239
239
  def pool
240
240
  @pool
241
241
  end
242
+
243
+ def ==(other) # :nodoc:
244
+ eql?(other)
245
+ end
246
+
247
+ def eql?(other) # :nodoc:
248
+ filename == other.filename
249
+ end
242
250
 
251
+ def hash
252
+ [self.class, filename].hash
253
+ end
243
254
  end
244
255
  end
@@ -259,4 +259,18 @@ describe Jsus::SourceFile do
259
259
  end
260
260
  end
261
261
  end
262
+
263
+ describe "#==, eql, hash" do
264
+ it "should return true for source files pointing to the same physical file" do
265
+ subject.should == described_class.from_file(subject.filename)
266
+ subject.should eql(described_class.from_file(subject.filename))
267
+ subject.hash.should == described_class.from_file(subject.filename).hash
268
+ end
269
+
270
+ it "should return false for source files pointing to different physical files" do
271
+ subject.should_not == described_class.from_file("spec/data/Extensions/app/javascripts/Orwik/Extensions/Class.js")
272
+ subject.should_not eql(described_class.from_file("spec/data/Extensions/app/javascripts/Orwik/Extensions/Class.js"))
273
+ subject.hash.should_not == described_class.from_file("spec/data/Extensions/app/javascripts/Orwik/Extensions/Class.js").hash
274
+ end
275
+ end
262
276
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 1
9
- version: 0.2.1
8
+ - 2
9
+ version: 0.2.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Mark Abramov
@@ -285,7 +285,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
285
285
  requirements:
286
286
  - - ">="
287
287
  - !ruby/object:Gem::Version
288
- hash: -1746975261011115171
288
+ hash: -1177677951338357144
289
289
  segments:
290
290
  - 0
291
291
  version: "0"