Class: Cejo::Floss::Main
- Inherits:
-
Object
- Object
- Cejo::Floss::Main
- Defined in:
- lib/cejo/floss/main.rb
Overview
Core Management FLOSS Projects
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#folders ⇒ Object
readonly
Returns the value of attribute folders.
-
#services ⇒ Object
readonly
Returns the value of attribute services.
-
#utils ⇒ Object
readonly
Returns the value of attribute utils.
Instance Method Summary collapse
- #archive ⇒ Object
- #grab ⇒ Object
-
#initialize(folders, utils, command) ⇒ Main
constructor
A new instance of Main.
- #parsed_projects ⇒ Object
- #process_projects ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(folders, utils, command) ⇒ Main
Returns a new instance of Main.
12 13 14 15 16 |
# File 'lib/cejo/floss/main.rb', line 12 def initialize(folders, utils, command) @folders = folders @utils = utils @command = command end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
10 11 12 |
# File 'lib/cejo/floss/main.rb', line 10 def command @command end |
#folders ⇒ Object (readonly)
Returns the value of attribute folders.
10 11 12 |
# File 'lib/cejo/floss/main.rb', line 10 def folders @folders end |
#services ⇒ Object (readonly)
Returns the value of attribute services.
10 11 12 |
# File 'lib/cejo/floss/main.rb', line 10 def services @services end |
#utils ⇒ Object (readonly)
Returns the value of attribute utils.
10 11 12 |
# File 'lib/cejo/floss/main.rb', line 10 def utils @utils end |
Instance Method Details
#archive ⇒ Object
35 36 37 38 39 |
# File 'lib/cejo/floss/main.rb', line 35 def archive process_projects do |info| Archive.new(utils, info.name, info.folder, info.to_s).run end end |
#grab ⇒ Object
42 43 44 45 46 |
# File 'lib/cejo/floss/main.rb', line 42 def grab process_projects do |info| Grab.new(utils, info.folder, info.url, info.to_s).run end end |
#parsed_projects ⇒ Object
18 19 20 21 |
# File 'lib/cejo/floss/main.rb', line 18 def parsed_projects folder = folders.cejo_config.join 'floss' utils.parse_folder folder end |
#process_projects ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/cejo/floss/main.rb', line 23 def process_projects parsed_projects.each do |language, projects| puts "\n❯ #{language.capitalize}" puts projects.each do |url| project_info = ProjectInfo.new url, language.to_s yield project_info end end end |
#run ⇒ Object
49 50 51 |
# File 'lib/cejo/floss/main.rb', line 49 def run public_send(command) end |