Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Commit 748bb2f

Browse files
committed
Update generators
1 parent 82f4c14 commit 748bb2f

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

lib/generators/hyper/templates/component_template.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Components
1+
22
<%- @modules.each do |module_name| %><%= " "* @indet %>module <%= module_name.camelize %><%- @indet += 1 %>
33
<%- end %><%=" "* @indet %>class <%= @file_name %> < Hyperloop::Component
44
@@ -38,4 +38,4 @@ module Components
3838
<%=" "* @indet %>end
3939
<%=" "* @indet %>end
4040
<%- @modules.each do %><%- @indet -= 1 %><%=" "* @indet %>end
41-
<%- end %>end
41+
<%- end %>

lib/generators/hyperloop/install_generator.rb

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def inject_react_file_js
1111
end
1212

1313
def inject_engine_to_routes
14-
route 'mount Hyperloop::Engine => \'/hyperloop\''
14+
route 'mount Hyperloop::Engine => \'/rr\''
1515
end
1616

1717
def create_hyperloop_directories
@@ -22,13 +22,13 @@ def create_hyperloop_directories
2222
end
2323

2424
def create_policies_directory
25-
create_file 'app/policies/hyperloop_application_policy.rb', <<-RUBY
26-
# app/policies/application_policy
25+
create_file 'app/policies/application_policy.rb', <<-RUBY
26+
# app/policies/application_policy
2727
28-
# Policies regulate access to your public models
29-
# The following policy will open up full access (but only in development)
30-
# The policy system is very flexible and powerful. See the documentation
31-
# for complete details.
28+
# Policies regulate access to your public models
29+
# The following policy will open up full access (but only in development)
30+
# The policy system is very flexible and powerful. See the documentation
31+
# for complete details.
3232
class Hyperloop::ApplicationPolicy
3333
# Allow any session to connect:
3434
always_allow_connection
@@ -40,6 +40,18 @@ class Hyperloop::ApplicationPolicy
4040
RUBY
4141
end
4242

43+
def create_initializer
44+
create_file 'config/initializers/hyperloop.rb', <<-RUBY
45+
46+
Hyperloop.configuration do |config|
47+
config.transport = :simple_poller
48+
config.import 'reactrb/auto-import'
49+
end
50+
51+
RUBY
52+
53+
end
54+
4355
def add_gems
4456
end
4557
end

0 commit comments

Comments
 (0)