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.
@@ -1,5 +1,10 @@
1
1
  = Change Log
2
2
 
3
+ == Version 0.10
4
+
5
+ * plays nice w/ active record
6
+ * plays nice w/ non osx
7
+
3
8
  == Version 0.9
4
9
 
5
10
  * example that directly imports into tracker api
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,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'rubygems'
3
- gem 'cards'
3
+ $LOAD_PATH << File.dirname(__FILE__) + "/../../lib"
4
4
  require 'cards'
5
5
  include Cards
6
6
 
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'rubygems'
3
- gem 'cards'
3
+ $LOAD_PATH << File.dirname(__FILE__) + "/../../lib"
4
4
  require 'cards'
5
5
  include Cards
6
6
 
@@ -1,5 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + "/../../lib/cards" # you probably want to include the gem version
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 File.dirname(__FILE__) + "/../../lib/cards"
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
 
@@ -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 'rb-appscript'
6
- require 'appscript'
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
- # writers
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.9.1"
28
+ VERSION = "0.10"
25
29
  end
@@ -38,7 +38,7 @@ module Cards
38
38
  private
39
39
 
40
40
  def my_layout
41
- @layout || NilLayout.new
41
+ @layout || Layouts::NilLayout.new
42
42
  end
43
43
  end
44
44
  end
@@ -1,7 +1,5 @@
1
- require 'cards/builder'
2
-
3
1
  module Cards
4
- class CardWall < Builder
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
@@ -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,3 +1,7 @@
1
+ # this is making this a mac only distro, I'm afraid
2
+ gem 'rb-appscript'
3
+ require 'appscript'
4
+
1
5
  module Cards
2
6
  class GraffleWriter
3
7
  CARD_WALL_STENCIL = File.expand_path(File.dirname(__FILE__) + "/CardWall.gstencil")
@@ -1,34 +1,36 @@
1
1
  require 'enumerator'
2
2
 
3
3
  module Cards
4
- class ColumnLayout
5
- def initialize(options = {})
6
- @wrap_at = options.delete(:wrap_at) || 10
7
- end
4
+ module Layouts
5
+ class ColumnLayout
6
+ def initialize(options = {})
7
+ @wrap_at = options.delete(:wrap_at) || 10
8
+ end
8
9
 
9
- def layout(card)
10
- x = card.x
11
- card.children.each_slice(@wrap_at) do |slice|
12
- y = card.y + 1
13
- slice.each do |child|
14
- child.x, child.y = x, y
15
- child.layout
16
- y += child.height
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
- def width(card)
23
- width = 0
24
- card.children.each_slice(@wrap_at) do |slice|
25
- width += slice.widths.max
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
- def height(card)
31
- card.children.heights.sum
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
- class NilLayout
3
- def layout(card)
4
- end
2
+ module Layouts
3
+ class NilLayout
4
+ def layout(card)
5
+ end
5
6
 
6
- def width(card)
7
- 1
8
- end
7
+ def width(card)
8
+ 1
9
+ end
9
10
 
10
- def height(card)
11
- 1
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
- class RowLayout
3
- def layout(card)
4
- x = card.x
5
- card.children.each_with_index do |child, i|
6
- child.x = x
7
- child.y = card.y + 1
8
- child.layout
9
- x += child.width
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
- def width(card)
14
- card.children.map {|c| c.width}.sum
15
- end
14
+ def width(card)
15
+ card.children.map {|c| c.width}.sum
16
+ end
16
17
 
17
- def height(card)
18
- card.children.map {|c| c.height}.max
18
+ def height(card)
19
+ card.children.map {|c| c.height}.max
20
+ end
19
21
  end
20
22
  end
21
- end
23
+ end
@@ -1,3 +1,6 @@
1
+ # this is making this a mac only distro, I'm afraid
2
+ gem 'rb-appscript'
3
+ require 'appscript'
1
4
  require 'cards/tabular_parser'
2
5
 
3
6
  module Cards
@@ -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)
@@ -1,6 +1,5 @@
1
1
  require File.dirname(__FILE__) + '/../spec_helper'
2
2
 
3
- require 'cards/card_wall'
4
3
  include Cards
5
4
 
6
5
  describe CardWall, "row, col" do
@@ -1,5 +1,5 @@
1
- require File.dirname(__FILE__) + '/../../spec_helper'
2
- require 'cards/writers/dot_writer'
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+ require 'cards/dot_writer'
3
3
  require 'stringio'
4
4
  include Cards
5
5
 
@@ -1,5 +1,5 @@
1
1
  require File.dirname(__FILE__) + '/../spec_helper'
2
- require 'cards'
2
+ require 'cards/numbers_parser'
3
3
 
4
4
  # not the best test, but it will do
5
5
  describe Cards::NumbersParser do
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/../../spec_helper'
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
2
  include Cards
3
3
 
4
4
  describe TextWriter do
@@ -1,12 +1,9 @@
1
- $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + "/../lib")
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/extensions'
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.9.1
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-06 00:00:00 -08:00
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.9.0
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/writers
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
@@ -1,9 +0,0 @@
1
- require 'cards/card'
2
- require 'cards/layouts/row_layout'
3
- require 'cards/layouts/column_layout'
4
- require 'cards/layouts/nil_layout'
5
-
6
- module Cards
7
- class Builder
8
- end
9
- end