Class: Jekyll::Minibundle::DevelopmentFile

Inherits:
Object
  • Object
show all
Includes:
AssetFileOperations, AssetFilePaths
Defined in:
lib/jekyll/minibundle/development_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AssetFilePaths

#asset_destination_path, #destination, #destination_exists?, #modified?, #mtime, #path

Methods included from AssetFileOperations

#static_file!, #write_destination

Constructor Details

#initialize(asset_source_path, asset_destination_path) ⇒ DevelopmentFile

Returns a new instance of DevelopmentFile.



11
12
13
14
15
16
# File 'lib/jekyll/minibundle/development_file.rb', line 11

def initialize(asset_source_path, asset_destination_path)
  @asset_source_path = asset_source_path
  @asset_destination_dir = File.dirname asset_destination_path
  @asset_destination_basename = File.basename asset_destination_path
  @stamped_at = nil
end

Instance Attribute Details

#asset_destination_basenameObject (readonly)

Returns the value of attribute asset_destination_basename.



9
10
11
# File 'lib/jekyll/minibundle/development_file.rb', line 9

def asset_destination_basename
  @asset_destination_basename
end

#asset_destination_dirObject (readonly)

Returns the value of attribute asset_destination_dir.



9
10
11
# File 'lib/jekyll/minibundle/development_file.rb', line 9

def asset_destination_dir
  @asset_destination_dir
end

#asset_source_pathObject (readonly)

Returns the value of attribute asset_source_path.



9
10
11
# File 'lib/jekyll/minibundle/development_file.rb', line 9

def asset_source_path
  @asset_source_path
end

#stamped_atObject (readonly)

Returns the value of attribute stamped_at.



9
10
11
# File 'lib/jekyll/minibundle/development_file.rb', line 9

def stamped_at
  @stamped_at
end

Instance Method Details

#write(site_destination_dir) ⇒ Object



18
19
20
21
22
23
24
25
26
# File 'lib/jekyll/minibundle/development_file.rb', line 18

def write(site_destination_dir)
  if destination_exists?(site_destination_dir) && !modified?
    false
  else
    @stamped_at = mtime
    write_destination site_destination_dir
    true
  end
end