Sprichwoerter 0.0.3 → 0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c9cdb20a498d4a3e449f5018c14c658bff23951e
4
- data.tar.gz: bbfe3cf2b6a119f8453433bdf85138cfe4040ac9
3
+ metadata.gz: 80f837ad47153be05dea980ae26c1fd24dfe9cf6
4
+ data.tar.gz: 93abff22aaac0f9232b93bd846099c98f8f8296f
5
5
  SHA512:
6
- metadata.gz: c3bf4145ca35c1688233fb85bc3de17a48bf31bf2bee2bcd1d5264872dcc6f6494455dc8954d45b59c3e106b3d2842b61c8897a4399dbfdc9e6f75a10a3c04ec
7
- data.tar.gz: 565c8818859ee3035255387cee69b5d4d1804ebc3cc1a3680cbcd2921022045a445289266c7e58d229dc33a459b60dc9b5ab998fcb7607f87539260e2f54d7aa
6
+ metadata.gz: c638f6865975268ed30b33962d17f7b2cda89703145f41c1f43386a5b2d2ad48c403b0977bef9bd537df154c22d173f02faaa271c19fcc4bd63f7abccb6e99ec
7
+ data.tar.gz: ba43ea04d0630ccc11cc0b382e18eac42b3815f8ad9514c7974c72edad1b12c49118b0fb9f04aab3f9108ccd5537bdce5dd16827fef41a31b96f83bf28316957
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env ruby
2
+ #encoding: UTF-8
3
+ =begin
4
+ /***************************************************************************
5
+ * ©2016-2016, Michael Uplawski <michael.uplawski@uplawski.eu> *
6
+ * *
7
+ * This program is free software; you can redistribute it and/or modify *
8
+ * it under the terms of the GNU General Public License as published by *
9
+ * the Free Software Foundation; either version 3 of the License, or *
10
+ * (at your option) any later version. *
11
+ * *
12
+ * This program is distributed in the hope that it will be useful, *
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15
+ * GNU General Public License for more details. *
16
+ * *
17
+ * You should have received a copy of the GNU General Public License *
18
+ * along with this program; if not, write to the *
19
+ * Free Software Foundation, Inc., *
20
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21
+ ***************************************************************************/
22
+ =end
23
+
24
+ require_relative '../lib/sprichwörter'
25
+ SprichWoerter.new('en')
@@ -22,4 +22,4 @@
22
22
  =end
23
23
 
24
24
  require_relative '../lib/sprichwörter'
25
- SprichWoerter.new
25
+ SprichWoerter.new('de')
File without changes
@@ -0,0 +1,108 @@
1
+ #encoding: UTF-8
2
+ =begin
3
+ /***************************************************************************
4
+ * ©2016-2016 Michael Uplawski <michael.uplawski@uplawski.eu> *
5
+ * *
6
+ * This program is free software; you can redistribute it and/or modify *
7
+ * it under the terms of the GNU General Public License as published by *
8
+ * the Free Software Foundation; either version 3 of the License, or *
9
+ * (at your option) any later version. *
10
+ * *
11
+ * This program is distributed in the hope that it will be useful, *
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
+ * GNU General Public License for more details. *
15
+ * *
16
+ * You should have received a copy of the GNU General Public License *
17
+ * along with this program; if not, write to the *
18
+ * Free Software Foundation, Inc., *
19
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
20
+ ***************************************************************************/
21
+ =end
22
+
23
+
24
+ $proverbs=[
25
+ ["The pen", "is mightier as the sword"],
26
+ ["The squeaky wheel", "gets the grease"],
27
+ ["No man", "is an island"],
28
+ ["Fortune", "favors the bold"],
29
+ ["A picture", "is worth a thousand words"],
30
+ ["Discretion", "is the greater part of valor"],
31
+ ["The early bird", "catches the worm"],
32
+ ["God", "helps those who help themselves"],
33
+ ["Cleanliness", "is next to godliness"],
34
+ ["A watched pot", "never boils"],
35
+ ["Practice", "makes perfect"],
36
+ ["One man's trash", "is another man's treasure"],
37
+ ["Beauty", "is in the eye of the beholder"],
38
+ ["Necessity", "is the mother of invention"],
39
+ ["A penny saved", "is a penny earned"],
40
+ ["Familiarity", "breeds contempt"],
41
+ ["The grass", "is always greener on the other side of the hill"],
42
+ ["A chain", "is only as strong as its weakest link"],
43
+ ["Honesty", "is the best policy"],
44
+ ["Absence", "makes the heart grow fonder"],
45
+ ["A broken clock", "is right twice a day"],
46
+ ["A friend in need", "is a friend indeed"],
47
+ ["A little bit of knowledge", "is a dangerous thing"],
48
+ ["A journey of a thousand miles", "begins with a single step"],
49
+ ["All", "is fair in love and war"],
50
+ ["All work and no play", "makes Jack a dull boy"],
51
+ ["Early to bed and early to rise", "makes a man healthy, wealthy and wise"],
52
+ ["Every cloud", "has a silver lining"],
53
+ ["Haste", "makes waste"],
54
+ ["Hindsight", "is 20/20"],
55
+ ["Jack of all trades", "master of none"],
56
+ ["Knowledge", "is power"],
57
+ ["Misery", "loves company"],
58
+ ["Power corrupts and absolute power", "corrupts absolutely"],
59
+ ["Rome", "wasn't build in a day"],
60
+ ["Slow and steady", "wins the race"],
61
+ ["The apple", "doesn't fall far from the tree"],
62
+ ["The road to hell", "is paved with good intentions"],
63
+ ["The best way to a man's heart", "is through his stomach"],
64
+ ["Time", "is money"],
65
+ ["Two is company, three", "is a crowd"],
66
+ ["What goes around", "comes around"],
67
+ ["What goes up", "must come down"],
68
+ ["What's good for the goose", "is good for the gender"],
69
+ ["He who does not advance", "goes backward"],
70
+ ["Advice most needed", "is least heeded"],
71
+ ["An apple a day", "keeps the doctor away"],
72
+ ["A rotten apple", "injures its companions"],
73
+ ["A bad settlement", "is better than a good lawsuit"],
74
+ ["Better", "is the enemy of good"],
75
+ ["A good beginning", "makes a good ending"],
76
+ ["Well begun", "is half done"],
77
+ ["A bird in the hand", "is worth two in the bush"],
78
+ ["Blood", "is thicker than water"],
79
+ ["Good blood", "always shows itself"],
80
+ ["A book", "is a friend"],
81
+ ["A rising tide", "lifts all boats"],
82
+ ["Half a loaf", "is better than no bread"],
83
+ ["A new broome", "sweapeth cleane"],
84
+ ["The younger brother", "the better gentleman"],
85
+ ["Business", "is business"],
86
+ ["Everyone's business", "is no one's business"],
87
+ ["A candle", "loses nothing by lighting another candle"],
88
+ ["Curiosity", "killed the cat"],
89
+ ["The child", "is father to the man and to the woman"],
90
+ ["Who has not served", "cannot command"],
91
+ ["Common sense", "is not so common"],
92
+ ["Confidence", "begets confidence"],
93
+ ["A guilty conscience", "needs an accuser"],
94
+ ["He's an ill cook that", "cannot lick his own fingers"],
95
+ ["Counsel", "is no command"],
96
+ ["The customer", "is always right"],
97
+ ["Deep", "calls to deep"],
98
+ ["The best defense", "is a good offence"],
99
+ ["Who digs a trap for others", "ends up in it himself"],
100
+ ["An ounce of discretion", "is worth a pound of wit"],
101
+ ["\"Well done\"", "is better than \"well said\""],
102
+ ["The door", "swings both ways"],
103
+ ["Constant dropping", "wears away the stone"],
104
+ ["Dwarf on a giants shoulder", "sees farther of the two"],
105
+ ["Good eating", "deserves good drinking"],
106
+ ["He that steals an egg", "will steal an ox"],
107
+ ["An empty vessel", "makes much noise"]
108
+ ]
@@ -21,21 +21,28 @@
21
21
  ***************************************************************************/
