rubyonacid 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/examples/test.rb +4 -4
- data/lib/rubyonacid/factory.rb +1 -1
- data/spec/shared_factory_specs.rb +0 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/examples/test.rb
CHANGED
@@ -80,10 +80,10 @@ class MyApp < Wx::App
|
|
80
80
|
@f.within(:width, 1, 5).to_i
|
81
81
|
)
|
82
82
|
surface.draw_line(
|
83
|
-
@f.
|
84
|
-
@f.
|
85
|
-
@f.
|
86
|
-
@f.
|
83
|
+
@f.get(:x, :max => WIDTH).to_i,
|
84
|
+
@f.get(:y, :max => HEIGHT).to_i,
|
85
|
+
@f.get(:x2, :max => WIDTH).to_i,
|
86
|
+
@f.get(:y2, :max => HEIGHT).to_i
|
87
87
|
)
|
88
88
|
end
|
89
89
|
@f.reset_assignments if @resetter.boolean(:reset)
|
data/lib/rubyonacid/factory.rb
CHANGED
@@ -15,7 +15,7 @@ class Factory
|
|
15
15
|
#Calls get_unit with key to get value between 0.0 and 1.0, then converts that value to be between given minimum and maximum.
|
16
16
|
def get(key, options = {})
|
17
17
|
@minimums[key] = (options[:min] || @minimums[key] || 0.0)
|
18
|
-
@maximums[key] = (options[:max] || @maximums[key] || @minimums[key] > 1.0 ? @minimums[key] + 1.0 : 1.0)
|
18
|
+
@maximums[key] = (options[:max] || @maximums[key] || (@minimums[key] > 1.0 ? @minimums[key] + 1.0 : 1.0))
|
19
19
|
get_unit(key) * (@maximums[key] - @minimums[key]) + @minimums[key]
|
20
20
|
end
|
21
21
|
|
@@ -61,7 +61,6 @@ shared_examples_for "a factory" do
|
|
61
61
|
end
|
62
62
|
it "uses a default maximum of 1.0" do
|
63
63
|
@it.get(:a).should <= 1.0
|
64
|
-
@it.get(:a, :min => -1.0).should <= 0.0
|
65
64
|
end
|
66
65
|
it "keeps the minimum and maximum between calls for a given key" do
|
67
66
|
@it.get(:a, :max => 2.0).should <= 2.0
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubyonacid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jay McGavren
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-11-
|
12
|
+
date: 2009-11-30 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|