git-ds 0.9.4.4 → 0.9.5.1
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/ChangeLog +4 -0
- data/lib/git-ds/model/item.rb +19 -1
- metadata +4 -4
data/ChangeLog
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
2011-04-18 : mkfs <mkfs@thoughtgang.org>
|
2
|
+
* Added ModelItem.exist? class member
|
3
|
+
* Added convenience property method aliases to ModelItem
|
4
|
+
|
1
5
|
2011-04-15 : mkfs <mkfs@thoughtgang.org>
|
2
6
|
* Removed newline from Repo.top_level
|
3
7
|
* Added exception handling to exec_in_git
|
data/lib/git-ds/model/item.rb
CHANGED
@@ -76,6 +76,14 @@ Return the path to an instance of the object under parent_path.
|
|
76
76
|
path += ident.to_s
|
77
77
|
end
|
78
78
|
|
79
|
+
=begin rdoc
|
80
|
+
Return true if the specified instance of this ModelItem class exists in the
|
81
|
+
model (i.e. database has 'ident' in it already).
|
82
|
+
=end
|
83
|
+
def exist?(parent, ident)
|
84
|
+
parent.model.include? instance_path(parent.path, ident)
|
85
|
+
end
|
86
|
+
|
79
87
|
=begin rdoc
|
80
88
|
List all children of this ModelItem class.
|
81
89
|
|
@@ -345,6 +353,8 @@ Convenience method for reading Integer properties.
|
|
345
353
|
val ? property_cache[name] = val.to_i : nil
|
346
354
|
end
|
347
355
|
|
356
|
+
alias :i_property :integer_property
|
357
|
+
|
348
358
|
=begin rdoc
|
349
359
|
Convenience method for reading Float properties.
|
350
360
|
=end
|
@@ -353,14 +363,18 @@ Convenience method for reading Float properties.
|
|
353
363
|
val ? property_cache[name] = val.to_f : nil
|
354
364
|
end
|
355
365
|
|
366
|
+
alias :f_property :float_property
|
367
|
+
|
356
368
|
=begin rdoc
|
357
369
|
Convenience method for reading Time (aka timestamp) properties.
|
358
370
|
=end
|
359
|
-
def
|
371
|
+
def timestamp_property(name)
|
360
372
|
val = property(name)
|
361
373
|
val && (! val.empty?) ? property_cache[name] = Time.parse(val) : nil
|
362
374
|
end
|
363
375
|
|
376
|
+
alias :ts_property :timestamp_property
|
377
|
+
|
364
378
|
=begin rdoc
|
365
379
|
Convenience method for reading Boolean properties.
|
366
380
|
=end
|
@@ -369,6 +383,8 @@ Convenience method for reading Boolean properties.
|
|
369
383
|
(val && val == 'true')
|
370
384
|
end
|
371
385
|
|
386
|
+
alias :b_property :bool_property
|
387
|
+
|
372
388
|
=begin rdoc
|
373
389
|
Convenience method for reading Array properties.
|
374
390
|
|
@@ -382,6 +398,8 @@ Classes which perform their own encoding can choose a different delimiter.
|
|
382
398
|
val ? (property_cache[name] = val.split(delim)) : nil
|
383
399
|
end
|
384
400
|
|
401
|
+
alias :a_property :array_property
|
402
|
+
|
385
403
|
=begin rdoc
|
386
404
|
Set the value of a specific property.
|
387
405
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-ds
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.5.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,12 +9,12 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-04-
|
12
|
+
date: 2011-04-18 00:00:00.000000000 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: grit
|
17
|
-
requirement: &
|
17
|
+
requirement: &19161300 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,7 +22,7 @@ dependencies:
|
|
22
22
|
version: 2.2.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *19161300
|
26
26
|
description: A hierarchical datastore based on Git.
|
27
27
|
email: community@thoughtgang.org
|
28
28
|
executables: []
|