22
22
  =end
23
23
 
24
- require_relative 'liste'
25
24
 
26
25
 
27
26
  class SprichWoerter
28
- def initialize
27
+ def initialize(lang='de')
28
+ require_relative 'liste_' << lang
29
29
  box = %w~┌ ┐ └ ┘ ─ │~
30
- srand(Time.new.to_i)
31
30
  num_pvs = $proverbs.size
32
- fi = rand(num_pvs)
33
- second = first = $proverbs[fi][0]
34
- si = fi
35
- until (si != fi && $proverbs[si][0] != first)
31
+ srand(Time.new.to_i)
32
+ first = ''
33
+ until !first.empty?
34
+ fi = rand(num_pvs)
35
+ second = first = $proverbs[fi][0]
36
+ si = fi
37
+ end
38
+ until (si != fi && $proverbs[si][0] != first && !second.empty?)
36
39
  si = rand(num_pvs)
37
40
  second = $proverbs[si][1]
38
41
  end
42
+ =begin
43
+ puts ($proverbs[fi].to_s << " (" << fi.to_s << ")")
44
+ puts ($proverbs[si].to_s << " (" << si.to_s << ")")
45
+ =end
39
46
  phr = first << ' ' << second << '.'
40
47
 
41
48
  #draw
@@ -48,5 +55,5 @@ class SprichWoerter
48
55
  end
49
56
 
50
57
  if __FILE__ == $0
51
- sp = SprichWoerter.new
58
+ sp = SprichWoerter.new(ARGV[0])
52
59
  end
metadata CHANGED
@@ -1,24 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Sprichwoerter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: '0.1'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Uplawski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-30 00:00:00.000000000 Z
11
+ date: 2016-11-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: Combines German proverbs into new, mostely senseless proverbs
13
+ description: Combines German or English proverbs into new, mostely senseless proverbs
14
14
  email: michael.uplawski@uplawski.eu
15
15
  executables:
16
16
  - sprichwoerter
17
+ - proverbs
17
18
  extensions: []
18
19
  extra_rdoc_files: []
19
20
  files:
21
+ - bin/proverbs
20
22
  - bin/sprichwoerter
21
- - lib/liste.rb
23
+ - lib/liste_de.rb
24
+ - lib/liste_en.rb
22
25
  - lib/sprichwörter.rb
23
26
  homepage:
24
27
  licenses:
@@ -40,8 +43,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
40
43
  version: '0'
41
44
  requirements: []
42
45
  rubyforge_project:
43
- rubygems_version: 2.6.6
46
+ rubygems_version: 2.6.7
44
47
  signing_key:
45
48
  specification_version: 4
46
- summary: minor changes, 's' added in the description text.
49
+ summary: Call as proverbs for English (senseless) proverbs.
47
50
  test_files: []