pluginizer 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 28fa7c704370b06e8fb1789ecab48a79247d211c
4
- data.tar.gz: 5405155e1ed9e75b0d2aaf982b3c7a6019d87d39
3
+ metadata.gz: fe77ffb23247717812c6aba71a79692c1303345e
4
+ data.tar.gz: e025fc083b0d282b09dda79c90926bd5f0b56c83
5
5
  SHA512:
6
- metadata.gz: c4c521f34968725fbf661cfee1f0da3f4c668caa35601c0dad98ed507ba6692eb9d361750c4849db7d5e26a4b2b420397b86a4e37f840842ca79d652b47e9cf7
7
- data.tar.gz: 58679116e06f5f708df3eb3f2b15caebd6848ff4a9318123119ebde39830478fef52187146f17feb5d4ab0ee83a6f3bd75f22f769dd81e5eac5539a83f038af6
6
+ metadata.gz: dc4c276ec7d78e050de3de983db0dc4c5b8497553217384029747bd51675d670b0b5abcd3b3a3ebf43ebe7140f848c3de454a1e5e1a01c3c17e9a853b766b352
7
+ data.tar.gz: af2627537210dff2bd6e7e6f58918accb188b917ff9daa5d96353bb0eb1291682f5d384f74dd9f485b46d1b1d2c53672688934f0f787d07c63cadd9a587c4c28
@@ -13,6 +13,7 @@ module Pluginizer
13
13
 
14
14
  after_bundle do
15
15
  in_root do
16
+ configure_database_yml if options.database == 'postgresql'
16
17
  configure_rspec
17
18
 
18
19
  git :init
@@ -24,6 +25,15 @@ module Pluginizer
24
25
 
25
26
  private
26
27
 
28
+ def configure_database_yml
29
+ insert_into_file 'spec/dummy/config/database.yml', <<-END.strip_heredoc.indent(2), after: "encoding: unicode"
30
+
31
+ host: 127.0.0.1
32
+ username: postgres
33
+ password: postgres
34
+ END
35
+ end
36
+
27
37
  def configure_rspec
28
38
  invoke('rspec:install')
29
39
  rails_helper = 'spec/rails_helper.rb'
@@ -37,25 +47,22 @@ module Pluginizer
37
47
 
38
48
  run "bundle binstubs rspec-core"
39
49
 
40
- requires = %w[fantaskspec email_spec email_spec/rspec].map{ |file| "require '#{file}'" }
41
- insert_into_file rails_helper,
42
- "\n#{requires.join("\n")}\n",
43
- after: "# Add additional requires below this line. Rails is not loaded until this point!"
44
- insert_into_file rails_helper,
45
- "\n config.infer_rake_task_specs_from_file_location!\n",
46
- before: /^end/
47
- insert_into_file rails_helper,
48
- "\n config.render_views\n",
49
- before: /^end/
50
- cache = <<-CACHE.strip_heredoc.indent(2)
50
+ requires = %w[
51
+ fantaskspec
52
+ email_spec
53
+ email_spec/rspec
54
+ ].map{ |file| "require '#{file}'" }.join("\n")
55
+ insert_into_file rails_helper, "\n#{requires}\n", after: "# Add additional requires below this line. Rails is not loaded until this point!"
56
+
57
+ insert_into_file rails_helper, "\n config.infer_rake_task_specs_from_file_location!\n", before: /^end/
58
+ insert_into_file rails_helper, "\n config.render_views\n", before: /^end/
59
+ insert_into_file rails_helper, <<-END.strip_heredoc.indent(2), before: /^end/
51
60
 
52
61
  config.before(:each) do
53
62
  Rails.cache.clear
54
63
  end
55
- CACHE
56
- insert_into_file rails_helper, cache,
57
- before: /^end/
58
- shoulda = <<-SHOULDA.strip_heredoc.indent(2)
64
+ END
65
+ insert_into_file rails_helper, <<-END.strip_heredoc.indent(2), before: /^end/
59
66
 
60
67
  Shoulda::Matchers.configure do |config|
61
68
  config.integrate do |with|
@@ -63,12 +70,8 @@ module Pluginizer
63
70
  with.library :rails
64
71
  end
65
72
  end
66
- SHOULDA
67
- insert_into_file rails_helper, shoulda,
68
- before: /^end/
69
- insert_into_file rails_helper,
70
- "\n config.include(Shoulda::Callback::Matchers::ActiveModel)\n",
71
- before: /^end/
73
+ END
74
+ insert_into_file rails_helper, "\n config.include(Shoulda::Callback::Matchers::ActiveModel)\n", before: /^end/
72
75
  end
73
76
  end
74
77
  end
@@ -1,3 +1,3 @@
1
1
  module Pluginizer
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pluginizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrice Lebel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-19 00:00:00.000000000 Z
11
+ date: 2016-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails