genspec 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +69 -53
- data/LICENSE +1 -1
- data/Rakefile +7 -2
- data/lib/genspec/matchers/base.rb +4 -11
- data/lib/genspec/shell.rb +19 -3
- data/lib/genspec/version.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- data/spec/support/generators/question/question_generator.rb +2 -2
- metadata +6 -12
data/Gemfile.lock
CHANGED
@@ -10,65 +10,75 @@ PATH
|
|
10
10
|
GEM
|
11
11
|
remote: http://rubygems.org/
|
12
12
|
specs:
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
rack (~> 1.
|
24
|
-
rack-mount (~> 0.
|
25
|
-
rack-test (~> 0.
|
26
|
-
|
27
|
-
activemodel (3.
|
28
|
-
activesupport (= 3.
|
29
|
-
builder (~>
|
30
|
-
i18n (~> 0.
|
31
|
-
activerecord (3.
|
32
|
-
activemodel (= 3.
|
33
|
-
activesupport (= 3.
|
34
|
-
arel (~> 2.
|
35
|
-
tzinfo (~> 0.3.
|
36
|
-
activeresource (3.
|
37
|
-
activemodel (= 3.
|
38
|
-
activesupport (= 3.
|
39
|
-
activesupport (3.
|
40
|
-
|
41
|
-
|
13
|
+
actionmailer (3.1.1)
|
14
|
+
actionpack (= 3.1.1)
|
15
|
+
mail (~> 2.3.0)
|
16
|
+
actionpack (3.1.1)
|
17
|
+
activemodel (= 3.1.1)
|
18
|
+
activesupport (= 3.1.1)
|
19
|
+
builder (~> 3.0.0)
|
20
|
+
erubis (~> 2.7.0)
|
21
|
+
i18n (~> 0.6)
|
22
|
+
rack (~> 1.3.2)
|
23
|
+
rack-cache (~> 1.1)
|
24
|
+
rack-mount (~> 0.8.2)
|
25
|
+
rack-test (~> 0.6.1)
|
26
|
+
sprockets (~> 2.0.2)
|
27
|
+
activemodel (3.1.1)
|
28
|
+
activesupport (= 3.1.1)
|
29
|
+
builder (~> 3.0.0)
|
30
|
+
i18n (~> 0.6)
|
31
|
+
activerecord (3.1.1)
|
32
|
+
activemodel (= 3.1.1)
|
33
|
+
activesupport (= 3.1.1)
|
34
|
+
arel (~> 2.2.1)
|
35
|
+
tzinfo (~> 0.3.29)
|
36
|
+
activeresource (3.1.1)
|
37
|
+
activemodel (= 3.1.1)
|
38
|
+
activesupport (= 3.1.1)
|
39
|
+
activesupport (3.1.1)
|
40
|
+
multi_json (~> 1.0)
|
41
|
+
arel (2.2.1)
|
42
|
+
builder (3.0.0)
|
42
43
|
diff-lcs (1.1.3)
|
43
|
-
erubis (2.
|
44
|
-
|
45
|
-
i18n (0.
|
46
|
-
|
47
|
-
|
44
|
+
erubis (2.7.0)
|
45
|
+
hike (1.2.1)
|
46
|
+
i18n (0.6.0)
|
47
|
+
json (1.6.1)
|
48
|
+
mail (2.3.0)
|
48
49
|
i18n (>= 0.4.0)
|
49
50
|
mime-types (~> 1.16)
|
50
51
|
treetop (~> 1.4.8)
|
51
|
-
mime-types (1.
|
52
|
-
|
53
|
-
|
54
|
-
rack
|
52
|
+
mime-types (1.17.2)
|
53
|
+
multi_json (1.0.3)
|
54
|
+
polyglot (0.3.2)
|
55
|
+
rack (1.3.5)
|
56
|
+
rack-cache (1.1)
|
57
|
+
rack (>= 0.4)
|
58
|
+
rack-mount (0.8.3)
|
55
59
|
rack (>= 1.0.0)
|
56
|
-
rack-
|
60
|
+
rack-ssl (1.3.2)
|
61
|
+
rack
|
62
|
+
rack-test (0.6.1)
|
57
63
|
rack (>= 1.0)
|
58
|
-
rails (3.
|
59
|
-
actionmailer (= 3.
|
60
|
-
actionpack (= 3.
|
61
|
-
activerecord (= 3.
|
62
|
-
activeresource (= 3.
|
63
|
-
activesupport (= 3.
|
64
|
+
rails (3.1.1)
|
65
|
+
actionmailer (= 3.1.1)
|
66
|
+
actionpack (= 3.1.1)
|
67
|
+
activerecord (= 3.1.1)
|
68
|
+
activeresource (= 3.1.1)
|
69
|
+
activesupport (= 3.1.1)
|
64
70
|
bundler (~> 1.0)
|
65
|
-
railties (= 3.
|
66
|
-
railties (3.
|
67
|
-
actionpack (= 3.
|
68
|
-
activesupport (= 3.
|
71
|
+
railties (= 3.1.1)
|
72
|
+
railties (3.1.1)
|
73
|
+
actionpack (= 3.1.1)
|
74
|
+
activesupport (= 3.1.1)
|
75
|
+
rack-ssl (~> 1.3.2)
|
69
76
|
rake (>= 0.8.7)
|
70
|
-
|
71
|
-
|
77
|
+
rdoc (~> 3.4)
|
78
|
+
thor (~> 0.14.6)
|
79
|
+
rake (0.9.2.2)
|
80
|
+
rdoc (3.11)
|
81
|
+
json (~> 1.4)
|
72
82
|
rspec (2.6.0)
|
73
83
|
rspec-core (~> 2.6.0)
|
74
84
|
rspec-expectations (~> 2.6.0)
|
@@ -79,10 +89,16 @@ GEM
|
|
79
89
|
rspec-mocks (2.6.0)
|
80
90
|
sc-core-ext (1.2.1)
|
81
91
|
activesupport (>= 2.3.5)
|
92
|
+
sprockets (2.0.3)
|
93
|
+
hike (~> 1.2)
|
94
|
+
rack (~> 1.0)
|
95
|
+
tilt (~> 1.1, != 1.3.0)
|
82
96
|
thor (0.14.6)
|
83
|
-
|
97
|
+
tilt (1.3.3)
|
98
|
+
treetop (1.4.10)
|
99
|
+
polyglot
|
84
100
|
polyglot (>= 0.3.1)
|
85
|
-
tzinfo (0.3.
|
101
|
+
tzinfo (0.3.30)
|
86
102
|
|
87
103
|
PLATFORMS
|
88
104
|
ruby
|
data/LICENSE
CHANGED
data/Rakefile
CHANGED
@@ -7,11 +7,16 @@ end
|
|
7
7
|
|
8
8
|
task :default do
|
9
9
|
run "rspec", "spec"
|
10
|
-
ENV['
|
10
|
+
ENV['USE_RAILS'] = '1'
|
11
11
|
run "rspec", "spec"
|
12
12
|
end
|
13
13
|
|
14
|
-
|
14
|
+
begin
|
15
|
+
require "rdoc/task"
|
16
|
+
rescue LoadError
|
17
|
+
require 'rake/rdoctask'
|
18
|
+
end
|
19
|
+
|
15
20
|
Rake::RDocTask.new do |rdoc|
|
16
21
|
version = GenSpec::VERSION
|
17
22
|
|
@@ -103,17 +103,10 @@ module GenSpec
|
|
103
103
|
end
|
104
104
|
|
105
105
|
@destination_root = tempdir
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
@generator.start(@args || [], {
|
111
|
-
:shell => @shell,
|
112
|
-
:destination_root => destination_root
|
113
|
-
})
|
114
|
-
ensure
|
115
|
-
$stdout, $stderr, $stdin = stdout, stderr, stdin
|
116
|
-
end
|
106
|
+
@generator.start(@args || [], {
|
107
|
+
:shell => @shell,
|
108
|
+
:destination_root => destination_root
|
109
|
+
})
|
117
110
|
|
118
111
|
check_for_errors
|
119
112
|
generated
|
data/lib/genspec/shell.rb
CHANGED
@@ -5,11 +5,19 @@ module GenSpec
|
|
5
5
|
# the specified streams. By default, these are initialized to instances of StringIO.
|
6
6
|
class Shell < Thor::Shell::Basic
|
7
7
|
attr_accessor :stdin, :stdout, :stderr
|
8
|
-
alias_method :input,
|
9
|
-
alias_method :input=,
|
10
|
-
alias_method :output,
|
8
|
+
alias_method :input, :stdin
|
9
|
+
alias_method :input=, :stdin=
|
10
|
+
alias_method :output, :stdout
|
11
11
|
alias_method :output=, :stdout=
|
12
12
|
|
13
|
+
Thor::Shell::SHELL_DELEGATED_METHODS.each do |method|
|
14
|
+
eval <<-end_code
|
15
|
+
def #{method}(*args, &block) # def yes?(*args, &block)
|
16
|
+
push_std { super(*args, &block) } # push_std { super(*args, &block) }
|
17
|
+
end # end
|
18
|
+
end_code
|
19
|
+
end
|
20
|
+
|
13
21
|
def ask(statement, color = nil)
|
14
22
|
say "#{statement} ", color
|
15
23
|
response = stdin.gets
|
@@ -34,6 +42,14 @@ module GenSpec
|
|
34
42
|
end
|
35
43
|
|
36
44
|
private
|
45
|
+
def push_std
|
46
|
+
_stderr, _stdout, _stdin = $stderr, $stdout, $stdin
|
47
|
+
$stderr, $stdout, $stdin = stderr, stdout, stdin
|
48
|
+
yield
|
49
|
+
ensure
|
50
|
+
$stderr, $stdout, $stdin = _stderr, _stdout, _stdin
|
51
|
+
end
|
52
|
+
|
37
53
|
def init_stream(which, value)
|
38
54
|
if value.kind_of?(String)
|
39
55
|
value = StringIO.new(value)
|
data/lib/genspec/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -11,8 +11,8 @@ class Question < base
|
|
11
11
|
def ask_question
|
12
12
|
yn = ask "Are you a GOD?"
|
13
13
|
case yn.downcase[0]
|
14
|
-
when ?y then
|
15
|
-
else
|
14
|
+
when ?y then say "Oh, uh... Good."
|
15
|
+
else say "You're new around here, aren't you?"
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: genspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.2.
|
5
|
+
version: 0.2.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Colin MacKenzie IV
|
@@ -14,6 +14,7 @@ date: 2010-07-08 00:00:00 Z
|
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: thor
|
17
|
+
prerelease: false
|
17
18
|
requirement: &id001 !ruby/object:Gem::Requirement
|
18
19
|
none: false
|
19
20
|
requirements:
|
@@ -21,10 +22,10 @@ dependencies:
|
|
21
22
|
- !ruby/object:Gem::Version
|
22
23
|
version: 0.14.6
|
23
24
|
type: :runtime
|
24
|
-
prerelease: false
|
25
25
|
version_requirements: *id001
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: rspec
|
28
|
+
prerelease: false
|
28
29
|
requirement: &id002 !ruby/object:Gem::Requirement
|
29
30
|
none: false
|
30
31
|
requirements:
|
@@ -32,10 +33,10 @@ dependencies:
|
|
32
33
|
- !ruby/object:Gem::Version
|
33
34
|
version: 2.6.0
|
34
35
|
type: :runtime
|
35
|
-
prerelease: false
|
36
36
|
version_requirements: *id002
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: sc-core-ext
|
39
|
+
prerelease: false
|
39
40
|
requirement: &id003 !ruby/object:Gem::Requirement
|
40
41
|
none: false
|
41
42
|
requirements:
|
@@ -43,10 +44,10 @@ dependencies:
|
|
43
44
|
- !ruby/object:Gem::Version
|
44
45
|
version: 1.2.1
|
45
46
|
type: :runtime
|
46
|
-
prerelease: false
|
47
47
|
version_requirements: *id003
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: i18n
|
50
|
+
prerelease: false
|
50
51
|
requirement: &id004 !ruby/object:Gem::Requirement
|
51
52
|
none: false
|
52
53
|
requirements:
|
@@ -54,7 +55,6 @@ dependencies:
|
|
54
55
|
- !ruby/object:Gem::Version
|
55
56
|
version: 0.5.0
|
56
57
|
type: :runtime
|
57
|
-
prerelease: false
|
58
58
|
version_requirements: *id004
|
59
59
|
description: Simple, expressive Thor and/or Rails 3 generator testing for RSpec. For the Rails 2.3 version, use genspec 0.1.x.
|
60
60
|
email: sinisterchipmunk@gmail.com
|
@@ -110,23 +110,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
110
110
|
requirements:
|
111
111
|
- - ">="
|
112
112
|
- !ruby/object:Gem::Version
|
113
|
-
hash: -2099379127679361504
|
114
|
-
segments:
|
115
|
-
- 0
|
116
113
|
version: "0"
|
117
114
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
115
|
none: false
|
119
116
|
requirements:
|
120
117
|
- - ">="
|
121
118
|
- !ruby/object:Gem::Version
|
122
|
-
hash: -2099379127679361504
|
123
|
-
segments:
|
124
|
-
- 0
|
125
119
|
version: "0"
|
126
120
|
requirements: []
|
127
121
|
|
128
122
|
rubyforge_project:
|
129
|
-
rubygems_version: 1.8.
|
123
|
+
rubygems_version: 1.8.10
|
130
124
|
signing_key:
|
131
125
|
specification_version: 3
|
132
126
|
summary: Simple, expressive Thor and/or Rails 3 generator testing for RSpec. For the Rails 2.3 version, use genspec 0.1.x.
|