mani 0.0.5 → 0.0.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 18b30d90ed9506e03c45de3565f38efb464d84b6
4
- data.tar.gz: d95269f153727d50b89899d779fb2faf0bf94b5b
2
+ SHA256:
3
+ metadata.gz: 248edfb40ba571b80bebfae697eaef292df540d27c687bad2ed6849291359bcc
4
+ data.tar.gz: 7c0b0a77e213473a24f65115c099a45d3902a15106a804ab9a1de9c242bfd6c2
5
5
  SHA512:
6
- metadata.gz: f864a24c2ae3ec799183d0fce429b1bd45fca05249bd5f4c5dd50cb014287a93517099c66a241354c671658f9c3ab17c5eaf00d40f5f46060b8ec8d75fe6b5f3
7
- data.tar.gz: 02b61a2a15c232a76338b225f82acc7d96d188dac32e4bb2b645f0be525de7a0ec0698445c10834af6264aca6940b8c99ed5d3b5428ae5253c086fe801f2241b
6
+ metadata.gz: 305a2cce7a56e7a23c4c911e55558ac008eb4667ee872deb96eef1313511f9067605635c372740efed02dd9719a959ebd14f67d1183ac5322689adfbc2729d7c
7
+ data.tar.gz: b6845503ea060fa5e151dcb9f9e48a06d033c9a3fc81b2ca37fbae053c5ef9032d4edd377aff3438e2b4eab7b15a6c67a64f70486a09745bfa420829556a012e
data/.rubocop.yml CHANGED
@@ -1,3 +1,9 @@
1
+ AllCops:
2
+ NewCops: enable
3
+
4
+ Metrics/AbcSize:
5
+ Max: 23
6
+
1
7
  Metrics/CyclomaticComplexity:
2
8
  Max: 8
3
9
 
@@ -6,3 +12,12 @@ Metrics/PerceivedComplexity:
6
12
 
7
13
  Metrics/MethodLength:
8
14
  Max: 18
15
+
16
+ Style/FrozenStringLiteralComment:
17
+ Enabled: false
18
+
19
+ Style/MutableConstant:
20
+ Enabled: false
21
+
22
+ Style/SignalException:
23
+ Enabled: false
data/LICENSE CHANGED
@@ -1,26 +1,19 @@
1
- Copyright (c) 2014, Nick Sinopoli <nsinopoli@gmail.com> All rights reserved.
1
+ Copyright 2014-2021 xcip <xcip@protonmail.com>
2
2
 
3
- Redistribution and use in source and binary forms, with or without
4
- modification, are permitted provided that the following conditions are met:
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ this software and associated documentation files (the "Software"), to deal in
5
+ the Software without restriction, including without limitation the rights to
6
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7
+ of the Software, and to permit persons to whom the Software is furnished to do
8
+ so, subject to the following conditions:
5
9
 
6
- * Redistributions of source code must retain the above copyright notice, this
7
- list of conditions and the following disclaimer.
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
8
12
 
