veils 0.1.0 → 0.1.1

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: 4e17ed55e57e44a067b74f7e777e807966a4ee95bb959cd02955e6b2de37ee13
4
- data.tar.gz: bcc1eede5094552059590051a2157719e89f6126fc62623b5172337540504396
3
+ metadata.gz: 118e44a284298758283feec3e5f526724285c9c230ea18422bfae98c47c9df59
4
+ data.tar.gz: f543413fd2516f9c39096da39b2686a93fd8d899a993696026e3faf5ac5d881d
5
5
  SHA512:
6
- metadata.gz: 653490f8e6aa789b305334cab1c62c06047768b6c6617cde88f3c9516c29571315716470a9aa6db38145c60da7d85c6e0ebee3352311dc6dd9c8bb8d8a4ea094
7
- data.tar.gz: f7951bab961d687b1fe768ae1f9c45c0a333e284fccf9627f32fe7990ebc68078ad83270e4a2daf175a0c631b02d416c4fde8b4dc155ce4822cbc1df26227845
6
+ metadata.gz: 83bf6ac8840069abd15abdd6a8c9579fbdd1eafb052aa698e29594510725e63d3e97bae0bb4b36b9cebef044dcdc9c44d96255b01be6279ee6967fc7a3d35512
7
+ data.tar.gz: 254c110d254d7888e8f2cdc976889cce64f4995daa4589a775bacff00de991ac8e669a9b05282eec2cd0c14ad8ec005f27c878f5b8f53da98b9ecf4382eebeb1
data/lib/veil.rb CHANGED
@@ -49,7 +49,8 @@ class Veil
49
49
 
50
50
  def method_missing(*args)
51
51
  method = args[0]
52
- if @pierced
52
+ if @pierced || !@methods.key?(method)
53
+ @pierced = true
53
54
  unless @origin.respond_to?(method)
54
55
  raise "Method #{method} is absent in #{@origin}"
55
56
  end
@@ -60,11 +61,8 @@ class Veil
60
61
  else
61
62
  @origin.__send__(*args)
62
63
  end
63
- elsif @methods.key?(method)
64
- @methods[method]
65
64
  else
66
- @pierced = true
67
- method_missing(*args)
65
+ @methods[method]
68
66
  end
69
67
  end
70
68
 
