dyndoc-ruby 1.4.7 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bbb6fee9fd8763baddb05232c91681f83da007607e61c827b1df68023da59c17
4
- data.tar.gz: 2df0d8e67b5393d1904b78f5565d01b4ae0ff6ec0ba894fdbc3d2e76eea6e482
3
+ metadata.gz: 9d8ce386759e518972d74c5e1ef3d3bef3290921554d47ac1fa8f5eb973b655d
4
+ data.tar.gz: b17c0d4239a7bbb4bdf0b0217d2f6dac284115f3ef262e222186cd90d608a6b2
5
5
  SHA512:
6
- metadata.gz: 49c984dc6000558a481084c4656626fe812cb25af73c9aa72d5344cbc883ea3483d5fc8b4e2d2254315bf042aeaf91181c6d7dc51a547be3e49fca0bc13b6bdc
7
- data.tar.gz: 5b6b70d9673737187d929a65a4cf2e4f6ae616d001bc019025cd15721474a07928af944dfd8a4893b6dfedf928e5d3882aa651ba5716f2d92dfba06c815c58cc
6
+ metadata.gz: 41d009a240f7913babe5ef0691a8e29ee3b1142e0d8e9a4a20c836dac81394a1ea1382b2aa83e449b66945e70b2e21064db4385adac782f2e69ba08e8d35a3f7
7
+ data.tar.gz: d694f257cfb7ea2cd0359834d28f6e1d155668d264be09882e2eb11f578e3f45587bb9453225cdb7ddd93c2f9cdfc1448e2bc848b2139d4bcae1fea13b66c5d5
data/bin/dyn CHANGED
@@ -102,7 +102,7 @@ if doc=~ /^dyn\:\/\/([^\/]*)\/(.*)(?:\.dyn)?$/
102
102
  room_id,dyn_file=$1,$2
103
103
 
104
104
  room_sync=File.join(ENV["HOME"],"dyndoc","etc",".room_sync")
105
- if File.exists? room_sync
105
+ if File.exist? room_sync
106
106
  room_dirs=eval(File.read(room_sync))
107
107
  room_dir=room_dirs[room_id]
108
108
  if room_dir
@@ -112,7 +112,7 @@ if doc=~ /^dyn\:\/\/([^\/]*)\/(.*)(?:\.dyn)?$/
112
112
  ## Copy files first
113
113
  [".dyn",".dyn_lib"].each do |ext|
114
114
  file=dyn_base+ext
115
- if File.exists? (file_to_copy=File.join(dyn_dir,file))
115
+ if File.exist? (file_to_copy=File.join(dyn_dir,file))
116
116
  require 'fileutils'
117
117
  FileUtils.cp file_to_copy,File.join(room_dir[:local],file)
118
118
  end
data/bin/dyn-auto CHANGED
@@ -7,7 +7,7 @@ full_dyn_file=File.expand_path(File.join(Dir.pwd,dyn_file))
7
7
  full_dyn_file + '.dyn' unless full_dyn_file =~ /.*\.dyn$/
8
8
 
9
9
 
10
- if File.exists? full_dyn_file
10
+ if File.exist? full_dyn_file
11
11
  Dyndoc.auto_convert_from_file(full_dyn_file)
12
12
  else
13
13
  puts "Error: #{full_dyn_file} does not exists"
data/bin/dyn-cli CHANGED
@@ -98,7 +98,7 @@ if dyn_layout and !File.exist? dyn_layout
98
98
  dyn_layout_path = ""
99
99
  dyn_layout_path << File.read(etc_dyn_cli_layout_path).strip if File.exist?(etc_dyn_cli_layout_path=File.join(ENV["HOME"],"dyndoc","etc","dyn_cli_layout_path"))
100
100
  dyn_layout_path << (dyn_layout_path.empty? ? "" : ";") << File.join(ENV["HOME"],"dyndoc","etc","dyn-cli","layout")
101
- dyn_layouts=dyn_layout_path.split(";").map{|p| (File.exists? (tmp=File.join(p,dyn_layout+".dyn"))) ? tmp : nil }.compact
101
+ dyn_layouts=dyn_layout_path.split(";").map{|p| (File.exist? (tmp=File.join(p,dyn_layout+".dyn"))) ? tmp : nil }.compact
102
102
  dyn_layout=dyn_layouts[0] #can be nil!
103
103
  end
104
104
 
data/bin/dyn-ctl CHANGED
@@ -18,7 +18,7 @@ end
18
18
  case (ARGV[0] || "start").downcase
19
19
  when "init"
20
20
  rodasrv=File.expand_path("~/RodaSrv")
21
- unless Dir.exists? rodasrv
21
+ unless Dir.exist? rodasrv
22
22
  FileUtils.mkdir_p rodasrv
23
23
  FileUtils.mkdir File.join(rodasrv,"edit")
24
24
  FileUtils.mkdir File.join(rodasrv,"public")
@@ -36,10 +36,10 @@ when "init"
36
36
  user=ARGV[1]
37
37
 
38
38
  if user
39
- FileUtils.mkdir_p File.join(rodasrv,"edit",user) unless Dir.exists? File.join(rodasrv,"edit",user)
40
- FileUtils.mkdir_p File.join(rodasrv,"public","users",user) unless Dir.exists? File.join(rodasrv,"public","users",user)
39
+ FileUtils.mkdir_p File.join(rodasrv,"edit",user) unless Dir.exist? File.join(rodasrv,"edit",user)
40
+ FileUtils.mkdir_p File.join(rodasrv,"public","users",user) unless Dir.exist? File.join(rodasrv,"public","users",user)
41
41
  ["dynlib","preload","tools"].each do |dir|
42
- FileUtils.mkdir_p File.join(rodasrv,"public","users",user,dir) unless Dir.exists? File.join(rodasrv,"public","users",user,dir)
42
+ FileUtils.mkdir_p File.join(rodasrv,"public","users",user,dir) unless Dir.exist? File.join(rodasrv,"public","users",user,dir)
43
43
  end
44
44
  end
45
45
 
@@ -99,7 +99,7 @@ when "status"
99
99
  DYNCTL_OUT_FILE = File.join(ENV["HOME"],"dyndoc","log","")+CMD+".out"
100
100
  FileUtils.mkdir_p File.join(ENV["HOME"],"dyndoc",'log')
101
101
 
102
- unless File.exists? DYNCTL_PLIST
102
+ unless File.exist? DYNCTL_PLIST
103
103
  plist= <<-END.sub(/CMD/,CMD).sub(/DYN_CMD/,`which #{CMD}`.strip).sub(/ERR_FILE/,DYNCTL_ERR_FILE).sub(/OUT_FILE/,DYNCTL_OUT_FILE).sub(/DYN_PATH/,ENV["PATH"]).sub(/DYN_LANG/,ENV["LANG"]).sub(/DYN_JULIA_DIR/,ENV["JULIA_DIR"] || "").sub(/DYN_JULIA_RUBYLIB_PATH/,ENV["JULIA_RUBYLIB_PATH"])
104
104
  <?xml version="1.0" encoding="UTF-8"?>
105
105
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
@@ -142,12 +142,12 @@ when "status"
142
142
  end
143
143
 
144
144
  when "load"
145
- `launchctl load #{DYNCTL_PLIST}` if RUBY_PLATFORM =~ /darwin/ and File.exists? DYNCTL_PLIST
145
+ `launchctl load #{DYNCTL_PLIST}` if RUBY_PLATFORM =~ /darwin/ and File.exist? DYNCTL_PLIST
146
146
 
147
147
  when "unload"
148
- `launchctl unload #{DYNCTL_PLIST}` if RUBY_PLATFORM =~ /darwin/ and File.exists? DYNCTL_PLIST
148
+ `launchctl unload #{DYNCTL_PLIST}` if RUBY_PLATFORM =~ /darwin/ and File.exist? DYNCTL_PLIST
149
149
  when "delete"
150
- if RUBY_PLATFORM =~ /darwin/ and File.exists? DYNCTL_PLIST
150
+ if RUBY_PLATFORM =~ /darwin/ and File.exist? DYNCTL_PLIST
151
151
  `launchctl unload #{DYNCTL_PLIST}`
