typed-array 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,19 +1,42 @@
1
1
  = typed-array
2
2
 
3
- Description goes here.
3
+ Gem provides enforced-type functionality to Arrays
4
4
 
5
- == Contributing to typed-array
5
+ Copyright (c) 2011 Ryan Biesemeyer
6
+ See LICENSE.txt for details
7
+
8
+ Ryan Biesemeyer mailto:ruby-dev@yaauie.com
9
+
10
+ == Example
11
+
12
+ === Create Standard Class
13
+
14
+ require 'typed-array'
15
+ class Things < Array
16
+ extend TypedArray
17
+ restrict_types Thing1,Thing2
18
+ end
19
+
20
+ === Generate Class using Factory
21
+
22
+ require 'typed-array'
23
+ things = TypedArray(Thing1,Thing2)
24
+
25
+ === Adding items to the Array
26
+
27
+ # All standard Array interfaces are implemented, including block-processing
28
+ # and variable-number of arguments. For methods that would usually return an
29
+ # Array, they instead return an instance of the current class (except to_a).
30
+ #
31
+ # The difference is that if the method would generate an Array including the
32
+ # wrong types, TypedArray::UnexpectedTypeException is raised and the call is
33
+ # aborted before modifying the enforced TypedArray instance.
6
34
 
7
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
8
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
9
- * Fork the project
10
- * Start a feature/bugfix branch
11
- * Commit and push until you are happy with your contribution
12
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
-
15
- == Copyright
16
-
17
- Copyright (c) 2011 Ryan Biesemeyer. See LICENSE.txt for
18
- further details.
35
+ require 'typed-array'
36
+ symbols = TypedArray(Symbol).new([:foo,:bar,:baz,:bingo])
37
+ begin
38
+ integers = TypedArray(Integer).new([1,3,7,2,:symbol])
39
+ rescue TypedArray::UnexpectedTypeException
40
+ puts "An error occured: #{$!}"
41
+ end
19
42
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -1,43 +1,4 @@
1
- # = typed-array - Gemp provides enforced-type functionality to Arrays
2
- #
3
- # Copyright (c) 2011 Ryan Biesemeyer
4
- # See LICENSE.txt for details
5
- #
6
- # Ryan Biesemeyer mailto:ruby-dev@yaauie.com
7
- #
8
- # == Example
9
- #
10
- # === Create Standard Class
11
- #
12
- # require 'typed-array'
13
- # class Things < Array
14
- # extend TypedArray
15
- # restrict_types Thing1,Thing2
16
- # end
17
- #
18
- # === Generate Class using Factory
19
- #
20
- # require 'typed-array'
21
- # things = TypedArray(Thing1,Thing2)
22
- #
23
- # === Adding items to the Array
24
- #
25
- # # All standard Array interfaces are implemented, including block-processing
26
- # # and variable-number of arguments. For methods that would usually return an
27
- # # Array, they instead return an instance of the current class (except to_a).
28
- # #
29
- # # The difference is that if the method would generate an Array including the
30
- # # wrong types, TypedArray::UnexpectedTypeException is raised and the call is
31
- # # aborted before modifying the enforced TypedArray instance.
32
- #
33
- # require 'typed-array'
34
- # symbols = TypedArray(Symbol).new([:foo,:bar,:baz,:bingo])
35
- # begin
36
- # integers = TypedArray(Integer).new([1,3,7,2,:symbol])
37
- # rescue TypedArray::UnexpectedTypeException
38
- # puts "An error occured: #{$!}"
39
- # end
40
- #
1
+ # :include: ../README.rdoc
41
2
 
42
3
  require "typed-array/functions"
43
4
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{typed-array}
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Ryan Biesemeyer}]
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: typed-array
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.1
5
+ version: 0.1.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Ryan Biesemeyer
@@ -93,7 +93,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
- hash: -1404333859744270865
96
+ hash: 2753660141613797258
97
97
  segments:
98
98
  - 0
99
99
  version: "0"