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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d30e6062790a6860bbf317d2d18947eb7841f24dd7615a1a0fdfc66353262d1f
4
- data.tar.gz: 9542dc2befb30ee7baa1aa648d4fb0c60352cda495ba8e0d0bc805d16b779db3
3
+ metadata.gz: 6991a0b1e19c0eae9316352fb86ac012e74b49c89c6d54d287dd35385a5688e0
4
+ data.tar.gz: f609c728e08ffd37ff6dd5915c83e9a79ac68c0f6014ab81c632cb2c40acf598
5
5
  SHA512:
6
- metadata.gz: a9a0f481acf6e65ba7a2962b190b56f504b392cdc2ecbb30f62337014ddc58652f6c3f25a2969570f32fd389e628d74c1a62e19a85bd0b3acd59144e7e509659
7
- data.tar.gz: 910734e17b91a2447f4947aeaad68a1be202ce891b6ef63adaf6752c9fb75197eb842d45f45eb824266234db9eef66d21e044bcedaa08892248c6fa2c147f174
6
+ metadata.gz: 2d898bea843c854caa84a692dc24957fb4b9a53ef42f7b1dabf0b77118e984ddacfd31cad2bb1669781f692e17ef8334543896a4f852f3fa91fd3756d5363733
7
+ data.tar.gz: 9162b55b121e3dc8d826b1473c5b42f3a66f65d3a8e887bbcbee4822b85e76e00beee921242151617cd502686ddabc17f51b9033c99211e1a520076befd045a8
@@ -113,4 +113,4 @@ files = {
113
113
 
114
114
  loc = "$(pwd)/controllers"
115
115
 
116
- makeFiles(files, loc)
116
+ makeFiles(files, loc)
@@ -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)
@@ -213,4 +213,4 @@ files = {
213
213
  "package.json": package
214
214
  }
215
215
 
216
- makeFiles(files, loc)
216
+ makeFiles(files, loc)
@@ -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)
@@ -4,4 +4,4 @@ dirs = [ "styles" ]
4
4
 
5
5
  loc = "$(pwd)/static"
6
6
 
7
- makeDirs(dirs, loc)
7
+ makeDirs(dirs, loc)
@@ -119,4 +119,4 @@ contentFiles = { "pagination.slim": pagination }
119
119
 
120
120
  contentPartialsLoc = "#{dirLoc}/content_partials"
121
121
 
122
- makeFiles(contentFiles, contentPartialsLoc)
122
+ makeFiles(contentFiles, contentPartialsLoc)
@@ -10,4 +10,4 @@ files = {
10
10
 
11
11
  loc = "$(pwd)/welcome"
12
12
 
13
- makeFiles(files, loc)
13
+ makeFiles(files, loc)
@@ -41,4 +41,4 @@ def add_new(name)
41
41
  `mkdir #{cwd}/#{downcasedName}`
42
42
  `echo '#{initialContent}' > #{cwd}/#{downcasedName}/#{downcasedName}.md`
43
43
  `echo '#{contentController}' > #{cwd}/controllers/#{downcasedName}.rb`
44
- end
44
+ end
@@ -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
@@ -12,4 +12,4 @@ def dockerVersionArgIsValid(versionArg)
12
12
  return versionArg != nil &&
13
13
  versionArg != "" &&
14
14
  versionArg.match(/^[0-9]\.[0-9]\.[0-9]$/)
15
- end
15
+ end
@@ -4,4 +4,4 @@ end
4
4
 
5
5
  def makeFiles(files, loc)
6
6
  files.each { |k, v| `touch #{loc}/#{k}; echo '#{v}' > #{loc}/#{k}` }
7
- end
7
+ end
data/bin/lei CHANGED
@@ -102,4 +102,4 @@ class Lei
102
102
  end
103
103
 
104
104
  lei = Lei.new
105
- lei.go
105
+ lei.go
@@ -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
@@ -3,10 +3,10 @@ require "#{$root}/controllers/content"
3
3
  puts "\tController: Test"
4
4
 
5
5
  class TestController < ContentController
6
-
6
+
7
7
  set :content_dir, "#{$root}/test"
8
8
  set :stylesheet, "content"
9
9
  set :public_folder, $assets_root
10
10
  set :views, $views
11
11
 
12
- end
12
+ end
@@ -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
@@ -40,5 +40,5 @@ module GlobalUtils
40
40
 
41
41
  $amp_bind = "<script async custom-element=\"amp-bind\" src=\"https://cdn.ampproject.org/v0/amp-bind-0.1.js\"></script>"
42
42
  end
43
-
44
- end
43
+
44
+ end
@@ -97,4 +97,4 @@ RSpec.configure do |config|
97
97
  # as the one that triggered the failure.
98
98
  Kernel.srand config.seed
99
99
  =end
100
- end
100
+ end
@@ -173,4 +173,4 @@ RSpec.describe "Tests Module: ContentHelpers" do
173
173
  expect(processed).to eq ".mock{display: none;}"
174
174
  end
175
175
 
176
- end
176
+ end
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.9
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: 2018-12-24 00:00:00.000000000 Z
11
+ date: 2019-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler