happygirl 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ == 1.1.0 / 2007-11-16
2
+ * Two new configuration options:
3
+ * NextMessageIsRandom
4
+ * StartMessageIndex
5
+
1
6
  == 1.0.1 / 2007-11-12
2
7
  * 1 bugfix:
3
8
  * when there is no .happygirl.yaml read default file correctly
data/Manifest.txt CHANGED
@@ -3,6 +3,7 @@ Manifest.txt
3
3
  README.txt
4
4
  Rakefile
5
5
  bin/happy_girl
6
+ index.html
6
7
  lib/happy_girl.rb
7
8
  lib/heart.gif
8
9
  lib/messages.yaml
data/README.txt CHANGED
@@ -3,13 +3,9 @@ HappyGirl
3
3
  http://rubyforge.org/projects/happygirl/
4
4
 
5
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).
6
+ 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).
9
7
 
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.
8
+ 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.
13
9
 
14
10
  == SYNOPSIS:
15
11
  First you should create file ~/.happygirl.yaml, like:
@@ -19,14 +15,17 @@ every once in a while.
19
15
  - Because she is so wonderful
20
16
  - Because she is ...
21
17
  SecondsToWait: 3600
22
-
18
+ NextMessageIsRandom: true # If set to true every message will be randomly selected. If any other value is provided messages are showed sequentialy.
19
+ StartMessageIndex: 1 # Message to show up first after running program. Any non numerical value means random message.
20
+
23
21
  Next you run program:
24
- happygirl &
22
+
23
+ % happy_girl
25
24
 
26
25
  And every SecondsToWait seconds you will see a window with message.
26
+
27
27
  *WARNING*
28
- You should click _Accept the Love_ button instead of closing window (because
29
- that would close application).
28
+ You should click _Accept the Love_ button instead of closing window (because that would close application).
30
29
 
31
30
  == REQUIREMENTS:
32
31
 
@@ -35,7 +34,7 @@ that would close application).
35
34
 
36
35
  == INSTALL:
37
36
 
38
- * sudo gem install happygirl
37
+ % sudo gem install happygirl
39
38
 
40
39
  == LICENSE:
41
40
 
data/Rakefile CHANGED
@@ -16,6 +16,6 @@ end
16
16
 
17
17
  task :publish => [:release, :post_news, :publish_docs] do
18
18
  sh "svn ci -m '#{@changes}'"
19
- sh "hg ci -m '#{changes}'"
19
+ sh "hg ci -m '#{@changes}'"
20
20
  end
21
21
  # vim: syntax=Ruby
data/index.html ADDED
@@ -0,0 +1,12 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+ <html>
4
+ <head>
5
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
6
+ <title>redirect</title>
7
+ <meta http-equiv="Refresh" content="1; URL=happygirl/">
8
+ </head>
9
+ <body id="index">
10
+ Please see: <a href="http://happygirl.rubyforge.org/happygirl/">documentation</a>.
11
+ </body>
12
+ </html>
data/lib/happy_girl.rb CHANGED
@@ -3,7 +3,7 @@ require 'yaml'
3
3
  # $:.unshift(File::join(File::dirname(File::dirname(__FILE__)), "/lib"))
4
4
 
5
5
  class HappyGirl
6
- VERSION = '1.0.1'
6
+ VERSION = '1.1.0'
7
7
  def readConfig()
8
8
  begin
9
9
  @cfg = YAML::parse(File.open("#{ENV['HOME']}/.happygirl.yaml"))
@@ -11,6 +11,10 @@ class HappyGirl
11
11
  @cfg = YAML::parse(File.open(File::dirname(__FILE__) + '/messages.yaml'))
12
12
  end
13
13
  @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 if @msgIdx < 0 or @msgIdx >= @messages.length
17
+ @randomNext = true unless @cfg["NextMessageIsRandom"].nil? or @cfg["NextMessageIsRandom"].value != "true"
14
18
  end
15
19
 
16
20
  def initialize()
@@ -52,8 +56,12 @@ class HappyGirl
52
56
  @msgIdx = rand(@messages.length) if @msgIdx.nil?
53
57
  @why.text(@messages[@msgIdx].value)
54
58
  @root.deiconify()
55
- @msgIdx += 1
56
- @msgIdx %= @messages.length
59
+ if @randomNext
60
+ @msgIdx = rand(@messages.length)
61
+ else
62
+ @msgIdx += 1
63
+ @msgIdx %= @messages.length
64
+ end
57
65
  end
58
66
 
59
67
  def start()
data/lib/messages.yaml CHANGED
@@ -3,4 +3,6 @@ Question: Why John Loves Mary?
3
3
  Messages:
4
4
  - Because she is so wonderful
5
5
  - Because she is ...
6
- SecondsToWait: 3600
6
+ SecondsToWait: 3600
7
+ NextMessageIsRandom: true # anything other means false
8
+ StartMessageIndex: random # or index starting from 0
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -3,15 +3,15 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: happygirl
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.0.1
7
- date: 2007-11-12 00:00:00 +01:00
6
+ version: 1.1.0
7
+ date: 2007-11-16 00:00:00 +01:00
8
8
  summary: Displays love message once on a while
9
9
  require_paths:
10
10
  - lib
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 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:"
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:"
15
15
  autorequire:
16
16
  default_executable:
17
17
  bindir: bin
@@ -56,6 +56,7 @@ files:
56
56
  - README.txt
57
57
  - Rakefile
58
58
  - bin/happy_girl
59
+ - index.html
59
60
  - lib/happy_girl.rb
60
61
  - lib/heart.gif
61
62
  - lib/messages.yaml
metadata.gz.sig CHANGED
@@ -1 +1 @@
1
- �)��SPL����JoUZxJz�x��T��!k��k�Y�� �[��K��i�� �n�&�[��s$�0Q>- Soo6:�4G=N�m�� W��!���m���ءǚvD�`�8�*z���va�d��S�zZN�~ͬi��Ǿ2 �9)�h��j���D��O�Jm�+GZu*:�X`��@�9��9�F� 7��!�՝ʗ�@4�����:� ��6�#L�N�#�������51�9�
1
+ ma�Gɏ��Ғ�p���72�B�O"����`Q���吠X%�&ϩ��2���3P�)����owH0�����my�~:���i�ɄiCCGXl��%����})$�G±��"V�ș+؟�\r?����CFi ��2S 0��d���5�;{?��^h������5pUG"����f����ڜ�D��ޝ���O��ʀ#H�`�k����/����_`.��*��d�M �����������n