khwon / loco Goto Github PK
View Code? Open in Web Editor NEWLOCO bbs system for KAIST
LOCO bbs system for KAIST
Why don't some menus have term.refresh
on process
method?
GoodbyeMenu
PrintBoardMenu
ReadBoardMenu
WelcomeMenu
Also, TermApp
works well without any term.refresh
.
What is Ncurses.erase
and its difference from TermApp::Terminal#erase_all
?
process
of WelcomeMenu
uses erase
process
of GoodbyeMenu
uses erase_all
erase_all
always calls getmaxyx
. Is it for dynamic size of terminal?
지금 나중에 이걸 원격으로 붙였을때의 구조를 생각해보면,
의 형태라 실질적으로 rails c나 거의 마찬가지기때문에 startup 시간이 매우 느릴수 밖에 없는데, (development env에서만 해봤지만 production env라고 딱히 달라질꺼 같진 않음)
이 문제를 해결하려면 결국엔 ruby로 된 서버가 하나 돌아서 미리 rails 관련 필요한 것들을 require해놓은 상태에서 fork로 해결해야함.
근데 단순 tcp 커넥션으로는 안되는게, ncurses를 쓰다보니 pty쪽에 뭔가 문제가 생겨서 이상하게 나오는거 같음.
결국 이상적인 시나리오는
이 될꺼 같은데, 잠깐 찾아보니 pty를 어떻게 alloc하는지에 대한 정보를 찾기가 매우 힘들어서 다같이 의논해보면 좋을거 같음.
In Liquid way, for example, welcome.ncurses
:
{% color colors[0] %}=${% endcolor %} {% color colors[3] %}:ZMMMMMMMMM:{% endcolor %}
{% color colors[0] %}~OMMMMM8.{% endcolor %} {% color colors[2] %}=ZMMMMDI.{% endcolor %} {% color colors[3] %}?MMMMMMMMMMMMM{% endcolor %}
{% color colors[0] %}MMMMMMMMM+{% endcolor %} {% color colors[2] %}?MMMD= =MMMM{% endcolor %} {% color colors[3] %}.DMMMMMMMMMMMMMM{% endcolor %}
{% color colors[0] %},MMMMMMN{% endcolor %} {% color colors[1] %},=,,{% endcolor %} {% color colors[2] %}IMMMM8 $MMMMMMMO{% endcolor %} {% color colors[3] %}MMMMMM$: ..OM~{% endcolor %}
{% color colors[0] %}~MMMMMM{% endcolor %} {% color colors[1] %}:OMMMMMMMMM?{% endcolor %} {% color colors[2] %},MMMMM= MMMMMMMM7{% endcolor %}{% color colors[3] %},MMMO IMM,{% endcolor %}
{% color colors[0] %}NMMMMM{% endcolor %} {% color colors[1] %}?MMMMMMMMMMMMM{% endcolor %} {% color colors[2] %}$MMMMMZ .DMMMMM8=.{% endcolor %}{% color colors[3] %}.MM.. .7MMMMM{% endcolor %}
{% color colors[0] %}:MMMMM~{% endcolor %} {% color colors[1] %}.OMMMMMMMMMMMMMM,{% endcolor %}{% color colors[2] %}OMMMMMM .{% endcolor %} {% color colors[3] %}MMMMMMMMMMMMMMM7{% endcolor %}
{% color colors[0] %}MMMMM,{% endcolor %} {% color colors[1] %}NMMMMM$: . +M+{% endcolor %}{% color colors[2] %}~MMMMMM: O7{% endcolor %} {% color colors[3] %}.OMMMMMMMMMMMM~{% endcolor %}
{% color colors[0] %}IMMMM~{% endcolor %} {% color colors[1] %}.MMM8. ?MM={% endcolor %}{% color colors[2] %}.MMMMMMM7 .ZMM,{% endcolor %} {% color colors[3] %}.$MMMMMMMM7{% endcolor %}
{% color colors[0] %}=MMMM:{% endcolor %} {% color colors[1] %}MM:. ,$MMMMM.{% endcolor %} {% color colors[2] %}?MMMMMMMMMMMMM.{% endcolor %} {% color colors[3] %}.{% endcolor %}
{% color colors[0] %}.MMMM.{% endcolor %} {% color colors[1] %}DMMMMMMMMMMMMMMO{% endcolor %} {% color colors[2] %}MMMMMMMMMM+.{% endcolor %}
{% color colors[0] %}:MMMNID.{% endcolor %} {% color colors[1] %}.IMMMMMMMMMMMM?.{% endcolor %} {% color colors[2] %},.~ ..{% endcolor %} {% color white %}managed by GoN security{% endcolor %}
{% color colors[0] %},MMMMMM${% endcolor %} {% color colors[1] %}+MMMMMMMMI.{% endcolor %} {% color white %}since 1999{% endcolor %}
{% color colors[0] %}.MMMMZI$.{% endcolor %} {% color colors[1] %}. .{% endcolor %}
{% color colors[0] %}=+.{% endcolor %}
type 'new' to join
there is no guest ID
┌──────────────────────────────┐
total hit: 14520652 │ ID : │
today hit: 229 │ PW : │
│ {% if failed %}Login failed!{% else %} {% end %} │
└──────────────────────────────┘
and termapp/color_block.rb
:
require 'liquid'
class ColorBlock < Liquid::Block
# tag_name: "color"
# markup: "colors[0] ", "colors[1] ", etc.
def initialize(tag_name, markup, tokens)
super
end
def render(context)
super # returns "=$", ":ZMMMMMMMMM:", etc.
end
end
Liquid::Template.register_tag('color', ColorBlock)
But we can't get x
, y
for each render
, which is the main problem. Also it is too verbose because of color
blocks.
Is there any possible solutions? I think current implementation is better than making new template engine.
https://getsentry.com/welcome/
gem "sentry-raven", :git => "https://github.com/getsentry/raven-ruby.git"
integration test
Possible scenarios:
termapp/lib
: Put termapp/termapp.rb
and require every files in it. Move every files under termapp/
into termapp/lib/termapp/
. Every files under termapp/lib/termapp/
should extend module TermApp
.
+- termapp/
+- lib/
+- termapp/
+- core_ext/
+- string.rb
+- board.rb
+- goodbye.rb
+- locoterm.rb
+- menu.rb
+- sample.rb
+- user.rb
+- welcome.rb
+- termapp.rb (Previous run.rb?)
termapp.rb
: Put termapp.rb
and require every files in it. Every files under termapp/
extends module TermApp
.
+- termapp/
+- core_ext/
+- string.rb
+- board.rb
+- goodbye.rb
+- locoterm.rb
+- menu.rb
+- sample.rb
+- user.rb
+- welcome.rb
+- termapp.rb (Previous run.rb?)
Also
TermApp
?Comments please for another scenarios and discussions.
틀린 로그인 여러번 시도시 연결 차단 되는 기능 미구현
For now, we use J
as $
, but J
and K
are used for navigating highlighted posts.
make sure our app is cp949 compatible
Terminal
for marking encodingLoading rails env costs lot of time in startup.
Require only models
directory and creating termapp group in Gemfile will solve this.
Should it be inside of bin/
directory? Also renaming and rewriting code is needed. term
would be the name.
For example, bin/term
:
#!/usr/bin/env ruby
require_relative '../config/environment'
require_relative '../termapp/application'
require_relative '../termapp/processor'
Dir[File.expand_path(
'../../termapp/processors/*.rb', __FILE__)].each { |f| require f }
begin
TermApp.run
rescue
binding.pry_remote
end
We can move lines requiring termapp/processor
and termapp/processors
to termapp/application
.
DEPRECATION WARNING: The configuration option config.serve_static_assets
has been renamed to config.serve_static_files
to clarify its role (it merely enables serving everything in the public
folder and is unrelated to the asset pipeline). The serve_static_assets
alias will be removed in Rails 5.0. Please migrate your configuration files accordingly. (called from block in <top (required)> at /home/bbs/loco/config/environments/bbs.rb:23)
Of course it's not some must-have feature, but it'll be good to have one.
Can we use i18n features in rails? If so, how?
Or, what are other options?
According to the description section of TomDoc,
Public: Indicates that the method is part of the project's public API. This annotation is designed to let developers know which methods are considered stable. You SHOULD use this to document the public API of your project. This information can then be used along with Semantic Versioning to inform decisions on when major, minor, and patch versions should be incremented.
# Public: Initialize a new Widget.
Internal: Indicates that the method is part of the project's internal API. These are methods that are intended to be called from other classes within the project but not intended for public consumption. For example:
# Internal: Normalize the filename.
Deprecated: Indicates that the method is deprecated and will be removed in a future version. You SHOULD use this to document methods that were Public but will be removed at the next major version.
# Deprecated: Resize an object to the given dimensions.
I think many of documented classes and methods are should be changed to Internal
. Is there any class or method to be considered as Public
? I think we don't have any public API because TermApp
is not a library.
TermApp::View
TermApp::View
TermApp::Application
process
method for displaying in main loop.process
method can have arguments. Possibly block in later?process
method have to return next menu's symbol, and arguments for its process
methodTermApp::Terminal
LocoTerm
class.kanghee@kanghees-rMBP:~/Dropbox/work/loco$ rake spec
/Users/kanghee/.rvm/rubies/ruby-2.1.0/bin/ruby -I/Users/kanghee/.rvm/gems/ruby-2.1.0/gems/rspec-core-3.0.3/lib:/Users/kanghee/.rvm/gems/ruby-2.1.0/gems/rspec-support-3.0.3/lib -S /Users/kanghee/.rvm/gems/ruby-2.1.0/gems/rspec-core-3.0.3/exe/rspec ./spec/models/board_spec.rb ./spec/models/post_spec.rb ./spec/models/user_spec.rb ./spec/termapp/core_ext/string_spec.rb ./spec/termapp/locoterm_spec.rb
/Users/kanghee/.rvm/gems/ruby-2.1.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in `require': cannot load such file -- locoterm (LoadError)
from /Users/kanghee/.rvm/gems/ruby-2.1.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in `block in require'
from /Users/kanghee/.rvm/gems/ruby-2.1.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/kanghee/.rvm/gems/ruby-2.1.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in `require'
from /Users/kanghee/Dropbox/work/loco/spec/termapp/core_ext/string_spec.rb:3:in `<top (required)>'
from /Users/kanghee/.rvm/gems/ruby-2.1.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241:in `load'
from /Users/kanghee/.rvm/gems/ruby-2.1.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241:in `block in load'
from /Users/kanghee/.rvm/gems/ruby-2.1.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/kanghee/.rvm/gems/ruby-2.1.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241:in `load'
from /Users/kanghee/.rvm/gems/ruby-2.1.0/gems/rspec-core-3.0.3/lib/rspec/core/configuration.rb:1057:in `block in load_spec_files'
from /Users/kanghee/.rvm/gems/ruby-2.1.0/gems/rspec-core-3.0.3/lib/rspec/core/configuration.rb:1057:in `each'
from /Users/kanghee/.rvm/gems/ruby-2.1.0/gems/rspec-core-3.0.3/lib/rspec/core/configuration.rb:1057:in `load_spec_files'
from /Users/kanghee/.rvm/gems/ruby-2.1.0/gems/rspec-core-3.0.3/lib/rspec/core/runner.rb:97:in `setup'
from /Users/kanghee/.rvm/gems/ruby-2.1.0/gems/rspec-core-3.0.3/lib/rspec/core/runner.rb:85:in `run'
from /Users/kanghee/.rvm/gems/ruby-2.1.0/gems/rspec-core-3.0.3/lib/rspec/core/runner.rb:70:in `run'
from /Users/kanghee/.rvm/gems/ruby-2.1.0/gems/rspec-core-3.0.3/lib/rspec/core/runner.rb:38:in `invoke'
from /Users/kanghee/.rvm/gems/ruby-2.1.0/gems/rspec-core-3.0.3/exe/rspec:4:in `<main>'
/Users/kanghee/.rvm/rubies/ruby-2.1.0/bin/ruby -I/Users/kanghee/.rvm/gems/ruby-2.1.0/gems/rspec-core-3.0.3/lib:/Users/kanghee/.rvm/gems/ruby-2.1.0/gems/rspec-support-3.0.3/lib -S /Users/kanghee/.rvm/gems/ruby-2.1.0/gems/rspec-core-3.0.3/exe/rspec ./spec/models/board_spec.rb ./spec/models/post_spec.rb ./spec/models/user_spec.rb ./spec/termapp/core_ext/string_spec.rb ./spec/termapp/locoterm_spec.rb failed
In termapp
directory, there are some TODO
and FIXME
comments but rake notes
won't detect them. Is there any way to add termapp
to the list of checking directories of rake notes
?
Is there any reason to keep master
branch with only 7 commits? I think current develop
branch is not experimental or adding extra features to master—it's actual master
. Why don't we use git tag
for release which is what current master
exists for?
ncursesw breaks on xinetd. have to figure out why & fix it
Should be implemented before #141.
We're using TomDoc now, but https://rubygems.org provides documentation link as http://rubydoc.info which parses YARD. Also there is an article What's Missing from TomDoc and many of them seem to be still missing though the article is written right after the publication of initial spec of TomDoc.
Should we change the standard documentation tool to YARD, or is it okay to document with TomDoc?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.