happygirl 1.1.1 → 1.1.2
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 +6 -0
- data/README.txt +7 -5
- data/Rakefile +1 -1
- data/lib/happy_girl.rb +23 -10
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +4 -5
data/History.txt
CHANGED
data/README.txt
CHANGED
@@ -3,12 +3,14 @@ HappyGirl
|
|
3
3
|
http://rubyforge.org/projects/happygirl/
|
4
4
|
|
5
5
|
== DESCRIPTION:
|
6
|
+
|
6
7
|
Have you ever needed to express your love every minute? If your beloved use computer you can install her this application that will articulate your feeling every now and then (even when you are absent).
|
7
8
|
|
8
9
|
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.
|
9
10
|
|
10
11
|
== SYNOPSIS:
|
11
|
-
|
12
|
+
|
13
|
+
First you should create file ~/.happygirl.yaml, like:
|
12
14
|
WindowTitle: Some Love Message
|
13
15
|
Question: Why John Loves Mary?
|
14
16
|
Messages:
|
@@ -18,14 +20,14 @@ Makes your girlfriend or wife happy, so it makes you happy :). Based on http://h
|
|
18
20
|
NextMessageIsRandom: true # If set to true every message will be randomly selected. If any other value is provided messages are showed sequentialy.
|
19
21
|
StartMessageIndex: 1 # Message to show up first after running program. Any non numerical value means random message.
|
20
22
|
|
21
|
-
|
23
|
+
Next you run program:
|
22
24
|
|
23
25
|
% happy_girl
|
24
26
|
|
25
|
-
|
27
|
+
And every SecondsToWait seconds you will see a window with message.
|
26
28
|
|
27
29
|
*WARNING*
|
28
|
-
|
30
|
+
You should click _Accept the Love_ button instead of closing window (because that would close application).
|
29
31
|
|
30
32
|
== REQUIREMENTS:
|
31
33
|
|
@@ -34,7 +36,7 @@ Makes your girlfriend or wife happy, so it makes you happy :). Based on http://h
|
|
34
36
|
|
35
37
|
== INSTALL:
|
36
38
|
|
37
|
-
|
39
|
+
% sudo gem install happygirl
|
38
40
|
|
39
41
|
== LICENSE:
|
40
42
|
|
data/Rakefile
CHANGED
@@ -9,7 +9,7 @@ Hoe.new('happygirl', HappyGirl::VERSION) do |p|
|
|
9
9
|
p.author = "Roman Kamyk"
|
10
10
|
p.email = 'roman.kamyk@gmail.com'
|
11
11
|
p.summary = 'Displays love message once on a while'
|
12
|
-
p.description = p.paragraphs_of('README.txt', 2..
|
12
|
+
p.description = p.paragraphs_of('README.txt', 2..3).join("\n\n")
|
13
13
|
p.url = p.paragraphs_of('README.txt', 0).first.split(/\n/)[1..-1]
|
14
14
|
@changes = p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
|
15
15
|
end
|
data/lib/happy_girl.rb
CHANGED
@@ -3,7 +3,18 @@ require 'yaml'
|
|
3
3
|
# $:.unshift(File::join(File::dirname(File::dirname(__FILE__)), "/lib"))
|
4
4
|
|
5
5
|
class HappyGirl
|
6
|
-
VERSION = '1.1.
|
6
|
+
VERSION = '1.1.2'
|
7
|
+
|
8
|
+
def initMessageIndex(smi)
|
9
|
+
return unless @msgIdx.nil?
|
10
|
+
if smi.nil? or smi.value.to_i.to_s != smi.value
|
11
|
+
@msgIdx = rand(@messages.length)
|
12
|
+
else
|
13
|
+
@msgIdx = smi.value.to_i
|
14
|
+
end
|
15
|
+
@msgIdx = rand(@messages.length) if @msgIdx.nil? or @msgIdx < 0 or @msgIdx >= @messages.length
|
16
|
+
end
|
17
|
+
|
7
18
|
def readConfig()
|
8
19
|
begin
|
9
20
|
@cfg = YAML::parse(File.open("#{ENV['HOME']}/.happygirl.yaml"))
|
@@ -11,10 +22,12 @@ class HappyGirl
|
|
11
22
|
@cfg = YAML::parse(File.open(File::dirname(__FILE__) + '/messages.yaml'))
|
12
23
|
end
|
13
24
|
@messages = @cfg["Messages"].value
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
25
|
+
initMessageIndex(@cfg["StartMessageIndex"])
|
26
|
+
unless @cfg["NextMessageIsRandom"].nil? or @cfg["NextMessageIsRandom"].value != "true"
|
27
|
+
@randomNext = true
|
28
|
+
else
|
29
|
+
@randomNext = false
|
30
|
+
end
|
18
31
|
end
|
19
32
|
|
20
33
|
def initialize()
|
@@ -24,13 +37,11 @@ class HappyGirl
|
|
24
37
|
font18 = TkFont.new('times').configure('size' => 18, 'family' => 'bold')
|
25
38
|
|
26
39
|
@root = TkRoot.new()
|
27
|
-
@
|
28
|
-
entry = TkLabel.new(@root) {
|
40
|
+
@entry = TkLabel.new(@root) {
|
29
41
|
font font24
|
30
42
|
justify 'left'
|
31
43
|
}
|
32
|
-
entry.
|
33
|
-
entry.pack("side" => 'top', "fill" => 'y')
|
44
|
+
@entry.pack("side" => 'top', "fill" => 'y')
|
34
45
|
|
35
46
|
@why = TkLabel.new(@root) {
|
36
47
|
font font18
|
@@ -53,8 +64,10 @@ class HappyGirl
|
|
53
64
|
end
|
54
65
|
|
55
66
|
def setMessage()
|
56
|
-
|
67
|
+
readConfig()
|
57
68
|
@why.text(@messages[@msgIdx].value)
|
69
|
+
@entry.text(@cfg["Question"].value)
|
70
|
+
@root.title(@cfg["WindowTitle"].value)
|
58
71
|
@root.deiconify()
|
59
72
|
if @randomNext
|
60
73
|
@msgIdx = rand(@messages.length)
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: happygirl
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.1.
|
6
|
+
version: 1.1.2
|
7
7
|
date: 2007-11-16 00:00:00 +01:00
|
8
8
|
summary: Displays love message once on a while
|
9
9
|
require_paths:
|
@@ -11,7 +11,7 @@ require_paths:
|
|
11
11
|
email: roman.kamyk@gmail.com
|
12
12
|
homepage: " by Roman Kamyk <roman.kamyk@gmail.com> made for his sweetheart --- Agnieszka :)"
|
13
13
|
rubyforge_project: happygirl
|
14
|
-
description:
|
14
|
+
description: Have you ever needed to express your love every minute? If your beloved use computer you can install her this application that will articulate your feeling every now and then (even when you are absent). 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.
|
15
15
|
autorequire:
|
16
16
|
default_executable:
|
17
17
|
bindir: bin
|
metadata.gz.sig
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
������i��F�1��H�Q��d
|
1
|
+
�����I���������S�-�NDbl6�~� Q���#����
|
2
|
+
�ӸY/]/���0x���D�뤆II�qГ���F,O�D�Ii&�b~.�b굗�m��8ʺ��i���M�&���78�O�1afYRX:K�z݉��ms��t
|
3
|
+
�X��jd{� ����dA�L2Z�\��Yg#�Ngk��P�q�p��V���m`
|
4
|
+
�YZ��7�9���������Ʃ��A9R$R��V�YW�unY�m�
|