cross-stub 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,10 +1,15 @@
1
- === 0.2.1 2010-09-16
1
+ === 0.2.2 (Sep 16, 2010)
2
+
3
+ = Bugfixes
4
+ * fixed incompatibilities with 1.8.6, MRI-1.8.6 is now officially supported [#ngty]
5
+
6
+ === 0.2.1 (Sep 16, 2010)
2
7
 
3
8
  = House-Keeping
4
9
  * use sourcify to extract proc code, instead of handrolled solution [#ngty]
5
10
  * use Otaku instead of handrolled EchoServer [#ngty]
6
11
 
7
- === 0.2.0 2010-07-16
12
+ === 0.2.0 (Jul 16, 2010)
8
13
 
9
14
  = New Features
10
15
  * added support for cross-stubbing instances [#liangzan]
@@ -15,33 +20,33 @@
15
20
  * dropped ParseTree dependency, use RubyParser instead [#ngty]
16
21
  * complete rewrite to have cleaner implementation (hopefully) [#ngty]
17
22
 
18
- === 0.1.4 2010-04-03
23
+ === 0.1.4 (Apr 03, 2010)
19
24
 
20
25
  = Bugfixes
21
26
  * fixed taken-for-granted-yet-broken support for nested class & module [#liangzan]
22
27
 
23
- === 0.1.3.1 2010-02-04
28
+ === 0.1.3.1 (Feb 04, 2010)
24
29
 
25
30
  * no bug fix nor new function added, somehow the previously gem release failed to
26
31
  include the previous bug fix, to avoid confusion, a new gem is released again.
27
32
 
28
- === 0.1.3 2009-12-17
33
+ === 0.1.3 (Dec 17, 2009)
29
34
 
30
35
  = Bugfixes
31
36
  * fixed broken support for stubbing a module's class methods [#liangzan]
32
37
 
33
- === 0.1.2 2009-12-16
38
+ === 0.1.2 (Dec 16, 2009)
34
39
 
35
40
  = Bugfixes
36
41
  * fixed failure in stubbing & unstubbing methods not implemented in ruby [#ngty]
37
42
 
38
- === 0.1.1 2009-12-07
43
+ === 0.1.1 (Dec 07, 2009)
39
44
 
40
45
  = Bugfixes
41
46
  * fixed rails generator by adding a matching 'After' block for clearing cache
42
47
  in current process [#ngty]
43
48
 
44
- === 0.1.0 2009-12-05
49
+ === 0.1.0 (Dec 05, 2010)
45
50
 
46
51
  First gem release! [#ngty]
47
52
 
data/Rakefile CHANGED
@@ -16,7 +16,7 @@ begin
16
16
  gem.add_dependency "ruby2ruby", ">= 1.2.5"
17
17
  gem.add_dependency "sexp_processor", ">= 3.0.5"
18
18
  gem.add_dependency "sourcify", ">= 0.2.3"
19
- gem.required_ruby_version = '>= 1.8.7'
19
+ gem.required_ruby_version = '>= 1.8.6'
20
20
  # TODO: How do we declare the following optional dependencies ??
21
21
  # 1. gem.add_dependency "memcache-client", "= 1.8.5"
22
22
  # 2. gem.add_dependency "redis", "= 2.0.3"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{cross-stub}
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["NgTzeYang"]
12
- s.date = %q{2010-09-15}
12
+ s.date = %q{2010-09-16}
13
13
  s.description = %q{}
14
14
  s.email = %q{ngty77@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -31,6 +31,7 @@ Gem::Specification.new do |s|
31
31
  "lib/cross-stub/arguments/hash.rb",
32
32
  "lib/cross-stub/arguments/proc.rb",
33
33
  "lib/cross-stub/cache.rb",
34
+ "lib/cross-stub/fixes.rb",
34
35
  "lib/cross-stub/stores.rb",
35
36
  "lib/cross-stub/stores/base.rb",
36
37
  "lib/cross-stub/stores/file.rb",
@@ -55,7 +56,7 @@ Gem::Specification.new do |s|
55
56
  s.homepage = %q{http://github.com/ngty/cross-stub}
56
57
  s.rdoc_options = ["--charset=UTF-8"]
57
58
  s.require_paths = ["lib"]
58
- s.required_ruby_version = Gem::Requirement.new(">= 1.8.7")
59
+ s.required_ruby_version = Gem::Requirement.new(">= 1.8.6")
59
60
  s.rubygems_version = %q{1.3.7}
60
61
  s.summary = %q{Simple cross process stubbing}
61
62
  s.test_files = [
@@ -9,6 +9,7 @@ require 'cross-stub/cache'
9
9
  require 'cross-stub/stubber'
10
10
  require 'cross-stub/arguments'
11
11
  require 'cross-stub/stores'
12
+ require 'cross-stub/fixes'
12
13
 
13
14
  module CrossStub
14
15
 
@@ -21,7 +21,7 @@ module CrossStub
21
21
  private
22
22
 
23
23
  def init(opts, truncate)
24
- type, arg = opts.to_a[0].map(&:to_s)
24
+ type, arg = opts.to_a[0].map{|o| o.to_s }
25
25
  @store =
26
26
  begin
27
27
  store_name = '%s%s' % [type[0..0].upcase, type[1..-1].downcase]
@@ -0,0 +1,8 @@
1
+ # 1.8.6 doesn't support String#end_with?
2
+ unless ''.respond_to?(:end_with?)
3
+ class String
4
+ def end_with?(s)
5
+ ((idx = self.length - s.length) < 0) ? false : (self[idx .. -1] == s)
6
+ end
7
+ end
8
+ end
@@ -103,7 +103,7 @@ module CrossStub
103
103
  alias_method :t_eval, :m_eval
104
104
 
105
105
  def has_method?(method)
106
- @thing.instance_methods.map(&:to_s).include?(method.to_s)
106
+ @thing.instance_methods.map{|m| m.to_s }.include?(method.to_s)
107
107
  end
108
108
 
109
109
  end
@@ -7,7 +7,7 @@ unless Object.const_defined?(:RUBY_VM)
7
7
  RUBY_VM = [
8
8
  RUBY_VERSION.gsub(/[^\d]/,''),
9
9
  RUBY_PLATFORM =~ /java/i ? 'j' : '',
10
- RUBY_DESCRIPTION =~ /enterprise/i ? 'e' : ''
10
+ (Object.const_defined?(:RUBY_DESCRIPTION) ? RUBY_DESCRIPTION : '') =~ /enterprise/i ? 'e' : ''
11
11
  ].join
12
12
 
13
13
  PROJECT_ROOT = File.join(File.dirname(File.expand_path(__FILE__)), '..')
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cross-stub
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 1
10
- version: 0.2.1
9
+ - 2
10
+ version: 0.2.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - NgTzeYang
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-15 00:00:00 +08:00
18
+ date: 2010-09-16 00:00:00 +08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -122,6 +122,7 @@ files:
122
122
  - lib/cross-stub/arguments/hash.rb
123
123
  - lib/cross-stub/arguments/proc.rb
124
124
  - lib/cross-stub/cache.rb
125
+ - lib/cross-stub/fixes.rb
125
126
  - lib/cross-stub/stores.rb
126
127
  - lib/cross-stub/stores/base.rb
127
128
  - lib/cross-stub/stores/file.rb
@@ -156,12 +157,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
156
157
  requirements:
157
158
  - - ">="
158
159
  - !ruby/object:Gem::Version
159
- hash: 57
160
+ hash: 59
160
161
  segments:
161
162
  - 1
162
163
  - 8
163
- - 7
164
- version: 1.8.7
164
+ - 6
165
+ version: 1.8.6
165
166
  required_rubygems_version: !ruby/object:Gem::Requirement
166
167
  none: false
167
168
  requirements: