cards 0.9.1 → 0.10
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/CHANGES.txt +5 -0
- data/Rakefile +6 -1
- data/examples/csv to dot/generate_card_walls +1 -1
- data/examples/custom csv builder/generate_card_wall +1 -1
- data/examples/importing into tracker api/generate_card_wall +4 -1
- data/examples/numbers to omnigraffle/generate_card_walls +5 -1
- data/lib/cards.rb +13 -9
- data/lib/cards/card.rb +1 -1
- data/lib/cards/card_wall.rb +4 -6
- data/lib/cards/{writers/dot_writer.rb → dot_writer.rb} +0 -0
- data/lib/cards/extensions.rb +0 -14
- data/lib/cards/{writers/graffle_writer.rb → graffle_writer.rb} +4 -0
- data/lib/cards/layouts/column_layout.rb +25 -23
- data/lib/cards/layouts/nil_layout.rb +10 -8
- data/lib/cards/layouts/row_layout.rb +17 -15
- data/lib/cards/numbers_parser.rb +3 -0
- data/lib/cards/{writers/text_writer.rb → text_writer.rb} +0 -0
- data/spec/cards/card_spec.rb +5 -8
- data/spec/cards/card_wall_spec.rb +0 -1
- data/spec/cards/{writers/dot_writer_spec.rb → dot_writer_spec.rb} +2 -2
- data/spec/cards/numbers_parser_spec.rb +1 -1
- data/spec/cards/{writers/text_writer_spec.rb → text_writer_spec.rb} +1 -1
- data/spec/spec_helper.rb +2 -5
- metadata +8 -11
- data/lib/cards/builder.rb +0 -9
data/CHANGES.txt
CHANGED
data/Rakefile
CHANGED
|
@@ -3,12 +3,17 @@ gem "rspec"
|
|
|
3
3
|
gem "hoe"
|
|
4
4
|
|
|
5
5
|
require 'rake/clean'
|
|
6
|
+
require 'spec/rake/spectask'
|
|
6
7
|
require 'hoe'
|
|
7
8
|
|
|
8
9
|
require 'lib/cards'
|
|
9
10
|
|
|
11
|
+
Spec::Rake::SpecTask.new(:spec) do |t|
|
|
12
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
|
13
|
+
end
|
|
14
|
+
|
|
10
15
|
desc "Default Task"
|
|
11
|
-
task :default => [:generate_manifest]
|
|
16
|
+
task :default => [:spec, :generate_manifest]
|
|
12
17
|
|
|
13
18
|
task :generate_manifest do
|
|
14
19
|
File.open("Manifest.txt", "w") do |f|
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
-
require
|
|
2
|
+
require 'rubygems'
|
|
3
|
+
$LOAD_PATH << File.dirname(__FILE__) + "/../../lib"
|
|
4
|
+
require 'cards'
|
|
5
|
+
|
|
3
6
|
gem 'rest-client', ">= 0.9"
|
|
4
7
|
require 'rest_client'
|
|
5
8
|
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
-
require
|
|
2
|
+
require 'rubygems'
|
|
3
|
+
$LOAD_PATH << File.dirname(__FILE__) + "/../../lib"
|
|
4
|
+
require 'cards'
|
|
5
|
+
require 'cards/numbers_parser'
|
|
6
|
+
require 'cards/graffle_writer'
|
|
3
7
|
|
|
4
8
|
# this requires numbers '09, before that you must export to csv and use the csv parser
|
|
5
9
|
|
data/lib/cards.rb
CHANGED
|
@@ -1,25 +1,29 @@
|
|
|
1
1
|
$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__))
|
|
2
2
|
|
|
3
|
-
# this is making this a mac only distro, I'm afraid
|
|
4
3
|
require 'rubygems'
|
|
5
|
-
gem '
|
|
6
|
-
require '
|
|
4
|
+
gem 'activesupport'
|
|
5
|
+
require 'activesupport'
|
|
7
6
|
|
|
8
7
|
require 'cards/extensions'
|
|
9
|
-
require 'cards/builder'
|
|
10
8
|
require 'cards/csv_parser'
|
|
11
|
-
require 'cards/numbers_parser'
|
|
12
9
|
|
|
10
|
+
require 'cards/layouts/column_layout'
|
|
11
|
+
require 'cards/layouts/row_layout'
|
|
12
|
+
require 'cards/layouts/nil_layout'
|
|
13
|
+
|
|
14
|
+
require 'cards/card'
|
|
13
15
|
require 'cards/card_wall'
|
|
14
|
-
|
|
15
|
-
require 'cards/writers/dot_writer'
|
|
16
|
-
require 'cards/writers/graffle_writer'
|
|
16
|
+
require 'cards/dot_writer'
|
|
17
17
|
|
|
18
18
|
# csv builders
|
|
19
19
|
require 'cards/csv_builder'
|
|
20
20
|
require 'cards/master_story_list'
|
|
21
21
|
require 'cards/tracker_csv'
|
|
22
22
|
|
|
23
|
+
# osx specific - require them explicitly
|
|
24
|
+
#require 'cards/numbers_parser'
|
|
25
|
+
#require 'cards/writers/graffle_writer'
|
|
26
|
+
|
|
23
27
|
module Cards
|
|
24
|
-
VERSION = "0.
|
|
28
|
+
VERSION = "0.10"
|
|
25
29
|
end
|
data/lib/cards/card.rb
CHANGED
data/lib/cards/card_wall.rb
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
require 'cards/builder'
|
|
2
|
-
|
|
3
1
|
module Cards
|
|
4
|
-
class CardWall
|
|
2
|
+
class CardWall
|
|
5
3
|
def define(&block)
|
|
6
4
|
DefinitionContext.new(self).instance_eval(&block)
|
|
7
5
|
self
|
|
@@ -34,7 +32,7 @@ module Cards
|
|
|
34
32
|
@handlers = []
|
|
35
33
|
@layouts = []
|
|
36
34
|
@root = Card.new("root")
|
|
37
|
-
@root.layout = RowLayout.new
|
|
35
|
+
@root.layout = Layouts::RowLayout.new
|
|
38
36
|
@root.y = -1
|
|
39
37
|
@last_cards = [@root]
|
|
40
38
|
end
|
|
@@ -76,13 +74,13 @@ module Cards
|
|
|
76
74
|
end
|
|
77
75
|
|
|
78
76
|
def row(name, *options)
|
|
79
|
-
@this.add_handler(name, RowLayout.new(*options)) do |name, row|
|
|
77
|
+
@this.add_handler(name, Layouts::RowLayout.new(*options)) do |name, row|
|
|
80
78
|
Card.new(name)
|
|
81
79
|
end
|
|
82
80
|
end
|
|
83
81
|
|
|
84
82
|
def column(name, *options)
|
|
85
|
-
@this.add_handler(name, ColumnLayout.new(*options)) do |name, row|
|
|
83
|
+
@this.add_handler(name, Layouts::ColumnLayout.new(*options)) do |name, row|
|
|
86
84
|
c = Card.new(name)
|
|
87
85
|
yield c, row if block_given?
|
|
88
86
|
c
|
|
File without changes
|
data/lib/cards/extensions.rb
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
class String
|
|
2
|
-
def blank?
|
|
3
|
-
self.size == 0 || self.strip.size == 0
|
|
4
|
-
end
|
|
5
|
-
|
|
6
2
|
def no_spaces
|
|
7
3
|
self.gsub(' ', '\\ ')
|
|
8
4
|
end
|
|
@@ -26,12 +22,6 @@ class String
|
|
|
26
22
|
end
|
|
27
23
|
|
|
28
24
|
class Array
|
|
29
|
-
def sum
|
|
30
|
-
s = 0
|
|
31
|
-
each {|i| s += i}
|
|
32
|
-
s
|
|
33
|
-
end
|
|
34
|
-
|
|
35
25
|
def widths
|
|
36
26
|
map {|c| c.width}
|
|
37
27
|
end
|
|
@@ -48,10 +38,6 @@ class Numeric
|
|
|
48
38
|
end
|
|
49
39
|
|
|
50
40
|
class Object
|
|
51
|
-
def blank?
|
|
52
|
-
nil?
|
|
53
|
-
end
|
|
54
|
-
|
|
55
41
|
def dump_methods(ignore = Object)
|
|
56
42
|
ignore = ignore.instance_methods if ignore.is_a? Class
|
|
57
43
|
p (methods - ignore).sort
|
|
@@ -1,34 +1,36 @@
|
|
|
1
1
|
require 'enumerator'
|
|
2
2
|
|
|
3
3
|
module Cards
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
module Layouts
|
|
5
|
+
class ColumnLayout
|
|
6
|
+
def initialize(options = {})
|
|
7
|
+
@wrap_at = options.delete(:wrap_at) || 10
|
|
8
|
+
end
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
def layout(card)
|
|
11
|
+
x = card.x
|
|
12
|
+
card.children.each_slice(@wrap_at) do |slice|
|
|
13
|
+
y = card.y + 1
|
|
14
|
+
slice.each do |child|
|
|
15
|
+
child.x, child.y = x, y
|
|
16
|
+
child.layout
|
|
17
|
+
y += child.height
|
|
18
|
+
end
|
|
19
|
+
x += slice.widths.max
|
|
17
20
|
end
|
|
18
|
-
x += slice.widths.max
|
|
19
21
|
end
|
|
20
|
-
end
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
def width(card)
|
|
24
|
+
width = 0
|
|
25
|
+
card.children.each_slice(@wrap_at) do |slice|
|
|
26
|
+
width += slice.widths.max
|
|
27
|
+
end
|
|
28
|
+
width
|
|
26
29
|
end
|
|
27
|
-
width
|
|
28
|
-
end
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
def height(card)
|
|
32
|
+
card.children.heights.sum
|
|
33
|
+
end
|
|
32
34
|
end
|
|
33
35
|
end
|
|
34
|
-
end
|
|
36
|
+
end
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
module Cards
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
module Layouts
|
|
3
|
+
class NilLayout
|
|
4
|
+
def layout(card)
|
|
5
|
+
end
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
def width(card)
|
|
8
|
+
1
|
|
9
|
+
end
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
def height(card)
|
|
12
|
+
1
|
|
13
|
+
end
|
|
12
14
|
end
|
|
13
15
|
end
|
|
14
16
|
end
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
module Cards
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
module Layouts
|
|
3
|
+
class RowLayout
|
|
4
|
+
def layout(card)
|
|
5
|
+
x = card.x
|
|
6
|
+
card.children.each_with_index do |child, i|
|
|
7
|
+
child.x = x
|
|
8
|
+
child.y = card.y + 1
|
|
9
|
+
child.layout
|
|
10
|
+
x += child.width
|
|
11
|
+
end
|
|
10
12
|
end
|
|
11
|
-
end
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
def width(card)
|
|
15
|
+
card.children.map {|c| c.width}.sum
|
|
16
|
+
end
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
def height(card)
|
|
19
|
+
card.children.map {|c| c.height}.max
|
|
20
|
+
end
|
|
19
21
|
end
|
|
20
22
|
end
|
|
21
|
-
end
|
|
23
|
+
end
|
data/lib/cards/numbers_parser.rb
CHANGED
|
File without changes
|
data/spec/cards/card_spec.rb
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
require File.dirname(__FILE__) + '/../spec_helper'
|
|
2
2
|
|
|
3
|
-
require 'cards/card'
|
|
4
|
-
require 'cards/layouts/row_layout'
|
|
5
|
-
require 'cards/layouts/column_layout'
|
|
6
3
|
include Cards
|
|
7
4
|
|
|
8
5
|
module Cards
|
|
@@ -68,7 +65,7 @@ de"
|
|
|
68
65
|
|
|
69
66
|
def new_card(name)
|
|
70
67
|
c = Card.new(name)
|
|
71
|
-
c.layout = RowLayout.new
|
|
68
|
+
c.layout = Layouts::RowLayout.new
|
|
72
69
|
c
|
|
73
70
|
end
|
|
74
71
|
end
|
|
@@ -77,8 +74,8 @@ describe Card, "column layout" do
|
|
|
77
74
|
include Cards
|
|
78
75
|
|
|
79
76
|
before do
|
|
80
|
-
a.layout = RowLayout.new
|
|
81
|
-
@layout = ColumnLayout.new
|
|
77
|
+
a.layout = Layouts::RowLayout.new
|
|
78
|
+
@layout = Layouts::ColumnLayout.new
|
|
82
79
|
end
|
|
83
80
|
|
|
84
81
|
it "should have 1 column" do
|
|
@@ -96,7 +93,7 @@ bcd
|
|
|
96
93
|
|
|
97
94
|
it "should show with 2 rows and then columns" do
|
|
98
95
|
a.add(b, c, d)
|
|
99
|
-
a.children.each {|child| child.layout = RowLayout.new}
|
|
96
|
+
a.children.each {|child| child.layout = Layouts::RowLayout.new}
|
|
100
97
|
b.add(e, f, g)
|
|
101
98
|
d.add(h)
|
|
102
99
|
h.add(i, j)
|
|
@@ -112,7 +109,7 @@ efg h
|
|
|
112
109
|
end
|
|
113
110
|
|
|
114
111
|
it "should wrap" do
|
|
115
|
-
@layout = ColumnLayout.new(:wrap_at => 3)
|
|
112
|
+
@layout = Layouts::ColumnLayout.new(:wrap_at => 3)
|
|
116
113
|
a.add(b, c, d)
|
|
117
114
|
c.add(e, f, g, h, i, j, k)
|
|
118
115
|
d.add(l, m)
|
data/spec/spec_helper.rb
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
require File.dirname(__FILE__) + "/../lib/cards"
|
|
2
2
|
|
|
3
|
-
require "rubygems"
|
|
4
3
|
gem "rspec"
|
|
5
|
-
gem "mocha"
|
|
6
4
|
gem "file_sandbox"
|
|
7
5
|
|
|
8
|
-
require 'cards/
|
|
9
|
-
require 'cards/writers/text_writer'
|
|
6
|
+
require 'cards/text_writer'
|
|
10
7
|
|
|
11
8
|
Spec::Runner.configure do |config|
|
|
12
9
|
#config.mock_with :mocha
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cards
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: "0.10"
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jeremy Lightsmith
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2009-03-
|
|
12
|
+
date: 2009-03-31 00:00:00 -07:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
@@ -40,7 +40,7 @@ dependencies:
|
|
|
40
40
|
requirements:
|
|
41
41
|
- - ">="
|
|
42
42
|
- !ruby/object:Gem::Version
|
|
43
|
-
version: 1.
|
|
43
|
+
version: 1.11.0
|
|
44
44
|
version:
|
|
45
45
|
description: CardWallGen is a program that reads a requirements map and generates a view of it. Typically it reads it from excel or csv and generates a graphical view in visio or omnigraffle, though it may also generate another csv view of it.
|
|
46
46
|
email: jeremy.lightsmith@gmail.com
|
|
@@ -74,12 +74,13 @@ files:
|
|
|
74
74
|
- examples/numbers to omnigraffle/generate_card_walls
|
|
75
75
|
- examples/numbers to omnigraffle/Voting Example.numbers
|
|
76
76
|
- lib/cards
|
|
77
|
-
- lib/cards/builder.rb
|
|
78
77
|
- lib/cards/card.rb
|
|
79
78
|
- lib/cards/card_wall.rb
|
|
80
79
|
- lib/cards/csv_builder.rb
|
|
81
80
|
- lib/cards/csv_parser.rb
|
|
81
|
+
- lib/cards/dot_writer.rb
|
|
82
82
|
- lib/cards/extensions.rb
|
|
83
|
+
- lib/cards/graffle_writer.rb
|
|
83
84
|
- lib/cards/layouts
|
|
84
85
|
- lib/cards/layouts/column_layout.rb
|
|
85
86
|
- lib/cards/layouts/nil_layout.rb
|
|
@@ -89,22 +90,18 @@ files:
|
|
|
89
90
|
- lib/cards/swim_lanes.rb
|
|
90
91
|
- lib/cards/tabular_parser.rb
|
|
91
92
|
- lib/cards/text.rb
|
|
93
|
+
- lib/cards/text_writer.rb
|
|
92
94
|
- lib/cards/tracker_csv.rb
|
|
93
|
-
- lib/cards/writers
|
|
94
|
-
- lib/cards/writers/dot_writer.rb
|
|
95
|
-
- lib/cards/writers/graffle_writer.rb
|
|
96
|
-
- lib/cards/writers/text_writer.rb
|
|
97
95
|
- lib/cards.rb
|
|
98
96
|
- spec/cards
|
|
99
97
|
- spec/cards/card_spec.rb
|
|
100
98
|
- spec/cards/card_wall_spec.rb
|
|
101
99
|
- spec/cards/csv_parser_spec.rb
|
|
100
|
+
- spec/cards/dot_writer_spec.rb
|
|
102
101
|
- spec/cards/extensions_spec.rb
|
|
103
102
|
- spec/cards/numbers_parser_spec.rb
|
|
104
103
|
- spec/cards/swim_lanes_spec.rb
|
|
105
|
-
- spec/cards/
|
|
106
|
-
- spec/cards/writers/dot_writer_spec.rb
|
|
107
|
-
- spec/cards/writers/text_writer_spec.rb
|
|
104
|
+
- spec/cards/text_writer_spec.rb
|
|
108
105
|
- spec/fixtures
|
|
109
106
|
- spec/fixtures/Voting Example.numbers
|
|
110
107
|
- spec/spec_helper.rb
|