coinflip 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/bin/MyClass.rb ADDED
@@ -0,0 +1,23 @@
1
+
2
+ class MyClass #(change name)
3
+
4
+ include GladeGUI
5
+
6
+ def before_show()
7
+ @path = File.dirname(__FILE__) + "/"
8
+ @builder["image1"].file = @path + "heads.jpg"
9
+ @builder["button1"].label = "Flip Coin"
10
+ end
11
+
12
+ def button1__clicked(*args)
13
+ if rand(2) == 1
14
+ @builder["image1"].file = @path + "heads.jpg"
15
+ @builder["button1"].label = "Heads"
16
+ else
17
+ @builder["image1"].file = @path + "tails.jpg"
18
+ @builder["button1"].label = "Tails"
19
+ end
20
+ end
21
+
22
+ end
23
+
@@ -0,0 +1,57 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <interface>
3
+ <requires lib="gtk+" version="2.16"/>
4
+ <!-- interface-naming-policy project-wide -->
5
+ <object class="GtkWindow" id="window1">
6
+ <property name="visible">True</property>
7
+ <property name="can_focus">False</property>
8
+ <property name="modal">True</property>
9
+ <property name="window_position">center-always</property>
10
+ <property name="default_width">300</property>
11
+ <property name="default_height">200</property>
12
+ <signal name="destroy" handler="destroy_window" swapped="no"/>
13
+ <child>
14
+ <object class="GtkVBox" id="vbox1">
15
+ <property name="visible">True</property>
16
+ <property name="can_focus">False</property>
17
+ <child>
18
+ <object class="GtkImage" id="image1">
19
+ <property name="visible">True</property>
20
+ <property name="can_focus">False</property>
21
+ <property name="stock">gtk-missing-image</property>
22
+ </object>
23
+ <packing>
24
+ <property name="expand">True</property>
25
+ <property name="fill">True</property>
26
+ <property name="position">0</property>
27
+ </packing>
28
+ </child>
29
+ <child>
30
+ <object class="GtkHButtonBox" id="hbuttonbox1">
31
+ <property name="visible">True</property>
32
+ <property name="can_focus">False</property>
33
+ <child>
34
+ <object class="GtkButton" id="button1">
35
+ <property name="label" translatable="yes">button</property>
36
+ <property name="visible">True</property>
37
+ <property name="can_focus">True</property>
38
+ <property name="receives_default">True</property>
39
+ <property name="use_action_appearance">False</property>
40
+ </object>
41
+ <packing>
42
+ <property name="expand">False</property>
43
+ <property name="fill">False</property>
44
+ <property name="position">0</property>
45
+ </packing>
46
+ </child>
47
+ </object>
48
+ <packing>
49
+ <property name="expand">True</property>
50
+ <property name="fill">True</property>
51
+ <property name="position">1</property>
52
+ </packing>
53
+ </child>
54
+ </object>
55
+ </child>
56
+ </object>
57
+ </interface>
data/bin/heads.jpg ADDED
Binary file
data/bin/tails.jpg ADDED
Binary file
data/coinflip ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/ruby
2
+
3
+ require 'vrlib'
4
+
5
+ #make program output in real time so errors visible in VR.
6
+ STDOUT.sync = true
7
+ STDERR.sync = true
8
+
9
+ #everything in these directories will be included
10
+ my_path = File.expand_path(File.dirname(__FILE__))
11
+ require_all Dir.glob(my_path + "/bin/**/*.rb")
12
+
13
+ MyClass.new.show
14
+
metadata ADDED
@@ -0,0 +1,99 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: coinflip
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.9
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Your Name
9
+ autorequire:
10
+ bindir:
11
+ - .
12
+ cert_chain: []
13
+ date: 2013-12-12 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: vrlib
17
+ requirement: !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: 0.0.1
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ! '>='
29
+ - !ruby/object:Gem::Version
30
+ version: 0.0.1
31
+ - !ruby/object:Gem::Dependency
32
+ name: gtk2
33
+ requirement: !ruby/object:Gem::Requirement
34
+ none: false
35
+ requirements:
36
+ - - ! '>='
37
+ - !ruby/object:Gem::Version
38
+ version: 0.0.1
39
+ type: :runtime
40
+ prerelease: false
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: 0.0.1
47
+ - !ruby/object:Gem::Dependency
48
+ name: require_all
49
+ requirement: !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: 0.0.1
55
+ type: :runtime
56
+ prerelease: false
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
62
+ version: 0.0.1
63
+ description: Full description here
64
+ email: you@yoursite.com
65
+ executables:
66
+ - coinflip
67
+ extensions: []
68
+ extra_rdoc_files: []
69
+ files:
70
+ - bin/MyClass.rb
71
+ - bin/glade/MyClass.glade
72
+ - bin/tails.jpg
73
+ - bin/heads.jpg
74
+ - ./coinflip
75
+ homepage: http://www.yoursite.org/
76
+ licenses: []
77
+ post_install_message:
78
+ rdoc_options: []
79
+ require_paths:
80
+ - .
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ none: false
83
+ requirements:
84
+ - - ! '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ none: false
89
+ requirements:
90
+ - - ! '>='
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ requirements: []
94
+ rubyforge_project: nowarning
95
+ rubygems_version: 1.8.25
96
+ signing_key:
97
+ specification_version: 3
98
+ summary: Short Description Here.
99
+ test_files: []