152
152
  FileUtils.rm DYNCTL_PLIST
153
153
  end
data/bin/dyn-init CHANGED
@@ -65,7 +65,7 @@ when "sync" ## MAYBE OBSOLETE!
65
65
  require 'fileutils'
66
66
  FileUtils.mkdir_p (etc=File.join(ENV["HOME"],"dyndoc","etc"))
67
67
  room_sync=File.join(etc,".room_sync")
68
- room_dirs=(File.exists? room_sync) ? eval(File.read(room_sync)) : {}
68
+ room_dirs=(File.exist? room_sync) ? eval(File.read(room_sync)) : {}
69
69
  if ARGV[1] =~ /([^\:@]*)\:([^\:@]*)@([^\:@]*)/
70
70
  room_id,room_local,room_remote=$1,$2,$3
71
71
  room_dirs[room_id]={local: room_local, remote: room_remote}
data/bin/dyn-x CHANGED
@@ -97,7 +97,7 @@ if dyn_layout and !File.exist? dyn_layout
97
97
  dyn_layout_path = ""
98
98
  dyn_layout_path << File.read(etc_dyn_cli_layout_path).strip if File.exist?(etc_dyn_cli_layout_path=File.join(ENV["HOME"],"dyndoc","etc","dyn_cli_layout_path"))
99
99
  dyn_layout_path << (dyn_layout_path.empty? ? "" : ";") << File.join(ENV["HOME"],"dyndoc","etc","dyn-cli","layout")
100
- dyn_layouts=dyn_layout_path.split(";").map{|p| (File.exists? (tmp=File.join(p,dyn_layout+".dyn"))) ? tmp : nil }.compact
100
+ dyn_layouts=dyn_layout_path.split(";").map{|p| (File.exist? (tmp=File.join(p,dyn_layout+".dyn"))) ? tmp : nil }.compact
101
101
  dyn_layout=dyn_layouts[0] #can be nil!
102
102
  end
103
103
 
data/bin/dyn-yml CHANGED
@@ -156,15 +156,15 @@ DyndocTasks.dyn_yml doc
156
156
  # puts dyntaskname
157
157
  # dyntaskname += "_task.dyn" unless dyntaskname=~/_task.dyn$/
158
158
  # dyntaskpath=dyntaskname
159
- # is_dyntask=File.exists? dyntaskpath
159
+ # is_dyntask=File.exist? dyntaskpath
160
160
  # unless is_dyntask
161
161
  # dyntaskpath=File.join(ENV["HOME"],"dyndoc","tasks",dyntaskname)
162
- # is_dyntask=File.exists? dyntaskpath
162
+ # is_dyntask=File.exist? dyntaskpath
163
163
  # end
164
164
  # unless is_dyntask
165
165
  # share_path=File.expand_path("../../share", __FILE__)
166
166
  # dyntaskpath=File.join(share_path,"dyntasks",dyntaskname)
167
- # is_dyntask=File.exists? dyntaskpath
167
+ # is_dyntask=File.exist? dyntaskpath
168
168
  # end
169
169
  # if is_dyntask
170
170
  # dynfile=docname+".dyn"
@@ -115,7 +115,7 @@ module Dyndoc
115
115
  ## NEEDS TO DECLARE the fields that behave like this in some other config file (keys.yml)
116
116
 
117
117
  cfg_yml_files=dyn_path.inject([""]) {|res,e| res + [(res[-1,1]+[e]).flatten]}.map{|pa| File.join(opts[:dyn_root],pa,"config.yml")}.reverse
118
- cfg_yml_file=cfg_yml_files.select{|c| File.exists? c}[0]
118
+ cfg_yml_file=cfg_yml_files.select{|c| File.exist? c}[0]
119
119
  cfg=YAML::load_file(cfg_yml_file) if cfg_yml_file
120
120
 
121
121
  ## add info related to dyn file
@@ -167,8 +167,8 @@ module Dyndoc
167
167
  if cfg["layout"][0] == "~"
