Class: Rusic::Generators::Theme

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/rusic/generators/theme.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



11
12
13
# File 'lib/rusic/generators/theme.rb', line 11

def self.source_root
  File.dirname(__FILE__) + '/..'
end

Instance Method Details

#assetsObject



50
51
52
53
54
55
56
57
58
59
# File 'lib/rusic/generators/theme.rb', line 50

def assets
  empty_directory("#{name}/assets")
  copy_file('templates/assets/bootstrap.css', "#{name}/assets/bootstrap.css")
  copy_file('templates/assets/bootstrap.js', "#{name}/assets/bootstrap.js")
  copy_file('templates/assets/cover.css', "#{name}/assets/cover.css")
  copy_file('templates/assets/glyphicons-halflings-regular.eot', "#{name}/assets/glyphicons-halflings-regular.eot")
  copy_file('templates/assets/glyphicons-halflings-regular.svg', "#{name}/assets/glyphicons-halflings-regular.svg")
  copy_file('templates/assets/glyphicons-halflings-regular.ttf', "#{name}/assets/glyphicons-halflings-regular.ttf")
  copy_file('templates/assets/glyphicons-halflings-regular.woff', "#{name}/assets/glyphicons-halflings-regular.woff")
end

#create_projectObject



15
16
17
# File 'lib/rusic/generators/theme.rb', line 15

def create_project
  empty_directory(name)
end

#gitObject



19
20
21
# File 'lib/rusic/generators/theme.rb', line 19

def git
  copy_file('templates/gitignore', "#{name}/.gitignore")
end

#ideasObject



32
33
34
35
36
37
38
# File 'lib/rusic/generators/theme.rb', line 32

def ideas
  empty_directory("#{name}/ideas")
  copy_file('templates/ideas/index.html.liquid', "#{name}/ideas/index.html.liquid")
  copy_file('templates/ideas/new.html.liquid', "#{name}/ideas/new.html.liquid")
  copy_file('templates/ideas/show.html.liquid', "#{name}/ideas/show.html.liquid")
  copy_file('templates/ideas/edit.html.liquid', "#{name}/ideas/edit.html.liquid")
end

#layoutObject



27
28
29
30
# File 'lib/rusic/generators/theme.rb', line 27

def layout
  empty_directory("#{name}/layouts")
  copy_file('templates/layouts/subdomain.html.liquid', "#{name}/layouts/subdomain.html.liquid")
end

#pagesObject



40
41
42
43
# File 'lib/rusic/generators/theme.rb', line 40

def pages
  empty_directory("#{name}/pages")
  copy_file('templates/pages/about.html.liquid', "#{name}/pages/about.html.liquid")
end

#readmeObject



23
24
25
# File 'lib/rusic/generators/theme.rb', line 23

def readme
  template('templates/README.md', "#{name}/README.md", name: name)
end

#snippetsObject



45
46
47
48
# File 'lib/rusic/generators/theme.rb', line 45

def snippets
  empty_directory("#{name}/snippets")
  copy_file('templates/snippets/navigation.html.liquid', "#{name}/snippets/navigation.html.liquid")
end