soup 0.9.9 → 0.9.9.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/soup.rb +7 -4
- metadata +3 -3
data/Rakefile
CHANGED
data/lib/soup.rb
CHANGED
@@ -91,7 +91,7 @@ class Soup
|
|
91
91
|
File.open(path_for(attributes[:name]), 'w') do |f|
|
92
92
|
content = attributes.delete(:content)
|
93
93
|
f.write content
|
94
|
-
f.write attributes.to_yaml.gsub(/^---\s/, attribute_token)
|
94
|
+
f.write attributes.to_yaml.gsub(/^---\s/, attribute_token) if attributes.any?
|
95
95
|
end
|
96
96
|
end
|
97
97
|
|
@@ -99,9 +99,12 @@ class Soup
|
|
99
99
|
path = path_for(name)
|
100
100
|
if File.exist?(path)
|
101
101
|
file = File.read(path)
|
102
|
-
attribute_start = file.index(attribute_token)
|
103
|
-
|
104
|
-
|
102
|
+
if attribute_start = file.index(attribute_token)
|
103
|
+
content = file.slice(0...attribute_start)
|
104
|
+
attributes = YAML.load(file.slice(attribute_start..-1)).merge(:content => content)
|
105
|
+
else
|
106
|
+
attributes = {:content => file, :name => name}
|
107
|
+
end
|
105
108
|
Snip.new(attributes, self)
|
106
109
|
else
|
107
110
|
nil
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.9
|
4
|
+
version: 0.9.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Adam
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-10
|
12
|
+
date: 2009-11-10 00:00:00 +00:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -54,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
54
54
|
requirements: []
|
55
55
|
|
56
56
|
rubyforge_project: soup
|
57
|
-
rubygems_version: 1.3.
|
57
|
+
rubygems_version: 1.3.5
|
58
58
|
signing_key:
|
59
59
|
specification_version: 3
|
60
60
|
summary: A super-simple data store
|