wallpapering 0.0.3 → 0.0.4

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.
@@ -1,5 +1,6 @@
1
1
  class Array
2
2
  def map_as(klass)
3
+ warn "[DEPRECATED] `map_as` has been deprecated in favour of `map(&Decorator)`"
3
4
  map{ |e| klass.new(e) }
4
5
  end
5
6
  end
@@ -3,5 +3,9 @@ module Wallpapering
3
3
  def class
4
4
  __getobj__.class
5
5
  end
6
+
7
+ def self.to_proc
8
+ ->(obj){ self.new(obj) }
9
+ end
6
10
  end
7
11
  end
@@ -1,3 +1,3 @@
1
1
  module Wallpapering
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -34,4 +34,12 @@ module Wallpapering
34
34
  expect(subject.class).to be(Object)
35
35
  end
36
36
  end
37
+
38
+ describe ".to_proc" do
39
+ it "allows Decorator to be passed as a proc" do
40
+ [1, 2, 3].map(&FooDecorator).each do |element|
41
+ element.should be_a FooDecorator
42
+ end
43
+ end
44
+ end
37
45
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wallpapering
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-30 00:00:00.000000000 Z
12
+ date: 2013-08-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -76,18 +76,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
76
76
  - - ! '>='
77
77
  - !ruby/object:Gem::Version
78
78
  version: '0'
79
- segments:
80
- - 0
81
- hash: 1900197081549939660
82
79
  required_rubygems_version: !ruby/object:Gem::Requirement
83
80
  none: false
84
81
  requirements:
85
82
  - - ! '>='
86
83
  - !ruby/object:Gem::Version
87
84
  version: '0'
88
- segments:
89
- - 0
90
- hash: 1900197081549939660
91
85
  requirements: []
92
86
  rubyforge_project:
93
87
  rubygems_version: 1.8.25