168
168
  user,*pa=cfg["layout"][1..-1].split("/")
169
169
  cfg_tmp=File.join(sys_root,"public","users",user,"layout",pa)+".dyn"
170
- cfg_tmp=File.join(sys_root,"public","users",user,pa[0...-1],"layout",pa[-1])+".dyn" unless File.exists? cfg_tmp
171
- cfg_tmp=File.join(sys_root,"public","users",user,pa) unless File.exists? cfg_tmp
170
+ cfg_tmp=File.join(sys_root,"public","users",user,pa[0...-1],"layout",pa[-1])+".dyn" unless File.exist? cfg_tmp
171
+ cfg_tmp=File.join(sys_root,"public","users",user,pa) unless File.exist? cfg_tmp
172
172
  else
173
173
  cfg_tmp=File.join(sys_root,"system","layout",cfg["layout"]+".dyn")
174
174
  end
@@ -271,7 +271,7 @@ module Dyndoc
271
271
  code_path << "\n" << sys_root
272
272
  code_path << "\n" << File.join(opts[:dyn_root],'dynlib')
273
273
  code_path << "\n" << opts[:dyn_root] << "\n"
274
- code_path << "\n" << "[#require]RodaSrvCore" << "\n" #if File.exists? File.join(sys_root,'system','dynlib',"RodaSrvCore.dyn","index.dyn")
274
+ code_path << "\n" << "[#require]RodaSrvCore" << "\n" #if File.exist? File.join(sys_root,'system','dynlib',"RodaSrvCore.dyn","index.dyn")
275
275
  code_path << "[#main][#<]\n"
276
276
  code = code_path + code
277
277
 
@@ -354,7 +354,7 @@ module Dyndoc
354
354
  ## NEEDS TO DECLARE the fields that behave like this in some other config file (keys.yml)
355
355
 
356
356
  cfg_yml_files=dyn_path.inject([""]) {|res,e| res + [(res[-1,1]+[e]).flatten]}.map{|pa| File.join("",pa,"config.yml")}.reverse
357
- cfg_yml_file=cfg_yml_files.select{|c| File.exists? c}[0]
357
+ cfg_yml_file=cfg_yml_files.select{|c| File.exist? c}[0]
358
358
  cfg=YAML::load_file(cfg_yml_file) if cfg_yml_file
359
359
 
360
360
  ## add info related to dyn file
@@ -464,10 +464,10 @@ module Dyndoc
464
464
 
465
465
  ## if a previous directory get .dyn_root file
466
466
  dyn_paths=nil
467
- dyn_paths_cfg=cfg[:dyn_dirname].split("/")[1..-1].inject([""]) {|res,e| res + [(res[-1,1]+[e]).flatten]}.map{|pa| File.join("",pa,".dyn_paths")}.reverse[0..-3].select{|f| File.exists? f}[0]
467
+ dyn_paths_cfg=cfg[:dyn_dirname].split("/")[1..-1].inject([""]) {|res,e| res + [(res[-1,1]+[e]).flatten]}.map{|pa| File.join("",pa,".dyn_paths")}.reverse[0..-3].select{|f| File.exist? f}[0]
468
468
  if dyn_paths_cfg
469
469
  dyn_paths=File.read(dyn_paths_cfg).strip.gsub(/\.\//,File.dirname(dyn_paths_cfg)+"/")
470
- dyn_paths=dyn_paths.split(":").map{|e| File.expand_path(e.strip)}.select{|d| Dir.exists? d}
470
+ dyn_paths=dyn_paths.split(":").map{|e| File.expand_path(e.strip)}.select{|d| Dir.exist? d}
471
471
  dyn_paths=dyn_paths.empty? ? nil : dyn_paths.join("\n")
472
472
  end
473
473
  ## add path for user
@@ -20,8 +20,8 @@ module Dyndoc
20
20
  def Browser.set(browser)
21
21
  Browser.cfg["browser"]=browser
22
22
  Browser.save_cfg
23
- FileUtils.rm(@@browser_load_osa) if File.exists? @@browser_load_osa
24
- FileUtils.rm(@@browser_reload_osa) if File.exists? @@browser_reload_osa
23
+ FileUtils.rm(@@browser_load_osa) if File.exist? @@browser_load_osa
24
+ FileUtils.rm(@@browser_reload_osa) if File.exist? @@browser_reload_osa
25
25
  Browser.set_browser_reload
26
26
  puts "Current browser is set to "+Browser.get+"!"
27
27
  end
@@ -137,9 +137,9 @@ module Dyndoc
137
137
 
138
138
  def Browser.reload
139
139
  if RUBY_PLATFORM =~ /darwin/
140
- Browser.set_browser_reload unless File.exists? @@browser_reload_osa
140
+ Browser.set_browser_reload unless File.exist? @@browser_reload_osa
141
141
  `osascript #{@@browser_reload_osa}`
142
- elsif RUBY_PLATFORM =~ /linux/ and File.exists? "/usr/bin/xdotool"
142
+ elsif RUBY_PLATFORM =~ /linux/ and File.exist? "/usr/bin/xdotool"
143
143
  `export DISPLAY=':0.0';/usr/bin/xdotool search --sync --onlyvisible #{Browser.name} key F5 windowactivate`
144
144
  end
145
145
  end
@@ -230,9 +230,9 @@ module Dyndoc
230
230
  def HtmlServers.dyn_http_server(host=nil,port=nil)
231
231
  require 'thin'
232
232
  dyn_html_srv_ru=File.join(ENV["HOME"],"RodaSrv","public","users",".dyn-html","srv.ru")
233
- dyn_html_srv_ru="/home/ubuntu/tools/dyn-html/srv.ru" unless File.exists? dyn_html_srv_ru # DyndocDockerSite guest-tools folder
234
- dyn_html_srv_ru=File.join(ENV["HOME"],"dyndoc","html-srv","dyn.ru") unless File.exists? dyn_html_srv_ru
235
- dyn_html_srv_ru=File.expand_path("../../share/html-srv/dyn-html-srv.ru",__FILE__) unless File.exists? dyn_html_srv_ru
233
+ dyn_html_srv_ru="/home/ubuntu/tools/dyn-html/srv.ru" unless File.exist? dyn_html_srv_ru # DyndocDockerSite guest-tools folder
234
+ dyn_html_srv_ru=File.join(ENV["HOME"],"dyndoc","html-srv","dyn.ru") unless File.exist? dyn_html_srv_ru
235
+ dyn_html_srv_ru=File.expand_path("../../share/html-srv/dyn-html-srv.ru",__FILE__) unless File.exist? dyn_html_srv_ru
236
236
 
237
237
  arg=["-R",dyn_html_srv_ru]
238
238
  if HtmlServers.cfg["html-srv-port"]
@@ -259,7 +259,7 @@ module Dyndoc
259
259
  end
260
260
  if html_file =~ /^(.*)_erb\.html$/
261
261
  erb_page=File.join(pages_root,$1)
262
- if File.exists? erb_page+"_erb.html"
262
+ if File.exist? erb_page+"_erb.html"
263
263
  FileUtils.mv erb_page+"_erb.html",erb_page+".erb"
264
264
  end
265
265
  html_file = "erb"+$1
data/lib/dyndoc-tasks.rb CHANGED
@@ -82,19 +82,19 @@ def DyndocTasks.dyn_yml(doc)
82
82
  ##DEBUG: p [:cfg_yml,cfg_yml]
83
83
  dyntaskname += "_task.dyn" unless dyntaskname=~/_task.dyn$/
84
84
  dyntaskpath=dyntaskname
85
- is_dyntask=File.exists? dyntaskpath
85
+ is_dyntask=File.exist? dyntaskpath
86
86
  unless is_dyntask
87
87
  dyntaskpath=File.join(ENV["HOME"],".dyndoc-world","tasks",dyntaskname)
88
- is_dyntask=File.exists? dyntaskpath
88
+ is_dyntask=File.exist? dyntaskpath
89
89
  end
90
90
  unless is_dyntask
91
91
  dyntaskpath=File.join(ENV["HOME"],"dyndoc","tasks",dyntaskname)
92
- is_dyntask=File.exists? dyntaskpath
92
+ is_dyntask=File.exist? dyntaskpath
93
93
  end
94
94
  unless is_dyntask
95
95
  share_path=File.expand_path("../../share", __FILE__)
96
96
  dyntaskpath=File.join(share_path,"dyntasks",dyntaskname)
97
- is_dyntask=File.exists? dyntaskpath
97
+ is_dyntask=File.exist? dyntaskpath
98
98
  end
99
99
  if is_dyntask
100
100
  dynfile=docname+".dyn"
data/lib/dyndoc-world.rb CHANGED
@@ -18,7 +18,7 @@ module DyndocWorld
18
18
  def DyndocWorld.cfg(admin=nil)
19
19
  cfg={}
20
20
  secret = File.join(DyndocWorld.root,admin ? ".admin.yml" : ".secret.yml")
21
- cfg = YAML::load_file(secret) if DyndocWorld.root and File.exists? secret
21
+ cfg = YAML::load_file(secret) if DyndocWorld.root and File.exist? secret
22
22
  return cfg
23
23
  end
24
24
 
@@ -44,10 +44,10 @@ module DyndocWorld
44
44
  case root
45
45
  when "public"
46
46
  prj_file=File.join(DyndocWorld.public_root,"users",user)
47
- prj_file=(Dir.exists? prj_file) ? File.join(prj_file,prj_subdir,parts) : ""
47
+ prj_file=(Dir.exist? prj_file) ? File.join(prj_file,prj_subdir,parts) : ""
48
48
  when "edit"
49
49
  prj_file=File.join(DyndocWorld.public_root,"users",user,".edit")
50
- prj_file=(Dir.exists? prj_file) ? File.join(prj_file,prj_subdir,parts) : ""
50
+ prj_file=(Dir.exist? prj_file) ? File.join(prj_file,prj_subdir,parts) : ""
51
51
  when "dynworld"
52
52
  prj_file=File.join(DyndocWorld.root,user,prj_subdir,parts)
53
53
  end
@@ -72,7 +72,7 @@ module DyndocWorld
72
72
 
73
73
  def DyndocWorld.open_prj_file(prj_file)
74
74
  res={success: false}
75
- if File.exists? prj_file
75
+ if File.exist? prj_file
76
76
  res[:content]=File.read(prj_file)
77
77
  res[:success]=true
78
78
  end
data/share/etc/uv/uv.rb CHANGED
@@ -32,7 +32,7 @@ module Dyndoc
32
32
  def self.load(output, style = nil, line_numbers = false, headers = false)
33
33
  style ||= Uv.default_style
34
34
  renderer = File.join( Uv.render_path, output,"#{style}.render")
35
- raise( ArgumentError, "Output for #{output} in #{style} style is not yet implemented" ) unless File.exists?(renderer)
35
+ raise( ArgumentError, "Output for #{output} in #{style} style is not yet implemented" ) unless File.exist?(renderer)
36
36
  options = YAML.load_file(renderer)
37
37
  processor = RenderProcessor.new(options, line_numbers, headers)
38
38
  yield processor if block_given?
@@ -177,7 +177,7 @@ class App < Roda
177
177
  p html_file
178
178
  if is_erb
179
179
  erb_yml=File.join($public_root,html_file+"_erb.yml")
180
- @cfg_erb=(File.exists? erb_yml) ? YAML::load_file(erb_yml) : {}
180
+ @cfg_erb=(File.exist? erb_yml) ? YAML::load_file(erb_yml) : {}
181
181
  end
182
182
  render html_file, :engine=> (is_erb ? "erb" : 'html'), :views=>$public_root
183
183
  else
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dyndoc-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.7
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - RCqls
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-12 00:00:00.000000000 Z
11
+ date: 2023-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: R4rb
@@ -509,7 +509,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
509
509
  version: '0'
510
510
  requirements:
511
511
  - none
512
- rubygems_version: 3.2.22
512
+ rubygems_version: 3.4.5
513
513
  signing_key:
514
514
  specification_version: 4
515
515
  summary: R and Ruby in text document