9
- * Redistributions in binary form must reproduce the above copyright notice,
10
- this list of conditions and the following disclaimer in the documentation
11
- and/or other materials provided with the distribution.
12
-
13
- * Neither the name of Nick Sinopoli nor the names of his contributors may be
14
- used to endorse or promote products derived from this software without
15
- specific prior written permission.
16
-
17
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
data/README.md CHANGED
@@ -6,7 +6,7 @@ visiting websites, and typing text) can be scripted using a simple Ruby DSL.
6
6
  While [xmonad](http://xmonad.org/) is currently the only supported window
7
7
  manager, Mani can support any window manager for the X Window System with just
8
8
  a few lines of code. Please open an
9
- [issue](https://github.com/NSinopoli/mani/issues) to add support for your
9
+ [issue](https://gitlab.com/xcip/mani/-/issues) to add support for your
10
10
  favorite window manager.
11
11
 
12
12
  ## Demo
@@ -272,7 +272,7 @@ Please follow the guidelines below.
272
272
 
273
273
  ### Issue Reporting
274
274
 
275
- * Use the [issue tracker](https://github.com/NSinopoli/mani/issues) to report
275
+ * Use the [issue tracker](https://gitlab.com/xcip/mani/-/issues) to report
276
276
  any issues or ideas for improvements.
277
277
  * Check that the issue has not already been reported.
278
278
  * Check that the issue has not already been fixed in the latest code (i.e., on
@@ -284,7 +284,6 @@ Please follow the guidelines below.
284
284
 
285
285
  ### Pull Requests
286
286
 
287
- * Read [how to properly contribute to open source projects on Github](http://gun.io/blog/how-to-github-fork-branch-and-pull-request).
288
287
  * Fork the project.
289
288
  * Use a topic/feature branch to easily amend a pull request later, if
290
289
  necessary.
@@ -305,8 +304,8 @@ Please follow the guidelines below.
305
304
  ### Code Conventions
306
305
 
307
306
  **Mani** follows the conventions laid out in the
308
- [Ruby Style Guide](https://github.com/bbatsov/ruby-style-guide). These
309
- conventions are enforced by [RuboCop](https://github.com/bbatsov/rubocop).
307
+ [Ruby Style Guide](https://github.com/rubocop/ruby-style-guide). These
308
+ conventions are enforced by [RuboCop](https://github.com/rubocop/rubocop).
310
309
 
311
310
  ```
312
311
  make install
data/examples/chording.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  Mani.new(window_manager: :xmonad) do
2
- window :urxvt, launch: 'urxvt' do
2
+ window :termite, launch: 'termite' do
3
3
  # Copy the most recent report id
4
4
  run %q(
5
5
  ssh 127.0.0.1 -p 49154
@@ -10,7 +10,7 @@ Mani.new(window_manager: :xmonad) do
10
10
  run 'exit'
11
11
  end
12
12
 
13
- window :chrome, launch: 'google-chrome-stable', delay: 1 do
13
+ window :firefox, launch: 'firefox-developer-edition', delay: 1 do
14
14
  # Paste the report id within the url
15
15
  visit 'localhost:8080/reports/{{ctrl+v}}/preview'
16
16
  end
data/examples/hello.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  Mani.new(window_manager: :xmonad) do
2
- window :hello, launch: 'urxvt' do
2
+ window :hello, launch: 'termite' do
3
3
  run 'echo "Hello, world."'
4
4
  end
5
5
  end
@@ -1,38 +1,47 @@
1
1
  Mani.new(window_manager: :xmonad) do
2
2
  workspace 1 do
3
- window :glances, launch: 'urxvt' do
4
- run 'par', delay: 1
5
- run 'glances'
3
+ window :atop, launch: 'termite' do
4
+ run 'atop'
6
5
  end
6
+
7
+ window :pavucontrol, launch: 'pavucontrol'
7
8
  end
8
9
 
9
10
  workspace 2 do
10
- window :pidgin, launch: 'pidgin', delay: 2
11
-
12
- window :mutt, launch: 'urxvt' do
13
- run 'mutt'
11
+ window :firefox_email, launch: 'firefox-developer-edition -P email', delay: 1.5 do
12
+ visit 'mail.zoho.com'
14
13
  end
15
14
  end
16
15
 
17
16
  workspace 3 do
18
- # Use "-f" to prevent vim from forking and detaching from the original
19
- # process.
20
- window :gvim, launch: 'gvim -f', delay: 1
17
+ window :vim, launch: 'termite' do
18
+ run 'nvim'
19
+ end
21
20
  end
22
21
 
23
22
  workspace 4 do
24
- window :thunderbird, launch: 'thunderbird'
23
+ window :firefox_work, launch: 'firefox-developer-edition -P work', delay: 1.5 do
24
+ visit 'outlook.office.com'
25
+
26
+ browser_tab :new do
27
+ visit 'teams.microsoft.com'
28
+ end
25
29
 
26
- window :hipchat, launch: 'hipchat', delay: 3
30
+ # Switch back to the first tab
31
+ browser_tab 1
32
+ end
27
33
  end
28
34
 
29
35
  workspace 8 do
30
- window :chromium, launch: 'chromium', delay: 1.5 do
31
- visit 'reddit.com'
36
+ window :firefox, launch: 'firefox-developer-edition', delay: 1.5 do
37
+ visit 'localhost:8080'
32
38
 
33
39
  browser_tab :new do
34
- visit 'news.ycombinator.com'
40
+ visit 'https://discord.com/channels/@me'
35
41
  end
42
+
43
+ # Switch back to the first tab
44
+ browser_tab 1
36
45
  end
37
46
  end
38
47
  end
@@ -68,10 +68,7 @@ class Mani
68
68
  return tokens
69
69
  end
70
70
 
71
- if !scanner.check_until SEQUENCE_CLOSE
72
- static = strip_comment_delimiters(match + scanner.rest)
73
- tokens.concat [[:static, static]]
74
- else
71
+ if scanner.check_until SEQUENCE_CLOSE
75
72
  static = strip_comment_delimiters match.chomp(SEQUENCE_OPEN_DELIMITER)
76
73
  tokens.concat [[:static, static]] unless static.empty?
77
74
 
@@ -82,6 +79,9 @@ class Mani
82
79
  tokens.concat [[:sequence, sequence]] unless sequence.empty?
83
80
 
84
81
  tokenize scanner, tokens
82
+ else
83
+ static = strip_comment_delimiters(match + scanner.rest)
84
+ tokens.concat [[:static, static]]
85
85
  end
86
86
  end
87
87
  end
data/lib/mani/version.rb CHANGED
@@ -2,6 +2,6 @@ class Mani
2
2
  # This class holds the Mani version information.
3
3
  class Version
4
4
  # The current version
5
- VERSION = '0.0.5'
5
+ VERSION = '0.0.7'
6
6
  end
7
7
  end
data/mani.gemspec CHANGED
@@ -3,12 +3,12 @@ require 'mani/version'
3
3
 
4
4
  Gem::Specification.new do |gem|
5
5
  gem.name = 'mani'
6
- gem.homepage = 'https://github.com/NSinopoli/mani'
7
- gem.license = 'BSD (3-Clause)'
6
+ gem.homepage = 'https://gitlab.com/xcip/mani'
7
+ gem.license = 'MIT'
8
8
  gem.summary = 'A window automation tool'
9
9
  gem.description = 'A window automation tool'
10
- gem.email = 'NSinopoli@gmail.com'
11
- gem.authors = ['Nick Sinopoli']
10
+ gem.email = 'xcip@protonmail.com'
11
+ gem.authors = ['xcip']
12
12
 
13
13
  gem.version = Mani::Version::VERSION
14
14
 
@@ -8,7 +8,7 @@ describe Mani::Tokenizer do
8
8
  source = 'static'
9
9
  actual = Mani::Tokenizer.get_tokens source
10
10
  expected = [[:static, 'static']]
11
- actual.must_equal expected
11
+ _(actual).must_equal expected
12
12
  end
13
13
  end
14
14
 
@@ -19,7 +19,7 @@ describe Mani::Tokenizer do
19
19
  expected = [
20
20
  [:static, 'static {{ static'],
21
21
  ]
22
- actual.must_equal expected
22
+ _(actual).must_equal expected
23
23
  end
24
24
  end
25
25
 
@@ -30,7 +30,7 @@ describe Mani::Tokenizer do
30
30
  expected = [
31
31
  [:static, 'static }} static']
32
32
  ]
33
- actual.must_equal expected
33
+ _(actual).must_equal expected
34
34
  end
35
35
  end
36
36
 
@@ -41,7 +41,7 @@ describe Mani::Tokenizer do
41
41
  expected = [
42
42
  [:static, 'static {{ static']
43
43
  ]
44
- actual.must_equal expected
44
+ _(actual).must_equal expected
45
45
  end
46
46
  end
47
47
 
@@ -52,7 +52,7 @@ describe Mani::Tokenizer do
52
52
  expected = [
53
53
  [:static, 'static }} static']
54
54
  ]
55
- actual.must_equal expected
55
+ _(actual).must_equal expected
56
56
  end
57
57
  end
58
58
 
@@ -63,7 +63,7 @@ describe Mani::Tokenizer do
63
63
  expected = [
64
64
  [:static, 'static {{seq}} static'],
65
65
  ]
66
- actual.must_equal expected
66
+ _(actual).must_equal expected
67
67
  end
68
68
  end
69
69
 
@@ -74,7 +74,7 @@ describe Mani::Tokenizer do
74
74
  expected = [
75
75
  [:static, 'static {{seq}} static'],
76
76
  ]
77
- actual.must_equal expected
77
+ _(actual).must_equal expected
78
78
  end
79
79
  end
80
80
 
@@ -85,7 +85,7 @@ describe Mani::Tokenizer do
85
85
  expected = [
86
86
  [:static, 'static {{seq}} static'],
87
87
  ]
88
- actual.must_equal expected
88
+ _(actual).must_equal expected
89
89
  end
90
90
  end
91
91
 
@@ -94,7 +94,7 @@ describe Mani::Tokenizer do
94
94
  source = '{{}}'
95
95
  actual = Mani::Tokenizer.get_tokens source
96
96
  expected = []
97
- actual.must_equal expected
97
+ _(actual).must_equal expected
98
98
  end
99
99
  end
100
100
 
@@ -107,7 +107,7 @@ describe Mani::Tokenizer do
107
107
  [:sequence, 'seq'],
108
108
  [:static, ' static']
109
109
  ]
110
- actual.must_equal expected
110
+ _(actual).must_equal expected
111
111
  end
112
112
  end
113
113
 
@@ -120,7 +120,7 @@ describe Mani::Tokenizer do
120
120
  [:sequence, 'seq {{ '],
121
121
  [:static, ' static']
122
122
  ]
123
- actual.must_equal expected
123
+ _(actual).must_equal expected
124
124
  end
125
125
  end
126
126
 
@@ -133,7 +133,7 @@ describe Mani::Tokenizer do
133
133
  [:sequence, 'seq }} '],
134
134
  [:static, ' static']
135
135
  ]
136
- actual.must_equal expected
136
+ _(actual).must_equal expected
137
137
  end
138
138
  end
139
139
 
@@ -146,7 +146,7 @@ describe Mani::Tokenizer do
146
146
  [:sequence, 'seq {{ nested }} '],
147
147
  [:static, ' static']
148
148
  ]
149
- actual.must_equal expected
149
+ _(actual).must_equal expected
150
150
  end
151
151
  end
152
152
 
@@ -159,7 +159,7 @@ describe Mani::Tokenizer do
159
159
  [:sequence, 'seq'],
160
160
  [:static, ' }} static']
161
161
  ]
162
- actual.must_equal expected
162
+ _(actual).must_equal expected
163
163
  end
164
164
  end
165
165
 
@@ -172,7 +172,7 @@ describe Mani::Tokenizer do
172
172
  [:sequence, 'nested {{seq'],
173
173
  [:static, ' }} static']
174
174
  ]
175
- actual.must_equal expected
175
+ _(actual).must_equal expected
176
176
  end
177
177
  end
178
178
 
@@ -186,7 +186,7 @@ describe Mani::Tokenizer do
186
186
  [:sequence, 'second seq'],
187
187
  [:static, ' more static']
188
188
  ]
189
- actual.must_equal expected
189
+ _(actual).must_equal expected
190
190
  end
191
191
  end
192
192
 
@@ -197,7 +197,7 @@ describe Mani::Tokenizer do
197
197
  expected = [
198
198
  [:static, ' static '],
199
199
  ]
200
- actual.must_equal expected
200
+ _(actual).must_equal expected
201
201
  end
202
202
  end
203
203
 
@@ -208,7 +208,7 @@ describe Mani::Tokenizer do
208
208
  expected = [
209
209
  [:static, '}} static {{'],
210
210
  ]
211
- actual.must_equal expected
211
+ _(actual).must_equal expected
212
212
  end
213
213
  end
214
214
 
@@ -219,7 +219,7 @@ describe Mani::Tokenizer do
219
219
  expected = [
220
220
  [:static, '}} static {{'],
221
221
  ]
222
- actual.must_equal expected
222
+ _(actual).must_equal expected
223
223
  end
224
224
  end
225
225
 
@@ -230,7 +230,7 @@ describe Mani::Tokenizer do
230
230
  expected = [
231
231
  [:static, '%{{ static %}} more static'],
232
232
  ]
233
- actual.must_equal expected
233
+ _(actual).must_equal expected
234
234
  end
235
235
  end
236
236
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mani
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
- - Nick Sinopoli
8
- autorequire:
7
+ - xcip
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-27 00:00:00.000000000 Z
11
+ date: 2021-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: x_do_bindings
@@ -25,7 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.2.1
27
27
  description: A window automation tool
28
- email: NSinopoli@gmail.com
28
+ email: xcip@protonmail.com
29
29
  executables:
30
30
  - mani
31
31
  extensions: []
@@ -51,11 +51,11 @@ files:
51
51
  - mani.gemspec
52
52
  - spec.rb
53
53
  - spec/lib/tokenizer_spec.rb
54
- homepage: https://github.com/NSinopoli/mani
54
+ homepage: https://gitlab.com/xcip/mani
55
55
  licenses:
56
- - BSD (3-Clause)
56
+ - MIT
57
57
  metadata: {}
58
- post_install_message:
58
+ post_install_message:
59
59
  rdoc_options: []
60
60
  require_paths:
61
61
  - lib
@@ -70,9 +70,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
70
70
  - !ruby/object:Gem::Version
71
71
  version: '0'
72
72
  requirements: []
73
- rubyforge_project:
74
- rubygems_version: 2.4.5
75
- signing_key:
73
+ rubygems_version: 3.1.2
74
+ signing_key:
76
75
  specification_version: 4
77
76
  summary: A window automation tool
78
77
  test_files: