swing 0.1.7 → 0.1.8
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.
- data/HISTORY +4 -0
- data/VERSION +1 -1
- data/lib/swing/j_frame.rb +2 -2
- data/spec/swing/j_frame_spec.rb +8 -4
- metadata +2 -2
data/HISTORY
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.8
|
data/lib/swing/j_frame.rb
CHANGED
@@ -5,8 +5,8 @@ class Swing::JFrame
|
|
5
5
|
attr_setter :layout, :background, :size, :title,
|
6
6
|
:default_close_operation => EXIT_ON_CLOSE #DISPOSE_ON_CLOSE, HIDE_ON_CLOSE
|
7
7
|
|
8
|
-
def initialize *args
|
9
|
-
super *args
|
8
|
+
def initialize *args, &block
|
9
|
+
super *args, &nil
|
10
10
|
|
11
11
|
# Yielding self to set up contents before making frame visible
|
12
12
|
yield self if block_given?
|
data/spec/swing/j_frame_spec.rb
CHANGED
@@ -4,17 +4,21 @@ require 'swing/shared'
|
|
4
4
|
describe Swing::JFrame do
|
5
5
|
|
6
6
|
context 'creating' do
|
7
|
-
after(:each) {@frame.dispose if @frame}
|
7
|
+
after(:each) { @frame.dispose if @frame }
|
8
8
|
let(:new_args) { ['Frame'] }
|
9
9
|
|
10
10
|
it_behaves_like 'enhanced awt component'
|
11
11
|
|
12
12
|
it 'is possible to create Frame with options' do
|
13
|
-
@frame = Swing::JFrame.new "
|
14
|
-
|
15
|
-
|
13
|
+
@frame = Swing::JFrame.new "Option frame",
|
14
|
+
:layout => Awt::FlowLayout.new(Awt::FlowLayout::LEFT),
|
15
|
+
:size => [1100, 1200]
|
16
16
|
end
|
17
17
|
|
18
|
+
it 'is possible to give frame constructor a block' do
|
19
|
+
@frame = Swing::JFrame.new("Block frame") { @called = true }
|
20
|
+
@called.should be_true
|
21
|
+
end
|
18
22
|
|
19
23
|
end
|
20
24
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: swing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.8
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- arvicco
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-05-
|
13
|
+
date: 2011-05-27 00:00:00 +04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|