enumerable_mapper 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +3 -0
- data/License.txt +20 -0
- data/Manifest.txt +18 -0
- data/README.txt +28 -0
- data/Rakefile +4 -0
- data/config/hoe.rb +70 -0
- data/config/requirements.rb +17 -0
- data/lib/enumerable_mapper/version.rb +9 -0
- data/lib/enumerable_mapper.rb +26 -0
- data/log/debug.log +0 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/setup.rb +1585 -0
- data/tasks/deployment.rake +27 -0
- data/tasks/environment.rake +7 -0
- data/tasks/website.rake +9 -0
- data/test/test_enumerable_mapper.rb +36 -0
- data/test/test_helper.rb +2 -0
- metadata +68 -0
@@ -0,0 +1,27 @@
|
|
1
|
+
desc 'Release the website and new gem version'
|
2
|
+
task :deploy => [:check_version, :website, :release] do
|
3
|
+
puts "Remember to create SVN tag:"
|
4
|
+
puts "svn copy svn+ssh://#{RUBYFORGE_USERNAME}@rubyforge.org/var/svn/#{PATH}/trunk " +
|
5
|
+
"svn+ssh://#{RUBYFORGE_USERNAME}@rubyforge.org/var/svn/#{PATH}/tags/REL-#{VERS} "
|
6
|
+
puts "Suggested comment:"
|
7
|
+
puts "Tagging release #{CHANGES}"
|
8
|
+
end
|
9
|
+
|
10
|
+
desc 'Runs tasks website_generate and install_gem as a local deployment of the gem'
|
11
|
+
task :local_deploy => [:website_generate, :install_gem]
|
12
|
+
|
13
|
+
task :check_version do
|
14
|
+
unless ENV['VERSION']
|
15
|
+
puts 'Must pass a VERSION=x.y.z release version'
|
16
|
+
exit
|
17
|
+
end
|
18
|
+
unless ENV['VERSION'] == VERS
|
19
|
+
puts "Please update your version.rb to match the release version, currently #{VERS}"
|
20
|
+
exit
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
desc 'Install the package as a gem, without generating documentation(ri/rdoc)'
|
25
|
+
task :install_gem_no_doc => [:clean, :package] do
|
26
|
+
sh "#{'sudo ' unless Hoe::WINDOZE }gem install pkg/*.gem --no-rdoc --no-ri"
|
27
|
+
end
|
data/tasks/website.rake
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper.rb'
|
2
|
+
|
3
|
+
class String
|
4
|
+
def pig_latin
|
5
|
+
( m = self.match( /^([bcdfghjklmnpqrstvwxyz])(.*)/i ) ) ? "#{m[2]}-#{m[1]}ay" : "#{self}-ay"
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
|
10
|
+
class TestEnumerableMapper < Test::Unit::TestCase
|
11
|
+
|
12
|
+
def setup
|
13
|
+
end
|
14
|
+
|
15
|
+
# Let's check that the pig latin translator works as intended
|
16
|
+
def test_pig_latin
|
17
|
+
assert_equal "utton-bay", "button".pig_latin
|
18
|
+
assert_equal "eagle-ay", "eagle".pig_latin
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_mapper
|
22
|
+
assert Array.new.methods.include?( 'mapped' ), "All enumerables should have been extended with mapped"
|
23
|
+
assert [1,2,3].mapped, "Array.mapped should return a value"
|
24
|
+
assert [1,2,3].collected, "The collected alias should work as well"
|
25
|
+
assert [1,2,3].mapped.kind_of?( Enumerable::Mapper ), "The returned object should be a mapper object"
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_mapped
|
29
|
+
assert_equal %w{enumerable-ay apper-may orks-way as-ay intended-ay}, %w{enumerable mapper works as intended}.mapped.pig_latin
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_with_args
|
33
|
+
assert_equal [0,1,0,1,0,1,0,1], [0,1,2,3,4,5,6,7].mapped.modulo( 2 )
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
data/test/test_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
rubygems_version: 0.9.4
|
3
|
+
specification_version: 1
|
4
|
+
name: enumerable_mapper
|
5
|
+
version: !ruby/object:Gem::Version
|
6
|
+
version: 0.5.0
|
7
|
+
date: 2007-08-29 00:00:00 +02:00
|
8
|
+
summary: This gem provides a shorthand for simple .map/.collect calls on collections.
|
9
|
+
require_paths:
|
10
|
+
- lib
|
11
|
+
email: inge@elektronaut.no
|
12
|
+
homepage: http://enum-mapper.rubyforge.org
|
13
|
+
rubyforge_project: enum-mapper
|
14
|
+
description: This gem provides a shorthand for simple .map/.collect calls on collections.
|
15
|
+
autorequire:
|
16
|
+
default_executable:
|
17
|
+
bindir: bin
|
18
|
+
has_rdoc: true
|
19
|
+
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.0.0
|
24
|
+
version:
|
25
|
+
platform: ruby
|
26
|
+
signing_key:
|
27
|
+
cert_chain:
|
28
|
+
post_install_message:
|
29
|
+
authors:
|
30
|
+
- "Inge J\xC3\xB8rgensen"
|
31
|
+
files:
|
32
|
+
- History.txt
|
33
|
+
- License.txt
|
34
|
+
- Manifest.txt
|
35
|
+
- README.txt
|
36
|
+
- Rakefile
|
37
|
+
- config/hoe.rb
|
38
|
+
- config/requirements.rb
|
39
|
+
- lib/enumerable_mapper.rb
|
40
|
+
- lib/enumerable_mapper/version.rb
|
41
|
+
- log/debug.log
|
42
|
+
- script/destroy
|
43
|
+
- script/generate
|
44
|
+
- setup.rb
|
45
|
+
- tasks/deployment.rake
|
46
|
+
- tasks/environment.rake
|
47
|
+
- tasks/website.rake
|
48
|
+
- test/test_enumerable_mapper.rb
|
49
|
+
- test/test_helper.rb
|
50
|
+
test_files:
|
51
|
+
- test/test_enumerable_mapper.rb
|
52
|
+
- test/test_helper.rb
|
53
|
+
rdoc_options:
|
54
|
+
- --main
|
55
|
+
- README.txt
|
56
|
+
extra_rdoc_files:
|
57
|
+
- History.txt
|
58
|
+
- License.txt
|
59
|
+
- Manifest.txt
|
60
|
+
- README.txt
|
61
|
+
executables: []
|
62
|
+
|
63
|
+
extensions: []
|
64
|
+
|
65
|
+
requirements: []
|
66
|
+
|
67
|
+
dependencies: []
|
68
|
+
|