ruby-lambdas 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 771d6089b5f69e89e34b7596edbdf925fa5e2b4648d81da1e3b4bf72ff28f477
4
- data.tar.gz: dfdf5062b4bdbdab2dccfa0004b503917891cb07440a6e0c8a51320d4e58749a
3
+ metadata.gz: 7e2a7b9e186dea079aa61cc20eb5b2635a67acbfa0ac712f2907bdba7003a0bb
4
+ data.tar.gz: 5c5991a70d60ba6bbf7cf186302be5000f637ab85650420098149061c35b96cf
5
5
  SHA512:
6
- metadata.gz: b97b8b83d86b626418e87b3aaa6b8a696c2e3b3e2ddc6436ef80b9c1e927475ca2383e00097d874cb51dc2616341cbdb98da36c3073ac7ade707ab041ddd2e25
7
- data.tar.gz: beb380a94fe2a5a937227b8f7231735000b95f44f4353512cba4246e4df8cd5adf7faf371910bc01ab3acb727e9e026d910385891d81ac374f7d20474eb85681
6
+ metadata.gz: ccef27684c7244f53d845c1a00b4b1ea23b897f8af5518e6cc324c22286820d4e1d7225e4ceaedfe754ec18bed651298133f14a0b236c203d620f7d972175f6f
7
+ data.tar.gz: 669a6de05dc29bc1d665c8bbc4c1d4a40885fee74a8bb9412c66b427ff623cda4de26cec841db924cfa191c644adcf4231076ff3ccbf59a82f0258bb7024e41c
@@ -6,14 +6,6 @@
6
6
  #
7
7
  [:String!, :Numeric!].each do |name|
8
8
  Kernel.remove_method(name) if Kernel.respond_to?(name)
9
- end
10
-
11
- module Kernel
12
- def String!(data)
13
- data
14
- end
15
9
 
16
- def Numeric!(data)
17
- data
18
- end
10
+ Kernel.module_eval { define_method(name) { |data| data } }
19
11
  end
@@ -6,12 +6,12 @@ module Kernel
6
6
  def String!(data)
7
7
  return data if data.is_a?(::String)
8
8
 
9
- raise TypeError, "#{data.inspect} must be a String"
9
+ raise Strings::TypeError.new(data)
10
10
  end
11
11
 
12
12
  def Numeric!(data)
13
13
  return data if data.is_a?(::Numeric)
14
14
 
15
- raise TypeError, "#{data.inspect} must be Numeric"
15
+ raise Numerics::TypeError.new(data)
16
16
  end
17
17
  end
@@ -2,6 +2,7 @@ module Numerics
2
2
  require_relative "core/strict_mode/disable"
3
3
  require_relative "core/import"
4
4
  require_relative "numerics/to_export"
5
+ require_relative "numerics/type_error"
5
6
 
6
7
  RubyLambdas::Import.(from: RubyLambdas::Numerics, to: self)
7
8
 
@@ -0,0 +1,7 @@
1
+ module Numerics
2
+ class TypeError < ::TypeError
3
+ def initialize(data)
4
+ super("#{data.inspect} must be Numeric")
5
+ end
6
+ end
7
+ end
@@ -2,6 +2,7 @@ module Strings
2
2
  require_relative "core/strict_mode/disable"
3
3
  require_relative "core/import"
4
4
  require_relative "strings/to_export"
5
+ require_relative "strings/type_error"
5
6
 
6
7
  RubyLambdas::Import.(from: RubyLambdas::Strings, to: self)
7
8
  end
@@ -0,0 +1,7 @@
1
+ module Strings
2
+ class TypeError < ::TypeError
3
+ def initialize(data)
4
+ super("#{data.inspect} must be a String")
5
+ end
6
+ end
7
+ end
@@ -1,3 +1,3 @@
1
1
  module RubyLambdas
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-lambdas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Serradura
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-03 00:00:00.000000000 Z
11
+ date: 2019-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -80,11 +80,13 @@ files:
80
80
  - lib/ruby/lambdas/core/strict_mode/enable.rb
81
81
  - lib/ruby/lambdas/numerics.rb
82
82
  - lib/ruby/lambdas/numerics/to_export.rb
83
+ - lib/ruby/lambdas/numerics/type_error.rb
83
84
  - lib/ruby/lambdas/objects.rb
84
85
  - lib/ruby/lambdas/objects/to_export.rb
85
86
  - lib/ruby/lambdas/strict-mode.rb
86
87
  - lib/ruby/lambdas/strings.rb
87
88
  - lib/ruby/lambdas/strings/to_export.rb
89
+ - lib/ruby/lambdas/strings/type_error.rb
88
90
  - lib/ruby/lambdas/version.rb
89
91
  - ruby-lambdas.gemspec
90
92
  homepage:
@@ -107,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
109
  - !ruby/object:Gem::Version
108
110
  version: '0'
109
111
  requirements: []
110
- rubygems_version: 3.0.1
112
+ rubygems_version: 3.0.2
111
113
  signing_key:
112
114
  specification_version: 4
113
115
  summary: Exposes Ruby object methods as lambdas (functions).