gtk_advent_calendar 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +21 -1
- data/gtk_advent_calendar.gemspec +2 -2
- data/lib/gtk_advent_calendar/calendar.rb +6 -4
- data/lib/gtk_advent_calendar/version.rb +1 -1
- data/sample/your_calendar.rb +18 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 315539d201ddd5274403ffa44a6add672dc86319
|
4
|
+
data.tar.gz: 66530332cc6f3884f3c329547f3d93a317b9c662
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 872b56afe734d3ca28399a2d1f81c6ea5ea2b8d214551405fc2fb1e629f74a94626ce5fce274cf5eafc8b4073c584aa35bf1b0edf0cf6ab5b39525dabdaf4f28
|
7
|
+
data.tar.gz: c5824a91eb6c58d8e3bea83b60ebe8a94041884a6143f8323e380e5a110ad937e6f70893ce70763f732496109e09ff0e6f26add6719f5069daee97d3f83cfb28
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# GtkAdventCalendar
|
2
2
|
|
3
|
-
|
3
|
+
An advent calendar by Ruby/GTK3.
|
4
4
|
|
5
5
|
## Requirements
|
6
6
|
|
@@ -22,8 +22,28 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
+
### For Command Line Application
|
26
|
+
|
25
27
|
$ gtk_advent_calendar
|
26
28
|
|
29
|
+
### For Library
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
require "gtk_advent_calendar"
|
33
|
+
|
34
|
+
class YourCalendar < GtkAdventCalendar::Calendar
|
35
|
+
# @params n [Integer] the day between 1 and 25.
|
36
|
+
def action(n)
|
37
|
+
...
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
window = Gtk::Window.new
|
42
|
+
window.add(YourCalendar.new)
|
43
|
+
window.show_all
|
44
|
+
Gtk.main
|
45
|
+
```
|
46
|
+
|
27
47
|
## Contributing
|
28
48
|
|
29
49
|
1. Fork it
|
data/gtk_advent_calendar.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = GtkAdventCalendar::VERSION
|
9
9
|
spec.authors = ["Masafumi Yokoyama"]
|
10
10
|
spec.email = ["myokoym@gmail.com"]
|
11
|
-
spec.description = %q{
|
12
|
-
spec.summary = %q{
|
11
|
+
spec.description = %q{An advent calendar by Ruby/GTK3.}
|
12
|
+
spec.summary = %q{An advent calendar by Ruby/GTK3}
|
13
13
|
spec.homepage = "https://github.com/myokoym/gtk_advent_calendar"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
@@ -8,9 +8,7 @@ module GtkAdventCalendar
|
|
8
8
|
def initialize
|
9
9
|
super
|
10
10
|
@day = 1
|
11
|
-
|
12
|
-
box.add(month)
|
13
|
-
add(box)
|
11
|
+
add(month)
|
14
12
|
end
|
15
13
|
|
16
14
|
def month
|
@@ -47,11 +45,15 @@ module GtkAdventCalendar
|
|
47
45
|
button.width_request = CELL_WIDTH
|
48
46
|
button.height_request = CELL_WIDTH
|
49
47
|
button.signal_connect("clicked") do
|
50
|
-
|
48
|
+
action(n)
|
51
49
|
end
|
52
50
|
button
|
53
51
|
end
|
54
52
|
|
53
|
+
def action(n)
|
54
|
+
show_uri("http://en.wikipedia.org/wiki/December_#{n}")
|
55
|
+
end
|
56
|
+
|
55
57
|
def show_uri(uri)
|
56
58
|
case RUBY_PLATFORM
|
57
59
|
when /darwin/
|
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "gtk_advent_calendar"
|
4
|
+
|
5
|
+
class YourCalendar < GtkAdventCalendar::Calendar
|
6
|
+
# @params n [Integer] the day between 1 and 25.
|
7
|
+
def action(n)
|
8
|
+
puts "It's December #{n}."
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
window = Gtk::Window.new
|
13
|
+
window.add(YourCalendar.new)
|
14
|
+
window.signal_connect("destroy") do
|
15
|
+
Gtk.main_quit
|
16
|
+
end
|
17
|
+
window.show_all
|
18
|
+
Gtk.main
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gtk_advent_calendar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masafumi Yokoyama
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
description:
|
55
|
+
description: An advent calendar by Ruby/GTK3.
|
56
56
|
email:
|
57
57
|
- myokoym@gmail.com
|
58
58
|
executables:
|
@@ -71,6 +71,7 @@ files:
|
|
71
71
|
- lib/gtk_advent_calendar/calendar.rb
|
72
72
|
- lib/gtk_advent_calendar/command.rb
|
73
73
|
- lib/gtk_advent_calendar/version.rb
|
74
|
+
- sample/your_calendar.rb
|
74
75
|
homepage: https://github.com/myokoym/gtk_advent_calendar
|
75
76
|
licenses:
|
76
77
|
- MIT
|
@@ -94,6 +95,6 @@ rubyforge_project:
|
|
94
95
|
rubygems_version: 2.0.3
|
95
96
|
signing_key:
|
96
97
|
specification_version: 4
|
97
|
-
summary:
|
98
|
+
summary: An advent calendar by Ruby/GTK3
|
98
99
|
test_files: []
|
99
100
|
has_rdoc:
|