Class: Tipsy::Runners::Generator
- Inherits:
-
Object
- Object
- Tipsy::Runners::Generator
- Includes:
- Utils::System
- Defined in:
- lib/tipsy/runners/generator.rb
Instance Attribute Summary collapse
-
#dest_path ⇒ Object
readonly
Returns the value of attribute dest_path.
-
#site ⇒ Object
readonly
Returns the value of attribute site.
-
#site_name ⇒ Object
readonly
Returns the value of attribute site_name.
-
#source_path ⇒ Object
readonly
Returns the value of attribute source_path.
Instance Method Summary collapse
- #excludes ⇒ Object
-
#initialize(args, site) ⇒ Generator
constructor
A new instance of Generator.
Methods included from Utils::System
#copy_file, #copy_folder, #copy_tree, #empty_dir?, #enumerate_tree, #excluded?, #excludes=, #log_action, #make_file, #mkdir_p, #normalize_path, #rm_rf, #skip_file?, #skip_path?, #unlink
Constructor Details
#initialize(args, site) ⇒ Generator
Returns a new instance of Generator.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/tipsy/runners/generator.rb', line 12 def initialize(args, site) @site_name, @site = args.first, site @source_path = File.("../../../templates/site", __FILE__) @dest_path = File.join(Tipsy.root, site_name) ensure_destination copy_tree(source_path, dest_path) public_dir = File.join(Tipsy.root, site_name, "public") File.mkdir_p(public_dir) unless ::Dir.exists?(public_dir) end |
Instance Attribute Details
#dest_path ⇒ Object (readonly)
Returns the value of attribute dest_path.
4 5 6 |
# File 'lib/tipsy/runners/generator.rb', line 4 def dest_path @dest_path end |
#site ⇒ Object (readonly)
Returns the value of attribute site.
4 5 6 |
# File 'lib/tipsy/runners/generator.rb', line 4 def site @site end |
#site_name ⇒ Object (readonly)
Returns the value of attribute site_name.
4 5 6 |
# File 'lib/tipsy/runners/generator.rb', line 4 def site_name @site_name end |
#source_path ⇒ Object (readonly)
Returns the value of attribute source_path.
4 5 6 |
# File 'lib/tipsy/runners/generator.rb', line 4 def source_path @source_path end |
Instance Method Details
#excludes ⇒ Object
8 9 10 |
# File 'lib/tipsy/runners/generator.rb', line 8 def excludes @_excludes ||= ['.svn', '.git', '.gitignore', '.sass-cache', 'config.erb', '.DS_Store'] end |