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: eb7a49b852c9ae54932e33c50bad1c656e7a48d8
4
- data.tar.gz: e3a63831077b57f88bdd6d76073f3f63520d3b94
3
+ metadata.gz: 8d6620fc944337406bf0dddc9b8aa2581123c8ce
4
+ data.tar.gz: b9db388c64519ddf5cce40369e2a8a3110b9f48c
5
5
  SHA512:
6
- metadata.gz: 27043fb182f71f7c1422f4e1dff86be27722eaeb4bcc1e47a697beba8278f1a8e2b46d1a612d5ee93b0069589abbe238edb3d582f4f97d760e5d13750b75a844
7
- data.tar.gz: 0d6ca20a140ce8fded5d60648782e4e77509b7678f6ae6f3ba86a53a4e065f577706eff94953fd9c4e4b60220eb8ae6dad624ef2e4c6aa3365110e2abe62f05f
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/react/components', @modules.map(&:downcase).join("/"), "#{@file_name.underscore}.rb")
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/react/components/.keep", ""
30
- create_file "app/react/models/.keep", "" if options[:"reactive-record"] || options[:all]
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/react/components.rb", <<-FILE
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 'models'" if options[:"reactive-record"] || options[:all]}
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/react/models.rb", <<-FILE
54
- # app/react/components.rb
55
- require_tree './models'
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', 'react').to_s"
62
- application 'config.autoload_paths += %W(#{config.root}/app/react/components)'
63
- application 'config.autoload_paths += %W(#{config.root}/app/react/models)' if options[:"reactive-record"] || options[:all]
64
- application 'config.eager_load_paths += %W(#{config.root}/app/react/components)'
65
- application 'config.eager_load_paths += %W(#{config.root}/app/react/models)' if options[:"reactive-record"] || options[:all]
66
- application 'config.watchable_files.concat Dir["#{config.root}/app/react/**/*.rb"]', env: :development
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/react/components', @modules.map(&:downcase).join("/"), "#{@file_name.underscore}.rb")
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reactive_rails_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Loic Boutet