rmonitor 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/rmonitor +37 -12
- data/lib/rmonitor/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5aec3b1453e7018791ba701830a361116b6d6679
|
4
|
+
data.tar.gz: c86e338487cdf85e2edec36bfe5eb4cf2f9326fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 727f5f3286fbb50885f5b56daca2173b5611a5198cedf1eae3fd25af326eba1c8d11d82d6b9dd3751a34b3b76b4156f9d74e8509d569c133484cf9d83c72bdfa
|
7
|
+
data.tar.gz: f9c8b6a223ad6906c24c1ca0b0273f4bf4639e1a024f46112c0c95a204e0716c5dce1acb0426ef572cb4a3cec5b732d69ad43887e02d489d1ed928ef43dbdd87
|
data/bin/rmonitor
CHANGED
@@ -14,17 +14,46 @@ DESC
|
|
14
14
|
RMonitor::Config.config_path = path
|
15
15
|
end
|
16
16
|
|
17
|
+
def create_common_options(c)
|
18
|
+
c.option "--strategy NAME", String, <<-DESC.strip.gsub(/^ +/, "")
|
19
|
+
invoke using an execution strategy
|
20
|
+
|
21
|
+
the possible options are
|
22
|
+
|
23
|
+
· optimistic - attempt to invoke a profile using a single xrandr command
|
24
|
+
|
25
|
+
· pessimistic - invoke a profile using multiple xrandr commands (slower, safer and default)
|
26
|
+
DESC
|
27
|
+
|
28
|
+
c.option "--dry-run", "don't run any destructive commands"
|
29
|
+
c.option "--verbose", "print every command ran"
|
30
|
+
end
|
31
|
+
|
32
|
+
def create_option_hash(options)
|
33
|
+
hash = {
|
34
|
+
:dry_run => options.dry_run,
|
35
|
+
:verbose => options.verbose
|
36
|
+
}
|
37
|
+
|
38
|
+
hash[:strategy] = case options.strategy
|
39
|
+
when "optimistic"
|
40
|
+
RMonitor::Strategies::Optimistic.new(hash)
|
41
|
+
when "pessimistic", nil
|
42
|
+
RMonitor::Strategies::Pessimistic.new(hash)
|
43
|
+
else
|
44
|
+
raise ArgumentError, "unknown execution strategy"
|
45
|
+
end
|
46
|
+
|
47
|
+
hash
|
48
|
+
end
|
49
|
+
|
17
50
|
command :invoke do |c|
|
18
51
|
c.syntax = "invoke [options]"
|
19
52
|
c.description = "invoke a profile by name"
|
20
53
|
c.option "-n", "--name NAME", String
|
21
|
-
c
|
22
|
-
c.option "--verbose", "print every command ran"
|
54
|
+
create_common_options(c)
|
23
55
|
c.action do |_, options|
|
24
|
-
RMonitor::Commands::CL::Invoke.new(
|
25
|
-
:verbose => options.verbose,
|
26
|
-
:dry_run => options.dry_run
|
27
|
-
).execute(options.name)
|
56
|
+
RMonitor::Commands::CL::Invoke.new(create_option_hash(options)).execute(options.name)
|
28
57
|
end
|
29
58
|
end
|
30
59
|
|
@@ -39,12 +68,8 @@ end
|
|
39
68
|
command :update do |c|
|
40
69
|
c.syntax = "update"
|
41
70
|
c.description = "invokes the most preferred profile"
|
42
|
-
c
|
43
|
-
c.option "--verbose", "print every command ran"
|
71
|
+
create_common_options(c)
|
44
72
|
c.action do |_, options|
|
45
|
-
RMonitor::Commands::CL::Update.new(
|
46
|
-
:verbose => options.verbose,
|
47
|
-
:dry_run => options.dry_run
|
48
|
-
).execute
|
73
|
+
RMonitor::Commands::CL::Update.new(create_option_hash(options)).execute
|
49
74
|
end
|
50
75
|
end
|
data/lib/rmonitor/version.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rmonitor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonas Amundsen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.3.
|
19
|
+
version: 4.3.5
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 4.3.
|
26
|
+
version: 4.3.5
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: codeclimate-test-reporter
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|