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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 652648059e7a5ead1e65f47f83dc025daa924d70
4
- data.tar.gz: df2b8b71b535142062fb18c997b3a231bda0d296
3
+ metadata.gz: 62fdcc557b8856ead5d5086447325b8c9f4d98d3
4
+ data.tar.gz: d139fbda270269d5c182a1e0e03833bd6eaf22f8
5
5
  SHA512:
6
- metadata.gz: 230e43c0265ca7825db3b0a5f8fbffadd2c32d2433121a285fb294a9e9e26c982a6b4da5ebf4de191bb3ea4994db918f8b123ed7b6ab36768cc95aab5ef6a68d
7
- data.tar.gz: 0e59ebeaee1404c7465a8420a9a112671f44abe202cf7db778789aed3d891520b04631442666b0d8d8f8a1294096ca6989481508c3f3577d994c06b16369a67d
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: '.'
@@ -1,3 +1,3 @@
1
1
  module Pluginizer
2
- VERSION = "0.2.2"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -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
- <% unless options[:skip_active_record] -%>
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
@@ -0,0 +1,6 @@
1
+ # A sample Bowerfile
2
+ # Check out https://github.com/42dev/bower-rails#ruby-dsl-configuration for more options
3
+
4
+ # asset 'jquery-migrate', github: 'jquery/jquery-migrate', ref: '48e7cae'
5
+ # asset 'signature_pad'
6
+ # resolution 'signature_pad', '1.5.2'
@@ -1,5 +1,7 @@
1
+ <% unless options.assets_only? -%>
1
2
  require "<%= namespaced_name %>/configuration"
2
3
 
4
+ <% end -%>
3
5
  <%= wrap_in_modules <<-rb.strip_heredoc
4
6
  class Engine < ::Rails::Engine
5
7
  #{mountable? ? ' isolate_namespace ' + camelized_modules : ' '}
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.2.2
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-20 00:00:00.000000000 Z
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