data/logo.svg ADDED
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="314px" height="314px" viewBox="0 0 314 314" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <!-- Generator: Sketch 43.2 (39069) - http://www.bohemiancoding.com/sketch -->
4
+ <title>Group 2</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <defs></defs>
7
+ <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
8
+ <g id="Group-2">
9
+ <g id="Group">
10
+ <circle id="Oval" fill="#053C5E" cx="157" cy="157" r="157"></circle>
11
+ <rect id="Rectangle" fill="#2B2B2B" x="0" y="234" width="212" height="68"></rect>
12
+ <text id="veils" font-family="CourierNewPS-BoldMT, Courier New" font-size="50" font-weight="bold" fill="#FFFFFF">
13
+ <tspan x="28" y="282">veils</tspan>
14
+ </text>
15
+ <path d="M135.676765,111.215287 C135.211714,113.540467 132.770932,120.688823 130.252813,127.100603 C127.734621,133.512383 125.2898,140.431445 124.819828,142.476214 C123.6868,147.405663 121.517836,147.185477 119.69487,141.95608 C116.899865,133.938362 105.171362,111.043501 103.859129,111.043501 C100.420089,111.043501 101.508757,114.986149 109.1771,130.30227 C113.739327,139.414532 118.032086,147.448041 118.716515,148.15443 C120.694817,150.196115 120.172626,154.319657 117.358599,158.877992 C113.567467,165.019055 107.570942,183.721189 108.054206,187.896804 C108.804956,194.383204 112.436054,192.210274 113.355359,184.724515 C114.48376,175.535577 120.945556,159.641154 124.897459,156.333653 C127.109021,154.482778 128.268636,151.905536 128.573284,148.163978 C128.818001,145.157747 131.906711,135.560972 135.437115,126.837819 C138.96752,118.114666 141.511492,110.079835 141.090434,108.982574 C139.755727,105.504315 136.554941,106.824333 135.676765,111.215287 M174.714659,126.841564 C169.37392,129.699438 169.197653,130.049915 167.452978,141.283475 C165.577352,153.360398 165.225112,168.513913 166.548289,180.203784 L167.566817,189.202501 L161.346213,191.9541 C154.601949,194.937416 150.91195,200.302465 153.156708,203.861146 C155.104824,206.949562 157.09025,206.70198 157.571826,203.310532 C158.083734,199.706169 166.097413,193.204052 170.29418,192.987978 C172.116999,192.894116 173.522874,191.717021 173.97823,189.903529 C174.383277,188.290613 177.740353,184.944554 181.438431,182.467858 C188.546172,177.707551 194.317883,170.450278 194.317883,166.273341 C194.317883,162.684548 189.493165,158.361603 185.487795,158.361603 C180.701636,158.361603 180.027195,155.239403 183.731222,150.229385 C188.308065,144.038966 188.284856,130.867646 183.690534,127.147387 C179.896537,124.075276 179.885006,124.074836 174.714659,126.841564 M182.67318,134.240439 C184.752542,140.153164 174.808961,161.185104 171.588639,157.68562 C169.868715,155.81653 172.863122,135.012708 175.266374,132.134564 C177.872553,129.013319 181.163896,129.949075 182.67318,134.240439 M184.854262,162.269586 C190.589839,163.855621 189.673839,167.881335 181.645765,176.371155 C177.281618,180.986262 173.904933,183.573859 173.371946,182.711474 C172.876636,181.91012 172.127869,176.711937 171.707987,171.159972 L170.944531,161.065463 L176.209475,161.200234 C179.105172,161.274339 182.995308,161.755548 184.854262,162.269586 M132.642184,172.492256 C131.593837,175.224098 133.152917,177.288844 136.264027,177.288844 C139.014965,177.288844 139.431396,176.221769 138.067531,172.667568 C137.039234,169.987871 133.645289,169.878218 132.642184,172.492256 M203.781503,185.840798 C203.781503,187.657595 209.264724,193.512152 210.966361,193.512152 C212.534035,193.512152 211.991059,187.391138 210.270768,185.670847 C208.092403,183.492409 203.781503,183.605293 203.781503,185.840798" id="Fill-6" fill="#427B8A" fill-rule="nonzero"></path>
16
+ </g>
17
+ </g>
18
+ </g>
19
+ </svg>
data/test/test_veil.rb CHANGED
@@ -62,4 +62,13 @@ class VeilTest < Minitest::Test
62
62
  foo.each { |_| observed += 1 }
63
63
  assert_equal(3, observed)
64
64
  end
65
+
66
+ def test_iterates_array_twice
67
+ origin = [1, 2, 3]
68
+ foo = Veil.new(origin, count: 1)
69
+ assert_equal(1, foo.count)
70
+ observed = 0
71
+ foo.each { |_| observed += 1 }
72
+ assert_equal(3, observed)
73
+ end
65
74
  end
data/veils.gemspec CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
31
31
  s.rubygems_version = '2.3.3'
32
32
  s.required_ruby_version = '>=2.3'
33
33
  s.name = 'veils'
34
- s.version = '0.1.0'
34
+ s.version = '0.1.1'
35
35
  s.license = 'MIT'
36
36
  s.summary = 'Ruby Veil Objects'
37
37
  s.description = 'Decorate your existing Ruby object with veils
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: veils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
@@ -101,6 +101,7 @@ files:
101
101
  - Rakefile
102
102
  - appveyor.yml
103
103
  - lib/veil.rb
104
+ - logo.svg
104
105
  - test/test_veil.rb
105
106
  - veils.gemspec
106
107
  homepage: http://github.com/yegor256/veils