soup 1.0.2 → 1.0.3
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/Rakefile +1 -1
- data/lib/soup/backends/file_backend.rb +1 -0
- data/test/file_backend_test.rb +5 -0
- metadata +6 -6
data/Rakefile
CHANGED
@@ -23,6 +23,7 @@ class Soup
|
|
23
23
|
content = data[0, attribute_start].strip
|
24
24
|
attributes = default_attributes.merge(YAML.load(data[attribute_start, data.length]))
|
25
25
|
else
|
26
|
+
content = data
|
26
27
|
attributes = default_attributes
|
27
28
|
end
|
28
29
|
attributes.update(:content => content) if content && content.length > 0
|
data/test/file_backend_test.rb
CHANGED
@@ -38,6 +38,11 @@ of the snip
|
|
38
38
|
assert_equal "blahface", @soup["blahface"].name
|
39
39
|
end
|
40
40
|
|
41
|
+
should "not require snip attributes to give content" do
|
42
|
+
write_snip "test", "snip content"
|
43
|
+
assert_equal "snip content", @soup["test"].content
|
44
|
+
end
|
45
|
+
|
41
46
|
should "take updated_at and created_at from file timestamps if not supplied" do
|
42
47
|
@soup << {:name => "snip", :content => "whatever"}
|
43
48
|
time = Time.parse("2010-11-04 14:56")
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 17
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 3
|
10
|
+
version: 1.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- James Adam
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2011-02-22 00:00:00 +00:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
89
|
requirements: []
|
90
90
|
|
91
91
|
rubyforge_project:
|
92
|
-
rubygems_version: 1.
|
92
|
+
rubygems_version: 1.4.1
|
93
93
|
signing_key:
|
94
94
|
specification_version: 3
|
95
95
|
summary: A super-simple data store
|