modular_engine 0.9.3 → 0.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c33daf3960a34674243f24eb73f058337e5b3b0
|
4
|
+
data.tar.gz: 2cb5390b880b6a99c7a59f7d57fe52280fb0c565
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6527f9c576bae054b6b8f593cf461d7e8cefb0689e3f3b6757f7dbb087f438453af154696e4b6f5c7638dbd9c5e45ac58a648787d1c603a46cc9e477cc8eac3
|
7
|
+
data.tar.gz: c1ea6c4160d958828927452fa18a4b00ec045f0748f7ec1d157c77996ca5899a8795c2e5984792c3d517cb22eabdf417f9b20b274b170df490bd57dc476bce37
|
@@ -15,6 +15,12 @@ module Modular
|
|
15
15
|
def app
|
16
16
|
directory 'app'
|
17
17
|
empty_directory_with_keep_file "app/assets/images/#{namespaced_name}"
|
18
|
+
empty_directory "app/decorators"
|
19
|
+
empty_directory_with_keep_file "app/decorators/controllers"
|
20
|
+
empty_directory_with_keep_file "app/decorators/models"
|
21
|
+
empty_directory_with_keep_file "app/overrides"
|
22
|
+
empty_directory_with_keep_file "app/views/#{namespaced_name}/overrides"
|
23
|
+
|
18
24
|
end
|
19
25
|
|
20
26
|
def readme
|
@@ -30,7 +36,7 @@ module Modular
|
|
30
36
|
end
|
31
37
|
|
32
38
|
def gemspec
|
33
|
-
template "%
|
39
|
+
template "%engine_loader%.gemspec"
|
34
40
|
end
|
35
41
|
|
36
42
|
def gitignore
|
@@ -232,6 +238,14 @@ module Modular
|
|
232
238
|
end
|
233
239
|
end
|
234
240
|
|
241
|
+
def wrap_in_modules_with_new_lines(content)
|
242
|
+
modules.reverse.inject(content) do |content, mod|
|
243
|
+
str = "module #{mod}\n"
|
244
|
+
str += content.lines.map { |line| " #{line}" }.join
|
245
|
+
str += content.present? ? "\nend" : "end"
|
246
|
+
end
|
247
|
+
end
|
248
|
+
|
235
249
|
def camelized_modules
|
236
250
|
@camelized_modules ||= namespaced_name.camelize
|
237
251
|
end
|
@@ -5,7 +5,7 @@ require "<%= namespaced_name %>/version"
|
|
5
5
|
|
6
6
|
# Describe your gem and declare its dependencies:
|
7
7
|
Gem::Specification.new do |s|
|
8
|
-
s.name = "<%=
|
8
|
+
s.name = "<%= engine_loader %>"
|
9
9
|
s.version = <%= camelized_modules %>::VERSION
|
10
10
|
s.authors = ["<%= author %>"]
|
11
11
|
s.email = ["<%= email %>"]
|
@@ -20,8 +20,6 @@ Gem::Specification.new do |s|
|
|
20
20
|
<% end -%>
|
21
21
|
|
22
22
|
<%= '# ' if options.dev? || options.edge? -%>s.add_dependency "rails", "~> <%= Rails::VERSION::STRING %>"
|
23
|
-
<% unless options[:skip_active_record] -%>
|
24
23
|
|
25
|
-
s.
|
26
|
-
<% end -%>
|
24
|
+
s.add_dependency "deface"
|
27
25
|
end
|
@@ -1,25 +1,25 @@
|
|
1
|
-
<%=
|
1
|
+
<%= wrap_in_modules_with_new_lines <<-rb.strip_heredoc
|
2
2
|
class Engine < ::Rails::Engine
|
3
3
|
#{' isolate_namespace ' + camelized_modules}
|
4
|
-
|
5
|
-
paths["app/views"] << "app/views/samurai/contact"
|
4
|
+
paths["app/views"] << "app/views/#{namespaced_name}"
|
6
5
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
initializer :append_migrations do |app|
|
7
|
+
unless app.root.to_s.match(root.to_s)
|
8
|
+
config.paths["db/migrate"].expanded.each do |p|
|
9
|
+
app.config.paths["db/migrate"] << p
|
10
|
+
end
|
11
11
|
end
|
12
12
|
end
|
13
|
-
end
|
14
13
|
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
config.to_prepare do
|
15
|
+
Dir.glob(Engine.root.join("app", "decorators", "**", "*_decorator*.rb")) do |c|
|
16
|
+
Rails.configuration.cache_classes ? require(c) : load(c)
|
17
|
+
end
|
18
18
|
end
|
19
|
-
|
20
|
-
|
19
|
+
|
21
20
|
end
|
22
21
|
rb
|
23
22
|
%>
|
24
23
|
|
25
24
|
|
25
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: modular_engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thibault
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -53,7 +53,7 @@ files:
|
|
53
53
|
- Rakefile
|
54
54
|
- lib/generators/modular/USAGE
|
55
55
|
- lib/generators/modular/engine_generator.rb
|
56
|
-
- lib/generators/modular/templates/%
|
56
|
+
- lib/generators/modular/templates/%engine_loader%.gemspec
|
57
57
|
- lib/generators/modular/templates/Gemfile
|
58
58
|
- lib/generators/modular/templates/MIT-LICENSE
|
59
59
|
- lib/generators/modular/templates/README.rdoc
|