artifacts 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,7 +20,7 @@ class Artifacts
20
20
  init :creator, :summary
21
21
 
22
22
  def self.priority_width
23
- all.map{|n|n.priority.to_s}.sort{|a,b|a.length <=> b.length}.first.length
23
+ all.map{|n|n.priority.to_s}.sort{|a,b|a.length <=> b.length}.last.length
24
24
  end
25
25
 
26
26
  def open?
@@ -70,6 +70,12 @@ class Artifacts
70
70
  ( comments.size > 0 ? (indentation + "comments :\n" + comments.join("\n")) : '' )
71
71
  end
72
72
 
73
+ def priority
74
+ open_depended_on_by.inject( @priority ) do |priority,artifact|
75
+ priority += artifact.priority
76
+ end
77
+ end
78
+
73
79
  end
74
80
 
75
81
  end
@@ -46,6 +46,7 @@ class Artifacts
46
46
  unless args.select{|n|n=~/^(?:-a|--all)$/}.empty?
47
47
  @closed = true
48
48
  @open = true
49
+ @dependants = true
49
50
  args.delete( '-a' )
50
51
  args.delete( '--all' )
51
52
  end
@@ -206,8 +207,8 @@ class Artifacts
206
207
  end
207
208
 
208
209
  def tags( *args )
209
- Tag.all.each do |tag|
210
- puts tag.inspect
210
+ @artifacts.map{|n|n.tags}.flatten.uniq.sort.each do |tag|
211
+ puts "#{tag}: #{@artifacts.select{|n|n.tags.index(tag)}.map{|n|n.id.to_s}.join(',')}"
211
212
  end
212
213
  end
213
214
 
@@ -15,6 +15,9 @@ class Artifacts
15
15
  def inspect
16
16
  "#{to_s}: #{artifacts.map{|n|n.id}.join(',')}"
17
17
  end
18
+ def <=>( other )
19
+ self.name <=> other.name
20
+ end
18
21
  end
19
22
 
20
23
  end
@@ -1,3 +1,3 @@
1
1
  class Artifacts
2
- VERSION = "2.1.1"
2
+ VERSION = "2.1.2"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 2
7
7
  - 1
8
- - 1
9
- version: 2.1.1
8
+ - 2
9
+ version: 2.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Clive Crous
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-02-17 00:00:00 +02:00
17
+ date: 2011-02-20 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -114,7 +114,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ">="
116
116
  - !ruby/object:Gem::Version
117
- hash: -192865329
117
+ hash: -322010195
118
118
  segments:
119
119
  - 0
120
120
  version: "0"
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  requirements:
124
124
  - - ">="
125
125
  - !ruby/object:Gem::Version
126
- hash: -192865329
126
+ hash: -322010195
127
127
  segments:
128
128
  - 0
129
129
  version: "0"