happygirl 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,9 @@
1
+ === 1.1.2 / 2007-11-16
2
+
3
+ * Bugfix
4
+ * interpreting NextMessageIsRandom corrected
5
+ * After displaying a message reads configuration, so it is not needed to restart program after appendix new messages.
6
+
1
7
  === 1.1.1 / 2007-11-16
2
8
 
3
9
  * Bugfix
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
- First you should create file ~/.happygirl.yaml, like:
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
- Next you run program:
23
+ Next you run program:
22
24
 
23
25
  % happy_girl
24
26
 
25
- And every SecondsToWait seconds you will see a window with message.
27
+ And every SecondsToWait seconds you will see a window with message.
26
28
 
27
29
  *WARNING*
28
- You should click _Accept the Love_ button instead of closing window (because that would close application).
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
- % sudo gem install happygirl
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..5).join("\n\n")
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.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
- smi = @cfg["StartMessageIndex"]
15
- @msgIdx = smi.value.to_i unless smi.nil? or smi.value.to_i.to_s != smi.value
16
- @msgIdx = nil unless @msgIdx.nil? or @msgIdx >= 0 or @msgIdx < @messages.length
17
- @randomNext = true unless @cfg["NextMessageIsRandom"].nil? or @cfg["NextMessageIsRandom"].value != "true"
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
- @root.title(@cfg["WindowTitle"].value)
28
- entry = TkLabel.new(@root) {
40
+ @entry = TkLabel.new(@root) {
29
41
  font font24
30
42
  justify 'left'
31
43
  }
32
- entry.text(@cfg["Question"].value)
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
- @msgIdx = rand(@messages.length) if @msgIdx.nil?
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.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: "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 NextMessageIsRandom: true # If set to true every message will be randomly selected. If any other value is provided messages are showed sequentialy. StartMessageIndex: 1 # Message to show up first after running program. Any non numerical value means random message. Next you run program: % happy_girl 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:"
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
- �uS5�����J���~��Y�|lV�#
2
- ���H�4��_!���@�s��w«.-�N4�����0^�nTAo���IZ4xYn4d3���zl.FR7�����6��
3
- ԧN(%9^�h-��a҂`��U��2(f`)��"�Ž/� p��ť�r~��g.D�
4
- �^d��XJ��cVN_�����9S�7���x7jL.�c���/��G�y+�� vM^��V�&
5
- ������i��F�1��H�Q��d
1
+ �����I���������S�-�NDbl6�~� Q���#����
2
+ �ӸY/]/���0x�� D�뤆IIqГ���F,ODIi&�b~.�b굗�m��8ʺ��i���M�&���78�O�1afYRX:K�z݉��ms��t
3
+ X��jd{� ����dA�L2Z�\��Yg#�Ngk��P�q�p��V���m`
4
+ �YZ��7�9���������Ʃ��A9R$R��VYWunY�m