Module: Ace::Idea::Atoms::IdeaFilePattern
- Defined in:
- lib/ace/idea/atoms/idea_file_pattern.rb
Overview
Provides glob patterns for finding idea spec files. Ideas use the .idea.s.md extension to distinguish from task .s.md files.
Constant Summary collapse
- FILE_GLOB =
Glob pattern for idea spec files within a directory
"*.idea.s.md"- FILE_EXTENSION =
Full file extension for idea spec files
".idea.s.md"
Class Method Summary collapse
-
.folder_name(id, slug) ⇒ String
Build the folder name for an idea.
-
.idea_file?(filename) ⇒ Boolean
Check if a filename matches the idea spec pattern.
-
.spec_filename(id, slug) ⇒ String
Build the spec filename for an idea.
Class Method Details
.folder_name(id, slug) ⇒ String
Build the folder name for an idea
27 28 29 |
# File 'lib/ace/idea/atoms/idea_file_pattern.rb', line 27 def self.folder_name(id, slug) "#{id}-#{slug}" end |
.idea_file?(filename) ⇒ Boolean
Check if a filename matches the idea spec pattern
34 35 36 |
# File 'lib/ace/idea/atoms/idea_file_pattern.rb', line 34 def self.idea_file?(filename) filename.to_s.end_with?(FILE_EXTENSION) end |
.spec_filename(id, slug) ⇒ String
Build the spec filename for an idea
19 20 21 |
# File 'lib/ace/idea/atoms/idea_file_pattern.rb', line 19 def self.spec_filename(id, slug) "#{id}-#{slug}#{FILE_EXTENSION}" end |