aro 0.2.4 → 0.2.6

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.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -2
  3. data/Gemfile.lock +126 -50
  4. data/LICENSE +1 -1
  5. data/README.md +1 -1
  6. data/aro.gemspec +10 -11
  7. data/bin/oss_om +15 -0
  8. data/checksums/aro-0.2.4.gem.sha512 +1 -0
  9. data/checksums/aro-0.2.5.gem.sha512 +1 -0
  10. data/checksums/aro-0.2.6.gem.sha512 +1 -0
  11. data/locale/en.cards.yml +19 -21
  12. data/locale/en.cmd.yml +34 -0
  13. data/locale/en.cor.yml +5 -8
  14. data/locale/en.menu_items.yml +2 -0
  15. data/locale/en.menus.yml +2 -0
  16. data/locale/en.usage.yml +24 -45
  17. data/locale/en.yml +61 -49
  18. data/sys/aro/cmd.rb +96 -0
  19. data/sys/{aos → aro}/cor.rb +224 -268
  20. data/sys/aro/d.rb +4 -3
  21. data/sys/aro/db/migrate/.DS_Store +0 -0
  22. data/sys/aro/db/migrate/1793913747_create_data_bases.rb +13 -0
  23. data/sys/aro/db/migrate/1793913777_create_data_base_directories.rb +14 -0
  24. data/sys/aro/db/migrate/1793913796_create_data_base_files.rb +12 -0
  25. data/sys/aro/db/migrate/1793913841_create_menus.rb +11 -0
  26. data/sys/aro/db/migrate/1793913861_create_menu_items.rb +14 -0
  27. data/sys/aro/db.rb +72 -33
  28. data/sys/aro/designer.rb +281 -0
  29. data/sys/aro/locale.rb +136 -0
  30. data/sys/aro/ma_ain.rb +54 -0
  31. data/sys/aro/mancy.rb +53 -28
  32. data/sys/aro/models/concerns/.keep +0 -0
  33. data/sys/aro/models/concerns/uuid.rb +29 -0
  34. data/sys/aro/models/data_base.rb +97 -0
  35. data/sys/aro/models/directory.rb +44 -0
  36. data/sys/aro/models/file.rb +27 -0
  37. data/sys/aro/models/menu.rb +27 -0
  38. data/sys/aro/models/menu_item.rb +47 -0
  39. data/sys/aro/models/teck.rb +40 -31
  40. data/sys/aro/p.rb +6 -3
  41. data/sys/aro/r.rb +1 -2
  42. data/sys/aro/store.rb +147 -0
  43. data/sys/aro/v.rb +2 -2
  44. data/sys/aro/views/base.rb +25 -0
  45. data/sys/aro/views/teck.rb +30 -0
  46. data/sys/aro.rb +1 -2
  47. data/sys/cli/constants.rb +1 -7
  48. data/sys/cli/create.rb +3 -3
  49. data/sys/cli/nterface.rb +8 -8
  50. data/sys/cli/teck.rb +17 -18
  51. data/sys/cli/usage.rb +4 -4
  52. data/sys/cli.rb +0 -1
  53. data/sys/reiquire.rb +146 -25
  54. data/sys/shr/.DS_Store +0 -0
  55. data/sys/shr/prompt.rb +8 -2
  56. data/sys/shr/t.rb +5 -5
  57. data/sys/shr/version.rb +9 -2
  58. data/tasks/make.rake +2 -1
  59. metadata +57 -103
  60. data/bin/aos +0 -31
  61. data/bin/aro +0 -60
  62. data/locale/en.abot.yml +0 -81
  63. data/locale/en.amg.yml +0 -44
  64. data/locale/en.aos.yml +0 -40
  65. data/locale/en.data.yml +0 -30
  66. data/locale/en.dom.yml +0 -46
  67. data/locale/en.flie.yml +0 -29
  68. data/sys/aos/abot.rb +0 -255
  69. data/sys/aos/amg.rb +0 -184
  70. data/sys/aos/aos.rb +0 -665
  71. data/sys/aos/data.rb +0 -117
  72. data/sys/aos/db/migrate/1765148774_create_yous.rb +0 -20
  73. data/sys/aos/db/migrate/1765762724_create_ilibs.rb +0 -22
  74. data/sys/aos/db/migrate/1765907766_create_ilogs.rb +0 -18
  75. data/sys/aos/db/migrate/1765933985_create_agodos.rb +0 -22
  76. data/sys/aos/db/migrate/1766203888_create_fpxies.rb +0 -18
  77. data/sys/aos/db.rb +0 -105
  78. data/sys/aos/flie.rb +0 -144
  79. data/sys/aos/models/agodo.rb +0 -95
  80. data/sys/aos/models/fpxy.rb +0 -26
  81. data/sys/aos/models/ilib.rb +0 -46
  82. data/sys/aos/models/ilog.rb +0 -27
  83. data/sys/aos/models/you.rb +0 -102
  84. data/sys/aos/s.rb +0 -26
  85. data/sys/aos/vws/base.rb +0 -159
  86. data/sys/aos/vws/dom.rb +0 -32
  87. data/sys/aos/vws/games/abot.rb +0 -21
  88. data/sys/aos/vws/games/teck.rb +0 -124
  89. data/sys/aos/vws/games.rb +0 -19
  90. data/sys/aos/vws/home.rb +0 -23
  91. data/sys/aos/vws/know/body.rb +0 -19
  92. data/sys/aos/vws/know/mind.rb +0 -19
  93. data/sys/aos/vws/know/spirit.rb +0 -19
  94. data/sys/aos/vws/know.rb +0 -19
  95. data/sys/aos/vws/root/amg.rb +0 -21
  96. data/sys/aos/vws/root/config.rb +0 -21
  97. data/sys/aos/vws/root/data.rb +0 -21
  98. data/sys/aos/vws/root/flie.rb +0 -21
  99. data/sys/aos/vws/root.rb +0 -19
  100. data/sys/aos/vws/welcome/waite.rb +0 -31
  101. data/sys/aos/vws/welcome/winner.rb +0 -19
  102. data/sys/aos/vws/welcome.rb +0 -66
  103. data/sys/aro/models/base_model.rb +0 -13
  104. data/sys/cli/dom.rb +0 -43
  105. data/sys/dom/d.rb +0 -138
  106. data/sys/dom/dom.rb +0 -210
  107. data/sys/dom/p.rb +0 -17
  108. data/sys/fpx.rb +0 -104
  109. data/sys/shr/ilib/crs/CMakeLists.txt +0 -12
  110. data/sys/shr/ilib/crs/compile.sh +0 -5
  111. data/sys/shr/ilib/crs/crs.c +0 -24
  112. data/sys/shr/ilib/crs/crs.o +0 -0
  113. data/sys/shr/ilib/crs/libcrs.so +0 -0
