twiddler-utils 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/twid-utils +52 -0
- data/doc/README +2 -0
- data/doc/Specifications +15 -0
- data/doc/coverage/index.html +170 -0
- data/doc/coverage/jquery-1.3.2.min.js +19 -0
- data/doc/coverage/jquery.tablesorter.min.js +15 -0
- data/doc/coverage/lib-twiddler-config_rb.html +2547 -0
- data/doc/coverage/lib-twiddler-lint_rb.html +417 -0
- data/doc/coverage/lib-twiddler-parser_rb.html +645 -0
- data/doc/coverage/lib-twiddler-rendering_rb.html +201 -0
- data/doc/coverage/lib-twiddler-target_builder_rb.html +783 -0
- data/doc/coverage/print.css +12 -0
- data/doc/coverage/rcov.js +42 -0
- data/doc/coverage/screen.css +270 -0
- data/lib/twiddler/config.rb +414 -0
- data/lib/twiddler/lint.rb +59 -0
- data/lib/twiddler/parser.rb +97 -0
- data/lib/twiddler/rendering.rb +23 -0
- data/lib/twiddler/target_builder.rb +120 -0
- data/spec_help/file-sandbox.rb +164 -0
- data/spec_help/fixtures/TWIDDLER.CFG +0 -0
- data/spec_help/gem_test_suite.rb +17 -0
- data/spec_help/spec_helper.rb +4 -0
- data/spec_help/ungemmer.rb +36 -0
- data/templates/cheatsheet.erb +38 -0
- data/templates/lua.erb +51 -0
- metadata +201 -0
Binary file
|
@@ -0,0 +1,17 @@
|
|
1
|
+
puts Dir::pwd
|
2
|
+
require 'test/unit'
|
3
|
+
begin
|
4
|
+
require 'spec'
|
5
|
+
rescue LoadError
|
6
|
+
false
|
7
|
+
end
|
8
|
+
|
9
|
+
class RSpecTest < Test::Unit::TestCase
|
10
|
+
def test_that_rspec_is_available
|
11
|
+
assert_nothing_raised("\n\n * RSpec isn't available - please run: gem install rspec *\n\n"){ ::Spec }
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_that_specs_pass
|
15
|
+
assert(system(*%w{spec -f e -p **/*.rb spec}),"\n\n * Specs failed *\n\n")
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
class Ungemmer
|
2
|
+
def self.ungem(*names)
|
3
|
+
deps = names.map do |name|
|
4
|
+
Gem::Dependency.new(name, nil)
|
5
|
+
end
|
6
|
+
|
7
|
+
deps.each do |dep|
|
8
|
+
Gem.source_index.search(dep).each do |gemspec|
|
9
|
+
puts " ** Ungemming #{gemspec.full_name} **"
|
10
|
+
Gem.source_index.remove_spec(gemspec.full_name)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
Gem.instance_eval do
|
15
|
+
if defined? Gem::MUTEX
|
16
|
+
Gem::MUTEX.synchronize do
|
17
|
+
@searcher = nil
|
18
|
+
end
|
19
|
+
else
|
20
|
+
@searcher = nil
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.ungem_gemspec
|
26
|
+
Dir[File::expand_path(__FILE__ + "../../../*.gemspec")].each do |gemspec_path|
|
27
|
+
puts "Ungemming based on #{gemspec_path}"
|
28
|
+
begin
|
29
|
+
spec = Gem::Specification::load(gemspec_path)
|
30
|
+
Ungemmer::ungem(spec.name)
|
31
|
+
rescue LoadError
|
32
|
+
puts "Couldn't load #{gemspec_path}"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
% cols = 4
|
2
|
+
% chords = []
|
3
|
+
% chords += keytable.tagged(:normal).map{|key| keyboard.find{|chord|
|
4
|
+
% key === chord and chord[0][1].empty?}
|
5
|
+
%}
|
6
|
+
% chords += keytable.find_all{|key| key.has_mod?("Shift")}.map{|key| keyboard.find{|chord|
|
7
|
+
% key === chord and (chord[0][1] == ["RSft"] or chord[0][1] == ["LSft"])}
|
8
|
+
%}
|
9
|
+
% chords += keytable.tagged(:special).map{|key| keyboard.find{|chord|
|
10
|
+
% key === chord and chord[0][1].empty?}
|
11
|
+
%}
|
12
|
+
% chords += keyboard.find_all{|chord| !chord.single?}
|
13
|
+
% chords.compact!
|
14
|
+
%
|
15
|
+
% columns = []
|
16
|
+
% chords.map! do |chord|
|
17
|
+
% rendered= [ chord.render_action, chord.render_keys]
|
18
|
+
% if rendered[0] =~ /^[a-z]$/
|
19
|
+
% rendered[0].upcase!
|
20
|
+
% end
|
21
|
+
% rendered
|
22
|
+
%end
|
23
|
+
|
24
|
+
% chords.each_slice((chords.length / cols.to_f).ceil){|col| columns << col}
|
25
|
+
% act_widths = columns.map{|col| col.map{|line| line[0].length}.max}
|
26
|
+
% key_widths = columns.map{|col| col.map{|line| line[1].length}.max}
|
27
|
+
% columns[0].zip(*columns[1..-1]).each_with_index do |row, index|
|
28
|
+
% row.zip(act_widths, key_widths).each do |chord, aw, kw|
|
29
|
+
% unless chord.nil?
|
30
|
+
<%= chord[0].rjust(aw) %>: <%= chord[1].ljust(kw + 2)%>
|
31
|
+
% end
|
32
|
+
% end
|
33
|
+
|
34
|
+
% end
|
35
|
+
|
36
|
+
%mouse.each do |chord|
|
37
|
+
<%= chord.render %>
|
38
|
+
%end
|
data/templates/lua.erb
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
chord_data = {
|
2
|
+
keyboard = {
|
3
|
+
% keyboard.each do |chord|
|
4
|
+
{
|
5
|
+
chord = {
|
6
|
+
mods = { num = <%= chord.mods[:num] %>, alt = <%= chord.mods[:alt] %>, shift = <%= chord.mods[:shift] %>, ctrl = <%= chord.mods[:ctrl] %> };
|
7
|
+
rows = { <% chord.rows.each do |row| %>
|
8
|
+
<%if row == :open %>"O"; <%end%>
|
9
|
+
<%if row == :left %>"L"; <%end%>
|
10
|
+
<%if row == :right %>"R"; <%end%>
|
11
|
+
<%if row == :middle %>"M"; <%end%>
|
12
|
+
% end
|
13
|
+
}
|
14
|
+
},
|
15
|
+
data = <%= chord.render_action.inspect %>
|
16
|
+
};
|
17
|
+
% end
|
18
|
+
};
|
19
|
+
mouse = {
|
20
|
+
% mouse.each do |chord|
|
21
|
+
{
|
22
|
+
chord = {
|
23
|
+
mods = { num = <%= chord.mods[:num] %>, alt = <%= chord.mods[:alt] %>, shift = <%= chord.mods[:shift] %>, ctrl = <%= chord.mods[:ctrl] %> };
|
24
|
+
rows = { <% chord.rows.each do |row| %>
|
25
|
+
<%if row == :open %>"O"; <%end%>
|
26
|
+
<%if row == :left %>"L"; <%end%>
|
27
|
+
<%if row == :right %>"R"; <%end%>
|
28
|
+
<%if row == :middle %>"M"; <%end%>
|
29
|
+
% end
|
30
|
+
}
|
31
|
+
},
|
32
|
+
action = {
|
33
|
+
buttons = { <% if chord.buttons[:left] %>Left; <% end %>
|
34
|
+
<%if chord.buttons[:middle]%>Middle; <%end%>
|
35
|
+
<%if chord.buttons[:right]%>Right; <%end%>
|
36
|
+
}; modifiers = { <%if chord.mods[:ctrl]%>Ctrl; <% end %>
|
37
|
+
<%if chord.mods[:alt]%>Alt; <% end %>
|
38
|
+
<%if chord.mods[:shift]%>Shift; <% end %>
|
39
|
+
<%if chord.mods[:toggle]%>Tgl; <% end %>
|
40
|
+
<%if chord.mods[:double]%>Dbl; <% end %>
|
41
|
+
}
|
42
|
+
}
|
43
|
+
};
|
44
|
+
% end
|
45
|
+
};
|
46
|
+
config = {
|
47
|
+
raw = <%= configs[:raw].inspect %>
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
return chord_data
|
metadata
ADDED
@@ -0,0 +1,201 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: twiddler-utils
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 25
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Judson Lester
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-05-03 00:00:00 -07:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: rake-rubygems
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 23
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
- 2
|
33
|
+
- 0
|
34
|
+
version: 0.2.0
|
35
|
+
type: :development
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: hanna
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 27
|
46
|
+
segments:
|
47
|
+
- 0
|
48
|
+
- 1
|
49
|
+
- 0
|
50
|
+
version: 0.1.0
|
51
|
+
type: :development
|
52
|
+
version_requirements: *id002
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: mailfactory
|
55
|
+
prerelease: false
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
hash: 7
|
62
|
+
segments:
|
63
|
+
- 1
|
64
|
+
- 4
|
65
|
+
- 0
|
66
|
+
version: 1.4.0
|
67
|
+
type: :development
|
68
|
+
version_requirements: *id003
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
prerelease: false
|
72
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
hash: 3
|
78
|
+
segments:
|
79
|
+
- 2
|
80
|
+
- 0
|
81
|
+
version: "2.0"
|
82
|
+
type: :development
|
83
|
+
version_requirements: *id004
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: bundler
|
86
|
+
prerelease: false
|
87
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
88
|
+
none: false
|
89
|
+
requirements:
|
90
|
+
- - ~>
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
hash: 23
|
93
|
+
segments:
|
94
|
+
- 1
|
95
|
+
- 0
|
96
|
+
- 0
|
97
|
+
version: 1.0.0
|
98
|
+
type: :development
|
99
|
+
version_requirements: *id005
|
100
|
+
- !ruby/object:Gem::Dependency
|
101
|
+
name: rcov
|
102
|
+
prerelease: false
|
103
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
104
|
+
none: false
|
105
|
+
requirements:
|
106
|
+
- - ">="
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
hash: 3
|
109
|
+
segments:
|
110
|
+
- 0
|
111
|
+
version: "0"
|
112
|
+
type: :development
|
113
|
+
version_requirements: *id006
|
114
|
+
description: " Some tools for working with config files for the Twiddler2 chording keyboard.\n\n If you don't have a Twiddler, you probably don't care.\n\n twid-utils cheatsheet <config>\n"
|
115
|
+
email:
|
116
|
+
- nyarly@gmail.com
|
117
|
+
executables:
|
118
|
+
- twid-utils
|
119
|
+
extensions: []
|
120
|
+
|
121
|
+
extra_rdoc_files:
|
122
|
+
- doc/README
|
123
|
+
- doc/Specifications
|
124
|
+
- doc/coverage/rcov.js
|
125
|
+
- doc/coverage/lib-twiddler-rendering_rb.html
|
126
|
+
- doc/coverage/jquery-1.3.2.min.js
|
127
|
+
- doc/coverage/index.html
|
128
|
+
- doc/coverage/lib-twiddler-parser_rb.html
|
129
|
+
- doc/coverage/jquery.tablesorter.min.js
|
130
|
+
- doc/coverage/lib-twiddler-target_builder_rb.html
|
131
|
+
- doc/coverage/lib-twiddler-config_rb.html
|
132
|
+
- doc/coverage/lib-twiddler-lint_rb.html
|
133
|
+
- doc/coverage/screen.css
|
134
|
+
- doc/coverage/print.css
|
135
|
+
files:
|
136
|
+
- templates/lua.erb
|
137
|
+
- templates/cheatsheet.erb
|
138
|
+
- lib/twiddler/rendering.rb
|
139
|
+
- lib/twiddler/config.rb
|
140
|
+
- lib/twiddler/parser.rb
|
141
|
+
- lib/twiddler/lint.rb
|
142
|
+
- lib/twiddler/target_builder.rb
|
143
|
+
- bin/twid-utils
|
144
|
+
- doc/README
|
145
|
+
- spec_help/spec_helper.rb
|
146
|
+
- spec_help/gem_test_suite.rb
|
147
|
+
- spec_help/ungemmer.rb
|
148
|
+
- spec_help/file-sandbox.rb
|
149
|
+
- spec_help/fixtures/TWIDDLER.CFG
|
150
|
+
- doc/Specifications
|
151
|
+
- doc/coverage/rcov.js
|
152
|
+
- doc/coverage/lib-twiddler-rendering_rb.html
|
153
|
+
- doc/coverage/jquery-1.3.2.min.js
|
154
|
+
- doc/coverage/index.html
|
155
|
+
- doc/coverage/lib-twiddler-parser_rb.html
|
156
|
+
- doc/coverage/jquery.tablesorter.min.js
|
157
|
+
- doc/coverage/lib-twiddler-target_builder_rb.html
|
158
|
+
- doc/coverage/lib-twiddler-config_rb.html
|
159
|
+
- doc/coverage/lib-twiddler-lint_rb.html
|
160
|
+
- doc/coverage/screen.css
|
161
|
+
- doc/coverage/print.css
|
162
|
+
has_rdoc: true
|
163
|
+
homepage: http://twiddler-utils.rubyforge.org/
|
164
|
+
licenses:
|
165
|
+
- MIT
|
166
|
+
post_install_message: Actual specs are coming soon for this guy.
|
167
|
+
rdoc_options:
|
168
|
+
- --inline-source
|
169
|
+
- --main
|
170
|
+
- doc/README
|
171
|
+
- --title
|
172
|
+
- twiddler-utils-0.0.3 RDoc
|
173
|
+
require_paths:
|
174
|
+
- lib/
|
175
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
176
|
+
none: false
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
hash: 3
|
181
|
+
segments:
|
182
|
+
- 0
|
183
|
+
version: "0"
|
184
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
185
|
+
none: false
|
186
|
+
requirements:
|
187
|
+
- - ">="
|
188
|
+
- !ruby/object:Gem::Version
|
189
|
+
hash: 3
|
190
|
+
segments:
|
191
|
+
- 0
|
192
|
+
version: "0"
|
193
|
+
requirements: []
|
194
|
+
|
195
|
+
rubyforge_project: twiddler-utils
|
196
|
+
rubygems_version: 1.4.2
|
197
|
+
signing_key:
|
198
|
+
specification_version: 3
|
199
|
+
summary: Utils for working with Twiddler configs
|
200
|
+
test_files:
|
201
|
+
- spec_help/gem_test_suite.rb
|