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 CHANGED
@@ -10,65 +10,75 @@ PATH
10
10
  GEM
11
11
  remote: http://rubygems.org/
12
12
  specs:
13
- abstract (1.0.0)
14
- actionmailer (3.0.7)
15
- actionpack (= 3.0.7)
16
- mail (~> 2.2.15)
17
- actionpack (3.0.7)
18
- activemodel (= 3.0.7)
19
- activesupport (= 3.0.7)
20
- builder (~> 2.1.2)
21
- erubis (~> 2.6.6)
22
- i18n (~> 0.5.0)
23
- rack (~> 1.2.1)
24
- rack-mount (~> 0.6.14)
25
- rack-test (~> 0.5.7)
26
- tzinfo (~> 0.3.23)
27
- activemodel (3.0.7)
28
- activesupport (= 3.0.7)
29
- builder (~> 2.1.2)
30
- i18n (~> 0.5.0)
31
- activerecord (3.0.7)
32
- activemodel (= 3.0.7)
33
- activesupport (= 3.0.7)
34
- arel (~> 2.0.2)
35
- tzinfo (~> 0.3.23)
36
- activeresource (3.0.7)
37
- activemodel (= 3.0.7)
38
- activesupport (= 3.0.7)
39
- activesupport (3.0.7)
40
- arel (2.0.10)
41
- builder (2.1.2)
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.6.6)
44
- abstract (>= 1.0.0)
45
- i18n (0.5.0)
46
- mail (2.2.19)
47
- activesupport (>= 2.3.6)
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.16)
52
- polyglot (0.3.1)
53
- rack (1.2.2)
54
- rack-mount (0.6.14)
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-test (0.5.7)
60
+ rack-ssl (1.3.2)
61
+ rack
62
+ rack-test (0.6.1)
57
63
  rack (>= 1.0)
58
- rails (3.0.7)
59
- actionmailer (= 3.0.7)
60
- actionpack (= 3.0.7)
61
- activerecord (= 3.0.7)
62
- activeresource (= 3.0.7)
63
- activesupport (= 3.0.7)
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.0.7)
66
- railties (3.0.7)
67
- actionpack (= 3.0.7)
68
- activesupport (= 3.0.7)
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
- thor (~> 0.14.4)
71
- rake (0.9.2)
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
- treetop (1.4.9)
97
+ tilt (1.3.3)
98
+ treetop (1.4.10)
99
+ polyglot
84
100
  polyglot (>= 0.3.1)
85
- tzinfo (0.3.27)
101
+ tzinfo (0.3.30)
86
102
 
87
103
  PLATFORMS
88
104
  ruby
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009 Colin MacKenzie IV
1
+ Copyright (c) 2009-2011 Colin MacKenzie IV
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/Rakefile CHANGED
@@ -7,11 +7,16 @@ end
7
7
 
8
8
  task :default do
9
9
  run "rspec", "spec"
10
- ENV['RAILS'] = '1'
10
+ ENV['USE_RAILS'] = '1'
11
11
  run "rspec", "spec"
12
12
  end
13
13
 
14
- require 'rake/rdoctask'
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
- stdout, stderr, stdin = $stdout, $stderr, $stdin
107
- $stdout, $stderr, $stdin = shell.output, shell.output, shell.input
108
-
109
- begin
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, :stdin
9
- alias_method :input=, :stdin=
10
- alias_method :output, :stdout
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)
@@ -2,7 +2,7 @@ module GenSpec
2
2
  class Version
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- PATCH = 1
5
+ PATCH = 2
6
6
  RELEASE = nil
7
7
 
8
8
  STRING = (RELEASE ? [MAJOR, MINOR, PATCH, RELEASE] : [MAJOR, MINOR, PATCH]).join('.')
data/spec/spec_helper.rb CHANGED
@@ -6,7 +6,7 @@ $LOAD_PATH.push File.join(File.dirname(__FILE__), "support")
6
6
  require 'bundler'
7
7
  Bundler.setup
8
8
 
9
- if ENV['RAILS']
9
+ if ENV['USE_RAILS']
10
10
  require 'rails'
11
11
  require 'rails/generators'
12
12
  end
@@ -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 puts "Oh, uh... Good."
15
- else puts "You're new around here, aren't you?"
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.1
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.5
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.