graffle 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/History.txt +5 -0
  2. data/Manifest.txt +22 -11
  3. data/README.txt +2 -2
  4. data/Rakefile.hoe +2 -1
  5. data/design-notes/graphical-tests-for-rails-objects.graffle +644 -0
  6. data/examples/objects with notes.expected +5 -0
  7. data/examples/objects with notes.graffle +338 -0
  8. data/examples/objects with notes.rb +42 -0
  9. data/examples/rails-workflow-test.expected +1 -1
  10. data/examples/rails-workflow-test.graffle/data.plist +86 -7
  11. data/examples/rails-workflow-test.rb +11 -9
  12. data/graffle.tmproj +82 -190
  13. data/lib/graffle.rb +19 -2
  14. data/lib/graffle/point.rb +1 -2
  15. data/lib/graffle/stereotypes.rb +62 -16
  16. data/lib/graffle/version.rb +1 -1
  17. data/lib/graphical_tests_for_rails.rb +8 -5
  18. data/lib/graphical_tests_for_rails/graphic-volunteers.rb +75 -0
  19. data/lib/graphical_tests_for_rails/orderings.rb +90 -84
  20. data/lib/graphical_tests_for_rails/picture-appliers.rb +225 -0
  21. data/lib/graphical_tests_for_rails/text-appliers.rb +135 -0
  22. data/lib/graphical_tests_for_rails/volunteer-pool.rb +115 -0
  23. data/test/abstract-graphic-tests.rb +48 -0
  24. data/test/document-tests.rb +5 -5
  25. data/test/examples-tests.rb +42 -0
  26. data/test/graphical_tests_for_rails/{graphic-interpreter-tests.rb → deprecated-graphic-interpreter-tests.rb} +11 -21
  27. data/test/graphical_tests_for_rails/graphic-volunteer-tests.rb +218 -0
  28. data/test/graphical_tests_for_rails/in-workflow-order-tests.rb +1 -1
  29. data/test/graphical_tests_for_rails/picture-applier-tests.rb +215 -0
  30. data/test/graphical_tests_for_rails/{text-interpreter-tests.rb → text-applier-tests.rb} +17 -3
  31. data/test/graphical_tests_for_rails/util.rb +16 -0
  32. data/test/line-graphic-tests.rb +9 -1
  33. data/test/note-tests.rb +62 -0
  34. data/test/{graffle-file-types → sample-files}/as-a-package.graffle/data.plist +0 -0
  35. data/test/{graffle-file-types → sample-files}/as-a-package.graffle/image1.png +0 -0
  36. data/test/{graffle-file-types → sample-files}/as-a-package.graffle/image2.png +0 -0
  37. data/test/{graffle-file-types → sample-files}/as-a-package.graffle/image3.png +0 -0
  38. data/test/{graffle-file-types → sample-files}/multiple-canvases.graffle +0 -0
  39. data/test/{graffle-file-types → sample-files}/opening-tests.rb +9 -4
  40. data/test/{graffle-file-types → sample-files}/two-boxes-and-a-line.graffle +0 -0
  41. data/test/shaped-graphic-tests.rb +2 -3
  42. metadata +42 -18
  43. data/lib/graphical_tests_for_rails/interpreters.rb +0 -147
  44. data/test/tests-of-examples/workflow-slowtests.rb +0 -19
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: graffle
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.1.8
7
- date: 2007-07-13 00:00:00 -05:00
6
+ version: 0.1.9
7
+ date: 2007-07-25 00:00:00 -05:00
8
8
  summary: Working with OmniGraffle documents, including support for Rails integration tests.
9
9
  require_paths:
10
10
  - lib
@@ -35,6 +35,10 @@ files:
35
35
  - README.txt
36
36
  - Rakefile
37
37
  - Rakefile.hoe
38
+ - design-notes/graphical-tests-for-rails-objects.graffle
39
+ - examples/objects with notes.expected
40
+ - examples/objects with notes.graffle
41
+ - examples/objects with notes.rb
38
42
  - examples/rails-workflow-test.expected
39
43
  - examples/rails-workflow-test.graffle/data.plist
40
44
  - examples/rails-workflow-test.graffle/image1.png
@@ -50,49 +54,60 @@ files:
50
54
  - lib/graffle/styled-text-reader.rb
51
55
  - lib/graffle/version.rb
52
56
  - lib/graphical_tests_for_rails.rb
53
- - lib/graphical_tests_for_rails/interpreters.rb
57
+ - lib/graphical_tests_for_rails/graphic-volunteers.rb
54
58
  - lib/graphical_tests_for_rails/orderings.rb
59
+ - lib/graphical_tests_for_rails/picture-appliers.rb
60
+ - lib/graphical_tests_for_rails/text-appliers.rb
61
+ - lib/graphical_tests_for_rails/volunteer-pool.rb
55
62
  - setup.rb
56
63
  - test/abstract-graphic-tests.rb
57
64
  - test/array-and-hash-stereotyping-tests.rb
58
65
  - test/document-tests.rb
59
- - test/graffle-file-types/as-a-package.graffle/data.plist
60
- - test/graffle-file-types/as-a-package.graffle/image1.png
61
- - test/graffle-file-types/as-a-package.graffle/image2.png
62
- - test/graffle-file-types/as-a-package.graffle/image3.png
63
- - test/graffle-file-types/multiple-canvases.graffle
64
- - test/graffle-file-types/opening-tests.rb
65
- - test/graffle-file-types/two-boxes-and-a-line.graffle
66
- - test/graphical_tests_for_rails/graphic-interpreter-tests.rb
66
+ - test/examples-tests.rb
67
+ - test/graphical_tests_for_rails/deprecated-graphic-interpreter-tests.rb
68
+ - test/graphical_tests_for_rails/graphic-volunteer-tests.rb
67
69
  - test/graphical_tests_for_rails/in-workflow-order-tests.rb
68
- - test/graphical_tests_for_rails/text-interpreter-tests.rb
70
+ - test/graphical_tests_for_rails/picture-applier-tests.rb
71
+ - test/graphical_tests_for_rails/text-applier-tests.rb
72
+ - test/graphical_tests_for_rails/util.rb
69
73
  - test/group-tests.rb
70
74
  - test/hacks-tests.rb
71
75
  - test/line-graphic-tests.rb
76
+ - test/note-tests.rb
72
77
  - test/point-tests.rb
78
+ - test/sample-files/as-a-package.graffle/data.plist
79
+ - test/sample-files/as-a-package.graffle/image1.png
80
+ - test/sample-files/as-a-package.graffle/image2.png
81
+ - test/sample-files/as-a-package.graffle/image3.png
82
+ - test/sample-files/multiple-canvases.graffle
83
+ - test/sample-files/opening-tests.rb
84
+ - test/sample-files/two-boxes-and-a-line.graffle
73
85
  - test/set-standalone-test-paths.rb
74
86
  - test/shaped-graphic-tests.rb
75
87
  - test/sheet-tests.rb
76
88
  - test/styled-text-reader-tests.rb
77
- - test/tests-of-examples/workflow-slowtests.rb
78
89
  - test/text-tests.rb
79
90
  - test/util.rb
80
91
  test_files:
81
92
  - test/abstract-graphic-tests.rb
82
93
  - test/array-and-hash-stereotyping-tests.rb
83
94
  - test/document-tests.rb
95
+ - test/examples-tests.rb
84
96
  - test/group-tests.rb
85
97
  - test/hacks-tests.rb
86
98
  - test/line-graphic-tests.rb
99
+ - test/note-tests.rb
87
100
  - test/point-tests.rb
88
101
  - test/shaped-graphic-tests.rb
89
102
  - test/sheet-tests.rb
90
103
  - test/styled-text-reader-tests.rb
