fidgit 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- data/fidgit.gemspec +1 -1
- data/lib/fidgit/elements/element.rb +5 -0
- data/lib/fidgit/history.rb +7 -1
- data/lib/fidgit/version.rb +1 -1
- data/spec/fidgit/history_spec.rb +9 -0
- metadata +16 -16
data/fidgit.gemspec
CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
|
|
24
24
|
s.add_dependency('gosu', '~> 0.7.33')
|
25
25
|
s.add_dependency('chingu', '~> 0.9rc5')
|
26
26
|
s.add_dependency('clipboard', '~> 0.9.9')
|
27
|
-
s.add_dependency('ffi', '
|
27
|
+
s.add_dependency('ffi', '= 1.0.9') # 1.0.10 is borked :(
|
28
28
|
s.add_development_dependency('rspec', '~> 2.1.0')
|
29
29
|
s.add_development_dependency('texplay', '~> 0.3.5')
|
30
30
|
end
|
@@ -24,6 +24,11 @@ module Fidgit
|
|
24
24
|
event :holding_right_mouse_button
|
25
25
|
event :released_right_mouse_button
|
26
26
|
event :clicked_right_mouse_button
|
27
|
+
|
28
|
+
event :middle_mouse_button
|
29
|
+
event :holding_middle_mouse_button
|
30
|
+
event :released_middle_mouse_button
|
31
|
+
event :clicked_middle_mouse_button
|
27
32
|
|
28
33
|
event :mouse_wheel_up
|
29
34
|
event :mouse_wheel_down
|
data/lib/fidgit/history.rb
CHANGED
@@ -35,7 +35,13 @@ module Fidgit
|
|
35
35
|
raise ArgumentError, "Parameter, 'action', expected to be a #{Action}, but received: #{action}" unless action.is_a? Action
|
36
36
|
|
37
37
|
# Remove all undone actions when a new one is performed.
|
38
|
-
|
38
|
+
if can_redo?
|
39
|
+
if @last_done == -1
|
40
|
+
@actions.clear
|
41
|
+
else
|
42
|
+
@actions = @actions[0..@last_done]
|
43
|
+
end
|
44
|
+
end
|
39
45
|
|
40
46
|
# If history is too big, remove the oldest action.
|
41
47
|
if @actions.size >= @max_size
|
data/lib/fidgit/version.rb
CHANGED
data/spec/fidgit/history_spec.rb
CHANGED
@@ -56,6 +56,15 @@ module Fidgit
|
|
56
56
|
@object.can_undo?.should be_true
|
57
57
|
@object.can_redo?.should be_false
|
58
58
|
end
|
59
|
+
|
60
|
+
it "should correctly delete any re-doable actions, even if there is only one" do
|
61
|
+
@object.do(History::Add.new(2))
|
62
|
+
@object.undo
|
63
|
+
@object.do(History::Add.new(3))
|
64
|
+
@object.undo
|
65
|
+
|
66
|
+
@object.can_undo?.should be_false
|
67
|
+
end
|
59
68
|
end
|
60
69
|
|
61
70
|
describe "undo()" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fidgit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-11-04 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: gosu
|
16
|
-
requirement: &
|
16
|
+
requirement: &26986392 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.7.33
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *26986392
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: chingu
|
27
|
-
requirement: &
|
27
|
+
requirement: &26985780 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 0.9rc5
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *26985780
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: clipboard
|
38
|
-
requirement: &
|
38
|
+
requirement: &26984424 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,21 +43,21 @@ dependencies:
|
|
43
43
|
version: 0.9.9
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *26984424
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: ffi
|
49
|
-
requirement: &
|
49
|
+
requirement: &26983992 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - =
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 1.0.9
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *26983992
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rspec
|
60
|
-
requirement: &
|
60
|
+
requirement: &26983536 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 2.1.0
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *26983536
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: texplay
|
71
|
-
requirement: &
|
71
|
+
requirement: &26983020 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: 0.3.5
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *26983020
|
80
80
|
description: Fidgit is a GUI library built on Gosu/Chingu
|
81
81
|
email:
|
82
82
|
- bil.bagpuss@gmail.com
|
@@ -193,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
193
193
|
version: '0'
|
194
194
|
requirements: []
|
195
195
|
rubyforge_project: fidgit
|
196
|
-
rubygems_version: 1.8.
|
196
|
+
rubygems_version: 1.8.11
|
197
197
|
signing_key:
|
198
198
|
specification_version: 3
|
199
199
|
summary: Fidgit is a GUI library built on Gosu/Chingu
|