Class: Jekyll::GithubCard::StyleFile
- Inherits:
-
StaticFile
- Object
- StaticFile
- Jekyll::GithubCard::StyleFile
- Defined in:
- lib/jekyll-github-card/generator.rb
Instance Method Summary collapse
-
#initialize(site, content) ⇒ StyleFile
constructor
A new instance of StyleFile.
- #path ⇒ Object
- #relative_path ⇒ Object
- #write(dest) ⇒ Object
Constructor Details
#initialize(site, content) ⇒ StyleFile
Returns a new instance of StyleFile.
18 19 20 21 22 23 24 25 |
# File 'lib/jekyll-github-card/generator.rb', line 18 def initialize(site, content) @site = site @content = content @relative_path = "/assets/css/github-card.css" @extname = ".css" @name = "github-card.css" @dir = "/assets/css" end |
Instance Method Details
#path ⇒ Object
34 35 36 |
# File 'lib/jekyll-github-card/generator.rb', line 34 def path @relative_path end |
#relative_path ⇒ Object
38 39 40 |
# File 'lib/jekyll-github-card/generator.rb', line 38 def relative_path @relative_path end |
#write(dest) ⇒ Object
27 28 29 30 31 32 |
# File 'lib/jekyll-github-card/generator.rb', line 27 def write(dest) dest_path = File.join(dest, @relative_path) FileUtils.mkdir_p(File.dirname(dest_path)) File.write(dest_path, @content) true end |