creepcheck 3181.0.1 → 3182.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +7 -0
  2. data/bin/creepcheck +26 -14
  3. data/lib/creep_check.rb +9 -1
  4. metadata +14 -16
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: decdb9556fdcd9e4ad50860d79ebbd966ddfdbf2
4
+ data.tar.gz: 6f3b23e4121a654f06a55ba10879a739cdd69710
5
+ SHA512:
6
+ metadata.gz: 183676bf8a7a19f286f8dfad6aa535c825900b70c8ad3470d2e0c814580e8b46ea8166288a3190f9453a31dd9723a7cff50abcc4ad8368f1be6a37ba88e22e83
7
+ data.tar.gz: abf387eba8cba7e9802876524a8fb9b3337067c39fa43117761cf915fc02f5db7ec13bc88b48cd71a5408174cb5abd9f1cb5c862a1917dc8ad42ecd8c8d14034
@@ -40,18 +40,16 @@ if (command == 'help') or (command == '-h') or (command == '--help')
40
40
  puts %q{ ject) and a TARGET_DATE (the current}
41
41
  puts %q{ date is default if no TARGET_DATE speci-}
42
42
  puts %q{ fied), rounded to two decimal places}
43
- =begin
44
- puts
45
- puts %q{ older <YOUNGER>}
46
- puts %q{ show the oldest non-creepy age for a}
47
- puts %q{ younger partner, given YOUNGER (the age}
48
- puts %q{ of the younger partner)}
49
43
  puts
50
44
  puts %q{ younger <OLDER>}
51
45
  puts %q{ show the youngest non-creepy age for an}
52
46
  puts %q{ older partner, given OLDER (the age of}
53
47
  puts %q{ the older partner)}
54
- =end
48
+ puts
49
+ puts %q{ older <YOUNGER>}
50
+ puts %q{ show the oldest non-creepy age for a}
51
+ puts %q{ younger partner, given YOUNGER (the age}
52
+ puts %q{ of the younger partner)}
55
53
  elsif command == 'creepy'
56
54
  current = Date.today
57
55
  if ARGV.size > 3
@@ -65,11 +63,7 @@ elsif command == 'creepy'
65
63
  puts 'You did not provide enough parameters.'
66
64
  end
67
65
 
68
- creepiness = if date
69
- CreepCheck.creep?(older, younger, date)
70
- else
71
- CreepCheck.creep?(older, younger)
72
- end
66
+ creepiness = CreepCheck.creep? older, younger, (date or current)
73
67
 
74
68
  puts creepiness ? 'CREEPY' : 'NOT CREEPY'
75
69
  elsif command == 'range'
@@ -88,10 +82,28 @@ elsif command == 'range'
88
82
  else
89
83
  puts 'You entered too many parameters.'
90
84
  end
91
- =begin
92
85
  elsif command == 'older'
86
+ if ARGV.size < 1
87
+ puts 'You did not provide enough parameters.'
88
+ elsif ARGV.size < 2
89
+ bday = ARGV.shift
90
+ maximum = CreepCheck.uncreepy_upper_bound(bday).round 2
91
+
92
+ puts "Maximum uncreepy partner age for birthday #{bday}: #{maximum}"
93
+ else
94
+ puts 'You entered too many parameters.'
95
+ end
93
96
  elsif command == 'younger'
94
- =end
97
+ if ARGV.size < 1
98
+ puts 'You did not provide enough parameters.'
99
+ elsif ARGV.size < 2
100
+ bday = ARGV.shift
101
+ minimum = CreepCheck.uncreepy_lower_bound(bday).round 2
102
+
103
+ puts "Minimum uncreepy partner age for birthday #{bday}: #{minimum}"
104
+ else
105
+ puts 'You entered too many parameters.'
106
+ end
95
107
  else
96
108
  usage
97
109
  if command
@@ -102,7 +102,7 @@ class CreepCheck
102
102
  end
103
103
 
