gtk_advent_calendar 0.0.3 → 0.0.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a83611fff6c263d1b12a35ca947d5c291e93283c
4
- data.tar.gz: 4c0d03240aa72b8139c63f14414a4114ea0db0c9
3
+ metadata.gz: 315539d201ddd5274403ffa44a6add672dc86319
4
+ data.tar.gz: 66530332cc6f3884f3c329547f3d93a317b9c662
5
5
  SHA512:
6
- metadata.gz: 6afb179199c1b0b0e3db28fa2d6c033d378789b1d7515bd4d176d80f29fa92ba3c5ef60d83c3d4f702e54abf30b71b9b046d1f3616eec7baac973487c69099f1
7
- data.tar.gz: d59ec931d0343f97323aabadedec2ab1ffb472140d3dd2294afeca356ef2ea15e639f419448688083df5f1aed875b349b3fdf7877359b9da64c414c8feed086d
6
+ metadata.gz: 872b56afe734d3ca28399a2d1f81c6ea5ea2b8d214551405fc2fb1e629f74a94626ce5fce274cf5eafc8b4073c584aa35bf1b0edf0cf6ab5b39525dabdaf4f28
7
+ data.tar.gz: c5824a91eb6c58d8e3bea83b60ebe8a94041884a6143f8323e380e5a110ad937e6f70893ce70763f732496109e09ff0e6f26add6719f5069daee97d3f83cfb28
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # GtkAdventCalendar
2
2
 
3
- A calendar by Ruby/GTK3.
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
@@ -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{A calendar by Ruby/GTK3.}
12
- spec.summary = %q{A calendar by Ruby/GTK3}
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
- box = Gtk::Box.new(:vertical)
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
- show_uri("http://en.wikipedia.org/wiki/December_#{n}")
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/
@@ -1,3 +1,3 @@
1
1
  module GtkAdventCalendar
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -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.3
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: A calendar by Ruby/GTK3.
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: A calendar by Ruby/GTK3
98
+ summary: An advent calendar by Ruby/GTK3
98
99
  test_files: []
99
100
  has_rdoc: