Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
ffbs-gluon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ffbs
ffbs-gluon
Commits
e665bfe6
Unverified
Commit
e665bfe6
authored
8 years ago
by
Matthias Schiffer
Browse files
Options
Downloads
Patches
Plain Diff
gluon-core: don't depend on luci.ltn12
parent
c83b5b3c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
package/gluon-core/luasrc/usr/lib/lua/gluon/site_config.lua
+15
-13
15 additions, 13 deletions
package/gluon-core/luasrc/usr/lib/lua/gluon/site_config.lua
with
15 additions
and
13 deletions
package/gluon-core/luasrc/usr/lib/lua/gluon/site_config.lua
+
15
−
13
View file @
e665bfe6
local
function
get_site_config
()
local
config
=
'/lib/gluon/site.json'
local
config
=
'/lib/gluon/site.json'
local
json
=
require
'luci.jsonc'
local
ltn12
=
require
'luci.ltn12'
local
json
=
require
'luci.jsonc'
local
decoder
=
json
.
new
()
local
sink
=
decoder
:
sink
()
local
file
=
assert
(
io.open
(
config
))
local
file
=
assert
(
io.open
(
config
))
local
decoder
=
json
.
new
()
ltn12
.
pump
.
all
(
ltn12
.
source
.
file
(
file
),
decoder
:
sink
())
while
true
do
local
chunk
=
file
:
read
(
2048
)
if
not
chunk
or
chunk
:
len
()
==
0
then
break
end
sink
(
chunk
)
end
file
:
close
()
file
:
close
()
return
assert
(
decoder
:
get
())
return
assert
(
decoder
:
get
())
end
local
setmetatable
=
setmetatable
module
'gluon.site_config'
setmetatable
(
_M
,
{
__index
=
get_site_config
(),
}
)
setmetatable
(
_M
,
{
__index
=
get_site_config
(),
})
return
_M
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment