Class: FillHelpers
- Inherits:
-
Object
- Object
- FillHelpers
- Defined in:
- lib/makeme/fill_helpers.rb
Instance Method Summary collapse
- #get_binding ⇒ Object
- #heuristic_project ⇒ Object
- #heuristic_username ⇒ Object
-
#initialize(working_directory, absolute_file_path, guess_data) ⇒ FillHelpers
constructor
A new instance of FillHelpers.
- #parent_directory ⇒ Object
- #project ⇒ Object
- #username ⇒ Object
Constructor Details
#initialize(working_directory, absolute_file_path, guess_data) ⇒ FillHelpers
Returns a new instance of FillHelpers.
8 9 10 11 12 |
# File 'lib/makeme/fill_helpers.rb', line 8 def initialize(working_directory, absolute_file_path, guess_data) @working_directory = working_directory @absolute_file_path = absolute_file_path @guess_data = guess_data end |
Instance Method Details
#get_binding ⇒ Object
14 15 16 |
# File 'lib/makeme/fill_helpers.rb', line 14 def get_binding binding end |
#heuristic_project ⇒ Object
28 29 30 |
# File 'lib/makeme/fill_helpers.rb', line 28 def heuristic_project parent_directory end |
#heuristic_username ⇒ Object
32 33 34 |
# File 'lib/makeme/fill_helpers.rb', line 32 def heuristic_username Etc.getlogin end |
#parent_directory ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/makeme/fill_helpers.rb', line 18 def parent_directory parent = Pathname.new(@absolute_file_path).parent.basename if parent parent.to_s else nil end end |
#project ⇒ Object
36 |
# File 'lib/makeme/fill_helpers.rb', line 36 def project; heuristic_project || Internal.placeholder("myproject"); end |
#username ⇒ Object
37 |
# File 'lib/makeme/fill_helpers.rb', line 37 def username; heuristic_username || Internal.placeholder("username"); end |