Class: ZombieScout::RubyProject
- Inherits:
-
Object
- Object
- ZombieScout::RubyProject
- Defined in:
- lib/zombie_scout/ruby_project.rb
Instance Method Summary collapse
-
#folders ⇒ Object
TODO this is only called from Mission…weird?.
- #globs ⇒ Object
-
#initialize(*globs) ⇒ RubyProject
constructor
A new instance of RubyProject.
- #ruby_file_paths ⇒ Object
- #ruby_sources ⇒ Object
Constructor Details
#initialize(*globs) ⇒ RubyProject
Returns a new instance of RubyProject.
7 8 9 10 |
# File 'lib/zombie_scout/ruby_project.rb', line 7 def initialize(*globs) @globs = globs @globs = %w[app config lib] if @globs.empty? end |
Instance Method Details
#folders ⇒ Object
TODO this is only called from Mission…weird?
33 34 35 36 37 |
# File 'lib/zombie_scout/ruby_project.rb', line 33 def folders # TODO this is only called from Mission...weird? %w[app config lib].select { |folder| Dir.exist?(folder) } end |
#globs ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/zombie_scout/ruby_project.rb', line 22 def globs pathnames = @globs.map { |g| Pathname.new(g) } pathnames.map { |pathname| if pathname.directory? "#{pathname}/**/*.rb" else pathname.to_s end } end |
#ruby_file_paths ⇒ Object
16 17 18 19 20 |
# File 'lib/zombie_scout/ruby_project.rb', line 16 def ruby_file_paths globs.map { |glob| Dir.glob(glob) }.flatten.map { |path| path.sub(/^\//, '') } end |
#ruby_sources ⇒ Object
12 13 14 |
# File 'lib/zombie_scout/ruby_project.rb', line 12 def ruby_sources ruby_file_paths.map { |path| RubySource.new(path) } end |