91
104
  - test/text-tests.rb
92
- - test/graffle-file-types/opening-tests.rb
93
- - test/graphical_tests_for_rails/graphic-interpreter-tests.rb
105
+ - test/graphical_tests_for_rails/deprecated-graphic-interpreter-tests.rb
106
+ - test/graphical_tests_for_rails/graphic-volunteer-tests.rb
94
107
  - test/graphical_tests_for_rails/in-workflow-order-tests.rb
95
- - test/graphical_tests_for_rails/text-interpreter-tests.rb
108
+ - test/graphical_tests_for_rails/picture-applier-tests.rb
109
+ - test/graphical_tests_for_rails/text-applier-tests.rb
110
+ - test/sample-files/opening-tests.rb
96
111
  rdoc_options:
97
112
  - --main
98
113
  - README.txt
@@ -133,7 +148,16 @@ dependencies:
133
148
  requirements:
134
149
  - - ">="
135
150
  - !ruby/object:Gem::Version
136
- version: 1.0.0
151
+ version: 1.0.1
152
+ version:
153
+ - !ruby/object:Gem::Dependency
154
+ name: fluid
155
+ version_requirement:
156
+ version_requirements: !ruby/object:Gem::Version::Requirement
157
+ requirements:
158
+ - - ">="
159
+ - !ruby/object:Gem::Version
160
+ version: 1.0.1
137
161
  version:
138
162
  - !ruby/object:Gem::Dependency
139
163
  name: hoe
@@ -142,5 +166,5 @@ dependencies:
142
166
  requirements:
143
167
  - - ">="
144
168
  - !ruby/object:Gem::Version
145
- version: 1.2.1
169
+ version: 1.2.2
146
170
  version:
