app_status_notification 0.9.0.beta2 → 0.9.0.beta4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/app_status_notification.rb +2 -2
- data/lib/app_status_notification/command.rb +6 -6
- data/lib/app_status_notification/config.rb +7 -6
- data/lib/app_status_notification/version.rb +1 -1
- data/lib/app_status_notification/watchman.rb +9 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f83b4047c5a400af798316cc3fa1f74d5bb25a6afdeb538a547dd2aaa1f6ecbb
|
4
|
+
data.tar.gz: d5129809a70c73e73d73adb5b7b85e6638105bf4b44de63c93a83f065c957533
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5baeaf849707ba264c8b4508555ca933a99baf95281f9ea1f701a7f2f4ec8b30309656bb728373b4376170289bf49837c0d2770571aad8fbf11bc1ffa87054a6
|
7
|
+
data.tar.gz: 9b11014958d24a18675f6c3a29e7b5f8e721fe0eb89959d8575cee2aee4d1978dfe1eb3024136ce0dc3470c63e8016eefafa968463c8d8be1e9db9616f6eb4d0
|
data/Gemfile.lock
CHANGED
@@ -14,8 +14,8 @@ module AppStatusNotification
|
|
14
14
|
AppStatusNotification::Command.run(params)
|
15
15
|
end
|
16
16
|
|
17
|
-
def self.watch(
|
18
|
-
AppStatusNotification::Watchman.run(
|
17
|
+
def self.watch(config_path = nil, store_path = nil)
|
18
|
+
AppStatusNotification::Watchman.run(config_path, store_path)
|
19
19
|
end
|
20
20
|
|
21
21
|
def self.development(enabled = false)
|
@@ -25,15 +25,15 @@ class AppStatusNotification::Command
|
|
25
25
|
arg_name 'config'
|
26
26
|
flag [:c, :config]
|
27
27
|
|
28
|
-
desc 'Set
|
29
|
-
arg_name '
|
30
|
-
flag [:
|
28
|
+
desc 'Set store path'
|
29
|
+
arg_name 'store'
|
30
|
+
flag [:s, :store]
|
31
31
|
|
32
32
|
desc 'Start watch service'
|
33
33
|
arg_name 'Describe arguments to ddd here'
|
34
34
|
command :watch do |c|
|
35
35
|
c.action do |global, options, args|
|
36
|
-
AppStatusNotification.watch(global[:config])
|
36
|
+
AppStatusNotification.watch(global[:config], global[:store])
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
@@ -54,10 +54,10 @@ class AppStatusNotification::Command
|
|
54
54
|
end
|
55
55
|
|
56
56
|
on_error do |exception|
|
57
|
-
puts exception.backtrace unless exception.is_a?(Interrupt)
|
57
|
+
# puts exception.backtrace unless exception.is_a?(Interrupt)
|
58
58
|
# Error logic here
|
59
59
|
# return false to skip default error handling
|
60
|
-
|
60
|
+
false
|
61
61
|
end
|
62
62
|
|
63
63
|
default_command :watch
|
@@ -14,6 +14,7 @@ module AppStatusNotification
|
|
14
14
|
notifications: {},
|
15
15
|
refresh_interval: 60,
|
16
16
|
locale: 'zh',
|
17
|
+
store_path: 'stores',
|
17
18
|
dry: false,
|
18
19
|
enable_crash_report: true,
|
19
20
|
crash_report: 'https://aa7c78acbb324fcf93169fce2b7e5758@o333914.ingest.sentry.io/5575774'
|
@@ -47,12 +48,8 @@ module AppStatusNotification
|
|
47
48
|
@account ||= Account.parse(super)
|
48
49
|
end
|
49
50
|
|
50
|
-
def store_path
|
51
|
-
File.join(File.expand_path('../../', __dir__), 'stores')
|
52
|
-
end
|
53
|
-
|
54
51
|
def config_path
|
55
|
-
|
52
|
+
Anyway::Settings.default_config_path
|
56
53
|
end
|
57
54
|
|
58
55
|
on_load :configure_locale
|
@@ -62,9 +59,13 @@ module AppStatusNotification
|
|
62
59
|
|
63
60
|
private
|
64
61
|
|
62
|
+
def builtin_config_path
|
63
|
+
@builtin_config_path ||= File.join(File.expand_path('../../', __dir__), 'config')
|
64
|
+
end
|
65
|
+
|
65
66
|
def configure_locale
|
66
67
|
# built-in
|
67
|
-
I18n.load_path << Dir[File.join(
|
68
|
+
I18n.load_path << Dir[File.join(builtin_config_path, 'locales', '*.yml')]
|
68
69
|
|
69
70
|
# default locale
|
70
71
|
I18n.locale = locale.to_sym
|
@@ -1,15 +1,22 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'app_status_notification/runner'
|
4
|
+
require 'fileutils'
|
4
5
|
|
5
6
|
module AppStatusNotification
|
6
7
|
class Watchman
|
7
8
|
include AppStatusNotification::I18nHelper
|
8
9
|
|
9
|
-
def self.run(config_path = nil)
|
10
|
-
Anyway::Settings.default_config_path = config_path if Dir.exist?(config_path)
|
10
|
+
def self.run(config_path = nil, store_path = '.')
|
11
|
+
Anyway::Settings.default_config_path = config_path if config_path && Dir.exist?(config_path)
|
11
12
|
|
12
13
|
config = Config.new
|
14
|
+
|
15
|
+
if store_path
|
16
|
+
FileUtils.mkdir_p(store_path)
|
17
|
+
config.store_path = store_path
|
18
|
+
end
|
19
|
+
|
13
20
|
yield config if block_given?
|
14
21
|
|
15
22
|
Watchman.new(config).run
|