rspec-kickstarter 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rspec_kickstarter/generator.rb +17 -2
- data/lib/rspec_kickstarter/version.rb +1 -1
- metadata +3 -3
@@ -86,14 +86,29 @@ module RSpecKickstarter
|
|
86
86
|
def write_spec(file_path, force_write = false, dry_run = false)
|
87
87
|
|
88
88
|
body = File.read(file_path)
|
89
|
-
|
89
|
+
|
90
90
|
top_level = RDoc::TopLevel.new(file_path)
|
91
|
+
if RUBY_VERSION.to_f < 2.0
|
92
|
+
# reset is removed since 2.0
|
93
|
+
RDoc::TopLevel.reset()
|
94
|
+
end
|
95
|
+
|
96
|
+
# RDoc::Stats initialization
|
97
|
+
if RUBY_VERSION.to_f >= 2.0
|
98
|
+
# Ruby 2.0 requires RDoc::Store internally.
|
99
|
+
store = RDoc::Store.new
|
100
|
+
top_level.store = store
|
101
|
+
stats = RDoc::Stats.new(store, 1)
|
102
|
+
else
|
103
|
+
stats = RDoc::Stats.new(1)
|
104
|
+
end
|
105
|
+
|
91
106
|
parser = RDoc::Parser::Ruby.new(
|
92
107
|
top_level,
|
93
108
|
file_path,
|
94
109
|
body,
|
95
110
|
RDoc::Options.new,
|
96
|
-
|
111
|
+
stats
|
97
112
|
)
|
98
113
|
top_level = parser.scan
|
99
114
|
c = get_target(top_level)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-kickstarter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
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-
|
12
|
+
date: 2013-04-26 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: RSpec kickstarter generates spec files for existing code.
|
15
15
|
email:
|
@@ -46,7 +46,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
46
46
|
version: '0'
|
47
47
|
requirements: []
|
48
48
|
rubyforge_project:
|
49
|
-
rubygems_version: 1.8.
|
49
|
+
rubygems_version: 1.8.23
|
50
50
|
signing_key:
|
51
51
|
specification_version: 3
|
52
52
|
summary: RSpec kickstarter generates spec files for existing code.
|