reactive_rails_generator 0.1.5 → 0.2.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d6620fc944337406bf0dddc9b8aa2581123c8ce
|
4
|
+
data.tar.gz: b9db388c64519ddf5cce40369e2a8a3110b9f48c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9668e05d6c3f522fbadfe8c0818cbd32fc47dae564a9974b43d9e68aee07c7cb0d1696ab5d671f352faad02ab9289b114e752511a04f8fba32572aacf8bbb0a
|
7
|
+
data.tar.gz: e482e56e031152fdd2d657eefa4a0950bf20aa759d51bbba53d227392a76fff637c4ae4b1bc17f2720856ecca80db80e06f86c6f9c58738cdc0ff2a1a986d4a7
|
@@ -10,7 +10,7 @@ module Reactrb
|
|
10
10
|
@modules = component_array[0..-2]
|
11
11
|
@file_name = component_array.last
|
12
12
|
@indet = 1
|
13
|
-
template "component_template.rb", File.join('app/
|
13
|
+
template "component_template.rb", File.join('app/views/components', @modules.map(&:downcase).join("/"), "#{@file_name.underscore}.rb")
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
@@ -26,12 +26,12 @@ JS
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def create_components_directory
|
29
|
-
create_file "app/
|
30
|
-
create_file "app/
|
29
|
+
create_file "app/views/components/.keep", ""
|
30
|
+
create_file "app/models/public/.keep", "" if options[:"reactive-record"] || options[:all]
|
31
31
|
end
|
32
32
|
|
33
33
|
def create_manifests
|
34
|
-
create_file "app/
|
34
|
+
create_file "app/views/components.rb", <<-FILE
|
35
35
|
# app/react/components.rb
|
36
36
|
require 'opal'
|
37
37
|
require 'reactive-ruby'
|
@@ -45,25 +45,25 @@ if React::IsomorphicHelpers.on_opal_client?
|
|
45
45
|
end
|
46
46
|
#{"require 'reactive-router'\nrequire 'react_router'" if options[:"reactive-router"] || options[:all]}
|
47
47
|
#{"require 'reactive-record'" if options[:"reactive-record"] || options[:all]}
|
48
|
-
#{"require '
|
48
|
+
#{"require '_react_public_models'" if options[:"reactive-record"] || options[:all]}
|
49
49
|
require_tree './components'
|
50
50
|
FILE
|
51
51
|
|
52
52
|
if options[:"reactive-record"] || options[:all]
|
53
|
-
create_file "app/
|
54
|
-
# app/
|
55
|
-
require_tree './
|
53
|
+
create_file "app/models/_react_public_models.rb", <<-FILE
|
54
|
+
# app/models/_react_public_models.rb
|
55
|
+
require_tree './public'
|
56
56
|
FILE
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
60
|
def add_config
|
61
|
-
application "config.assets.paths << ::Rails.root.join('app', '
|
62
|
-
application 'config.autoload_paths += %W(#{config.root}/app/
|
63
|
-
application 'config.autoload_paths += %W(#{config.root}/app/
|
64
|
-
application 'config.eager_load_paths += %W(#{config.root}/app/
|
65
|
-
application 'config.eager_load_paths += %W(#{config.root}/app/
|
66
|
-
application 'config.watchable_files.concat Dir["#{config.root}/app/
|
61
|
+
application "config.assets.paths << ::Rails.root.join('app', 'models').to_s"
|
62
|
+
# application 'config.autoload_paths += %W(#{config.root}/app/view/components)'
|
63
|
+
application 'config.autoload_paths += %W(#{config.root}/app/models/public)' if options[:"reactive-record"] || options[:all]
|
64
|
+
# application 'config.eager_load_paths += %W(#{config.root}/app/views/components)'
|
65
|
+
application 'config.eager_load_paths += %W(#{config.root}/app/models/public)' if options[:"reactive-record"] || options[:all]
|
66
|
+
application 'config.watchable_files.concat Dir["#{config.root}/app/models/public/*.rb"]', env: :development
|
67
67
|
application 'config.react.variant = :development', env: :development
|
68
68
|
end
|
69
69
|
|
@@ -9,7 +9,7 @@ module Reactrb
|
|
9
9
|
@modules = component_array[0..-2]
|
10
10
|
@file_name = component_array.last
|
11
11
|
@indet = 1
|
12
|
-
template "router_template.rb", File.join('app/
|
12
|
+
template "router_template.rb", File.join('app/views/components', @modules.map(&:downcase).join("/"), "#{@file_name.underscore}.rb")
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|