Class: FeduxOrgStdlib::Rake::WebserverTask
- Defined in:
- lib/fedux_org_stdlib/rake/webserver_task.rb
Overview
Webserver Task
Instance Attribute Summary collapse
-
#checksums ⇒ Object
readonly
Returns the value of attribute checksums.
-
#checksums_file ⇒ Object
readonly
Returns the value of attribute checksums_file.
-
#directory ⇒ Object
readonly
Returns the value of attribute directory.
-
#files ⇒ Object
readonly
Returns the value of attribute files.
-
#index_file_content ⇒ Object
readonly
Returns the value of attribute index_file_content.
-
#report ⇒ Object
readonly
The report to be generated.
-
#site ⇒ Object
readonly
Returns the value of attribute site.
Attributes inherited from Task
#description, #name, #verbose, #verbose (true)
Instance Method Summary collapse
-
#initialize(directory: File.expand_path('utils/server'), site: 'http://fedux-org.github.io/data/downloads/local_webserver', checksums_file: 'CHECKSUMS', index_file_content: nil, files: %w( server.darwin.amd64 server.linux.amd64 server.windows.amd64.exe ), redirect_to: nil, **args) ⇒ WebserverTask
constructor
Create a new webserver task.
- #run_task(_verbose) ⇒ Object
Methods inherited from Task
Constructor Details
#initialize(directory: File.expand_path('utils/server'), site: 'http://fedux-org.github.io/data/downloads/local_webserver', checksums_file: 'CHECKSUMS', index_file_content: nil, files: %w( server.darwin.amd64 server.linux.amd64 server.windows.amd64.exe ), redirect_to: nil, **args) ⇒ WebserverTask
Create a new webserver task
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/fedux_org_stdlib/rake/webserver_task.rb', line 26 def initialize( directory: File.('utils/server'), site: 'http://fedux-org.github.io/data/downloads/local_webserver', checksums_file: 'CHECKSUMS', index_file_content: nil, files: %w( server.darwin.amd64 server.linux.amd64 server.windows.amd64.exe ), redirect_to: nil, **args ) super(**args) @site = Addressable::URI.heuristic_parse(site) @files = Array(files) @checksums_file = checksums_file @directory = File.(directory) @index_file_content = if index_file_content index_file_content elsif redirect_to redirect_to_destination(redirect_to) else nil end end |
Instance Attribute Details
#checksums ⇒ Object (readonly)
Returns the value of attribute checksums.
16 17 18 |
# File 'lib/fedux_org_stdlib/rake/webserver_task.rb', line 16 def checksums @checksums end |
#checksums_file ⇒ Object (readonly)
Returns the value of attribute checksums_file.
16 17 18 |
# File 'lib/fedux_org_stdlib/rake/webserver_task.rb', line 16 def checksums_file @checksums_file end |
#directory ⇒ Object (readonly)
Returns the value of attribute directory.
16 17 18 |
# File 'lib/fedux_org_stdlib/rake/webserver_task.rb', line 16 def directory @directory end |
#files ⇒ Object (readonly)
Returns the value of attribute files.
16 17 18 |
# File 'lib/fedux_org_stdlib/rake/webserver_task.rb', line 16 def files @files end |
#index_file_content ⇒ Object (readonly)
Returns the value of attribute index_file_content.
16 17 18 |
# File 'lib/fedux_org_stdlib/rake/webserver_task.rb', line 16 def index_file_content @index_file_content end |
#report ⇒ Object (readonly)
The report to be generated
16 |
# File 'lib/fedux_org_stdlib/rake/webserver_task.rb', line 16 attr_reader :site, :directory, :index_file_content, :files, :checksums_file, :checksums |
#site ⇒ Object (readonly)
Returns the value of attribute site.
16 17 18 |
# File 'lib/fedux_org_stdlib/rake/webserver_task.rb', line 16 def site @site end |
Instance Method Details
#run_task(_verbose) ⇒ Object
55 56 57 58 59 |
# File 'lib/fedux_org_stdlib/rake/webserver_task.rb', line 55 def run_task(_verbose) fetch_checksums fetch_files create_index_file unless index_file_content.blank? end |