procto 0.0.1 → 0.0.2

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.
@@ -14,4 +14,4 @@ matrix:
14
14
  - rvm: jruby-head
15
15
  env: JRUBY_OPTS="$JRUBY_OPTS --debug"
16
16
  allow_failures:
17
- - rvm: ruby-head
17
+ - rvm: rbx-19mode
@@ -6,7 +6,7 @@ class Procto < Module
6
6
 
7
7
  private_class_method :new
8
8
 
9
- # Return a custom module that calls a method named +name+
9
+ # Return a module that turns the host into a method object
10
10
  #
11
11
  # @example without a name
12
12
  #
@@ -40,28 +40,26 @@ class Procto < Module
40
40
  #
41
41
  # Printer.call('world') # => "Hello world"
42
42
  #
43
- # @param [Symbol, String] name
43
+ # @param [#to_sym] name
44
44
  # the name of the instance method to call
45
45
  #
46
46
  # @return [Procto]
47
47
  #
48
48
  # @api public
49
49
  def self.call(name = DEFAULT_NAME)
50
- new(name)
50
+ new(name.to_sym)
51
51
  end
52
52
 
53
53
  # Initialize a new instance
54
54
  #
55
- # @param [Symbol, String] name
55
+ # @param [Symbol] name
56
56
  # the name of the instance method to call
57
57
  #
58
58
  # @return [undefined]
59
59
  #
60
60
  # @api private
61
61
  def initialize(name)
62
- @block = ->(*args) {
63
- new(*args).public_send(name)
64
- }
62
+ @block = ->(*args) { new(*args).public_send(name) }
65
63
  end
66
64
 
67
65
  private
@@ -2,5 +2,5 @@
2
2
 
3
3
  class Procto < Module
4
4
  # Gem version
5
- VERSION = '0.0.1'.freeze
5
+ VERSION = '0.0.2'.freeze
6
6
  end
@@ -35,9 +35,12 @@ describe Procto, '.call' do
35
35
  context 'with a name' do
36
36
  include_context 'procto'
37
37
 
38
+ let(:name) { double('name', to_sym: :print) }
39
+
38
40
  let(:klass) do
41
+ method_name = name
39
42
  Class.new do
40
- include Procto.call(:print)
43
+ include Procto.call(method_name)
41
44
 
42
45
  def initialize(text)
43
46
  @text = text
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: procto
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: