rspec_engine_generator 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/TODO +2 -0
- data/bin/rspec_engine +11 -2
- data/lib/rspec_engine_generator/version.rb +1 -1
- metadata +17 -7
data/TODO
CHANGED
@@ -1,3 +1,5 @@
|
|
1
1
|
add good examples of most things you'd want to configure, commented out in the generated app
|
2
2
|
- routing calls. when to use engine.resources_path main_app.something_path
|
3
3
|
- how to setup EngineName.configure do |config| blocks
|
4
|
+
|
5
|
+
add rspec lines to generator in engine so if you generate models it'll use rspec instead of test unit
|
data/bin/rspec_engine
CHANGED
@@ -21,6 +21,15 @@ class RspecEngine < Thor
|
|
21
21
|
insert_into_file "Rakefile", after: "load 'rails/tasks/engine.rake'" do
|
22
22
|
%{\n\nrequire 'rspec/core/rake_task'\nRSpec::Core::RakeTask.new(:spec)\ntask :default => :spec}
|
23
23
|
end
|
24
|
+
insert_into_file "lib/#{name}/engine.rb", after: "Rails::Engine" do
|
25
|
+
text = <<-TEXT.gsub(/^ {4}/,'')
|
26
|
+
|
27
|
+
config.generators do |g|
|
28
|
+
g.test_framework :rspec
|
29
|
+
g.integration_tool :rspec
|
30
|
+
end
|
31
|
+
TEXT
|
32
|
+
end
|
24
33
|
run 'git add . && git commit -m"added rspec"'
|
25
34
|
empty_directory "spec/requests"
|
26
35
|
create_file "spec/requests/requests_helper.rb", "require 'spec_helper.rb'\nrequire 'capybara/rspec'"
|
@@ -44,7 +53,7 @@ class RspecEngine < Thor
|
|
44
53
|
SPEC
|
45
54
|
run 'git add . && git ci -am"installed capybara"'
|
46
55
|
|
47
|
-
insert_into_file 'spec/dummy/config/routes.rb', "
|
56
|
+
insert_into_file 'spec/dummy/config/routes.rb', "\n root to: 'home#index'\n", after: '.draw do'
|
48
57
|
# generate a home controller and place to link off to engine from
|
49
58
|
inside 'spec/dummy' do
|
50
59
|
run "rails g controller Home index"
|
@@ -67,7 +76,7 @@ class RspecEngine < Thor
|
|
67
76
|
# if it's a full engine, then there's no real dashboard, as it's integrated fully into the host app, not alongside
|
68
77
|
if options[:mountable]
|
69
78
|
run "rails g controller Dashboard index"
|
70
|
-
insert_into_file 'config/routes.rb', "
|
79
|
+
insert_into_file 'config/routes.rb', "\n root to: 'dashboard#index'\n", after: '.draw do'
|
71
80
|
create_file "app/views/#{name}/dashboard/index.html.erb", force: true do
|
72
81
|
content = <<-INDEX.gsub(/^ {10}/, '')
|
73
82
|
<h1>Welcome to an example Dashboard for #{name}</h1>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec_engine_generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-08-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: 0.15.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.15.2
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: rails
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ~>
|
@@ -32,7 +37,12 @@ dependencies:
|
|
32
37
|
version: '3.0'
|
33
38
|
type: :runtime
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '3.0'
|
36
46
|
description: Thor based gem that generates an RSpec ready Rails 3 engine
|
37
47
|
email:
|
38
48
|
- jack.dempsey@gmail.com
|
@@ -71,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
81
|
version: '0'
|
72
82
|
requirements: []
|
73
83
|
rubyforge_project:
|
74
|
-
rubygems_version: 1.8.
|
84
|
+
rubygems_version: 1.8.24
|
75
85
|
signing_key:
|
76
86
|
specification_version: 3
|
77
87
|
summary: Thor based gem that generates an RSpec ready Rails 3 engine
|