git-ds 0.9.7.4 → 0.9.7.5
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +3 -0
- data/lib/git-ds/database.rb +13 -0
- data/lib/git-ds/model/property.rb +9 -2
- metadata +4 -4
data/ChangeLog
CHANGED
data/lib/git-ds/database.rb
CHANGED
@@ -239,6 +239,19 @@ if a staging index already exists.
|
|
239
239
|
exec { index.add(path, data, on_fs) }
|
240
240
|
end
|
241
241
|
|
242
|
+
=begin rdoc
|
243
|
+
Add files to the database *without* using ExecCmd or Transaction. Care must
|
244
|
+
be taken in using this as it does not sync/build the staging index, so it must
|
245
|
+
be wrapped in an ExecCmd or Transaction, or the index must be synced/built
|
246
|
+
after all of the fast_add calls are complete.
|
247
|
+
|
248
|
+
See Database#add.
|
249
|
+
=end
|
250
|
+
def fast_add(path, data='', on_fs=false)
|
251
|
+
# TODO: verify that this will suffice
|
252
|
+
index.add(path, data, on_fs)
|
253
|
+
end
|
254
|
+
|
242
255
|
=begin rdoc
|
243
256
|
Delete an object from the database.
|
244
257
|
=end
|
@@ -89,6 +89,15 @@ Property BLOB.
|
|
89
89
|
=end
|
90
90
|
def set(model, parent_path, value)
|
91
91
|
raise InvalidPropertyValueError.new(name, value) if not valid? value
|
92
|
+
val = convert_value(value)
|
93
|
+
write(model, path(parent_path), val + "\n")
|
94
|
+
val
|
95
|
+
end
|
96
|
+
|
97
|
+
=begin rdoc
|
98
|
+
Convert value to its internal (in-Git) representation.
|
99
|
+
=end
|
100
|
+
def convert_value(value)
|
92
101
|
val = value.to_s
|
93
102
|
|
94
103
|
if value.kind_of?(Array)
|
@@ -97,8 +106,6 @@ Property BLOB.
|
|
97
106
|
val = value.inspect
|
98
107
|
end
|
99
108
|
|
100
|
-
write(model, path(parent_path), val + "\n")
|
101
|
-
|
102
109
|
val
|
103
110
|
end
|
104
111
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-ds
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
9
|
- 7
|
10
|
-
-
|
11
|
-
version: 0.9.7.
|
10
|
+
- 5
|
11
|
+
version: 0.9.7.5
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- TG Community
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-07-
|
19
|
+
date: 2011-07-08 00:00:00 -04:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|