pluginizer 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pluginizer.rb +1 -0
- data/lib/pluginizer/plugin_builder.rb +18 -4
- data/lib/pluginizer/version.rb +1 -1
- data/templates/%name%.gemspec.tt +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c12cc5abb1a107f7a886a639493d0d8215224e9
|
4
|
+
data.tar.gz: a9bb964223412cc2d25f8b60040710d9f8355da0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a62059e3cdf13b84daacb04c57869d1da1169d32a333021255f3648b9556362cd27a44c7d795d27e772a9326ed1f5191a70e5c57797f9856cd7208ceb43f5a0c
|
7
|
+
data.tar.gz: 8944d9b7bf193140b884bfd73b06298c7548a75312fe9759c6eaef95bfc2988b520b5edd76ff9cb743b47a57e3daf4e59d69c4afb37a17736c0f70d638f620dd
|
data/lib/pluginizer.rb
CHANGED
@@ -34,15 +34,26 @@ module Pluginizer
|
|
34
34
|
|
35
35
|
def configure_rspec
|
36
36
|
invoke('rspec:install')
|
37
|
+
rails_helper = 'spec/rails_helper.rb'
|
37
38
|
|
38
|
-
gsub_file
|
39
|
+
gsub_file rails_helper,
|
39
40
|
"require File.expand_path('../../config/environment', __FILE__)",
|
40
41
|
"require File.expand_path('../dummy/config/environment', __FILE__)"
|
42
|
+
gsub_file rails_helper,
|
43
|
+
%{config.fixture_path = "\#{::Rails.root}/spec/fixtures"},
|
44
|
+
%{config.fixture_path = "\#{#{camelized}::Engine.root}/spec/fixtures"}
|
41
45
|
|
42
46
|
run "bundle binstubs rspec-core"
|
43
47
|
|
44
|
-
insert_into_file
|
45
|
-
|
48
|
+
insert_into_file rails_helper,
|
49
|
+
"\nrequire 'fantaskspec'\n",
|
50
|
+
after: "# Add additional requires below this line. Rails is not loaded until this point!"
|
51
|
+
insert_into_file rails_helper,
|
52
|
+
"\n config.infer_rake_task_specs_from_file_location!\n",
|
53
|
+
before: /^end/
|
54
|
+
insert_into_file rails_helper,
|
55
|
+
"\n config.render_views\n",
|
56
|
+
before: /^end/
|
46
57
|
shoulda = <<-SHOULDA.strip_heredoc.indent(2)
|
47
58
|
|
48
59
|
Shoulda::Matchers.configure do |config|
|
@@ -52,7 +63,10 @@ module Pluginizer
|
|
52
63
|
end
|
53
64
|
end
|
54
65
|
SHOULDA
|
55
|
-
insert_into_file
|
66
|
+
insert_into_file rails_helper, shoulda, before: /^end/
|
67
|
+
insert_into_file rails_helper,
|
68
|
+
"\n config.include(Shoulda::Callback::Matchers::ActiveModel)\n",
|
69
|
+
before: /^end/
|
56
70
|
end
|
57
71
|
end
|
58
72
|
end
|
data/lib/pluginizer/version.rb
CHANGED
data/templates/%name%.gemspec.tt
CHANGED
@@ -25,4 +25,5 @@ Gem::Specification.new do |s|
|
|
25
25
|
s.add_development_dependency 'rspec-rails', '~> 3.5'
|
26
26
|
s.add_development_dependency 'fantaskspec', '~> 1.0'
|
27
27
|
s.add_development_dependency 'shoulda-matchers', '~> 3.1'
|
28
|
+
s.add_development_dependency 'shoulda-callback-matchers', '~> 1.1'
|
28
29
|
end
|