lei 0.2.9 → 0.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/_app/_controllers.rb +1 -1
- data/bin/_app/_helpers.rb +2 -2
- data/bin/_app/_root.rb +1 -1
- data/bin/_app/_src.rb +2 -2
- data/bin/_app/_static.rb +1 -1
- data/bin/_app/_views.rb +1 -1
- data/bin/_app/_welcome.rb +1 -1
- data/bin/_new/_content.rb +1 -1
- data/bin/_new/_custom.rb +2 -2
- data/bin/docker_utils.rb +1 -1
- data/bin/functions.rb +1 -1
- data/bin/lei +1 -1
- data/example/controllers/content.rb +2 -2
- data/example/controllers/custom.rb +2 -2
- data/example/controllers/test.rb +2 -2
- data/example/helpers/content_helpers.rb +12 -12
- data/example/helpers/global_utils.rb +2 -2
- data/example/spec/spec_helper.rb +1 -1
- data/example/spec/test/content_helper_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6991a0b1e19c0eae9316352fb86ac012e74b49c89c6d54d287dd35385a5688e0
|
|
4
|
+
data.tar.gz: f609c728e08ffd37ff6dd5915c83e9a79ac68c0f6014ab81c632cb2c40acf598
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2d898bea843c854caa84a692dc24957fb4b9a53ef42f7b1dabf0b77118e984ddacfd31cad2bb1669781f692e17ef8334543896a4f852f3fa91fd3756d5363733
|
|
7
|
+
data.tar.gz: 9162b55b121e3dc8d826b1473c5b42f3a66f65d3a8e887bbcbee4822b85e76e00beee921242151617cd502686ddabc17f51b9033c99211e1a520076befd045a8
|
data/bin/_app/_controllers.rb
CHANGED
data/bin/_app/_helpers.rb
CHANGED
|
@@ -177,7 +177,7 @@ module GlobalUtils
|
|
|
177
177
|
|
|
178
178
|
$amp_bind = "<script async custom-element=\\"amp-bind\\" src=\\"https://cdn.ampproject.org/v0/amp-bind-0.1.js\\"></script>"
|
|
179
179
|
end
|
|
180
|
-
|
|
180
|
+
|
|
181
181
|
end
|
|
182
182
|
GLOBAL
|
|
183
183
|
|
|
@@ -188,4 +188,4 @@ files = {
|
|
|
188
188
|
|
|
189
189
|
loc = "$(pwd)/helpers"
|
|
190
190
|
|
|
191
|
-
makeFiles(files, loc)
|
|
191
|
+
makeFiles(files, loc)
|
data/bin/_app/_root.rb
CHANGED
data/bin/_app/_src.rb
CHANGED
|
@@ -140,7 +140,7 @@ welcome = <<~WELCOME
|
|
|
140
140
|
@fw300();
|
|
141
141
|
text-align: center;
|
|
142
142
|
}
|
|
143
|
-
|
|
143
|
+
|
|
144
144
|
h2 {
|
|
145
145
|
@fs2();
|
|
146
146
|
@fw300();
|
|
@@ -167,4 +167,4 @@ files = {
|
|
|
167
167
|
|
|
168
168
|
filesLoc = "#{dirLoc}/styles"
|
|
169
169
|
|
|
170
|
-
makeFiles(files, filesLoc)
|
|
170
|
+
makeFiles(files, filesLoc)
|
data/bin/_app/_static.rb
CHANGED
data/bin/_app/_views.rb
CHANGED
data/bin/_app/_welcome.rb
CHANGED
data/bin/_new/_content.rb
CHANGED
data/bin/_new/_custom.rb
CHANGED
|
@@ -60,7 +60,7 @@ def add_new(name)
|
|
|
60
60
|
}
|
|
61
61
|
STYLE
|
|
62
62
|
|
|
63
|
-
initialContent = "# #{capitalizedName}\nYour content goes here."
|
|
63
|
+
initialContent = "# #{capitalizedName}\n\nYour content goes here."
|
|
64
64
|
|
|
65
65
|
`echo '#{custom.to_yaml}' > #{cwd}/customlist.yml`
|
|
66
66
|
`mkdir #{cwd}/#{downcasedName}`
|
|
@@ -68,4 +68,4 @@ def add_new(name)
|
|
|
68
68
|
`echo '#{customView}' > #{cwd}/views/#{downcasedName}.slim`
|
|
69
69
|
`echo '#{customStyle}' > #{cwd}/src/styles/#{downcasedName}.less`
|
|
70
70
|
`gulp shrink`
|
|
71
|
-
end
|
|
71
|
+
end
|
data/bin/docker_utils.rb
CHANGED
data/bin/functions.rb
CHANGED
data/bin/lei
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
puts "\tController: Content"
|
|
2
2
|
|
|
3
3
|
class ContentController < Sinatra::Base
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
set :content_dir, "#{$root}/content"
|
|
6
6
|
set :stylesheet, "content"
|
|
7
7
|
set :public_folder, $assets_root
|
|
@@ -64,4 +64,4 @@ class ContentController < Sinatra::Base
|
|
|
64
64
|
slim :notfound, locals: { **ContentHelpers.nf_404, url: request.url }
|
|
65
65
|
end
|
|
66
66
|
|
|
67
|
-
end
|
|
67
|
+
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
puts "\tController: Custom"
|
|
2
2
|
|
|
3
3
|
class CustomController < Sinatra::Base
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
set :public_folder, $assets_root
|
|
6
6
|
set :views, $views
|
|
7
7
|
|
|
@@ -30,4 +30,4 @@ class CustomController < Sinatra::Base
|
|
|
30
30
|
slim :notfound, locals: { **ContentHelpers.nf_404, url: request.url }
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
end
|
|
33
|
+
end
|
data/example/controllers/test.rb
CHANGED
|
@@ -19,27 +19,27 @@ module ContentHelpers
|
|
|
19
19
|
!post.match?(Regexp.new(term, true))
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
|
-
|
|
22
|
+
|
|
23
23
|
yyyy = params["year"]
|
|
24
24
|
if !yyyy.nil? && yyyy.length == 4
|
|
25
25
|
content.reject! { |c| File::Stat.new(c).mtime.year != yyyy.to_i }
|
|
26
26
|
end
|
|
27
|
-
|
|
27
|
+
|
|
28
28
|
mm = params["month"]
|
|
29
29
|
if !mm.nil? && mm.length == 2
|
|
30
30
|
content.reject! { |c| File::Stat.new(c).mtime.month != mm.to_i }
|
|
31
31
|
end
|
|
32
|
-
|
|
32
|
+
|
|
33
33
|
dd = params["day"]
|
|
34
34
|
if !dd.nil? && dd.length == 2
|
|
35
35
|
content.reject! { |c| File::Stat.new(c).mtime.day != dd.to_i }
|
|
36
36
|
end
|
|
37
37
|
end
|
|
38
|
-
|
|
38
|
+
|
|
39
39
|
def self.get_content(contentDir)
|
|
40
40
|
all = Dir.glob("#{contentDir}/*.md")
|
|
41
41
|
classified = YAML.load_file($banlist)
|
|
42
|
-
|
|
42
|
+
|
|
43
43
|
all - classified
|
|
44
44
|
end
|
|
45
45
|
|
|
@@ -76,16 +76,16 @@ module ContentHelpers
|
|
|
76
76
|
style: self.load_css("notfound")
|
|
77
77
|
}
|
|
78
78
|
end
|
|
79
|
-
|
|
79
|
+
|
|
80
80
|
def self.paginate(content, params, url)
|
|
81
81
|
pageParam = params["page"].to_i
|
|
82
|
-
|
|
82
|
+
|
|
83
83
|
page = pageParam != 0 ? pageParam : 1
|
|
84
84
|
pages = (content.length / 5.0).ceil
|
|
85
85
|
|
|
86
86
|
firstIndex = (page - 1) * 5
|
|
87
87
|
lastIndex = page * 5 - 1
|
|
88
|
-
|
|
88
|
+
|
|
89
89
|
path = URI(url).path
|
|
90
90
|
pageUrls = [ nil, nil, nil, nil ]
|
|
91
91
|
|
|
@@ -95,14 +95,14 @@ module ContentHelpers
|
|
|
95
95
|
prev = (page - 1).to_s
|
|
96
96
|
pageUrls[1] = self.mp_eu(path, params, { "page" => prev })
|
|
97
97
|
end
|
|
98
|
-
|
|
98
|
+
|
|
99
99
|
if page < pages
|
|
100
100
|
foll = (page + 1).to_s
|
|
101
101
|
pageUrls[2] = self.mp_eu(path, params, { "page" => foll })
|
|
102
102
|
|
|
103
103
|
pageUrls[3] = self.mp_eu(path, params, { "page" => pages.to_s })
|
|
104
104
|
end
|
|
105
|
-
|
|
105
|
+
|
|
106
106
|
{
|
|
107
107
|
content: self.parse_md(content[firstIndex..lastIndex]),
|
|
108
108
|
page: page,
|
|
@@ -122,10 +122,10 @@ module ContentHelpers
|
|
|
122
122
|
CARPET.render(content)
|
|
123
123
|
end
|
|
124
124
|
end
|
|
125
|
-
|
|
125
|
+
|
|
126
126
|
def self.time_sort(content)
|
|
127
127
|
content.sort_by! { |c| File::Stat.new(c).mtime }
|
|
128
128
|
content.reverse!
|
|
129
129
|
end
|
|
130
130
|
|
|
131
|
-
end
|
|
131
|
+
end
|
data/example/spec/spec_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lei
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ezra Chang
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2019-03-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|