happygirl 1.0.0

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.txt ADDED
@@ -0,0 +1,5 @@
1
+ == 1.0.0 / 2007-11-10
2
+
3
+ * 1 major enhancement
4
+ * Birthday!
5
+
data/Manifest.txt ADDED
@@ -0,0 +1,9 @@
1
+ History.txt
2
+ Manifest.txt
3
+ README.txt
4
+ Rakefile
5
+ bin/happy_girl
6
+ lib/happy_girl.rb
7
+ lib/heart.gif
8
+ lib/messages.yaml
9
+ test/test_happy_girl.rb
data/README.txt ADDED
@@ -0,0 +1,63 @@
1
+ HappyGirl
2
+ by Roman Kamyk <roman.kamyk@gmail.com>
3
+ http://rubyforge.org/projects/happygirl/
4
+
5
+ == DESCRIPTION:
6
+ Have you ever needed to express your love every minute? If your beloved use
7
+ computer you can install her this application that will articulate your
8
+ feeling every now and then (even when you are absent).
9
+
10
+ Makes your girlfriend or wife happy, so it makes you happy :). Based on
11
+ http://homepage.mac.com/khsu/HappyWife/HappyWife.html. It shows a love message
12
+ every once in a while.
13
+
14
+ == SYNOPSIS:
15
+ First you should create file ~/.happygirl.yaml, like:
16
+ WindowTitle: Some Love Message
17
+ Question: Why John Loves Mary?
18
+ Messages:
19
+ - Because she is so wonderful
20
+ - Because she is ...
21
+ SecondsToWait: 3600
22
+
23
+ Next you run program:
24
+ happygirl &
25
+
26
+ And every SecondsToWait seconds you will see a window with message.
27
+ *WARNING*
28
+ You should click _Accept the Love_ button instead of closing window (because
29
+ that would close application).
30
+
31
+ == REQUIREMENTS:
32
+
33
+ * Ruby/Tk
34
+ * Hoe
35
+
36
+ == INSTALL:
37
+
38
+ * sudo gem install happygirl
39
+
40
+ == LICENSE:
41
+
42
+ (The MIT License)
43
+
44
+ Copyright (c) 2007 Roman Kamyk
45
+
46
+ Permission is hereby granted, free of charge, to any person obtaining
47
+ a copy of this software and associated documentation files (the
48
+ 'Software'), to deal in the Software without restriction, including
49
+ without limitation the rights to use, copy, modify, merge, publish,
50
+ distribute, sublicense, and/or sell copies of the Software, and to
51
+ permit persons to whom the Software is furnished to do so, subject to
52
+ the following conditions:
53
+
54
+ The above copyright notice and this permission notice shall be
55
+ included in all copies or substantial portions of the Software.
56
+
57
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
58
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
59
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
60
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
61
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
62
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
63
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,17 @@
1
+ # -*- ruby -*-
2
+
3
+ require 'rubygems'
4
+ require 'hoe'
5
+ require './lib/happy_girl.rb'
6
+
7
+ Hoe.new('happygirl', HappyGirl::VERSION) do |p|
8
+ p.rubyforge_name = 'happygirl'
9
+ p.author = "Roman Kamyk"
10
+ p.email = 'roman.kamyk@gmail.com'
11
+ p.summary = 'Displays love message once on a while'
12
+ p.description = p.paragraphs_of('README.txt', 2..5).join("\n\n")
13
+ p.url = p.paragraphs_of('README.txt', 0).first.split(/\n/)[1..-1]
14
+ p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
15
+ end
16
+
17
+ # vim: syntax=Ruby
data/bin/happy_girl ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ $:.unshift(File::join(File::dirname(File::dirname(__FILE__)), "lib"))
3
+ require 'happy_girl'
4
+ HappyGirl.new().start()
data/lib/happy_girl.rb ADDED
@@ -0,0 +1,71 @@
1
+ require 'tk'
2
+ require 'yaml'
3
+
4
+ class HappyGirl
5
+ VERSION = '1.0.0'
6
+ def readConfig()
7
+ begin
8
+ @cfg = YAML::parse(File.open("#{ENV['HOME']}/.happygirl.yaml"))
9
+ rescue Exception
10
+ @cfg = YAML::parse(File.open('messages.yaml'))
11
+ end
12
+ @messages = @cfg["Messages"].value
13
+ end
14
+
15
+ def initialize()
16
+ readConfig()
17
+
18
+ font24 = TkFont.new('arial').configure('size'=>24, 'family' => 'bold')
19
+ font18 = TkFont.new('times').configure('size' => 18, 'family' => 'bold')
20
+
21
+ @root = TkRoot.new()
22
+ @root.title(@cfg["WindowTitle"].value)
23
+ entry = TkLabel.new(@root) {
24
+ font font24
25
+ justify 'left'
26
+ }
27
+ entry.text(@cfg["Question"].value)
28
+ entry.pack("side" => 'top', "fill" => 'y')
29
+
30
+ @why = TkLabel.new(@root) {
31
+ font font18
32
+ }
33
+ setMessage()
34
+ @why.pack("fill" => "x", "side" => "left" )
35
+
36
+ image = TkLabel.new(@root) {
37
+ image TkPhotoImage.new { file File::dirname(__FILE__) + '/heart.gif' }
38
+ }.pack('side' => "left", "fill" => "both")
39
+
40
+ button = TkButton.new(@root) {
41
+ text "Accept the love..."
42
+ justify "right"
43
+ }.pack("side" => "bottom", "fill" => "x")
44
+
45
+ button.bind("Button-1") {
46
+ @root.withdraw()
47
+ }
48
+ end
49
+
50
+ def setMessage()
51
+ @msgIdx = rand(@messages.length) if @msgIdx.nil?
52
+ @why.text(@messages[@msgIdx].value)
53
+ @root.deiconify()
54
+ @msgIdx += 1
55
+ @msgIdx %= @messages.length
56
+ end
57
+
58
+ def start()
59
+ th = Thread.new do
60
+ loop do
61
+ setMessage()
62
+ sleep(@cfg["SecondsToWait"].value.to_i)
63
+ end
64
+ end
65
+ Tk.mainloop()
66
+ end
67
+ end
68
+
69
+ if $0 == __FILE__
70
+ HappyGirl.new().start()
71
+ end
data/lib/heart.gif ADDED
Binary file
data/lib/messages.yaml ADDED
@@ -0,0 +1,6 @@
1
+ WindowTitle: Some Love Message
2
+ Question: Why John Loves Mary?
3
+ Messages:
4
+ - Because she is so wonderful
5
+ - Because she is ...
6
+ SecondsToWait: 3600
File without changes
data.tar.gz.sig ADDED
Binary file
metadata ADDED
@@ -0,0 +1,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ rubygems_version: 0.9.4
3
+ specification_version: 1
4
+ name: happygirl
5
+ version: !ruby/object:Gem::Version
6
+ version: 1.0.0
7
+ date: 2007-11-12 00:00:00 +01:00
8
+ summary: Displays love message once on a while
9
+ require_paths:
10
+ - lib
11
+ email: roman.kamyk@gmail.com
12
+ homepage: " by Roman Kamyk <roman.kamyk@gmail.com>"
13
+ rubyforge_project: happygirl
14
+ description: "Makes your girlfriend or wife happy, so it makes you happy :). Based on http://homepage.mac.com/khsu/HappyWife/HappyWife.html. It shows a love message every once in a while. == SYNOPSIS: First you should create file ~/.happygirl.yaml, like: WindowTitle: Some Love Message Question: Why John Loves Mary? Messages: - Because she is so wonderful - Because she is ... SecondsToWait: 3600 Next you run program: happygirl & And every SecondsToWait seconds you will see a window with message. *WARNING* You should click _Accept the Love_ button instead of closing window (because that would close application). == REQUIREMENTS:"
15
+ autorequire:
16
+ default_executable:
17
+ bindir: bin
18
+ has_rdoc: true
19
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
20
+ requirements:
21
+ - - ">"
22
+ - !ruby/object:Gem::Version
23
+ version: 0.0.0
24
+ version:
25
+ platform: ruby
26
+ signing_key:
27
+ cert_chain:
28
+ - |
29
+ -----BEGIN CERTIFICATE-----
30
+ MIIDODCCAiCgAwIBAgIBADANBgkqhkiG9w0BAQUFADBCMRQwEgYDVQQDDAtyb21h
31
+ bi5rYW15azEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYD
32
+ Y29tMB4XDTA3MTExMDA1MzUzM1oXDTA4MTEwOTA1MzUzM1owQjEUMBIGA1UEAwwL
33
+ cm9tYW4ua2FteWsxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixk
34
+ ARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMdV1ujoU4I2
35
+ daF4KANtDPTSjLYhXC1CiiyEgGEVA6GvieQ2NpNNsSXl+6tbWXGNUWFHj50rrLTC
36
+ e1dJSGGTZa9ZjI6fkeb/Gr13s71ncCJ+hBbpvktWIWdvOvzvNo9bdzNCKX00Rlk5
37
+ hQzxhm/ZxQ2VG4ZDYc/gWOCzKYH8aKrAzzdjRsxE/QMgnVbnirCGSPQTjPVhBvcX
38
+ pH2yDvZF9NOs3D89JvA4P50WRCe8/kKPx7TG9Qkd303/FmO8yDUvJn0KgiYkm1pc
39
+ Sb+kcDZnh2+2uvkygLLDQhV5m7DfFLLkgwb/t7R4tSNFqcHoa0829rnSVBbCZACg
40
+ mrXhThP3LX8CAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0O
41
+ BBYEFGVgSLBvjD5kTd+1XMf58PK9llj6MA0GCSqGSIb3DQEBBQUAA4IBAQCGX43w
42
+ PspP+rmsfCKztiUwtfb4d+eqW62WaAUBT37KeW8IEm3UpAe5T1c3fFm46bxM3a2Y
43
+ wUeLqSMSquXNzb2fy+3vLAUYHc4UkR5nA5kB+F3RJwuc7LJCBGlkPsCfa91dE6j5
44
+ S80vqeRf4ITITHZbFLuVFFvQb/nPGe2LtyP4+neAktSu4r7rQ5vLbQQ/NSAliFrP
45
+ pJbWXmfjKQsDKGgs1TiISC3kfLcynhCgCcbLCek5Oc0U195z36e8x3aYEJSGFVmF
46
+ y8xfBxyZ4t0FP3lTPvGMfmSKOVOjcwT4OVpzdvRXWR8lghrQlAzNG5HdOxMzeBjb
47
+ Z2byiG0rlbybmXMS
48
+ -----END CERTIFICATE-----
49
+
50
+ post_install_message:
51
+ authors:
52
+ - Roman Kamyk
53
+ files:
54
+ - History.txt
55
+ - Manifest.txt
56
+ - README.txt
57
+ - Rakefile
58
+ - bin/happy_girl
59
+ - lib/happy_girl.rb
60
+ - lib/heart.gif
61
+ - lib/messages.yaml
62
+ - test/test_happy_girl.rb
63
+ test_files:
64
+ - test/test_happy_girl.rb
65
+ rdoc_options:
66
+ - --main
67
+ - README.txt
68
+ extra_rdoc_files:
69
+ - History.txt
70
+ - Manifest.txt
71
+ - README.txt
72
+ executables:
73
+ - happy_girl
74
+ extensions: []
75
+
76
+ requirements: []
77
+
78
+ dependencies:
79
+ - !ruby/object:Gem::Dependency
80
+ name: hoe
81
+ version_requirement:
82
+ version_requirements: !ruby/object:Gem::Version::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: 1.3.0
87
+ version:
metadata.gz.sig ADDED
Binary file