104
104
  def self.version
105
- '3181.0.1'
105
+ '3182.0.0'
106
106
  end
107
107
 
108
108
  def creep?(younger)
@@ -179,6 +179,14 @@ class CreepCheck
179
179
  ]
180
180
  end
181
181
 
182
+ def self.uncreepy_lower_bound(bday, target_date=Date.today)
183
+ uncreepy_lower_bound_days(bday, target_date) / @@year
184
+ end
185
+
186
+ def self.uncreepy_upper_bound(bday, target_date=Date.today)
187
+ uncreepy_upper_bound_days(bday, target_date) / @@year
188
+ end
189
+
182
190
  def self.uncreepy_lower_bound_days(bday, target_date=Date.today)
183
191
  (to_date(target_date) - to_date(bday)) / 2.0 + @@seven
184
192
  end
metadata CHANGED
@@ -1,27 +1,26 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: creepcheck
3
3
  version: !ruby/object:Gem::Version
4
- version: 3181.0.1
5
- prerelease:
4
+ version: 3182.0.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Chad Perrin
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2015-04-01 00:00:00.000000000 Z
11
+ date: 2016-04-01 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: |2
15
14
  CreepCheck is a Ruby library that provides an API for checking romantic age
16
15
  compatibility based on the popular half-plus-seven formula for determining
17
- when it is socially (in)appropriate for people to date based on their
18
- relative ages. It comes with a sample command line interface utility.
16
+ when it is socially (in)appropriate for people to date based on their rela-
17
+ tive ages. It comes with a sample command line interface utility.
19
18
 
20
19
  Opinions vary on appropriate age differences in romantic relationships, but
21
- the half-plus-seven formula seems to approximate United States cultural
22
- biases about appropriate age differences pretty well. This library and
23
- utility package was originally created as a joke related to assessing the
24
- appropriateness of relationships between characters in fictional contexts,
20
+ the half-plus-seven formula seems to approximate United States cultural bi-
21
+ ases about appropriate age differences pretty well. This library and util-
22
+ ity package was originally created as a joke related to assessing the ap-
23
+ propriateness of relationships between characters in fictional contexts,
25
24
  such as in fantasy/sci-fi prose and roleplaying games. It is not intended
26
25
  to be treated as a substitute for moral fiber or individual judgement, and
27
26
  no guarantees are made about the likelihood one's family or local courts of
@@ -39,11 +38,12 @@ extra_rdoc_files: []
39
38
  files:
40
39
  - LICENSE
41
40
  - README
42
- - lib/creep_check.rb
43
41
  - bin/creepcheck
42
+ - lib/creep_check.rb
44
43
  homepage: http://fossrec.com/u/apotheon/creepcheck
45
44
  licenses:
46
45
  - DPL
46
+ metadata: {}
47
47
  post_install_message: |2
48
48
  Thank you for using creepcheck. Usage help for the "creepcheck" command
49
49
  line utility is a "creepcheck help" command away. Unfortunately, that
@@ -60,21 +60,19 @@ rdoc_options: []
60
60
  require_paths:
61
61
  - lib
62
62
  required_ruby_version: !ruby/object:Gem::Requirement
63
- none: false
64
63
  requirements:
65
- - - '>='
64
+ - - ">="
66
65
  - !ruby/object:Gem::Version
67
66
  version: 1.9.3
68
67
  required_rubygems_version: !ruby/object:Gem::Requirement
69
- none: false
70
68
  requirements:
71
- - - '>='
69
+ - - ">="
72
70
  - !ruby/object:Gem::Version
73
71
  version: '0'
74
72
  requirements: []
75
73
  rubyforge_project:
76
- rubygems_version: 1.8.29
74
+ rubygems_version: 2.4.5.1
77
75
  signing_key:
78
- specification_version: 3
76
+ specification_version: 4
79
77
  summary: CreepCheck - check the creepiness of your relationship
80
78
  test_files: []