Class: SocialConstruct::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/social_construct/install/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_routeObject



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/generators/social_construct/install/install_generator.rb', line 34

def add_route
  route_string = "\n  # Social card previews (development only)\n  if Rails.env.development?\n    mount SocialConstruct::Engine, at: \"/rails/social_cards\"\n  end\n  RUBY\n\n  route(route_string)\nend\n"

#create_application_social_cardObject



14
15
16
# File 'lib/generators/social_construct/install/install_generator.rb', line 14

def create_application_social_card
  template("application_social_card.rb", "app/social_cards/application_social_card.rb")
end

#create_example_previewObject



30
31
32
# File 'lib/generators/social_construct/install/install_generator.rb', line 30

def create_example_preview
  template("example_social_card_preview.rb", "test/social_cards/previews/example_social_card_preview.rb")
end

#create_example_social_cardObject



18
19
20
# File 'lib/generators/social_construct/install/install_generator.rb', line 18

def create_example_social_card
  template("example_social_card.rb", "app/social_cards/example_social_card.rb")
end

#create_example_templateObject



22
23
24
# File 'lib/generators/social_construct/install/install_generator.rb', line 22

def create_example_template
  template("example_social_card.html.erb", "app/views/social_cards/example_social_card.html.erb")
end

#create_initializer_fileObject



10
11
12
# File 'lib/generators/social_construct/install/install_generator.rb', line 10

def create_initializer_file
  template("social_construct.rb", "config/initializers/social_construct.rb")
end

#create_social_cards_layoutObject



26
27
28
# File 'lib/generators/social_construct/install/install_generator.rb', line 26

def create_social_cards_layout
  template("social_cards_layout.html.erb", "app/views/layouts/social_cards.html.erb")
end