@@ -1,31 +0,0 @@
1
- =begin
2
-
3
- vws/welcome/waite.rb
4
-
5
- the welcome waite view.
6
-
7
- by i2097i
8
-
9
- =end
10
-
11
- require_relative :"../base".to_s
12
-
13
- module Aos
14
- module Vw
15
- class Waite < Aos::Vw::Base
16
- def self.show
17
- # print all commands
18
- lines = []
19
- lines << ""
20
- lines << I18n.t("aos.constants.commands")
21
- lines << ""
22
- Aos::Os::CMDS.values.each{|v|
23
- lines += lines_for_cmd(v)
24
- }
25
-
26
- # draw output
27
- draw(lines)
28
- end
29
- end
30
- end
31
- end
@@ -1,19 +0,0 @@
1
- =begin
2
-
3
- vws/welcome/winner.rb
4
-
5
- the welcome winner view.
6
-
7
- by i2097i
8
-
9
- =end
10
-
11
- require_relative :"../base".to_s
12
-
13
- module Aos
14
- module Vw
15
- class Winner < Aos::Vw::Base
16
-
17
- end
18
- end
19
- end
@@ -1,66 +0,0 @@
1
- =begin
2
-
3
- vws/welcome.rb
4
-
5
- the welcome view.
6
-
7
- by i2097i
8
-
9
- =end
10
-
11
- require_relative :"./base".to_s
12
-
13
- module Aos
14
- module Vw
15
- class Welcome < Aos::Vw::Base
16
- def self.show
17
- lines = []
18
-
19
- dc = Aos::Cor.discon
20
- width = dc[:WIDTH]
21
-
22
- lines << "welcome to #{Aro::Dom.ethergeist_name}".center(width)
23
- lines << ""
24
- hwidth = width - (Aos::Vw::Base::MARGIN_H * Aro::Mancy::OS)
25
- lines << "".ljust(hwidth, dc[:DIVIDER])
26
- lines << "map".center(hwidth)
27
- lines << "".ljust(hwidth, dc[:DIVIDER])
28
- lines << ""
29
- yous = Aos::You.where(pwd: Aro::Dom.dom_root)
30
- dom_line = "#{Aro::Dom.ethergeist_name}"
31
- dom_line += (yous.any? ? " [#{yous.map{|y| y.name}.join(" ")}]" : "")
32
- lines << dom_line
33
- Aro::Dom::D::LAYOUT.values.each{|wing|
34
- yous = Aos::You.where(pwd: File.join(Aro::Dom.dom_root, wing[:name].to_s))
35
- wing_line = "".ljust(Aro::Mancy::NUMERALS[:IV])
36
- wing_line += wing[:name].to_s
37
- wing_line += (yous.any? ? " [#{yous.map{|y| y.name}.join(" ")}]" : "")
38
- lines << wing_line
39
- wing[:rooms].each{|room|
40
- yous = Aos::You.where(pwd: File.join(Aro::Dom.dom_root, Aro::Dom.room_path(room[:name])))
41
- room_line = "".ljust(Aro::Mancy::NUMERALS[:VIII])
42
- room_line += room[:name].to_s
43
- room_line += (yous.any? ? " [#{yous.map{|y| y.name}.join(" ")}]" : "")
44
- lines << room_line
45
- }
46
- }
47
- lines << ""
48
-
49
- yous = Aos::You.order(access: :desc).all
50
- if yous.empty?
51
- lines << "no yous."
52
- else
53
- lines << "".ljust(hwidth, dc[:DIVIDER])
54
- lines << "roster".center(hwidth)
55
- lines << "".ljust(hwidth, dc[:DIVIDER])
56
- lines << ""
57
- yous.each{|y|
58
- next if y.root? && !Aos::Os.instance.you.root?
59
- lines += y.get_lines.map{|l| l.center(hwidth)}
60
- }
61
- end
62
- draw(lines)
63
- end
64
- end
65
- end
66
- end
@@ -1,13 +0,0 @@
1
- =begin
2
-
3
- aro/base_model.rb
4
-
5
- aro base_model object.
6
-
7
- by i2097i
8
-
9
- =end
10
-
11
- class Aro::BaseModel < ActiveRecord::Base
12
-
13
- end
data/sys/cli/dom.rb DELETED
@@ -1,43 +0,0 @@
1
- =begin
2
-
3
- dom.rb
4
-
5
- process dom commands.
6
-
7
- by i2097i
8
-
9
- =end
10
-
11
- module CLI
12
- def self.dom
13
- if CLI::FLAGS[:HELP].include?(CLI::ARGV1)
14
- CLI.usage_dom
15
- exit(CLI::EXIT_CODES[:SUCCESS])
16
- end
17
-
18
- action = CLI::ARGV1&.to_sym
19
-
20
- CLI::Nterface.exit_error_invalid_usage! unless !action.nil? &&
21
- CLI::CMDS[:DOM].values.include?(action)
22
-
23
- case action
24
- when CLI::CMDS[:DOM][:INIT]
25
- if Aro::Dom.is_initialized?
26
- Aro::P.say(I18n.t("dom.errors.failed_already_initialized"))
27
- elsif Aro::Dom.in_arodom? && !Aro::Dom.is_initialized?
28
- Aro::Dom.instance.generate(ARGV[Aro::Mancy::OS], ARGV[Aro::Mancy::E])
29
- else
30
- CLI::Nterface.exit_error_invalid_usage!
31
- end
32
- when CLI::CMDS[:DOM][:NEW]
33
- CLI::Nterface.exit_error_missing_args!(:var_dom_name) if CLI::ARGV2.nil?
34
- if Aro::Dom.in_arodom?
35
- Aro::P.say(I18n.t("dom.errors.failed_already_in_arodom"))
36
- elsif Aro::Mancy.in_aro?
37
- Aro::P.say(I18n.t("dom.errors.failed_in_aro_space"))
38
- else
39
- Aro::Dom.create(CLI::ARGV2.to_s)
40
- end
41
- end
42
- end
43
- end
data/sys/dom/d.rb DELETED
@@ -1,138 +0,0 @@
1
- =begin
2
-
3
- d.rb
4
-
5
- dom definition.
6
-
7
- by i2097i
8
-
9
- =end
10
-
11
- require_relative :dom.to_s
12
- require_relative :"../shr/prompt".to_s
13
-
14
- module Aro
15
- class Dom::D
16
- include Singleton
17
-
18
- attr_accessor :reserved_words_def
19
-
20
- def self.reserved_words(include_root = false)
21
- if Aro::Dom::D.instance.reserved_words_def.nil?
22
-
23
- reserved = []
24
- Aro::Dom::D::LAYOUT.values.each{|wing|
25
- if wing == Aro::Dom::D::LAYOUT[:ROOT]&& !include_root
26
- next
27
- end
28
-
29
- reserved << wing[:name].to_s
30
- wing[:rooms].each{|room| reserved << room[:name].to_s}
31
- }
32
-
33
- Aro::Dom::D.instance.reserved_words_def = reserved.sort
34
- end
35
-
36
- return Aro::Dom::D.instance.reserved_words_def
37
- end
38
-
39
- # definition of rooms in each layout wing
40
- WINGS = {
41
- WELCOME: {
42
- WAITE: {
43
- # todo: make a wai/wait/wae learning tool for practicing
44
- # command usage in a sandbox.
45
- name: Aro::Dom::WAITE,
46
- description: I18n.t("dom.rooms.waite.description"),
47
- },
48
- WINNER: {
49
- name: Aro::Dom::WINNER,
50
- description: I18n.t("dom.rooms.winner.description"),
51
- },
52
- },
53
- GAMES: {
54
- ABOT: {
55
- name: Aro::Dom::ABOT,
56
- description: I18n.t("dom.rooms.abot.description"),
57
- },
58
- },
59
- HOME: {},
60
- KNOW: {
61
- BODY: {
62
- name: Aro::Dom::BODY,
63
- description: I18n.t("dom.rooms.body.description"),
64
- },
65
- MIND: {
66
- name: Aro::Dom::MIND,
67
- description: I18n.t("dom.rooms.mind.description"),
68
- },
69
- SPIRIT: {
70
- name: Aro::Dom::SPIRIT,
71
- description: I18n.t("dom.rooms.spirit.description"),
72
- },
73
- },
74
- ROOT: {
75
- AMG: {
76
- name: Aro::Dom::AMG,
77
- description: I18n.t("dom.rooms.amg.description"),
78
- },
79
- COR: {
80
- name: Aro::Dom::COR,
81
- description: I18n.t("dom.rooms.config.description"),
82
- },
83
- DATA: {
84
- name: Aro::Dom::DATA,
85
- description: I18n.t("dom.rooms.data.description"),
86
- },
87
- FLIE: {
88
- name: Aro::Dom::FLIE,
89
- description: I18n.t("dom.rooms.flie.description"),
90
- }
91
- },
92
- }
93
-
94
- # overall layout
95
- LAYOUT = {
96
- WELCOME: {
97
- name: Aro::Dom::WELCOME,
98
- description: I18n.t("dom.wings.welcome.description"),
99
- rooms: [
100
- Aro::Dom::D::WINGS[:WELCOME][:WAITE],
101
- Aro::Dom::D::WINGS[:WELCOME][:WINNER],
102
- ]
103
- },
104
- GAMES: {
105
- name: Aro::Dom::GAMES,
106
- description: I18n.t("dom.wings.games.description"),
107
- rooms: [
108
- Aro::Dom::D::WINGS[:GAMES][:ABOT],
109
- ],
110
- },
111
- HOME: {
112
- name: Aro::Dom::HOME,
113
- description: I18n.t("dom.wings.home.description"),
114
- rooms: [],
115
- },
116
- KNOW: {
117
- name: Aro::Dom::KNOW,
118
- description: I18n.t("dom.wings.know.description"),
119
- rooms: [
120
- Aro::Dom::D::WINGS[:KNOW][:BODY],
121
- Aro::Dom::D::WINGS[:KNOW][:MIND],
122
- Aro::Dom::D::WINGS[:KNOW][:SPIRIT],
123
- ],
124
- },
125
- ROOT: {
126
- name: Aro::Dom::ROOT,
127
- description: I18n.t("dom.wings.root.description"),
128
- rooms: [
129
- Aro::Dom::D::WINGS[:ROOT][:AMG],
130
- Aro::Dom::D::WINGS[:ROOT][:COR],
131
- Aro::Dom::D::WINGS[:ROOT][:DATA],
132
- Aro::Dom::D::WINGS[:ROOT][:FLIE],
133
- ],
134
- }
135
- }
136
-
137
- end
138
- end
data/sys/dom/dom.rb DELETED
@@ -1,210 +0,0 @@
1
- =begin
2
-
3
- d.rb
4
-
5
- aro and dom.
6
-
7
- by i2097i
8
-
9
- =end
10
-
11
- module Aro
12
- class Dom
13
- include Singleton
14
-
15
- attr_accessor :eg_path, :is_initializing
16
-
17
- PS1 = :">[#{Aro::Dom.name}]>:"
18
- DOT = :"."
19
- DOTT = :"#{DOT}#{DOT}"
20
- ETHERGEIST = :eg
21
- ETHER_FILE = :".#{Aro::Dom::ETHERGEIST}"
22
-
23
- # < aro space
24
- ARODOME = :arodome
25
-
26
- # < user spaces
27
- WELCOME = :welcome
28
- GAMES = :games
29
- HOME = :home
30
- KNOW = :know
31
- ROOT = :root
32
-
33
- # > welcome spaces
34
- WAITE = :waite
35
- WINNER = :winner
36
-
37
- # > game spaces
38
- ABOT = :abot
39
-
40
- # > know spaces
41
- BODY = :body
42
- MIND = :mind
43
- SPIRIT = :spirit
44
- # ...
45
-
46
- # > root spaces
47
- AMG = :amg
48
- COR = :cor
49
- DATA = :data
50
- FLIE = :flie
51
- # ...
52
-
53
- def initialize
54
- self.is_initializing = false
55
- end
56
-
57
- def self.create(name)
58
- if Dir.exist?(name) || File.exist?(name)
59
- Aro::Dom::P.say(I18n.t("dom.errors.failed_directory_exists", name: name))
60
- return
61
- end
62
-
63
- Aro::Dom::P.say(I18n.t("dom.messages.creating_arodome", name: name))
64
- FileUtils.mkdir(name)
65
- ether_file_path = "#{name}/#{Aro::Dom::ETHER_FILE}"
66
- FileUtils.mkdir(ether_file_path)
67
- File.open(File.join(ether_file_path, Aro::Mancy::NAME_FILE.to_s), "w+") do |file|
68
- file.write(name)
69
- end
70
-
71
- Aro::Dom::P.say(I18n.t("dom.messages.arodome_created", name: name))
72
- end
73
-
74
- def self.in_arodom?
75
- !Aro::Dom.ethergeist_path.nil?
76
- end
77
-
78
- def self.is_initialized?
79
- return false if !Aro::Dom.in_arodom? || self.instance.is_initializing
80
-
81
- File.exist?(
82
- File.join(
83
- Aro::Dom.dom_root,
84
- Aro::Dom.room_path(:data),
85
- Aos::Db::SQL_FILE.to_s
86
- )
87
- )
88
- end
89
-
90
- def self.domain
91
- "#{Aos::Os.instance.you.nil? ? Aro::Dom : Aos::Os.instance.you.name}#{Aos::Os::A}#{Aro::Dom.ethergeist_name}"
92
- end
93
-
94
- def self.dom_root
95
- Aro::Dom.in_arodom? ? File.dirname(Aro::Dom::ethergeist_path) : nil
96
- end
97
-
98
- def self.room_path(needle)
99
- return nil if needle.nil?
100
- needle = needle.to_s.strip
101
- found_space = nil
102
- found_room = nil
103
- Aro::Dom::D::LAYOUT.values.each{|layout|
104
- next unless found_room.nil?
105
- found_space = layout[:name].to_s
106
- if found_space == needle
107
- found_room = found_space
108
- found_space = nil
109
- else
110
- layout[:rooms].each{|room|
111
- if room[:name].to_s == needle
112
- found_room = room[:name].to_s
113
- end
114
- }
115
- end
116
- }
117
- found_space = nil if found_room.nil?
118
- [found_space, found_room].compact.join("/")
119
- end
120
-
121
- def self.ethergeist_path
122
- if self.instance.eg_path.nil?
123
- path = nil
124
- search_path = Dir.pwd.split("/").reject{|p| p.empty?}
125
- search_pwd = "/"
126
- search_path.any?{|step|
127
- search_pwd = File.join(search_pwd, step)
128
- ls = Dir.glob("#{search_pwd}/#{ETHER_FILE}", File::FNM_DOTMATCH)
129
-
130
- path = ls.first if ls.any?
131
- !path.nil?
132
- }
133
-
134
- self.instance.eg_path = path unless path.nil?
135
- end
136
-
137
- return self.instance.eg_path
138
- end
139
-
140
- def self.ethergeist_name
141
- return nil unless Aro::Dom.in_arodom?
142
-
143
- File.read(
144
- File.join(
145
- Aro::Dom.ethergeist_path, Aro::Mancy::NAME_FILE.to_s
146
- )
147
- )
148
- end
149
-
150
- def generate(r_you, r_password)
151
- if r_you.nil? || r_you.empty?
152
- Aro::Dom::P.say(I18n.t("dom.messages.missing_root_username"))
153
- return
154
- end
155
-
156
- if r_password.nil? || r_password.empty?
157
- Aro::Dom::P.say(I18n.t("dom.messages.missing_root_password"))
158
- return
159
- end
160
-
161
- unless Aro::Dom.in_arodom?
162
- Aro::Dom::P.say(I18n.t("dom.errors.failed_already_initialized"))
163
- return
164
- end
165
-
166
- self.is_initializing = true
167
- Aro::Dom::P.say(I18n.t("dom.messages.generating_wings"))
168
- Aro::Dom::D::LAYOUT.values.each{|w| generate_wing w}
169
- # generate a dom aro instance and teck named same as dom
170
- Dir.chdir(Aro::Dom.ethergeist_path) do
171
- Aro::Dom::P.say(I18n.t("dom.messages.generating_dom_aro"))
172
- Aro::Mancy.init
173
- Aro::Teck.select_teck(
174
- Aro::Teck.make(Aro::Dom.ethergeist_name)
175
- )
176
- end
177
- Aos::Db.load(r_password)
178
- Aos::You.create(name: r_you, access: :root)
179
- Aro::Dom::P.say(I18n.t("dom.messages.initialization_complete", name: Aro::Dom.name))
180
- # todo: make this better and make an initial commit
181
- system(:"git init".to_s) if `which git`&.strip&.split("/")&.include?(:git.to_s)
182
-
183
- self.is_initializing = false
184
- end
185
-
186
- def generate_wing(wing)
187
- return unless Aro::Dom::D::LAYOUT.values.include?(wing)
188
- Aro::Dom::P.say(I18n.t("dom.messages.generating_wing", wing: wing[:name].to_s))
189
- FileUtils.mkdir(wing[:name].to_s)
190
-
191
- wing[:rooms].each{|r| generate_room(wing, r)}
192
- end
193
-
194
- def generate_room(wing, room)
195
- return unless Aro::Dom::D::WINGS[wing[:name].upcase].values.include?(room) ||
196
- wing[:name] == Aro::Dom::HOME
197
-
198
- Aro::Dom::P.say(I18n.t("dom.messages.generating_room", room: room[:name].to_s))
199
-
200
- r_path = File.join(wing[:name].to_s, room[:name].to_s)
201
- FileUtils.mkdir(r_path)
202
-
203
- if wing[:name] == Aro::Dom::GAMES
204
- File.open(File.join(r_path, Aro::Mancy::NAME_FILE.to_s), "w") do |f|
205
- f.write(room[:name])
206
- end
207
- end
208
- end
209
- end
210
- end # aroadhome
data/sys/dom/p.rb DELETED
@@ -1,17 +0,0 @@
1
- =begin
2
-
3
- p.rb
4
-
5
- p logger for dom space.
6
-
7
- by i2097i
8
-
9
- =end
10
-
11
- module Aro
12
- class Dom::P < Aro::Prompt
13
- def self.say(message)
14
- super(["#{Aro::Dom::PS1}#{message}"])
15
- end
16
- end
17
- end
data/sys/fpx.rb DELETED
@@ -1,104 +0,0 @@
1
- =begin
2
-
3
- fpx.rb
4
-
5
- aos flie proxy.
6
-
7
- by i2097i
8
-
9
- =end
10
-
11
- require :"rack/cors".to_s
12
- require :sinatra.to_s
13
-
14
- module Aos
15
- module Fpx
16
- class Server < Sinatra::Base
17
- PORT = 7474
18
- HOST = :localhost
19
- # no ssl for now
20
- URL = :"http://#{Aos::Fpx::Server::HOST}:#{Aos::Fpx::Server::PORT}/".to_s
21
- TIMEOUT = Aro::Mancy::NUMERALS[:VI] * Aro::Mancy::NUMERALS[:X]
22
-
23
- def self.log_filepath
24
- File.join(
25
- Aro::Dom.dom_root,
26
- Aro::Dom.room_path(:flie),
27
- "fpx.log"
28
- )
29
- end
30
-
31
- def self.server_pid_file
32
- return "" if Aro::Dom.dom_root.nil? || Aro::Dom.room_path(:flie).nil?
33
- File.join(Aro::Dom.dom_root, Aro::Dom.room_path(:flie), "fpx.pid")
34
- end
35
-
36
-
37
- def self.start
38
- return if File.exist?(Aos::Fpx::Server.server_pid_file)
39
-
40
- serve_pid = fork {Aos::Fpx::Server.run!}
41
- Process.detach(serve_pid)
42
- File.open(Aos::Fpx::Server.server_pid_file, "w") do |f|
43
- f.write(serve_pid)
44
- end
45
- end
46
-
47
- def self.stop
48
- if File.exist?(Aos::Fpx::Server.server_pid_file)
49
- system("kill -9 #{File.read(Aos::Fpx::Server.server_pid_file)}")
50
- FileUtils.rm(Aos::Fpx::Server.server_pid_file)
51
- end
52
- end
53
-
54
- # todo: make this work
55
- # aos fpx -h localhost -p 7474 -t 60 -l root/flie/fpx.log --flie localhost:3000
56
-
57
- set :port, Aos::Fpx::Server::PORT
58
- # set :bind, "0.0.0.0"
59
- set :server_settings, timeout: Aos::Fpx::Server::TIMEOUT
60
-
61
- configure do
62
- enable :logging
63
- file = File.new(Aos::Fpx::Server.log_filepath, "w+")
64
- file.sync = true
65
- use Rack::CommonLogger, file
66
- set :logging, Logger::DEBUG
67
- end
68
-
69
- use Rack::Cors do |config|
70
- config.allow do |allow|
71
- allow.origins Aos::Fpx::Server::HOST.to_s + ":3000"
72
- allow.resource "*"
73
- # allow.resource "/file/list_all/", :headers => :any
74
- # allow.resource "/file/at/*",
75
- # :methods => [:get, :post, :put, :delete],
76
- # :headers => :any,
77
- # :max_age => 0
78
- end
79
- end
80
-
81
- get "/" do
82
- status 200
83
- "".to_json
84
- end
85
-
86
- get "/you/:name" do
87
- Aos::Db.load
88
- you = Aos::You.find_by(name: params[:name])
89
- content_type :json
90
- if you.nil?
91
- status 404
92
- "".to_json
93
- else
94
- status 200
95
- you.fpx.to_json
96
- end
97
- end
98
-
99
- not_found do
100
- redirect "/"
101
- end
102
- end
103
- end
104
- end
@@ -1,12 +0,0 @@
1
- cmake_minimum_required(VERSION 4.2.0)
2
- project(crs)
3
- set(CMAKE_C_STANDARD 99)
4
-
5
- set(BUILD_SHARED_LIBS ON)
6
-
7
- # Game Build
8
- add_library(
9
- crs
10
- crs.c)
11
-
12
-
@@ -1,5 +0,0 @@
1
- #!/bin/sh
2
-
3
- gcc -fPIC -c crs.c -o crs.o
4
- gcc -shared -o libcrs.so crs.o
5
- chmod +x libcrs.so
@@ -1,24 +0,0 @@
1
- #include <stdio.h>
2
-
3
- #if defined(__clang__) || defined(__gcc__)
4
- #define EXPORT __attribute__((visibility("default")))
5
- #define IMPORT
6
- #define INLINE __attribute__((always_inline)) inline
7
- #define NOINLINE __attribute((noinline))
8
- #elif defined(_MSC_VER)
9
- #define EXPORT __declspec(dllexport)
10
- #define IMPORT __declspec(dllimport)
11
- #define INLINE __forceinline
12
- #define _Static_assert static_assert
13
- #else
14
- #define EXPORT __attribute__((visibility("default")))
15
- #define IMPORT
16
- #define INLINE static inline
17
- #define NOINLINE
18
- #endif
19
-
20
- char* CRS_str = "Hello World\n";
21
-
22
- EXPORT char* hello() {
23
- return CRS_str;
24
- }
Binary file
Binary file