typesafe-ruby 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.rdoc +70 -0
  2. data/Rakefile +0 -15
  3. metadata +6 -4
@@ -0,0 +1,70 @@
1
+ = typesafe-ruby
2
+
3
+ * http://github.com/drexin/typesafe-ruby
4
+
5
+ == Description:
6
+
7
+ Adds typesafe macro to class Module, to provide type safe method declarations.
8
+
9
+ == Usage
10
+
11
+ require 'typesafe'
12
+
13
+ Now you can use the typesafe macro in classes and modules.
14
+
15
+ Example:
16
+
17
+ class Foo
18
+ typesafe(Integer)
19
+ def bar a
20
+ p a
21
+ end
22
+ end
23
+
24
+ The method bar now only accepts arguments of type Integer. If an object of a different type is passed to foo it will raise an ArgumentError.
25
+
26
+ You can also use typed collections and varargs.
27
+
28
+ Example:
29
+
30
+ class Foo
31
+ typesafe(Array[Integer])
32
+ def bar a
33
+ p a
34
+ end
35
+
36
+ typesafe(VarArgs[Integer])
37
+ def baz *a
38
+ p a
39
+ end
40
+
41
+ typesafe(Hash[String, Integer])
42
+ def foobar a
43
+ p a
44
+ end
45
+ end
46
+
47
+ == License:
48
+
49
+ The MIT License
50
+
51
+ Copyright (c) 2010 Dario Rexin
52
+
53
+ Permission is hereby granted, free of charge, to any person obtaining
54
+ a copy of this software and associated documentation files (the
55
+ "Software"), to deal in the Software without restriction, including
56
+ without limitation the rights to use, copy, modify, merge, publish,
57
+ distribute, sublicense, and/or sell copies of the Software, and to
58
+ permit persons to whom the Software is furnished to do so, subject to
59
+ the following conditions:
60
+
61
+ The above copyright notice and this permission notice shall be
62
+ included in all copies or substantial portions of the Software.
63
+
64
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
65
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
66
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
67
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
68
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
69
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
70
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile CHANGED
@@ -11,21 +11,6 @@ require 'rake/rdoctask'
11
11
  require 'rake/testtask'
12
12
  require 'rspec/core/rake_task'
13
13
 
14
- spec = Gem::Specification.new do |s|
15
- s.name = 'typesafe-ruby'
16
- s.version = '0.0.1'
17
- s.has_rdoc = true
18
- s.extra_rdoc_files = ['LICENSE']
19
- s.summary = 'Adds typesafe macro to class Module, to provide type safe method declarations.'
20
- s.description = s.summary
21
- s.author = 'Dario Rexin'
22
- s.email = 'dario.rexin@r3-tech.de'
23
- # s.executables = ['your_executable_here']
24
- s.files = %w(LICENSE Rakefile) + Dir.glob("{bin,lib,spec}/**/*")
25
- s.require_path = "lib"
26
- s.bindir = "bin"
27
- end
28
-
29
14
  Rake::RDocTask.new do |rdoc|
30
15
  files =['LICENSE', 'lib/**/*.rb']
31
16
  rdoc.rdoc_files.add(files)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Dario Rexin
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-10-13 00:00:00 +02:00
17
+ date: 2010-10-14 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -38,6 +38,7 @@ extensions: []
38
38
 
39
39
  extra_rdoc_files:
40
40
  - LICENSE
41
+ - README.rdoc
41
42
  files:
42
43
  - LICENSE
43
44
  - Rakefile
@@ -48,6 +49,7 @@ files:
48
49
  - lib/var_args.rb
49
50
  - spec/spec_helper.rb
50
51
  - spec/typesafe/typesafe_spec.rb
52
+ - README.rdoc
51
53
  has_rdoc: true
52
54
  homepage:
53
55
  licenses: []
@@ -79,6 +81,6 @@ rubyforge_project:
79
81
  rubygems_version: 1.3.7
80
82
  signing_key:
81
83
  specification_version: 3
82
- summary: Adds typesafe macro to class Module, to provide type safe method declarations.
84
+ summary: Never write typechecking yourself again.
83
85
  test_files: []
84
86