pluginizer 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pluginizer/generators/plugin_generator.rb +3 -0
- data/lib/pluginizer/plugin_builder.rb +45 -0
- data/lib/pluginizer/version.rb +1 -1
- data/templates/%name%.gemspec.tt +10 -2
- data/templates/Bowerfile +6 -0
- data/templates/lib/%namespaced_name%/engine.rb.tt +2 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62fdcc557b8856ead5d5086447325b8c9f4d98d3
|
4
|
+
data.tar.gz: d139fbda270269d5c182a1e0e03833bd6eaf22f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ff6a9c74acde19bc5bbcec9f967d3e091d417d9d7c142b9b41cbc03d459b00d4a0ff5db14b319789ff142dd0892ccd6ad0887ff143ec95132ce5fd46e52c85e
|
7
|
+
data.tar.gz: c2ff98b8d4a8f7d8b95e5fb9e82623943be133db8a5d9f10b74fb9ee50dbedca6b996e2d4de72f1debe1c85aca4a372aaeee2ebab63fe84f289489d1a0eb9bd2
|
@@ -15,6 +15,9 @@ module Pluginizer
|
|
15
15
|
class_option :skip_git_init, type: :boolean, default: false,
|
16
16
|
desc: 'Skip git repository initialization'
|
17
17
|
|
18
|
+
class_option :assets_only, type: :boolean, default: false,
|
19
|
+
desc: 'Configure the plugin for assets only'
|
20
|
+
|
18
21
|
protected
|
19
22
|
|
20
23
|
def get_builder_class
|
@@ -18,6 +18,51 @@ module Pluginizer
|
|
18
18
|
configure_rspec
|
19
19
|
configure_dummy_environments
|
20
20
|
|
21
|
+
if options.assets_only?
|
22
|
+
copy_file 'Bowerfile'
|
23
|
+
insert_into_file 'Rakefile', "\n\nRails.application.load_tasks",
|
24
|
+
after: "require 'bundler/gem_tasks'"
|
25
|
+
inside 'app' do
|
26
|
+
remove_dir 'assets/config'
|
27
|
+
remove_dir 'assets/images'
|
28
|
+
remove_dir 'controllers'
|
29
|
+
remove_dir 'helpers'
|
30
|
+
remove_dir 'mailers'
|
31
|
+
remove_dir 'models'
|
32
|
+
remove_dir 'views'
|
33
|
+
end
|
34
|
+
remove_dir 'bin'
|
35
|
+
remove_dir 'config'
|
36
|
+
remove_dir 'lib/tasks'
|
37
|
+
remove_file "lib/#{namespaced_name}/configuration.rb"
|
38
|
+
inside 'spec' do
|
39
|
+
remove_file 'rails_helper.rb'
|
40
|
+
remove_file 'spec_helper.rb'
|
41
|
+
inside 'dummy' do
|
42
|
+
remove_dir 'app'
|
43
|
+
remove_dir 'bin'
|
44
|
+
inside 'config' do
|
45
|
+
remove_dir 'environments'
|
46
|
+
remove_dir 'initializers'
|
47
|
+
remove_dir 'locales'
|
48
|
+
remove_file 'cable.yml'
|
49
|
+
remove_file 'database.yml'
|
50
|
+
remove_file 'environment.rb'
|
51
|
+
remove_file 'puma.rb'
|
52
|
+
remove_file 'routes.rb'
|
53
|
+
remove_file 'secrets.yml'
|
54
|
+
remove_file 'spring.rb'
|
55
|
+
end
|
56
|
+
remove_dir 'db'
|
57
|
+
remove_dir 'lib'
|
58
|
+
remove_dir 'log'
|
59
|
+
remove_dir 'public'
|
60
|
+
remove_dir 'tmp'
|
61
|
+
remove_file 'config.ru'
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
21
66
|
unless options.skip_git? || options.skip_git_init?
|
22
67
|
git :init
|
23
68
|
git add: '.'
|
data/lib/pluginizer/version.rb
CHANGED
data/templates/%name%.gemspec.tt
CHANGED
@@ -14,18 +14,26 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.description = "<%= camelized_modules %>"
|
15
15
|
s.license = "MIT"
|
16
16
|
|
17
|
+
<% if options.assets_only? -%>
|
18
|
+
s.files = Dir["{app,lib,vendor}/**/*", "Bowerfile", "MIT-LICENSE", "Rakefile", "README.md"]
|
19
|
+
<% else -%>
|
17
20
|
s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"]
|
21
|
+
<% end -%>
|
18
22
|
s.test_files = Dir["spec/**/*"]
|
19
23
|
|
20
24
|
<%= '# ' if options.dev? || options.edge? -%>s.add_dependency "rails", "~> 5.0"
|
21
|
-
<%
|
25
|
+
<% if options.assets_only? -%>
|
26
|
+
s.add_dependency 'bower-rails', '~> 0.11'
|
27
|
+
<% else -%>
|
28
|
+
<% unless options[:skip_active_record] -%>
|
22
29
|
|
23
30
|
s.add_development_dependency "<%= gem_for_database[0] %>"
|
24
|
-
<% end -%>
|
31
|
+
<% end -%>
|
25
32
|
s.add_development_dependency 'rspec-rails', '~> 3.5'
|
26
33
|
s.add_development_dependency 'fantaskspec', '~> 1.0'
|
27
34
|
s.add_development_dependency 'shoulda-matchers', '~> 3.1'
|
28
35
|
s.add_development_dependency 'shoulda-callback-matchers', '~> 1.1'
|
29
36
|
s.add_development_dependency 'rails-controller-testing'
|
30
37
|
s.add_development_dependency 'email_spec', '~> 2.1'
|
38
|
+
<% end -%>
|
31
39
|
end
|
data/templates/Bowerfile
ADDED
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.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrice Lebel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -83,6 +83,7 @@ files:
|
|
83
83
|
- templates/%name%.gemspec.tt
|
84
84
|
- templates/.gitignore.tt
|
85
85
|
- templates/.ruby-version.tt
|
86
|
+
- templates/Bowerfile
|
86
87
|
- templates/README.md.tt
|
87
88
|
- templates/lib/%namespaced_name%/configuration.rb.tt
|
88
89
|
- templates/lib/%namespaced_name%/engine.rb.tt
|