inverter 0.4.6 → 0.4.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/Gemfile.lock +33 -18
- data/lib/inverter/parser.rb +5 -1
- data/lib/inverter/renderer.rb +7 -3
- data/lib/inverter/version.rb +1 -1
- data/test/rails_app/config/mongoid.yml +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59e191c717b9b0b28ff7af2c0195b6b4490ffc55
|
4
|
+
data.tar.gz: 158b658593ac1f703c4376cbe097b8928f6321fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb82028e6cd7eb1350c7cef41e52f288ec35dc42e90a7f4207a5c8167d9ed1b0aedc5b9c8c956d761e957db9e0e0f679cd25beb7ee3c7f8b6dba678bd823fdfe
|
7
|
+
data.tar.gz: 696d30cae06b51ee25c4d476e0f92c70f5c301d4c76f4018c177b5b4e87afc56451e403625433b04ebb6ac813123cede3528d6a33069673447bab75e8c26d010
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
inverter (0.4.
|
4
|
+
inverter (0.4.6)
|
5
5
|
ants (>= 0.1.4)
|
6
6
|
awesome_print (>= 1.6.1)
|
7
7
|
meta-tags (>= 2.0)
|
@@ -49,12 +49,14 @@ GEM
|
|
49
49
|
thread_safe (~> 0.3, >= 0.3.4)
|
50
50
|
tzinfo (~> 1.1)
|
51
51
|
ansi (1.5.0)
|
52
|
-
ants (0.
|
52
|
+
ants (0.3.5)
|
53
|
+
devise
|
53
54
|
mongoid (>= 4.0)
|
54
55
|
mongoid-slug (>= 4.0.0)
|
55
56
|
arel (6.0.0)
|
56
57
|
awesome_print (1.6.1)
|
57
|
-
|
58
|
+
bcrypt (3.1.10)
|
59
|
+
bson (3.2.6)
|
58
60
|
builder (3.2.2)
|
59
61
|
capybara (2.4.4)
|
60
62
|
mime-types (>= 1.16)
|
@@ -72,9 +74,15 @@ GEM
|
|
72
74
|
coffee-script-source
|
73
75
|
execjs
|
74
76
|
coffee-script-source (1.9.1.1)
|
75
|
-
connection_pool (2.2.0)
|
76
77
|
database_cleaner (1.4.1)
|
77
|
-
|
78
|
+
devise (3.5.2)
|
79
|
+
bcrypt (~> 3.0)
|
80
|
+
orm_adapter (~> 0.1)
|
81
|
+
railties (>= 3.2.6, < 5)
|
82
|
+
responders
|
83
|
+
thread_safe (~> 0.1)
|
84
|
+
warden (~> 1.2.3)
|
85
|
+
easy_diff (0.0.6)
|
78
86
|
erubis (2.7.0)
|
79
87
|
execjs (2.5.2)
|
80
88
|
factory_girl (4.5.0)
|
@@ -90,7 +98,7 @@ GEM
|
|
90
98
|
nokogiri (>= 1.5.9)
|
91
99
|
mail (2.6.3)
|
92
100
|
mime-types (>= 1.16, < 3)
|
93
|
-
meta-tags (2.
|
101
|
+
meta-tags (2.1.0)
|
94
102
|
actionpack (>= 3.0.0)
|
95
103
|
mime-types (2.6.1)
|
96
104
|
mini_portile (0.6.2)
|
@@ -116,26 +124,29 @@ GEM
|
|
116
124
|
builder
|
117
125
|
minitest (>= 5.0)
|
118
126
|
ruby-progressbar
|
119
|
-
|
127
|
+
mongo (2.1.2)
|
128
|
+
bson (~> 3.0)
|
129
|
+
mongoid (5.0.1)
|
120
130
|
activemodel (~> 4.0)
|
121
|
-
|
131
|
+
mongo (~> 2.1)
|
122
132
|
origin (~> 2.1)
|
123
133
|
tzinfo (>= 0.3.37)
|
124
|
-
mongoid-
|
134
|
+
mongoid-compatibility (0.3.1)
|
135
|
+
activesupport
|
136
|
+
mongoid (>= 2.0)
|
137
|
+
mongoid-history (0.5.0)
|
125
138
|
activesupport
|
126
139
|
easy_diff
|
127
140
|
mongoid (>= 3.0)
|
128
|
-
|
141
|
+
mongoid-compatibility
|
142
|
+
mongoid-slug (5.1.1)
|
129
143
|
mongoid (>= 3.0)
|
144
|
+
mongoid-compatibility
|
130
145
|
stringex (~> 2.0)
|
131
|
-
moped (2.0.6)
|
132
|
-
bson (~> 3.0)
|
133
|
-
connection_pool (~> 2.0)
|
134
|
-
optionable (~> 0.2.0)
|
135
146
|
nokogiri (1.6.6.2)
|
136
147
|
mini_portile (~> 0.6.0)
|
137
|
-
optionable (0.2.0)
|
138
148
|
origin (2.1.1)
|
149
|
+
orm_adapter (0.5.0)
|
139
150
|
rack (1.6.1)
|
140
151
|
rack-test (0.6.3)
|
141
152
|
rack (>= 1.0)
|
@@ -164,9 +175,11 @@ GEM
|
|
164
175
|
rake (>= 0.8.7)
|
165
176
|
thor (>= 0.18.1, < 2.0)
|
166
177
|
rake (10.4.2)
|
167
|
-
redcarpet (3.3.
|
168
|
-
render_anywhere (0.0.
|
178
|
+
redcarpet (3.3.3)
|
179
|
+
render_anywhere (0.0.12)
|
169
180
|
rails (>= 3.0.7)
|
181
|
+
responders (2.1.0)
|
182
|
+
railties (>= 4.2.0, < 5)
|
170
183
|
ruby-progressbar (1.7.5)
|
171
184
|
sprockets (3.1.0)
|
172
185
|
rack (~> 1.0)
|
@@ -179,6 +192,8 @@ GEM
|
|
179
192
|
thread_safe (0.3.5)
|
180
193
|
tzinfo (1.2.2)
|
181
194
|
thread_safe (~> 0.1)
|
195
|
+
warden (1.2.3)
|
196
|
+
rack (>= 1.0)
|
182
197
|
xpath (2.0.0)
|
183
198
|
nokogiri (~> 1.3)
|
184
199
|
|
@@ -199,4 +214,4 @@ DEPENDENCIES
|
|
199
214
|
rake (~> 10.0)
|
200
215
|
|
201
216
|
BUNDLED WITH
|
202
|
-
1.10.
|
217
|
+
1.10.6
|
data/lib/inverter/parser.rb
CHANGED
@@ -110,7 +110,11 @@ module Inverter
|
|
110
110
|
private
|
111
111
|
|
112
112
|
def file_content
|
113
|
-
@file_content ||=
|
113
|
+
@file_content ||= template_file
|
114
|
+
end
|
115
|
+
|
116
|
+
def template_file
|
117
|
+
File.open(Rails.root.join("app/views", @template_name), "rb").read
|
114
118
|
end
|
115
119
|
end
|
116
120
|
end
|
data/lib/inverter/renderer.rb
CHANGED
@@ -11,11 +11,15 @@ module Inverter
|
|
11
11
|
return false
|
12
12
|
end
|
13
13
|
|
14
|
-
def self.
|
14
|
+
def self.markdown
|
15
15
|
# markdown configuration
|
16
16
|
# https://github.com/vmg/redcarpet#and-its-like-really-simple-to-use
|
17
|
-
markdown
|
17
|
+
@markdown ||= Redcarpet::Markdown.new(Redcarpet::Render::HTML,
|
18
|
+
autolink: true,
|
19
|
+
tables: true)
|
20
|
+
end
|
18
21
|
|
22
|
+
def self.render(html, blocks)
|
19
23
|
offset = 0
|
20
24
|
map = ::Inverter::Parser.map_blocks_for(html)
|
21
25
|
|
@@ -27,7 +31,7 @@ module Inverter
|
|
27
31
|
block = markdown.render(block)
|
28
32
|
end
|
29
33
|
|
30
|
-
block = "
|
34
|
+
block = "#{ block }"
|
31
35
|
|
32
36
|
html[offset+pos[0]..offset+pos[1]] = block
|
33
37
|
|
data/lib/inverter/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inverter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Kravets
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ants
|
@@ -296,7 +296,6 @@ files:
|
|
296
296
|
- test/rails_app/lib/assets/.keep
|
297
297
|
- test/rails_app/lib/tasks/.keep
|
298
298
|
- test/rails_app/log/.keep
|
299
|
-
- test/rails_app/log/test.log
|
300
299
|
- test/rails_app/public/404.html
|
301
300
|
- test/rails_app/public/422.html
|
302
301
|
- test/rails_app/public/500.html
|