konjac 0.2.6.5 → 0.2.6.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/konjac/cli.rb +8 -1
- data/lib/konjac/tag_manager.rb +3 -1
- data/lib/konjac/translator.rb +3 -0
- data/lib/konjac/version.rb +1 -1
- metadata +25 -25
data/lib/konjac/cli.rb
CHANGED
@@ -15,6 +15,11 @@ module Konjac
|
|
15
15
|
SUB_COMMANDS = ["add", "edit", "export", "import", "language", "list",
|
16
16
|
"suggest", "translate", "use"]
|
17
17
|
|
18
|
+
# The minimum amount by which to offset subcommands in standard display.
|
19
|
+
# Should be equal to the length of the longest top-level flag (e.g. the
|
20
|
+
# +version+ in opt :version) plus 6
|
21
|
+
SC_MIN_OFFSET = 13 # :nodoc:
|
22
|
+
|
18
23
|
# The banner to displaying when requesting help through the command line
|
19
24
|
BANNER = <<-eos
|
20
25
|
#{Color.bold { Color.underscore { "KONJAC" } }}
|
@@ -155,7 +160,7 @@ eos
|
|
155
160
|
# Describe the subcommands available to the command line interface
|
156
161
|
def describe_subcommands
|
157
162
|
text = []
|
158
|
-
leftcol_width = SUB_COMMANDS.map(&:length).max
|
163
|
+
leftcol_width = [SUB_COMMANDS.map(&:length).max, SC_MIN_OFFSET].max
|
159
164
|
SUB_COMMANDS.each do |sc|
|
160
165
|
text << " %#{leftcol_width}s: %s" % [sc, I18n.t(sc, :scope => :subcommands)]
|
161
166
|
end
|
@@ -164,6 +169,8 @@ eos
|
|
164
169
|
|
165
170
|
private
|
166
171
|
|
172
|
+
# Suggests a translation based on the provided word and the supplied
|
173
|
+
# optional arguments
|
167
174
|
def suggest(word, opts = {})
|
168
175
|
to_lang = Language.find(opts[:to]).to_s
|
169
176
|
from_lang = Language.find(opts[:from]).to_s
|
data/lib/konjac/tag_manager.rb
CHANGED
@@ -6,9 +6,11 @@ module Konjac
|
|
6
6
|
attr_accessor :tags
|
7
7
|
|
8
8
|
# A regex to match lines that start with <tt>-</tt>, that is, lines that
|
9
|
-
# indicate
|
9
|
+
# indicate removed text in .diff files
|
10
10
|
OLD_TAG = /^-[^-]/
|
11
11
|
|
12
|
+
# A regex to match lines that start with <tt>+</tt>, that is, lines that
|
13
|
+
# indicate added text in .diff files
|
12
14
|
NEW_TAG = /^\+[^+]/
|
13
15
|
|
14
16
|
# Regex for matching index numbers
|
data/lib/konjac/translator.rb
CHANGED
data/lib/konjac/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: konjac
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.6.
|
4
|
+
version: 0.2.6.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-01-26 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: amatch
|
16
|
-
requirement: &
|
16
|
+
requirement: &70309718912920 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70309718912920
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: highline
|
27
|
-
requirement: &
|
27
|
+
requirement: &70309718912500 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70309718912500
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: i18n
|
38
|
-
requirement: &
|
38
|
+
requirement: &70309718912080 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70309718912080
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: nokogiri
|
49
|
-
requirement: &
|
49
|
+
requirement: &70309718911660 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70309718911660
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: sdoc
|
60
|
-
requirement: &
|
60
|
+
requirement: &70309718911240 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70309718911240
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: term-ansicolor
|
71
|
-
requirement: &
|
71
|
+
requirement: &70309718927020 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70309718927020
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: trollop
|
82
|
-
requirement: &
|
82
|
+
requirement: &70309718926460 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :runtime
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70309718926460
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: autotest
|
93
|
-
requirement: &
|
93
|
+
requirement: &70309718925760 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,10 +98,10 @@ dependencies:
|
|
98
98
|
version: '0'
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *70309718925760
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: autotest-fsevent
|
104
|
-
requirement: &
|
104
|
+
requirement: &70309718925300 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ! '>='
|
@@ -109,10 +109,10 @@ dependencies:
|
|
109
109
|
version: '0'
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *70309718925300
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: autotest-growl
|
115
|
-
requirement: &
|
115
|
+
requirement: &70309718924880 !ruby/object:Gem::Requirement
|
116
116
|
none: false
|
117
117
|
requirements:
|
118
118
|
- - ! '>='
|
@@ -120,10 +120,10 @@ dependencies:
|
|
120
120
|
version: '0'
|
121
121
|
type: :development
|
122
122
|
prerelease: false
|
123
|
-
version_requirements: *
|
123
|
+
version_requirements: *70309718924880
|
124
124
|
- !ruby/object:Gem::Dependency
|
125
125
|
name: bundler
|
126
|
-
requirement: &
|
126
|
+
requirement: &70309718924280 !ruby/object:Gem::Requirement
|
127
127
|
none: false
|
128
128
|
requirements:
|
129
129
|
- - ! '>='
|
@@ -131,10 +131,10 @@ dependencies:
|
|
131
131
|
version: '0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
|
-
version_requirements: *
|
134
|
+
version_requirements: *70309718924280
|
135
135
|
- !ruby/object:Gem::Dependency
|
136
136
|
name: rspec
|
137
|
-
requirement: &
|
137
|
+
requirement: &70309718923700 !ruby/object:Gem::Requirement
|
138
138
|
none: false
|
139
139
|
requirements:
|
140
140
|
- - ! '>='
|
@@ -142,7 +142,7 @@ dependencies:
|
|
142
142
|
version: '0'
|
143
143
|
type: :development
|
144
144
|
prerelease: false
|
145
|
-
version_requirements: *
|
145
|
+
version_requirements: *70309718923700
|
146
146
|
description: A Ruby command-line utility for translating files using a YAML wordlist
|
147
147
|
email:
|
148
148
|
- bryan.mckelvey@gmail.com
|