Class: RubyClone::FromFolder
- Inherits:
-
Object
- Object
- RubyClone::FromFolder
- Defined in:
- lib/ruby_clone/profile.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
- #exclude_pattern=(path) ⇒ Object
- #include_pattern=(path) ⇒ Object
-
#initialize(path, options = {}) ⇒ FromFolder
constructor
A new instance of FromFolder.
- #ssh? ⇒ Boolean
- #to_command ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(path, options = {}) ⇒ FromFolder
Returns a new instance of FromFolder.
6 7 8 9 10 11 |
# File 'lib/ruby_clone/profile.rb', line 6 def initialize(path, = {}) @exclude_patterns = [] @include_patterns = [] @options = @path = path end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
4 5 6 |
# File 'lib/ruby_clone/profile.rb', line 4 def path @path end |
Instance Method Details
#exclude_pattern=(path) ⇒ Object
13 14 15 |
# File 'lib/ruby_clone/profile.rb', line 13 def exclude_pattern=(path) @exclude_patterns << path end |
#include_pattern=(path) ⇒ Object
17 18 19 |
# File 'lib/ruby_clone/profile.rb', line 17 def include_pattern=(path) @include_patterns << path end |
#ssh? ⇒ Boolean
28 29 30 31 32 33 34 |
# File 'lib/ruby_clone/profile.rb', line 28 def ssh? if @options[:ssh] true else false end end |
#to_command ⇒ Object
21 22 23 24 25 26 |
# File 'lib/ruby_clone/profile.rb', line 21 def to_command command = "" command << @include_patterns.map { |e| "--include=#{e}" }.join(" ") + " " command << @exclude_patterns.map { |e| "--exclude=#{e}" }.join(" ") command.strip end |
#to_s ⇒ Object
36 37 38 39 |
# File 'lib/ruby_clone/profile.rb', line 36 def to_s return "#{@options[:ssh]}:#{@path}" if @options[:ssh] return @path if not @options[:ssh] end |