bulldog 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/DESCRIPTION.txt +3 -0
- data/LICENSE +20 -0
- data/README.rdoc +18 -0
- data/Rakefile +64 -0
- data/VERSION +1 -0
- data/bulldog.gemspec +157 -0
- data/lib/bulldog.rb +95 -0
- data/lib/bulldog/attachment.rb +49 -0
- data/lib/bulldog/attachment/base.rb +167 -0
- data/lib/bulldog/attachment/has_dimensions.rb +94 -0
- data/lib/bulldog/attachment/image.rb +63 -0
- data/lib/bulldog/attachment/maybe.rb +229 -0
- data/lib/bulldog/attachment/none.rb +37 -0
- data/lib/bulldog/attachment/pdf.rb +63 -0
- data/lib/bulldog/attachment/unknown.rb +11 -0
- data/lib/bulldog/attachment/video.rb +143 -0
- data/lib/bulldog/error.rb +5 -0
- data/lib/bulldog/has_attachment.rb +214 -0
- data/lib/bulldog/interpolation.rb +73 -0
- data/lib/bulldog/missing_file.rb +12 -0
- data/lib/bulldog/processor.rb +5 -0
- data/lib/bulldog/processor/argument_tree.rb +116 -0
- data/lib/bulldog/processor/base.rb +124 -0
- data/lib/bulldog/processor/ffmpeg.rb +172 -0
- data/lib/bulldog/processor/image_magick.rb +134 -0
- data/lib/bulldog/processor/one_shot.rb +19 -0
- data/lib/bulldog/reflection.rb +234 -0
- data/lib/bulldog/saved_file.rb +19 -0
- data/lib/bulldog/stream.rb +186 -0
- data/lib/bulldog/style.rb +38 -0
- data/lib/bulldog/style_set.rb +101 -0
- data/lib/bulldog/tempfile.rb +28 -0
- data/lib/bulldog/util.rb +92 -0
- data/lib/bulldog/validations.rb +68 -0
- data/lib/bulldog/vector2.rb +18 -0
- data/rails/init.rb +9 -0
- data/script/console +8 -0
- data/spec/data/empty.txt +0 -0
- data/spec/data/test.jpg +0 -0
- data/spec/data/test.mov +0 -0
- data/spec/data/test.pdf +0 -0
- data/spec/data/test.png +0 -0
- data/spec/data/test2.jpg +0 -0
- data/spec/helpers/image_creation.rb +8 -0
- data/spec/helpers/temporary_directory.rb +25 -0
- data/spec/helpers/temporary_models.rb +76 -0
- data/spec/helpers/temporary_values.rb +102 -0
- data/spec/helpers/test_upload_files.rb +108 -0
- data/spec/helpers/time_travel.rb +20 -0
- data/spec/integration/data/test.jpg +0 -0
- data/spec/integration/lifecycle_hooks_spec.rb +213 -0
- data/spec/integration/processing_image_attachments.rb +72 -0
- data/spec/integration/processing_video_attachments_spec.rb +82 -0
- data/spec/integration/saving_an_attachment_spec.rb +31 -0
- data/spec/matchers/file_operations.rb +159 -0
- data/spec/spec_helper.rb +76 -0
- data/spec/unit/attachment/base_spec.rb +311 -0
- data/spec/unit/attachment/image_spec.rb +128 -0
- data/spec/unit/attachment/maybe_spec.rb +126 -0
- data/spec/unit/attachment/pdf_spec.rb +137 -0
- data/spec/unit/attachment/video_spec.rb +176 -0
- data/spec/unit/attachment_spec.rb +61 -0
- data/spec/unit/has_attachment_spec.rb +700 -0
- data/spec/unit/interpolation_spec.rb +108 -0
- data/spec/unit/processor/argument_tree_spec.rb +159 -0
- data/spec/unit/processor/ffmpeg_spec.rb +467 -0
- data/spec/unit/processor/image_magick_spec.rb +260 -0
- data/spec/unit/processor/one_shot_spec.rb +70 -0
- data/spec/unit/reflection_spec.rb +338 -0
- data/spec/unit/stream_spec.rb +234 -0
- data/spec/unit/style_set_spec.rb +44 -0
- data/spec/unit/style_spec.rb +51 -0
- data/spec/unit/validations_spec.rb +491 -0
- data/spec/unit/vector2_spec.rb +27 -0
- data/tasks/bulldog_tasks.rake +4 -0
- metadata +193 -0
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Vector2 do
|
4
|
+
describe "#initialize" do
|
5
|
+
def check(object)
|
6
|
+
vector = Vector2.new(object)
|
7
|
+
vector.x.should == 1
|
8
|
+
vector.y.should == -2
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should parse strings containing 2 integers" do
|
12
|
+
check '1 -2'
|
13
|
+
check '+1x-2'
|
14
|
+
check '1,-2'
|
15
|
+
check '+1-2'
|
16
|
+
check '1 -2'
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should interpret a 2-element array of integers as x- and y- values" do
|
20
|
+
check [1, -2]
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should interpret a 2-element array of strings as x- and y- values" do
|
24
|
+
check ['1', '-2']
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
metadata
ADDED
@@ -0,0 +1,193 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: bulldog
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- George Ogata
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-11-15 00:00:00 -05:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: rspec
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rspec_outlines
|
27
|
+
type: :development
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: "0"
|
34
|
+
version:
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: mocha
|
37
|
+
type: :development
|
38
|
+
version_requirement:
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: "0"
|
44
|
+
version:
|
45
|
+
description: |
|
46
|
+
= Bulldog
|
47
|
+
|
48
|
+
Flexible file attachments for active record.
|
49
|
+
|
50
|
+
email: george.ogata@gmail.com
|
51
|
+
executables: []
|
52
|
+
|
53
|
+
extensions: []
|
54
|
+
|
55
|
+
extra_rdoc_files:
|
56
|
+
- LICENSE
|
57
|
+
- README.rdoc
|
58
|
+
files:
|
59
|
+
- .gitignore
|
60
|
+
- DESCRIPTION.txt
|
61
|
+
- LICENSE
|
62
|
+
- README.rdoc
|
63
|
+
- Rakefile
|
64
|
+
- VERSION
|
65
|
+
- bulldog.gemspec
|
66
|
+
- lib/bulldog.rb
|
67
|
+
- lib/bulldog/attachment.rb
|
68
|
+
- lib/bulldog/attachment/base.rb
|
69
|
+
- lib/bulldog/attachment/has_dimensions.rb
|
70
|
+
- lib/bulldog/attachment/image.rb
|
71
|
+
- lib/bulldog/attachment/maybe.rb
|
72
|
+
- lib/bulldog/attachment/none.rb
|
73
|
+
- lib/bulldog/attachment/pdf.rb
|
74
|
+
- lib/bulldog/attachment/unknown.rb
|
75
|
+
- lib/bulldog/attachment/video.rb
|
76
|
+
- lib/bulldog/error.rb
|
77
|
+
- lib/bulldog/has_attachment.rb
|
78
|
+
- lib/bulldog/interpolation.rb
|
79
|
+
- lib/bulldog/missing_file.rb
|
80
|
+
- lib/bulldog/processor.rb
|
81
|
+
- lib/bulldog/processor/argument_tree.rb
|
82
|
+
- lib/bulldog/processor/base.rb
|
83
|
+
- lib/bulldog/processor/ffmpeg.rb
|
84
|
+
- lib/bulldog/processor/image_magick.rb
|
85
|
+
- lib/bulldog/processor/one_shot.rb
|
86
|
+
- lib/bulldog/reflection.rb
|
87
|
+
- lib/bulldog/saved_file.rb
|
88
|
+
- lib/bulldog/stream.rb
|
89
|
+
- lib/bulldog/style.rb
|
90
|
+
- lib/bulldog/style_set.rb
|
91
|
+
- lib/bulldog/tempfile.rb
|
92
|
+
- lib/bulldog/util.rb
|
93
|
+
- lib/bulldog/validations.rb
|
94
|
+
- lib/bulldog/vector2.rb
|
95
|
+
- rails/init.rb
|
96
|
+
- script/console
|
97
|
+
- spec/data/empty.txt
|
98
|
+
- spec/data/test.jpg
|
99
|
+
- spec/data/test.mov
|
100
|
+
- spec/data/test.pdf
|
101
|
+
- spec/data/test.png
|
102
|
+
- spec/data/test2.jpg
|
103
|
+
- spec/helpers/image_creation.rb
|
104
|
+
- spec/helpers/temporary_directory.rb
|
105
|
+
- spec/helpers/temporary_models.rb
|
106
|
+
- spec/helpers/temporary_values.rb
|
107
|
+
- spec/helpers/test_upload_files.rb
|
108
|
+
- spec/helpers/time_travel.rb
|
109
|
+
- spec/integration/data/test.jpg
|
110
|
+
- spec/integration/lifecycle_hooks_spec.rb
|
111
|
+
- spec/integration/processing_image_attachments.rb
|
112
|
+
- spec/integration/processing_video_attachments_spec.rb
|
113
|
+
- spec/integration/saving_an_attachment_spec.rb
|
114
|
+
- spec/matchers/file_operations.rb
|
115
|
+
- spec/spec_helper.rb
|
116
|
+
- spec/unit/attachment/base_spec.rb
|
117
|
+
- spec/unit/attachment/image_spec.rb
|
118
|
+
- spec/unit/attachment/maybe_spec.rb
|
119
|
+
- spec/unit/attachment/pdf_spec.rb
|
120
|
+
- spec/unit/attachment/video_spec.rb
|
121
|
+
- spec/unit/attachment_spec.rb
|
122
|
+
- spec/unit/has_attachment_spec.rb
|
123
|
+
- spec/unit/interpolation_spec.rb
|
124
|
+
- spec/unit/processor/argument_tree_spec.rb
|
125
|
+
- spec/unit/processor/ffmpeg_spec.rb
|
126
|
+
- spec/unit/processor/image_magick_spec.rb
|
127
|
+
- spec/unit/processor/one_shot_spec.rb
|
128
|
+
- spec/unit/reflection_spec.rb
|
129
|
+
- spec/unit/stream_spec.rb
|
130
|
+
- spec/unit/style_set_spec.rb
|
131
|
+
- spec/unit/style_spec.rb
|
132
|
+
- spec/unit/validations_spec.rb
|
133
|
+
- spec/unit/vector2_spec.rb
|
134
|
+
- tasks/bulldog_tasks.rake
|
135
|
+
has_rdoc: true
|
136
|
+
homepage: http://github.com/oggy/bulldog
|
137
|
+
licenses: []
|
138
|
+
|
139
|
+
post_install_message:
|
140
|
+
rdoc_options:
|
141
|
+
- --charset=UTF-8
|
142
|
+
require_paths:
|
143
|
+
- lib
|
144
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
145
|
+
requirements:
|
146
|
+
- - ">="
|
147
|
+
- !ruby/object:Gem::Version
|
148
|
+
version: "0"
|
149
|
+
version:
|
150
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
151
|
+
requirements:
|
152
|
+
- - ">="
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: "0"
|
155
|
+
version:
|
156
|
+
requirements: []
|
157
|
+
|
158
|
+
rubyforge_project:
|
159
|
+
rubygems_version: 1.3.5
|
160
|
+
signing_key:
|
161
|
+
specification_version: 3
|
162
|
+
summary: A heavy-duty paperclip. File attachments for ActiveRecord.
|
163
|
+
test_files:
|
164
|
+
- spec/helpers/image_creation.rb
|
165
|
+
- spec/helpers/temporary_directory.rb
|
166
|
+
- spec/helpers/temporary_models.rb
|
167
|
+
- spec/helpers/temporary_values.rb
|
168
|
+
- spec/helpers/test_upload_files.rb
|
169
|
+
- spec/helpers/time_travel.rb
|
170
|
+
- spec/integration/lifecycle_hooks_spec.rb
|
171
|
+
- spec/integration/processing_image_attachments.rb
|
172
|
+
- spec/integration/processing_video_attachments_spec.rb
|
173
|
+
- spec/integration/saving_an_attachment_spec.rb
|
174
|
+
- spec/matchers/file_operations.rb
|
175
|
+
- spec/spec_helper.rb
|
176
|
+
- spec/unit/attachment/base_spec.rb
|
177
|
+
- spec/unit/attachment/image_spec.rb
|
178
|
+
- spec/unit/attachment/maybe_spec.rb
|
179
|
+
- spec/unit/attachment/pdf_spec.rb
|
180
|
+
- spec/unit/attachment/video_spec.rb
|
181
|
+
- spec/unit/attachment_spec.rb
|
182
|
+
- spec/unit/has_attachment_spec.rb
|
183
|
+
- spec/unit/interpolation_spec.rb
|
184
|
+
- spec/unit/processor/argument_tree_spec.rb
|
185
|
+
- spec/unit/processor/ffmpeg_spec.rb
|
186
|
+
- spec/unit/processor/image_magick_spec.rb
|
187
|
+
- spec/unit/processor/one_shot_spec.rb
|
188
|
+
- spec/unit/reflection_spec.rb
|
189
|
+
- spec/unit/stream_spec.rb
|
190
|
+
- spec/unit/style_set_spec.rb
|
191
|
+
- spec/unit/style_spec.rb
|
192
|
+
- spec/unit/validations_spec.rb
|
193
|
+
- spec/unit/vector2_spec.rb
|