konjac 0.2.9.1 → 0.2.9.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/applescripts/konjac_word_import +30 -0
- data/lib/konjac/language.rb +6 -6
- data/lib/konjac/version.rb +1 -1
- metadata +28 -28
@@ -15,6 +15,16 @@ to parse_header(header)
|
|
15
15
|
return at_offset
|
16
16
|
end parse_header
|
17
17
|
|
18
|
+
to ends_with_forbidden_character(txt)
|
19
|
+
set last_character to character -1 of txt
|
20
|
+
|
21
|
+
if last_character is in {line_feed, carriage_return, vertical_tab}
|
22
|
+
return true
|
23
|
+
else
|
24
|
+
return false
|
25
|
+
end if
|
26
|
+
end ends_with_forbidden_character
|
27
|
+
|
18
28
|
to get_posix_path(mac_path)
|
19
29
|
set result to POSIX path of mac_path
|
20
30
|
end get_posix_path
|
@@ -82,7 +92,27 @@ to import(filename)
|
|
82
92
|
set my_range to create range active document ¬
|
83
93
|
start (start of content of current_content) ¬
|
84
94
|
end (end of content of current_content)
|
95
|
+
|
85
96
|
select my_range
|
97
|
+
|
98
|
+
-- FIXME: this is super-ugly
|
99
|
+
if count of paragraphs of selection is greater than 1
|
100
|
+
set my_range to create range active document ¬
|
101
|
+
start (start of content of text object of selection) ¬
|
102
|
+
end ((end of content of text object of selection) - 1)
|
103
|
+
select my_range
|
104
|
+
repeat while (count of paragraphs of selection is greater than 1)
|
105
|
+
selection move start of range by a line item
|
106
|
+
end repeat
|
107
|
+
end if
|
108
|
+
|
109
|
+
repeat while my ends_with_forbidden_character(content of selection as text)
|
110
|
+
set my_range to create range active document ¬
|
111
|
+
start (start of content of text object of selection) ¬
|
112
|
+
end ((end of content of text object of selection) - 1)
|
113
|
+
select my_range
|
114
|
+
end repeat
|
115
|
+
|
86
116
|
type text selection text text_content
|
87
117
|
set text_content to ""
|
88
118
|
end if
|
data/lib/konjac/language.rb
CHANGED
@@ -256,12 +256,12 @@ module Konjac
|
|
256
256
|
|
257
257
|
# Convert to underscore case
|
258
258
|
def underscore(str) # :doc:
|
259
|
-
str.to_s.
|
260
|
-
gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2'). # underscore-delimit caps
|
261
|
-
gsub(/([a-z\d])\s?([A-Z])/,'\1_\2'). # underscore-delimit words
|
262
|
-
tr("-", "_").
|
263
|
-
downcase.
|
264
|
-
to_sym
|
259
|
+
str.to_s. # allow symbols and strings
|
260
|
+
gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2'). # underscore-delimit caps
|
261
|
+
gsub(/([a-z\d])\s?([A-Z])/, '\1_\2'). # underscore-delimit words
|
262
|
+
tr("-", "_"). # dashes to underscores
|
263
|
+
downcase. # everything lowercase
|
264
|
+
to_sym # convert to symbol
|
265
265
|
end
|
266
266
|
end
|
267
267
|
end
|
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.9.
|
4
|
+
version: 0.2.9.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-02-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: amatch
|
16
|
-
requirement: &
|
16
|
+
requirement: &70118068632120 !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: *70118068632120
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: git
|
27
|
-
requirement: &
|
27
|
+
requirement: &70118068631540 !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: *70118068631540
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: highline
|
38
|
-
requirement: &
|
38
|
+
requirement: &70118068631120 !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: *70118068631120
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: i18n
|
49
|
-
requirement: &
|
49
|
+
requirement: &70118068630440 !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: *70118068630440
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: nokogiri
|
60
|
-
requirement: &
|
60
|
+
requirement: &70118068629800 !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: *70118068629800
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: sdoc
|
71
|
-
requirement: &
|
71
|
+
requirement: &70118068629120 !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: *70118068629120
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: term-ansicolor
|
82
|
-
requirement: &
|
82
|
+
requirement: &70118068628240 !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: *70118068628240
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: trollop
|
93
|
-
requirement: &
|
93
|
+
requirement: &70118068627360 !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: :runtime
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *70118068627360
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: autotest
|
104
|
-
requirement: &
|
104
|
+
requirement: &70118068626760 !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: *70118068626760
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: autotest-fsevent
|
115
|
-
requirement: &
|
115
|
+
requirement: &70118068626100 !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: *70118068626100
|
124
124
|
- !ruby/object:Gem::Dependency
|
125
125
|
name: autotest-growl
|
126
|
-
requirement: &
|
126
|
+
requirement: &70118068625460 !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: *70118068625460
|
135
135
|
- !ruby/object:Gem::Dependency
|
136
136
|
name: bundler
|
137
|
-
requirement: &
|
137
|
+
requirement: &70118068625040 !ruby/object:Gem::Requirement
|
138
138
|
none: false
|
139
139
|
requirements:
|
140
140
|
- - ! '>='
|
@@ -142,10 +142,10 @@ dependencies:
|
|
142
142
|
version: '0'
|
143
143
|
type: :development
|
144
144
|
prerelease: false
|
145
|
-
version_requirements: *
|
145
|
+
version_requirements: *70118068625040
|
146
146
|
- !ruby/object:Gem::Dependency
|
147
147
|
name: rspec
|
148
|
-
requirement: &
|
148
|
+
requirement: &70118068624620 !ruby/object:Gem::Requirement
|
149
149
|
none: false
|
150
150
|
requirements:
|
151
151
|
- - ! '>='
|
@@ -153,7 +153,7 @@ dependencies:
|
|
153
153
|
version: '0'
|
154
154
|
type: :development
|
155
155
|
prerelease: false
|
156
|
-
version_requirements: *
|
156
|
+
version_requirements: *70118068624620
|
157
157
|
description: A Ruby command-line utility for translating files using a YAML wordlist
|
158
158
|
email:
|
159
159
|
- bryan.mckelvey@gmail.com
|