imitate 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/imitate.gemspec +1 -1
  3. data/lib/imitate.rb +3 -7
  4. metadata +10 -10
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
data/imitate.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "imitate"
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Petr Janda"]
data/lib/imitate.rb CHANGED
@@ -23,12 +23,8 @@ module Imitate
23
23
  # @param [Proc] Optional block to be instance evaluated on new class.
24
24
  #
25
25
  def mock_class(name, &block)
26
- process_name(name) {|parent, token, tokens|
27
- if tokens.length > 0
28
- create_const(Module, parent, token)
29
- else
30
- create_const(Class, parent, token, &block)
31
- end
26
+ process_name(name) {|parent, token, leaf|
27
+ leaf ? create_const(Class, parent, token, &block) : create_const(Module, parent, token)
32
28
  }
33
29
  end
34
30
 
@@ -59,7 +55,7 @@ module Imitate
59
55
  parent = Object
60
56
 
61
57
  while token = tokens.shift
62
- parent = yield(parent, token, tokens)
58
+ parent = yield(parent, token, tokens.length == 0)
63
59
  end
64
60
  end
65
61
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imitate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-05-03 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &2159204420 !ruby/object:Gem::Requirement
16
+ requirement: &2157547400 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 2.8.0
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *2159204420
24
+ version_requirements: *2157547400
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rdoc
27
- requirement: &2159203920 !ruby/object:Gem::Requirement
27
+ requirement: &2157546900 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '3.12'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *2159203920
35
+ version_requirements: *2157546900
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: bundler
38
- requirement: &2159203400 !ruby/object:Gem::Requirement
38
+ requirement: &2157546420 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 1.0.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *2159203400
46
+ version_requirements: *2157546420
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: jeweler
49
- requirement: &2159202880 !ruby/object:Gem::Requirement
49
+ requirement: &2157545920 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: 1.8.3
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *2159202880
57
+ version_requirements: *2157545920
58
58
  description: Simple class mock
59
59
  email: petrjanda@me.com
60
60
  executables: []
@@ -90,7 +90,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
90
90
  version: '0'
91
91
  segments:
92
92
  - 0
93
- hash: 2996185596802046611
93
+ hash: 3941489243692019198
94
94
  required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  none: false
96
96
  requirements: