soup 1.0.13 → 1.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/lib/soup/backends/file_backend.rb +16 -13
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18fe77d82b9d4f4b75d02b84e763dd0734a5e88d
|
4
|
+
data.tar.gz: 2a5615ee341ac63134c9bf1c8e697592fda14707
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e13bb835c158734560ef3906335a6c4fcafaaf2941a6e7742d689918aa24e13d9ceb2945a1dea40781e9c082b1fb6b81c5824423319c78b270987ac6c84a06aa
|
7
|
+
data.tar.gz: bdaea59a78bd3534e5c9c243baf9649ee6a996e67497cb978ed0134f37f90dc70b0a00c016ecf9a4568e341c697fa41105f11f3ce0d9c91e3833958aaa425efa
|
data/Rakefile
CHANGED
@@ -54,20 +54,23 @@ class Soup
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def load_snip_from_path(path, name)
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
57
|
+
snip = nil
|
58
|
+
File.open(path) do |file|
|
59
|
+
data = file.read
|
60
|
+
default_attributes = {:name => name, :updated_at => file.mtime, :created_at => file.mtime}
|
61
|
+
if attribute_start = data.index("\n:")
|
62
|
+
content = data[0, attribute_start].strip
|
63
|
+
attributes = default_attributes.merge(YAML.load(data[attribute_start, data.length]))
|
64
|
+
else
|
65
|
+
content = data
|
66
|
+
attributes = default_attributes
|
67
|
+
end
|
68
|
+
attributes.update(:content => content) if content && content.length > 0
|
69
|
+
extension = File.extname(path).gsub(/^\./, '')
|
70
|
+
attributes.update(:extension => extension) if extension != "snip"
|
71
|
+
snip = Snip.new(attributes, self)
|
66
72
|
end
|
67
|
-
|
68
|
-
extension = File.extname(path).gsub(/^\./, '')
|
69
|
-
attributes.update(:extension => extension) if extension != "snip"
|
70
|
-
Snip.new(attributes, self)
|
73
|
+
snip
|
71
74
|
end
|
72
75
|
|
73
76
|
def path_for(name, extension=nil)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Adam
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kintama
|
@@ -86,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
86
86
|
version: '0'
|
87
87
|
requirements: []
|
88
88
|
rubyforge_project:
|
89
|
-
rubygems_version: 2.5.
|
89
|
+
rubygems_version: 2.5.2
|
90
90
|
signing_key:
|
91
91
|
specification_version: 4
|
92
92
|
summary: A super-simple data store
|