qipowl 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -8
- data/lib/qipowl/bowlers/html.rb +16 -24
- data/lib/qipowl/core/ruler.rb +1 -5
- data/lib/qipowl/version.rb +1 -1
- data/qipowl.gemspec +2 -2
- metadata +13 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1285e55189abe3129f00711fb21fbc905440796
|
4
|
+
data.tar.gz: 2b46cc8dbd9b675f5293a8ebd3242aee06a2e06b
|
5
5
|
!binary "U0hBNTEy":
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84bca4876f808702f0c4d8ae4a28ea46a9319fb7319c855c231d3b27ffadebaafecc85f8c94821d9373e6c8d087a526355900ba0d61a1668ad82e8cfd57ed605
|
7
|
+
data.tar.gz: 045c623b7344d3c84e47beb8240742fb04cabb329007e7f9a14814fec415efe0289381eaa505d7150e144780caf8b518386356f73a38dff112f34d30407256f8
|
data/Gemfile
CHANGED
@@ -4,13 +4,5 @@ source 'https://rubygems.org'
|
|
4
4
|
gemspec
|
5
5
|
|
6
6
|
gem 'aquarium', '~> 0.6', :git => 'git://github.com/deanwampler/Aquarium.git'
|
7
|
-
gem "crochets", :git => 'git://github.com/mudasobwa/crochets.git'
|
8
|
-
|
9
|
-
#gem "diff-lcs", :git => 'git://github.com/halostatue/diff-lcs.git'
|
10
|
-
|
11
|
-
#gem "rspec-core", :git => 'git://github.com/rspec/rspec-core.git'
|
12
|
-
#gem "rspec-expectations", :path => '../rspec-expectations'
|
13
|
-
#gem "rspec-mocks", :git => 'git://github.com/rspec/rspec-mocks.git'
|
14
|
-
# gem "rspec", :git => 'git://github.com/rspec/rspec.git'
|
15
7
|
|
16
8
|
gem 'rake', :group => :test
|
data/lib/qipowl/bowlers/html.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
require 'net/http'
|
4
|
+
require 'typogrowth'
|
4
5
|
|
5
6
|
require_relative '../core/bowler'
|
6
7
|
|
@@ -197,6 +198,13 @@ module Qipowl
|
|
197
198
|
alias_method :▷, :▶
|
198
199
|
|
199
200
|
protected
|
201
|
+
# @see {Qipowl::Bowlers::Bowler#defreeze}
|
202
|
+
#
|
203
|
+
# @param [String] str to be defreezed
|
204
|
+
def defreeze str
|
205
|
+
(super str)
|
206
|
+
end
|
207
|
+
|
200
208
|
# Computes the level of the `:linewide` element by counting
|
201
209
|
# preceeding non-breakable spaces. For instance, nested lists
|
202
210
|
# are produced by appending `"\u{00A0}"` to the line item
|
@@ -216,6 +224,14 @@ module Qipowl
|
|
216
224
|
callee.to_s.gsub(/^#{String::NBSP}*/, '').to_sym if callee
|
217
225
|
end
|
218
226
|
|
227
|
+
# Produces html paragraph tag (`<p>`) with no class.
|
228
|
+
# @see Qipowl::Bowler#orphan
|
229
|
+
# @param str the words, to be put in paragraph tag.
|
230
|
+
# @return [String] tagged words.
|
231
|
+
def orphan str
|
232
|
+
"#{tagify(:p, {}, str.to_s.strip)}"
|
233
|
+
end
|
234
|
+
|
219
235
|
# @see Qipowl::Bowler#harvest
|
220
236
|
#
|
221
237
|
# Additionally it checks if there was a `:linewide` item, requiring
|
@@ -259,13 +275,6 @@ module Qipowl
|
|
259
275
|
send method, args, block
|
260
276
|
end
|
261
277
|
|
262
|
-
# Produces html paragraph tag (`<p>`) with class `owl`.
|
263
|
-
# @see Qipowl::Bowler#orphan
|
264
|
-
# @param str the words, to be put in paragraph tag.
|
265
|
-
# @return [String] tagged words.
|
266
|
-
def orphan str
|
267
|
-
"#{tagify(:p, {}, str.to_s.strip)}"
|
268
|
-
end
|
269
278
|
# Constructs opening html tag for the input given.
|
270
279
|
#
|
271
280
|
# To construct `abbr` tag with `title` _Title_ and class _default_:
|
@@ -365,23 +374,6 @@ end
|
|
365
374
|
|
366
375
|
|
367
376
|
|
368
|
-
# @see {Qipowl::Bowler#defreeze}
|
369
|
-
#
|
370
|
-
# Additionally it checks if tag is a `:block` tag and
|
371
|
-
# substitutes all the carriage returns (`$/`) with special symbol
|
372
|
-
# {String::CARRIAGE_RETURN} to prevent format damage.
|
373
|
-
#
|
374
|
-
# @param [String] str to be defreezed
|
375
|
-
def defreeze str
|
376
|
-
str = super str
|
377
|
-
@mapping[:block].each { |tag, htmltag|
|
378
|
-
str.gsub!(/(#{tag})(.*?)$(.*?)(#{tag}|\Z)/m) { |m|
|
379
|
-
"#{$1}('#{$2}', '#{$3}')\n\n"
|
380
|
-
}
|
381
|
-
}
|
382
|
-
str
|
383
|
-
end
|
384
|
-
|
385
377
|
# @see {Qipowl::Bowler#serveup}
|
386
378
|
#
|
387
379
|
# Additionally it beatifies the output HTML
|
data/lib/qipowl/core/ruler.rb
CHANGED
@@ -20,8 +20,6 @@ module Qipowl
|
|
20
20
|
extend self
|
21
21
|
|
22
22
|
@@bowlers = {} # FIXME REDIS!!!!
|
23
|
-
@@yamls = {}
|
24
|
-
|
25
23
|
|
26
24
|
def get_bowler id: nil, type: nil
|
27
25
|
@@bowlers[id] || new_bowler(type, true)
|
@@ -50,13 +48,11 @@ module Qipowl
|
|
50
48
|
|
51
49
|
private
|
52
50
|
def get_yaml yaml
|
53
|
-
return @@yamls[yaml] if @@yamls[yaml]
|
54
|
-
|
55
51
|
clazz = Qipowl::Mappers.const_get("#{yaml.capitalize}BowlerMapper")
|
56
52
|
raise NameError.new("Invalid mapper type: #{clazz}") \
|
57
53
|
unless clazz.is_a?(Class) && clazz < Qipowl::Mappers::BowlerMapper
|
58
54
|
|
59
|
-
|
55
|
+
clazz.new
|
60
56
|
end
|
61
57
|
|
62
58
|
# FIXME Make contants PER-EIGENCLASS
|
data/lib/qipowl/version.rb
CHANGED
data/qipowl.gemspec
CHANGED
@@ -35,8 +35,8 @@ Gem::Specification.new do |s|
|
|
35
35
|
|
36
36
|
s.add_dependency 'psych'
|
37
37
|
s.add_dependency 'unicode'
|
38
|
-
s.add_dependency 'typogrowth'
|
39
|
-
s.add_dependency 'aquarium'
|
38
|
+
s.add_dependency 'typogrowth', '~> 0.9.0', '>= 0.9.1'
|
39
|
+
s.add_dependency 'aquarium', '~> 0.6'
|
40
40
|
s.add_dependency 'crochets'
|
41
41
|
end
|
42
42
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qipowl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexei Matyushkin
|
@@ -112,30 +112,36 @@ dependencies:
|
|
112
112
|
name: typogrowth
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
+
- - ~>
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 0.9.0
|
115
118
|
- - ! '>='
|
116
119
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
120
|
+
version: 0.9.1
|
118
121
|
type: :runtime
|
119
122
|
prerelease: false
|
120
123
|
version_requirements: !ruby/object:Gem::Requirement
|
121
124
|
requirements:
|
125
|
+
- - ~>
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: 0.9.0
|
122
128
|
- - ! '>='
|
123
129
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
130
|
+
version: 0.9.1
|
125
131
|
- !ruby/object:Gem::Dependency
|
126
132
|
name: aquarium
|
127
133
|
requirement: !ruby/object:Gem::Requirement
|
128
134
|
requirements:
|
129
|
-
- -
|
135
|
+
- - ~>
|
130
136
|
- !ruby/object:Gem::Version
|
131
|
-
version: '0'
|
137
|
+
version: '0.6'
|
132
138
|
type: :runtime
|
133
139
|
prerelease: false
|
134
140
|
version_requirements: !ruby/object:Gem::Requirement
|
135
141
|
requirements:
|
136
|
-
- -
|
142
|
+
- - ~>
|
137
143
|
- !ruby/object:Gem::Version
|
138
|
-
version: '0'
|
144
|
+
version: '0.6'
|
139
145
|
- !ruby/object:Gem::Dependency
|
140
146
|
name: crochets
|
141
147
|
requirement: !ruby/object:Gem::Requirement
|