ardekantur-gantty 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/gantty.rb +9 -15
- data/spec/gantty_spec.rb +1 -0
- metadata +2 -2
data/lib/gantty.rb
CHANGED
@@ -323,7 +323,6 @@ module Gantty
|
|
323
323
|
#
|
324
324
|
class Task
|
325
325
|
|
326
|
-
attr_accessor :start, :duration, :end
|
327
326
|
attr_accessor :percent_complete, :coordinators, :priority, :color
|
328
327
|
|
329
328
|
# The dependency arrays of the task. Dependencies are defined at Task.
|
@@ -349,6 +348,7 @@ module Gantty
|
|
349
348
|
raise ArgumentError, "name cannot be blank" if t.length == 0
|
350
349
|
@name = t
|
351
350
|
else
|
351
|
+
# This is when we're probably getting a Nokogiri object, so attempt to parse that.
|
352
352
|
@name = t.attributes["name"]
|
353
353
|
@start = Date.strptime(t.attributes["start"])
|
354
354
|
@duration = t.attributes["duration"].to_i
|
@@ -444,20 +444,14 @@ module Gantty
|
|
444
444
|
end
|
445
445
|
|
446
446
|
# Attributes
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
end
|
456
|
-
|
457
|
-
def duration set = nil
|
458
|
-
return @duration unless set
|
459
|
-
self.duration = set
|
460
|
-
end
|
447
|
+
%w/ name start duration end /.each do |attribute|
|
448
|
+
define_method(attribute.to_sym) do |*args|
|
449
|
+
set = *args
|
450
|
+
set ||= nil
|
451
|
+
return self.instance_variable_get("@" + attribute) unless set
|
452
|
+
self.send("#{attribute}=".to_sym, set)
|
453
|
+
end
|
454
|
+
end
|
461
455
|
|
462
456
|
end
|
463
457
|
|
data/spec/gantty_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ardekantur-gantty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ardekantur
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-11-
|
12
|
+
date: 2008-11-26 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|