From f9d5baebb1e8c312c9acb9721f84d48e18fa1909 Mon Sep 17 00:00:00 2001 From: Nick Date: Tue, 7 Apr 2015 20:47:19 +0700 Subject: [PATCH] fixed errors when generating blocks --- lib/generators/sir_trevor_rails/block/block_generator.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/generators/sir_trevor_rails/block/block_generator.rb b/lib/generators/sir_trevor_rails/block/block_generator.rb index dbd0ee0..93d1b09 100644 --- a/lib/generators/sir_trevor_rails/block/block_generator.rb +++ b/lib/generators/sir_trevor_rails/block/block_generator.rb @@ -14,7 +14,7 @@ def create_block copy_file "_block.js", "app/assets/javascripts/sir_trevor/blocks/#{name}.js" gsub_file "app/assets/javascripts/sir_trevor/blocks/#{name}.js", /SirTrevor\.Blocks\.Example/, "SirTrevor.Blocks.#{name.capitalize}" - gsub_file "app/assets/javascripts/sir_trevor/blocks/#{name}.js", /return "Example"/, "return: '#{name.capitalize}'" + gsub_file "app/assets/javascripts/sir_trevor/blocks/#{name}.js", /return "Example"/, "return '#{name.capitalize}'" gsub_file "app/assets/javascripts/sir_trevor/blocks/#{name}.js", /type: 'example'/, "type: '#{name.downcase}'" # Copy the HTML @@ -24,10 +24,10 @@ def create_block # Copy the BlockDecorator copy_file "_block.rb", "app/sir_trevor_blocks/#{name}_block.rb" - gsub_file "app/sir_trevor_blocks/#{name}_block.rb", /ExampleBlock/, " #{name}Block" + gsub_file "app/sir_trevor_blocks/#{name}_block.rb", /ExampleBlock/, " #{name.capitalize}Block" end end end -end \ No newline at end of file +end