@@ -1,147 +0,0 @@
1
- require 'enumerator'
2
- require 'test/unit/assertionfailederror'
3
-
4
- module GraphicalTestsForRails
5
-
6
- # A GraphicInterpreter takes a list of _graphics_, some
7
- # instructions about how to interpret them, and a _target_.
8
- # It interprets the instructions to create messages that it then
9
- # sends to the target.
10
- #
11
- class GraphicInterpreter
12
-
13
- # The _graphics_ are an array of OmniGraffle AbstractGraphic objects. The
14
- # _instructions_ map a string to an object that must respond to
15
- # produce_method_call. (See AbstractMessageMaker#produce_method_call
16
- # for more.)
17
- #
18
- # Here are the available instructions (keys in _instructions_):
19
- #
20
- # * ['line labels' => ...]: each line within the (single)
21
- # label on the line is to be interpreted as a message-send by an
22
- # instance of the given class.
23
- # * ['shaped graphic text' => ...]: each line of content
24
- # within the graphic is to be interpreted by the given class. The
25
- # content is the text you type in an object after double-clicking
26
- # on it.
27
- # * ['text...' => ...]: a line ending in ellipses is treated this way,
28
- # no matter what other instructions say.
29
- #
30
- def initialize(graphics, instructions = {})
31
- @graphics = graphics
32
- @line_label_strategy =
33
- instructions['line labels']
34
- @shaped_graphic_text_strategy =
35
- instructions['shaped graphic text']
36
-
37
- @ellipses_override = instructions['text...']
38
- end
39
-
40
- # Apply the _graphics_, according to the _instructions_, against
41
- # the _target_.
42
- def run_against(target)
43
- @target = target
44
- @log = []
45
- @graphics.each do |g|
46
- case g.stereotype.basename
47
- when "ShapedGraphic"
48
- process_commands(@shaped_graphic_text_strategy,
49
- g.content.as_lines)
50
- when "LineGraphic"
51
- process_commands(@line_label_strategy,
52
- g.label_lines)
53
- end
54
- end
55
- end
56
-
57
- private
58
-
59
- def process_commands(command_maker, command_lines)
60
- return if command_maker.nil?
61
- command_lines.each do |line|
62
- info = if /\.\.\.\s*$/ =~ line && @ellipses_override
63
- @ellipses_override.produce_method_call(line)
64
- else
65
- command_maker.produce_method_call(line)
66
- end
67
- begin
68
- @log << readable(*info)
69
- @target.send(*info)
70
- rescue Test::Unit::AssertionFailedError, StandardError, ScriptError => e
71
- raise e.class.new(%Q{#{e.message} after\n#{@log.join("\n")}})
72
- end
73
- end
74
- end
75
-
76
- def readable(message, *args)
77
- inspected = args.collect { |a| a.inspect }
78
- "+ #{message}(#{inspected.join(', ')})"
79
- end
80
-
81
- end
82
-
83
- class AbstractMessageMaker
84
- # produce_method_call is given a string that is derived from some
85
- # text somewhere associated with a graphic (label, contents of text
86
- # box, annotation). It must answer an array whose first element is a
87
- # message name. That message, along with any remaining array elements,
88
- # is sent to the target.
89
- #
90
- # This class only exists so there's a place to hang this comment.
91
- def produce_method_call; subclass_responsibility; end
92
- end
93
-
94
-
95
- class ArgsFromQuotedText < AbstractMessageMaker
96
-
97
- # The arguments are quoted within the _string_.
98
- # The message is the text before the first arg, snake-cased.
99
- def produce_method_call(string)
100
- quote_marker = '%<<<==-'
101
-
102
- string = string.gsub(/(\w)'(\w)/, "#{quote_marker}\\1\\2#{quote_marker}")
103
- tokens = string.split(/['"],?/, allow_trailing_null_fields = -1)
104
- message = tokens[0].strip.downcase
105
- args = tokens[1..-1]
106
-
107
-
108
- message.gsub!(/#{quote_marker}(.)(.)#{quote_marker}/, "\\1\\2")
109
- message.gsub!(/\s+/,'_')
110
- message.gsub!(/-/, '_')
111
- message.gsub!(/\W/, '')
112
-
113
-
114
- args = args.enum_slice(2).collect { |e| e[0] }
115
- args = args.collect do | arg |
116
- arg.gsub(/#{quote_marker}(.)(.)#{quote_marker}/, "\\1'\\2")
117
- end
118
-
119
- [message] + args
120
- end
121
- end
122
-
123
-
124
- class TextIsNameOfPage
125
-
126
- # When producing a method call, objects of this class will
127
- # prepend the _message_ to
128
- # a single argument it constructs.
129
- def initialize(message)
130
- @message = message
131
- end
132
-
133
- # All of the text in the _string_ is expected to be the name
134
- # of a page. It is downcased and treated as the single argument to
135
- # the message passed to +new+.
136
- def produce_method_call(string)
137
- [@message, string.downcase.strip]
138
- end
139
- end
140
-
141
- class Ineffectual # :nodoc:
142
- def produce_method_call(string)
143
- [:object_id] # no_op
144
- end
145
- end
146
- end
147
-
@@ -1,19 +0,0 @@
1
- #!/usr/bin/env ruby
2
- #
3
- # Created by Brian Marick on 2007-07-11.
4
- # Copyright (c) 2007. All rights reserved.
5
-
6
- require "../set-standalone-test-paths.rb" unless $started_from_rakefile
7
- require "test/unit"
8
- require 's4t-utils'
9
-
10
-
11
- class TestThatExamplesWork < Test::Unit::TestCase
12
- In_examples = "cd #{PACKAGE_ROOT}/examples;"
13
- def test_all
14
- system "#{In_examples} ruby rails-workflow-test.rb > rails-workflow-test.actual 2>&1"
15
- system("#{In_examples} diff rails-workflow-test.{e*,a*}")
16
- assert_equal(0, $?)
17
- system "#{In_examples} rm rails-workflow-test.actual" if $? == 0
18
- end
19
- end