Class: Miteru::Configuration
- Inherits:
-
Object
- Object
- Miteru::Configuration
- Defined in:
- lib/miteru/configuration.rb
Instance Attribute Summary collapse
- #auto_download ⇒ Boolean
- #ayashige ⇒ Boolean
- #database ⇒ String
- #directory_traveling ⇒ Boolean
- #download_to ⇒ String
- #post_to_slack ⇒ Boolean
- #size ⇒ Integer
- #slack_channel ⇒ String
- #slack_webhook_url ⇒ String?
- #threads ⇒ Integer
- #valid_extensions ⇒ Array<String> readonly
- #valid_mime_types ⇒ Array<String> readonly
- #verbose ⇒ Boolean
Instance Method Summary collapse
- #auto_download? ⇒ Boolean
- #ayashige? ⇒ Boolean
- #directory_traveling? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #post_to_slack? ⇒ Boolean
- #slack_webhook_url? ⇒ Boolean
- #verbose? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/miteru/configuration.rb', line 46 def initialize @auto_download = false @ayashige = false @directory_traveling = false @download_to = "/tmp" @post_to_slack = false @size = 100 @threads = Parallel.processor_count @verbose = false @database = ENV["MITERU_DATABASE"] || "miteru.db" @slack_webhook_url = ENV["SLACK_WEBHOOK_URL"] @slack_channel = ENV["SLACK_CHANNEL"] || "#general" @valid_extensions = [".zip", ".rar", ".7z", ".tar", ".gz"].freeze @valid_mime_types = ["application/zip", "application/vnd.rar", "application/x-7z-compressed", "application/x-tar", "application/gzip"] end |
Instance Attribute Details
#auto_download ⇒ Boolean
8 9 10 |
# File 'lib/miteru/configuration.rb', line 8 def auto_download @auto_download end |
#ayashige ⇒ Boolean
11 12 13 |
# File 'lib/miteru/configuration.rb', line 11 def ayashige @ayashige end |
#database ⇒ String
32 33 34 |
# File 'lib/miteru/configuration.rb', line 32 def database @database end |
#directory_traveling ⇒ Boolean
14 15 16 |
# File 'lib/miteru/configuration.rb', line 14 def directory_traveling @directory_traveling end |
#download_to ⇒ String
17 18 19 |
# File 'lib/miteru/configuration.rb', line 17 def download_to @download_to end |
#post_to_slack ⇒ Boolean
20 21 22 |
# File 'lib/miteru/configuration.rb', line 20 def post_to_slack @post_to_slack end |
#size ⇒ Integer
23 24 25 |
# File 'lib/miteru/configuration.rb', line 23 def size @size end |
#slack_channel ⇒ String
38 39 40 |
# File 'lib/miteru/configuration.rb', line 38 def slack_channel @slack_channel end |
#slack_webhook_url ⇒ String?
35 36 37 |
# File 'lib/miteru/configuration.rb', line 35 def slack_webhook_url @slack_webhook_url end |
#threads ⇒ Integer
26 27 28 |
# File 'lib/miteru/configuration.rb', line 26 def threads @threads end |
#valid_extensions ⇒ Array<String> (readonly)
41 42 43 |
# File 'lib/miteru/configuration.rb', line 41 def valid_extensions @valid_extensions end |
#valid_mime_types ⇒ Array<String> (readonly)
44 45 46 |
# File 'lib/miteru/configuration.rb', line 44 def valid_mime_types @valid_mime_types end |
#verbose ⇒ Boolean
29 30 31 |
# File 'lib/miteru/configuration.rb', line 29 def verbose @verbose end |
Instance Method Details
#auto_download? ⇒ Boolean
64 65 66 |
# File 'lib/miteru/configuration.rb', line 64 def auto_download? @auto_download end |
#ayashige? ⇒ Boolean
68 69 70 |
# File 'lib/miteru/configuration.rb', line 68 def ayashige? @ayashige end |
#directory_traveling? ⇒ Boolean
72 73 74 |
# File 'lib/miteru/configuration.rb', line 72 def directory_traveling? @directory_traveling end |
#post_to_slack? ⇒ Boolean
76 77 78 |
# File 'lib/miteru/configuration.rb', line 76 def post_to_slack? @post_to_slack end |
#slack_webhook_url? ⇒ Boolean
84 85 86 |
# File 'lib/miteru/configuration.rb', line 84 def slack_webhook_url? @slack_webhook_url end |
#verbose? ⇒ Boolean
80 81 82 |
# File 'lib/miteru/configuration.rb', line 80 def verbose? @verbose end |