generator-spec 0.7.4 → 0.7.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -1
- data/VERSION +1 -1
- data/generator-spec.gemspec +7 -1
- data/lib/generator-spec/rspec.rb +2 -2
- data/lib/generator-spec/rspec/generator/require.rb +5 -2
- data/lib/generator-spec/rspec/matchers/generate_artifact.rb +1 -1
- data/lib/generator-spec/rspec/matchers/generate_artifact_file.rb +1 -1
- data/lib/generator-spec/rspec/matchers/generate_artifact_files.rb +1 -1
- data/lib/generator-spec/rspec/matchers/generate_artifacts.rb +1 -1
- data/spec/generator_spec/fixtures/generators/controller/controller_generator.rb +2 -2
- data/spec/generator_spec/fixtures/generators/helper/helper_generator.rb +2 -2
- data/spec/generator_spec/fixtures/generators/migration/migration_generator.rb +2 -3
- data/spec/generator_spec/fixtures/generators/model/model_generator.rb +2 -2
- data/spec/generator_spec/fixtures/generators/observer/observer_generator.rb +2 -2
- data/spec/generator_spec/fixtures/generators/view/view_generator.rb +2 -2
- data/spec/generator_spec/generators/controller_gen_spec.rb +4 -0
- data/spec/generator_spec/generators/migration_gen_spec.rb +1 -1
- data/spec/generator_spec/matchers/generate_artifact_file_spec.rb +3 -2
- data/spec/generator_spec/matchers/generate_artifact_files_spec.rb +2 -0
- data/spec/generator_spec/matchers/generate_artifact_spec.rb +1 -0
- data/spec/generator_spec/matchers/generate_artifacts_spec.rb +1 -0
- data/spec/spec_helper.rb +1 -1
- metadata +37 -15
data/Rakefile
CHANGED
@@ -12,6 +12,7 @@ begin
|
|
12
12
|
# gem.add_development_dependency "rspec", ">= 2.0.1"
|
13
13
|
gem.add_development_dependency "mocha", ">= 0.9.8"
|
14
14
|
# gem.add_development_dependency 'rails-app-spec', "~> 0.3.0"
|
15
|
+
gem.add_development_dependency 'logging_assist', "~> 0.2.2"
|
15
16
|
|
16
17
|
# gem.add_dependency 'rails-app-spec', ">= 0.3.2"
|
17
18
|
gem.add_dependency "rspec", ">= 2.4.1"
|
@@ -21,7 +22,7 @@ begin
|
|
21
22
|
|
22
23
|
gem.add_dependency "require_all", "~> 1.2.0"
|
23
24
|
gem.add_dependency "sugar-high", "~> 0.4.0"
|
24
|
-
|
25
|
+
gem.add_dependency "rails_artifactor", ">= 0.3.3"
|
25
26
|
|
26
27
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
27
28
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
1
|
+
0.7.5
|
data/generator-spec.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{generator-spec}
|
8
|
-
s.version = "0.7.
|
8
|
+
s.version = "0.7.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Kristian Mandrup"]
|
@@ -93,29 +93,35 @@ Gem::Specification.new do |s|
|
|
93
93
|
|
94
94
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
95
95
|
s.add_development_dependency(%q<mocha>, [">= 0.9.8"])
|
96
|
+
s.add_development_dependency(%q<logging_assist>, ["~> 0.2.2"])
|
96
97
|
s.add_runtime_dependency(%q<rspec>, [">= 2.4.1"])
|
97
98
|
s.add_runtime_dependency(%q<rake>, [">= 0.8.7"])
|
98
99
|
s.add_runtime_dependency(%q<rails>, [">= 3.0.1"])
|
99
100
|
s.add_runtime_dependency(%q<test-unit>, [">= 2.0.1"])
|
100
101
|
s.add_runtime_dependency(%q<require_all>, ["~> 1.2.0"])
|
101
102
|
s.add_runtime_dependency(%q<sugar-high>, ["~> 0.4.0"])
|
103
|
+
s.add_runtime_dependency(%q<rails_artifactor>, [">= 0.3.3"])
|
102
104
|
else
|
103
105
|
s.add_dependency(%q<mocha>, [">= 0.9.8"])
|
106
|
+
s.add_dependency(%q<logging_assist>, ["~> 0.2.2"])
|
104
107
|
s.add_dependency(%q<rspec>, [">= 2.4.1"])
|
105
108
|
s.add_dependency(%q<rake>, [">= 0.8.7"])
|
106
109
|
s.add_dependency(%q<rails>, [">= 3.0.1"])
|
107
110
|
s.add_dependency(%q<test-unit>, [">= 2.0.1"])
|
108
111
|
s.add_dependency(%q<require_all>, ["~> 1.2.0"])
|
109
112
|
s.add_dependency(%q<sugar-high>, ["~> 0.4.0"])
|
113
|
+
s.add_dependency(%q<rails_artifactor>, [">= 0.3.3"])
|
110
114
|
end
|
111
115
|
else
|
112
116
|
s.add_dependency(%q<mocha>, [">= 0.9.8"])
|
117
|
+
s.add_dependency(%q<logging_assist>, ["~> 0.2.2"])
|
113
118
|
s.add_dependency(%q<rspec>, [">= 2.4.1"])
|
114
119
|
s.add_dependency(%q<rake>, [">= 0.8.7"])
|
115
120
|
s.add_dependency(%q<rails>, [">= 3.0.1"])
|
116
121
|
s.add_dependency(%q<test-unit>, [">= 2.0.1"])
|
117
122
|
s.add_dependency(%q<require_all>, ["~> 1.2.0"])
|
118
123
|
s.add_dependency(%q<sugar-high>, ["~> 0.4.0"])
|
124
|
+
s.add_dependency(%q<rails_artifactor>, [">= 0.3.3"])
|
119
125
|
end
|
120
126
|
end
|
121
127
|
|
data/lib/generator-spec/rspec.rb
CHANGED
@@ -47,14 +47,17 @@ module RSpec::Generator
|
|
47
47
|
base_path = File.join(lib, 'generators')
|
48
48
|
path = name ? File.join(base_path, name) : base_path
|
49
49
|
path = File.expand_path path
|
50
|
-
|
50
|
+
root = root_dir || ''
|
51
|
+
path = File.join(root, path)
|
52
|
+
puts "require_all: #{path}" if debug?
|
51
53
|
require_all path
|
52
54
|
end
|
53
55
|
|
54
56
|
def require_generator! name, generator=nil
|
55
57
|
require_all_generators(name) and return if generator == :all
|
56
58
|
|
57
|
-
file = (require_file_name name, generator)
|
59
|
+
file = (require_file_name name, generator)
|
60
|
+
file.gsub! /^\//, ''
|
58
61
|
puts "Loading generator: #{file}" if debug?
|
59
62
|
require file
|
60
63
|
end
|
@@ -15,7 +15,7 @@ module RSpec::RailsApp::Artifact
|
|
15
15
|
GenerateArtifact.new name, type
|
16
16
|
end
|
17
17
|
|
18
|
-
(::
|
18
|
+
(::RailsAssist.artifacts - [:view]).each do |name|
|
19
19
|
plural_artifact = name.to_s.pluralize
|
20
20
|
class_eval %{
|
21
21
|
def generate_#{name} name
|
@@ -2,7 +2,7 @@ module RSpec::RailsApp::ArtifactFile
|
|
2
2
|
module Matchers
|
3
3
|
alias_method :generate_artifact_files, :have_rails_artifact_files
|
4
4
|
|
5
|
-
::
|
5
|
+
::RailsAssist.artifacts.each do |name|
|
6
6
|
class_eval %{
|
7
7
|
alias_method :generate_#{name}_files, :have_#{name}_files
|
8
8
|
}
|
@@ -15,7 +15,7 @@ module RSpec::RailsApp::Artifact
|
|
15
15
|
GenerateArtifacts.new type, *names
|
16
16
|
end
|
17
17
|
|
18
|
-
(::
|
18
|
+
(::RailsAssist.artifacts - [:view]).each do |name|
|
19
19
|
plural_artifact = name.to_s.pluralize
|
20
20
|
class_eval %{
|
21
21
|
def generate_#{plural_artifact} *names
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'rails_artifactor'
|
2
2
|
|
3
3
|
class ControllerGenerator < Rails::Generators::NamedBase
|
4
4
|
desc "Adds method 'control_me' to a Controller"
|
@@ -15,7 +15,7 @@ class ControllerGenerator < Rails::Generators::NamedBase
|
|
15
15
|
|
16
16
|
protected
|
17
17
|
|
18
|
-
extend
|
18
|
+
extend RailsAssist::UseMacro
|
19
19
|
use_helpers :controller
|
20
20
|
|
21
21
|
def include_txt
|
@@ -1,8 +1,7 @@
|
|
1
1
|
require 'migration_assist'
|
2
2
|
|
3
|
-
class MigrationGenerator < Rails::Generators::NamedBase
|
4
|
-
include
|
5
|
-
include Rails3::Assist::Migration
|
3
|
+
class MigrationGenerator < Rails::Generators::NamedBase
|
4
|
+
include RailsAssist::Migration
|
6
5
|
|
7
6
|
desc "Creates a migration"
|
8
7
|
|
@@ -28,9 +28,9 @@ class ModelGenerator < Rails::Generators::NamedBase
|
|
28
28
|
|
29
29
|
protected
|
30
30
|
|
31
|
-
include
|
31
|
+
include RailsAssist::BasicLogger
|
32
32
|
|
33
|
-
extend
|
33
|
+
extend RailsAssist::UseMacro
|
34
34
|
use_orm :mongoid
|
35
35
|
# use_helper :model
|
36
36
|
|
@@ -4,8 +4,8 @@ require 'logging_assist'
|
|
4
4
|
include Log4r
|
5
5
|
|
6
6
|
class ObserverGenerator < Rails::Generators::NamedBase
|
7
|
-
include
|
8
|
-
extend
|
7
|
+
include RailsAssist::BasicLogger
|
8
|
+
extend RailsAssist::UseMacro
|
9
9
|
|
10
10
|
desc "Adds method 'observe_me' to a Observer"
|
11
11
|
|
@@ -4,8 +4,8 @@ require 'logging_assist'
|
|
4
4
|
include Log4r
|
5
5
|
|
6
6
|
class ViewGenerator < Rails::Generators::NamedBase
|
7
|
-
include
|
8
|
-
extend
|
7
|
+
include RailsAssist::BasicLogger
|
8
|
+
extend RailsAssist::UseMacro
|
9
9
|
|
10
10
|
desc "Adds some view code to existing View"
|
11
11
|
|
@@ -1,9 +1,10 @@
|
|
1
1
|
require 'rspec/core'
|
2
2
|
require 'generator-spec'
|
3
3
|
# require 'spec_helper'
|
4
|
-
# RSpec::Generator::Require.root_dir = 'generator_spec/fixtures'
|
5
4
|
|
6
|
-
|
5
|
+
RSpec::Generator::Require.root_dir = 'generator_spec/fixtures'
|
6
|
+
|
7
|
+
require_generator :model
|
7
8
|
|
8
9
|
describe 'model_generator' do
|
9
10
|
use_orm :mongoid
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: generator-spec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -14,7 +14,7 @@ default_executable:
|
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: mocha
|
17
|
-
requirement: &
|
17
|
+
requirement: &2157680920 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,10 +22,21 @@ dependencies:
|
|
22
22
|
version: 0.9.8
|
23
23
|
type: :development
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *2157680920
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: logging_assist
|
28
|
+
requirement: &2157680420 !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.2.2
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: *2157680420
|
26
37
|
- !ruby/object:Gem::Dependency
|
27
38
|
name: rspec
|
28
|
-
requirement: &
|
39
|
+
requirement: &2157679940 !ruby/object:Gem::Requirement
|
29
40
|
none: false
|
30
41
|
requirements:
|
31
42
|
- - ! '>='
|
@@ -33,10 +44,10 @@ dependencies:
|
|
33
44
|
version: 2.4.1
|
34
45
|
type: :runtime
|
35
46
|
prerelease: false
|
36
|
-
version_requirements: *
|
47
|
+
version_requirements: *2157679940
|
37
48
|
- !ruby/object:Gem::Dependency
|
38
49
|
name: rake
|
39
|
-
requirement: &
|
50
|
+
requirement: &2157679460 !ruby/object:Gem::Requirement
|
40
51
|
none: false
|
41
52
|
requirements:
|
42
53
|
- - ! '>='
|
@@ -44,10 +55,10 @@ dependencies:
|
|
44
55
|
version: 0.8.7
|
45
56
|
type: :runtime
|
46
57
|
prerelease: false
|
47
|
-
version_requirements: *
|
58
|
+
version_requirements: *2157679460
|
48
59
|
- !ruby/object:Gem::Dependency
|
49
60
|
name: rails
|
50
|
-
requirement: &
|
61
|
+
requirement: &2157678980 !ruby/object:Gem::Requirement
|
51
62
|
none: false
|
52
63
|
requirements:
|
53
64
|
- - ! '>='
|
@@ -55,10 +66,10 @@ dependencies:
|
|
55
66
|
version: 3.0.1
|
56
67
|
type: :runtime
|
57
68
|
prerelease: false
|
58
|
-
version_requirements: *
|
69
|
+
version_requirements: *2157678980
|
59
70
|
- !ruby/object:Gem::Dependency
|
60
71
|
name: test-unit
|
61
|
-
requirement: &
|
72
|
+
requirement: &2157678500 !ruby/object:Gem::Requirement
|
62
73
|
none: false
|
63
74
|
requirements:
|
64
75
|
- - ! '>='
|
@@ -66,10 +77,10 @@ dependencies:
|
|
66
77
|
version: 2.0.1
|
67
78
|
type: :runtime
|
68
79
|
prerelease: false
|
69
|
-
version_requirements: *
|
80
|
+
version_requirements: *2157678500
|
70
81
|
- !ruby/object:Gem::Dependency
|
71
82
|
name: require_all
|
72
|
-
requirement: &
|
83
|
+
requirement: &2157678000 !ruby/object:Gem::Requirement
|
73
84
|
none: false
|
74
85
|
requirements:
|
75
86
|
- - ~>
|
@@ -77,10 +88,10 @@ dependencies:
|
|
77
88
|
version: 1.2.0
|
78
89
|
type: :runtime
|
79
90
|
prerelease: false
|
80
|
-
version_requirements: *
|
91
|
+
version_requirements: *2157678000
|
81
92
|
- !ruby/object:Gem::Dependency
|
82
93
|
name: sugar-high
|
83
|
-
requirement: &
|
94
|
+
requirement: &2157677460 !ruby/object:Gem::Requirement
|
84
95
|
none: false
|
85
96
|
requirements:
|
86
97
|
- - ~>
|
@@ -88,7 +99,18 @@ dependencies:
|
|
88
99
|
version: 0.4.0
|
89
100
|
type: :runtime
|
90
101
|
prerelease: false
|
91
|
-
version_requirements: *
|
102
|
+
version_requirements: *2157677460
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: rails_artifactor
|
105
|
+
requirement: &2157676960 !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 0.3.3
|
111
|
+
type: :runtime
|
112
|
+
prerelease: false
|
113
|
+
version_requirements: *2157676960
|
92
114
|
description: RSpec 2 library to facilitate creating generator specs
|
93
115
|
email: kmandrup@gmail.com
|
94
116
|
executables: []
|