ruby-nuggets 0.6.3 → 0.6.4

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/README CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  == VERSION
4
4
 
5
- This documentation refers to ruby-nuggets version 0.6.3
5
+ This documentation refers to ruby-nuggets version 0.6.4
6
6
 
7
7
 
8
8
  == DESCRIPTION
data/Rakefile CHANGED
@@ -16,8 +16,8 @@ begin
16
16
  :extra_files => FileList['[A-Z]*'].to_a
17
17
  }
18
18
  }}
19
- rescue LoadError
20
- abort "Please install the 'hen' gem first."
19
+ rescue LoadError => err
20
+ warn "Please install the `hen' gem first. (#{err})"
21
21
  end
22
22
 
23
23
  desc "Run all specs in isolation"
@@ -0,0 +1,5 @@
1
+ require 'nuggets/integer/map_mixin'
2
+
3
+ class Integer
4
+ include Nuggets::Integer::MapMixin
5
+ end
@@ -0,0 +1,43 @@
1
+ #--
2
+ ###############################################################################
3
+ # #
4
+ # A component of ruby-nuggets, some extensions to the Ruby programming #
5
+ # language. #
6
+ # #
7
+ # Copyright (C) 2007-2010 Jens Wille #
8
+ # #
9
+ # Authors: #
10
+ # Jens Wille <jens.wille@uni-koeln.de> #
11
+ # #
12
+ # ruby-nuggets is free software; you can redistribute it and/or modify it #
13
+ # under the terms of the GNU General Public License as published by the Free #
14
+ # Software Foundation; either version 3 of the License, or (at your option) #
15
+ # any later version. #
16
+ # #
17
+ # ruby-nuggets is distributed in the hope that it will be useful, but WITHOUT #
18
+ # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
19
+ # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
20
+ # more details. #
21
+ # #
22
+ # You should have received a copy of the GNU General Public License along #
23
+ # with ruby-nuggets. If not, see <http://www.gnu.org/licenses/>. #
24
+ # #
25
+ ###############################################################################
26
+ #++
27
+
28
+ module Nuggets
29
+ class Integer
30
+ module MapMixin
31
+
32
+ # call-seq:
33
+ # int.map_positive => anInteger
34
+ #
35
+ # Creates a bijection from *Z* to *N*, i.e., it maps _int_ to a positive
36
+ # integer.
37
+ def map_positive
38
+ 2 * abs + (self > 0 ? 0 : 1)
39
+ end
40
+
41
+ end
42
+ end
43
+ end
@@ -4,7 +4,7 @@ module Nuggets
4
4
 
5
5
  MAJOR = 0
6
6
  MINOR = 6
7
- TINY = 3
7
+ TINY = 4
8
8
 
9
9
  class << self
10
10
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-nuggets
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 3
10
- version: 0.6.3
9
+ - 4
10
+ version: 0.6.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jens Wille
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-06-28 00:00:00 +02:00
18
+ date: 2010-12-17 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -31,6 +31,8 @@ extra_rdoc_files:
31
31
  - README
32
32
  files:
33
33
  - lib/nuggets.rb
34
+ - lib/nuggets/integer/map_mixin.rb
35
+ - lib/nuggets/integer/map.rb
34
36
  - lib/nuggets/integer/to_binary_s.rb
35
37
  - lib/nuggets/integer/factorial.rb
36
38
  - lib/nuggets/integer/length_mixin.rb
@@ -132,14 +134,14 @@ licenses: []
132
134
 
133
135
  post_install_message:
134
136
  rdoc_options:
135
- - --line-numbers
136
- - --inline-source
137
+ - --title
138
+ - ruby-nuggets Application documentation
137
139
  - --main
138
140
  - README
141
+ - --line-numbers
142
+ - --inline-source
139
143
  - --charset
140
144
  - UTF-8
141
- - --title
142
- - ruby-nuggets Application documentation
143
145
  - --all
144
146
  require_paths:
145
147
  - lib