Module: RakeTasks::System
Instance Method Summary collapse
- #dir(*glob) ⇒ Object
- #dir_glob(*patterns) ⇒ Object
- #directory?(*args) ⇒ Boolean
- #file?(*args) ⇒ Boolean
- #import_task(*task_path) ⇒ Object
- #load_gemspec(*args) ⇒ Object
- #load_yaml(*args) ⇒ Object
- #open_file(*args, &block) ⇒ Object
- #pwd(*args) ⇒ Object
- #rm(*args) ⇒ Object
- #write_file(file_path, array) ⇒ Object
Instance Method Details
#dir(*glob) ⇒ Object
6 7 8 |
# File 'lib/rake_tasks/system.rb', line 6 def dir(*glob) Dir[*glob] end |
#dir_glob(*patterns) ⇒ Object
10 11 12 |
# File 'lib/rake_tasks/system.rb', line 10 def dir_glob(*patterns) Dir.glob(*patterns) end |
#directory?(*args) ⇒ Boolean
26 27 28 |
# File 'lib/rake_tasks/system.rb', line 26 def directory?(*args) File.directory?(*args) end |
#file?(*args) ⇒ Boolean
22 23 24 |
# File 'lib/rake_tasks/system.rb', line 22 def file?(*args) File.file?(*args) end |
#import_task(*task_path) ⇒ Object
14 15 16 |
# File 'lib/rake_tasks/system.rb', line 14 def import_task(*task_path) import(*task_path) end |
#load_gemspec(*args) ⇒ Object
52 53 54 |
# File 'lib/rake_tasks/system.rb', line 52 def load_gemspec(*args) ::Gem::Specification.load(*args) end |
#load_yaml(*args) ⇒ Object
46 47 48 49 50 |
# File 'lib/rake_tasks/system.rb', line 46 def load_yaml(*args) # Psych must be available on the system, # preferably via installing ruby with libyaml already installed. Psych.load_file(*args) end |
#open_file(*args, &block) ⇒ Object
34 35 36 |
# File 'lib/rake_tasks/system.rb', line 34 def open_file(*args, &block) File.open(*args, &block) end |
#pwd(*args) ⇒ Object
18 19 20 |
# File 'lib/rake_tasks/system.rb', line 18 def pwd(*args) Dir.pwd(*args) end |
#rm(*args) ⇒ Object
30 31 32 |
# File 'lib/rake_tasks/system.rb', line 30 def rm(*args) FileUtils.rm(*args) end |
#write_file(file_path, array) ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/rake_tasks/system.rb', line 38 def write_file(file_path, array) open_file(file_path, 'w') do |file| array.each do |element| file.puts element end end end |