Class: Miteru::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/miteru/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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_downloadBoolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/miteru/configuration.rb', line 8

def auto_download
  @auto_download
end

#ayashigeBoolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/miteru/configuration.rb', line 11

def ayashige
  @ayashige
end

#databaseString

Returns:

  • (String)


32
33
34
# File 'lib/miteru/configuration.rb', line 32

def database
  @database
end

#directory_travelingBoolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/miteru/configuration.rb', line 14

def directory_traveling
  @directory_traveling
end

#download_toString

Returns:

  • (String)


17
18
19
# File 'lib/miteru/configuration.rb', line 17

def download_to
  @download_to
end

#post_to_slackBoolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/miteru/configuration.rb', line 20

def post_to_slack
  @post_to_slack
end

#sizeInteger

Returns:

  • (Integer)


23
24
25
# File 'lib/miteru/configuration.rb', line 23

def size
  @size
end

#slack_channelString

Returns:

  • (String)


38
39
40
# File 'lib/miteru/configuration.rb', line 38

def slack_channel
  @slack_channel
end

#slack_webhook_urlString?

Returns:

  • (String, nil)


35
36
37
# File 'lib/miteru/configuration.rb', line 35

def slack_webhook_url
  @slack_webhook_url
end

#threadsInteger

Returns:

  • (Integer)


26
27
28
# File 'lib/miteru/configuration.rb', line 26

def threads
  @threads
end

#valid_extensionsArray<String> (readonly)

Returns:

  • (Array<String>)


41
42
43
# File 'lib/miteru/configuration.rb', line 41

def valid_extensions
  @valid_extensions
end

#valid_mime_typesArray<String> (readonly)

Returns:

  • (Array<String>)


44
45
46
# File 'lib/miteru/configuration.rb', line 44

def valid_mime_types
  @valid_mime_types
end

#verboseBoolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/miteru/configuration.rb', line 29

def verbose
  @verbose
end

Instance Method Details

#auto_download?Boolean

Returns:

  • (Boolean)


64
65
66
# File 'lib/miteru/configuration.rb', line 64

def auto_download?
  @auto_download
end

#ayashige?Boolean

Returns:

  • (Boolean)


68
69
70
# File 'lib/miteru/configuration.rb', line 68

def ayashige?
  @ayashige
end

#directory_traveling?Boolean

Returns:

  • (Boolean)


72
73
74
# File 'lib/miteru/configuration.rb', line 72

def directory_traveling?
  @directory_traveling
end

#post_to_slack?Boolean

Returns:

  • (Boolean)


76
77
78
# File 'lib/miteru/configuration.rb', line 76

def post_to_slack?
  @post_to_slack
end

#slack_webhook_url?Boolean

Returns:

  • (Boolean)


84
85
86
# File 'lib/miteru/configuration.rb', line 84

def slack_webhook_url?
  @slack_webhook_url
end

#verbose?Boolean

Returns:

  • (Boolean)


80
81
82
# File 'lib/miteru/configuration.rb', line 80

def verbose?
  @verbose
end