directed-edge 0.2.3 → 0.3.0

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.2.3
1
+ 0.3.0
@@ -114,7 +114,7 @@ module DirectedEdge
114
114
  # :foo_bar to 'fooBar'
115
115
 
116
116
  def normalize_params!(hash)
117
- hash.each do |key, value|
117
+ hash.clone.each do |key, value|
118
118
  if !key.is_a?(String)
119
119
  hash.delete(key)
120
120
  key = key.to_s
@@ -788,7 +788,7 @@ module DirectedEdge
788
788
  type = type ? type.to_s : ''
789
789
  weight = link_element.attribute('weight').to_s.to_i
790
790
  target = link_element.text
791
- @links[type][target] = weight unless @links[type][target]
791
+ @links[type][target] = weight unless target.nil? || @links[type][target]
792
792
  end
793
793
 
794
794
  @tags.merge(list_from_document(document, 'tag'))
@@ -846,7 +846,7 @@ module DirectedEdge
846
846
  end
847
847
  end
848
848
 
849
- @tags_to_remove.each { |tag| item.add_element('tag').add_text(tag.to_s) }
849
+ @tags_to_remove.each { |tag| item.add_element('tag').add_text("#{tag}") }
850
850
  @preselected_to_remove.each { |p| item.add_element('preselected').add_text(p.to_s) }
851
851
  @blacklisted_to_remove.each { |b| item.add_element('blacklisted').add_text(b.to_s) }
852
852
  @properties_to_remove.each do |property|
@@ -862,12 +862,12 @@ module DirectedEdge
862
862
  element = item.add_element('link')
863
863
  element.add_attribute('type', type) unless type.empty?
864
864
  element.add_attribute('weight', weight.to_s) unless weight == 0
865
- element.add_text(link.to_s)
865
+ element.add_text("#{link}")
866
866
  end
867
867
  end
868
- @tags.each { |tag| item.add_element('tag').add_text(tag.to_s) }
869
- @preselected.each { |p| item.add_element('preselected').add_text(p.to_s) }
870
- @blacklisted.each { |b| item.add_element('blacklisted').add_text(b.to_s) }
868
+ @tags.each { |tag| item.add_element('tag').add_text("#{tag}") }
869
+ @preselected.each { |p| item.add_element('preselected').add_text("#{p}") }
870
+ @blacklisted.each { |b| item.add_element('blacklisted').add_text("#{b}") }
871
871
  @properties.each do |key, value|
872
872
  property = item.add_element('property')
873
873
  property.add_attribute('name', key.to_s)
@@ -164,7 +164,7 @@ class TestDirectedEdge < Test::Unit::TestCase
164
164
  second_item.destroy
165
165
  first_item.reload
166
166
 
167
- assert(0, first_item.links.length)
167
+ assert_equal(0, first_item.links.length)
168
168
  end
169
169
 
170
170
  def test_tags
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: directed-edge
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 2
9
8
  - 3
10
- version: 0.2.3
9
+ - 0
10
+ version: 0.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Directed Edge
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-22 00:00:00 +01:00
18
+ date: 2011-03-03 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency