dyndoc-ruby 1.4.2 → 1.4.5

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: eb2f3e831ea517eaff9fc31d345306051d56fb4c2a8c501ffd6e57cacb7e31b1
4
- data.tar.gz: 0002b697759d5ada6085ef5ab02040e0e9c83bf19c864fb250ea210382ec5be1
3
+ metadata.gz: d255842b28ec56165e4afeaa4365023f907564018686c100ddaaa51a5da082d8
4
+ data.tar.gz: 0cfcbc668b436f90246754c516b2c6fe3ab7c8db9a1c0fa25f308fafbb994440
5
5
  SHA512:
6
- metadata.gz: ecc7fef24adac129da5b2fe4753d183f62fdbbf31ba4638d2da20e5dbad11d423dc54f329b3caa9b8229985f1e87567e544c3a81530e777f052acc0192b88c3f
7
- data.tar.gz: 2169eb881e4d9a25fea6b3d7fd1ce8b791c5708d6c1e6e8ab66c22fb68f2f6c6fea5b442cf3f3e7d11fc60fd0058331650fc5ce5cdb948fe00b1ee4e20f1059c
6
+ metadata.gz: 9d31008fa44284347b7cb449547b070c3fadff5d46502add8d765da72add3306d8b9aeb2395534e51b6f64be18cc7a7e6e94431f97c5ecc50c74e20e580b8d1e
7
+ data.tar.gz: cb6cdaac3ac2f79261eed45e915d1ca55adf438a27858fb302462466a34c1c0ee5c43e6bcdfcf6fb091330834c0b2ae586b3d9d42a4a7ca8b16fffe827a46a42
@@ -6,6 +6,15 @@ SRVS=["dyn-srv","dyn-html","dyn-http","dyn-task"]
6
6
  CMD="dyn-ctl"
7
7
  DYNCTL_PLIST=File.expand_path("~/Library/LaunchAgents/local.dyn-ctl.plist")
8
8
 
9
+ def srvs?(srvs)
10
+ if srvs
11
+ srvs=srvs.split(",",-1).map{|e| "dyn-"+e}
12
+ else
13
+ srvs=SRVS.dup
14
+ end
15
+ return srvs
16
+ end
17
+
9
18
  case (ARGV[0] || "start").downcase
10
19
  when "init"
11
20
  rodasrv=File.expand_path("~/RodaSrv")
@@ -58,7 +67,8 @@ when "unwatch"
58
67
  end
59
68
 
60
69
  when "start"
61
- status=SRVS.map do |srv|
70
+ srvs=srvs?(ARGV[1])
71
+ status=srvs.map do |srv|
62
72
  `#{srv} status`.empty?
63
73
  end
64
74
  if status.any?
@@ -69,16 +79,18 @@ when "start"
69
79
  `osascript -e '#{cmd_to_display}'`
70
80
  end
71
81
  puts message
72
- status.each_with_index { |e,i| `#{SRVS[i]} start` if e }
82
+ status.each_with_index { |e,i| `#{srvs[i]} start` if e }
73
83
  end
74
84
 
75
85
  when "stop"
76
- SRVS.each {|srv| `#{srv} stop`}
86
+ srvs=srvs?(ARGV[1])
87
+ srvs.each {|srv| `#{srv} stop`}
77
88
 
78
89
  when "status"
79
- SRVS.each {|srv| puts srv+(`#{srv} status`.empty? ? "stopped" : "running")}
90
+ srvs=srvs?(ARGV[1])
91
+ srvs.each {|srv| puts srv+(`#{srv} status`.empty? ? "stopped" : "running")}
80
92
 
81
- when "new"
93
+ when "new"
82
94
 
83
95
  if RUBY_PLATFORM =~ /darwin/
84
96
  ## launchctl seems to work but actually: dyn-srv, dyn-html and dyn-http started but noit properly
@@ -229,7 +229,8 @@ module Dyndoc
229
229
 
230
230
  def HtmlServers.dyn_http_server(host=nil,port=nil)
231
231
  require 'thin'
232
- dyn_html_srv_ru="/home/ubuntu/tools/dyn-html/srv.ru" # DyndocDockerSite guest-tools folder
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
233
234
  dyn_html_srv_ru=File.join(ENV["HOME"],"dyndoc","html-srv","dyn.ru") unless File.exists? dyn_html_srv_ru
234
235
  dyn_html_srv_ru=File.expand_path("../../share/html-srv/dyn-html-srv.ru",__FILE__) unless File.exists? dyn_html_srv_ru
235
236
 
@@ -275,7 +276,7 @@ module Dyndoc
275
276
  $VERBOSE = nil
276
277
  options={first: true}
277
278
  ## To put inside yaml config file!
278
- root ||= cfg["root"] || HtmlServers.cfg["root"] || File.join(ENV["HOME"],"RCqls","RodaServer")
279
+ root ||= cfg["root"] || HtmlServers.cfg["root"] || File.join(ENV["HOME"],"RodaSrv")
279
280
  dyn_root = cfg["dyn_root"] || HtmlServers.cfg["dyn_root"] || File.join(root ,"edit")
280
281
  public_root = cfg["public_root"] || HtmlServers.cfg["public_root"] || File.join(root ,"public")
281
282
  dyn_public_edit_root = File.join(public_root,"users","*",".edit","**","*.dyn")
@@ -98,9 +98,9 @@ def DyndocTasks.dyn_yml(doc)
98
98
  end
99
99
  if is_dyntask
100
100
  dynfile=docname+".dyn"
101
- FileUtils.cp dyntaskpath, dynfile
102
- $params=cfg_yml["params"]
103
- $dyntask=dyntaskname
101
+ FileUtils.cp dyntaskpath, dynfile
102
+ $params=cfg_yml["params"]
103
+ $dyntask=dyntaskname
104
104
  cfg_yml["params"].each do |key,val|
105
105
  Settings["cfg_dyn.user_input"] << [key,val]
106
106
  end
@@ -126,8 +126,16 @@ def DyndocTasks.filewatcher(cfg={}) #cfg
126
126
  ::FileWatcher.new(dyntasks_root).watch() do |filename, event|
127
127
  ##DEBUG:
128
128
  puts filename + "->" + event.to_s+"\n"
129
- if [:changed,:updated,:new].include? event and File.extname(filename) == ".yml"
130
- DyndocTasks.dyn_yml filename
129
+ if [:changed,:updated,:new].include? event
130
+ case File.extname(filename)
131
+ when ".yml"
132
+ DyndocTasks.dyn_yml filename
133
+ when ".rb"
134
+ system("/usr/bin/env ruby "+filename)
135
+ when ".sh"
136
+ system("/usr/bin/env bash "+filename)
137
+ end
138
+
131
139
  end
132
140
  end
133
141
  end
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.2
4
+ version: 1.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - RCqls
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-31 00:00:00.000000000 Z
11
+ date: 2020-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: R4rb
@@ -493,7 +493,7 @@ licenses:
493
493
  - MIT
494
494
  - GPL-2.0
495
495
  metadata: {}
496
- post_install_message:
496
+ post_install_message:
497
497
  rdoc_options: []
498
498
  require_paths:
499
499
  - lib
@@ -510,7 +510,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
510
510
  requirements:
511
511
  - none
512
512
  rubygems_version: 3.0.6
513
- signing_key:
513
+ signing_key:
514
514
  specification_version: 4
515
515
  summary: R and Ruby in text document
516
516
  test_files: []