dyndoc-ruby 0.5.3 → 0.5.4
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.
- checksums.yaml +4 -4
- data/bin/dyn-env +82 -0
- data/share/demo/first.dyn +8 -86
- data/share/demo/firstAsciidoc.dyn +101 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32e37a92918f6da0c139d2e588512b3a688a8b8f
|
4
|
+
data.tar.gz: eba1ddaac4c3cde40a95409c277eb1f3f1a5523a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10557ba8463dc503d82cea9df63a53da117a475a943779f310f3fd7c1da7a3e90e72703b56757b21148dd9ec1fbe21f525b8e4870d4bdfcfcd90791b82ed216d
|
7
|
+
data.tar.gz: 3d789e7c23a47b079ae26a55c2ff77edfdbc1779994df719c25a5086e2d688cf61ab444c2093a180969555caa152146f892f776e46b1b625498985d769c2fc41
|
data/bin/dyn-env
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: utf-8
|
3
|
+
require 'rubygems' # if you use RubyGems
|
4
|
+
require 'commander/import'
|
5
|
+
require 'dyndoc/common/utils'
|
6
|
+
|
7
|
+
|
8
|
+
# :name is optional, otherwise uses the basename of this executable
|
9
|
+
program :name, 'dyndoc environment'
|
10
|
+
program :version, '0.1.0'
|
11
|
+
program :description, 'Dyndoc environment management.'
|
12
|
+
|
13
|
+
highline= HighLine.new
|
14
|
+
|
15
|
+
command :path do |c|
|
16
|
+
c.syntax = 'dyndoc-envir path'
|
17
|
+
c.description = 'Manage paths for Windows'
|
18
|
+
c.action do |args, options|
|
19
|
+
if Dyndoc::Utils.is_windows?
|
20
|
+
dirsR=Dir[File.join(ENV['ProgramFiles'].split('\\'),'**','R.dll')].map{|e| File.dirname(e).split('/').join('\\').strip}.uniq
|
21
|
+
if dirsR.empty?
|
22
|
+
say("No R directory found in your Windows System!")
|
23
|
+
else
|
24
|
+
require 'win32/registry'
|
25
|
+
paths=nil
|
26
|
+
Win32::Registry::HKEY_CURRENT_USER.open('Environment') do |reg|
|
27
|
+
paths=reg['path'].split(";").map{|l| l.strip}
|
28
|
+
end
|
29
|
+
save=false
|
30
|
+
case args[0].downcase.to_sym
|
31
|
+
when :r
|
32
|
+
highline.choose do |menu|
|
33
|
+
menu.prompt = "Please select the R directory to add to your PATH: "
|
34
|
+
menu.choices(*dirsR) do |ch|
|
35
|
+
paths << ch
|
36
|
+
save=true
|
37
|
+
say("#{ch} added to user PATH!")
|
38
|
+
end
|
39
|
+
menu.choice :quit do say("Nothing done!") end
|
40
|
+
end
|
41
|
+
when :add
|
42
|
+
paths << args[1].split(";").map{|l| l.strip}
|
43
|
+
say("#{args[1]} added to user PATH!")
|
44
|
+
save=true
|
45
|
+
when :del
|
46
|
+
highline.choose do |menu|
|
47
|
+
menu.prompt = "Please choose path to delete? "
|
48
|
+
menu.choices(*paths) do |ch|
|
49
|
+
paths.delete(ch)
|
50
|
+
save=true
|
51
|
+
say("#{ch} removed from user PATH!")
|
52
|
+
end
|
53
|
+
menu.choice :quit do say("Nothing done!") end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
if save
|
57
|
+
Win32::Registry::HKEY_CURRENT_USER.open('Environment',Win32::Registry::KEY_WRITE) do |reg|
|
58
|
+
reg['path'] = paths.join(";")
|
59
|
+
puts reg['path']
|
60
|
+
end
|
61
|
+
end
|
62
|
+
puts paths.join("\n")+"\n"
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
command :link do |c|
|
69
|
+
c.syntax = 'dyndoc-envir link'
|
70
|
+
c.description = 'Create a link for Dyndoc Console2'
|
71
|
+
c.action do |args, options|
|
72
|
+
console=args[0] ? args[0] : "C:\\tools\\Console2\\Console.exe"
|
73
|
+
require 'win32/shortcut'
|
74
|
+
Win32::Shortcut.new(ENV["HOME"].split("/").join("\\")+"\\Desktop\\Dyndoc.lnk") do |s|
|
75
|
+
s.description = 'Dyndoc'
|
76
|
+
s.path = console
|
77
|
+
s.window_style = Win32::Shortcut::SHOWNORMAL
|
78
|
+
s.icon_location = console
|
79
|
+
s.working_directory = ENV["HOME"].split("/").join("\\")
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
data/share/demo/first.dyn
CHANGED
@@ -1,27 +1,23 @@
|
|
1
|
-
[#md>]
|
1
|
+
[#md>]
|
2
|
+
# dyndoc first test
|
2
3
|
|
3
|
-
|
4
|
-
|
5
|
-
## Install
|
6
|
-
|
7
|
-
[#txtl>]h1. test
|
8
|
-
|
9
|
-
[#rb<]p Dyndoc.cfg_dyn[:root_doc]
|
4
|
+
## ruby test (no output)
|
10
5
|
|
11
6
|
[#rb<]nn=15;n2=3
|
12
7
|
(1..10).map do |i| #
|
8
|
+
i*2
|
13
9
|
end
|
10
|
+
[#md>]## R test
|
14
11
|
|
15
12
|
[#R>>]rnorm(:{nn})
|
16
13
|
log(-1)
|
17
14
|
a<-c(1,3,2)
|
18
|
-
version
|
19
|
-
[#>]
|
20
|
-
|
21
|
-
titi
|
22
15
|
|
16
|
+
[#>]
|
23
17
|
{#rverb]rnorm(20)[#rverb}
|
24
18
|
|
19
|
+
[#md>]## ruby and R loop tests
|
20
|
+
|
25
21
|
[#rb>]
|
26
22
|
(1..10).each do |i| #
|
27
23
|
{#>]elt:{i}\\[#>}
|
@@ -33,77 +29,3 @@ for(i in 1:5) {
|
|
33
29
|
{#>]eltR:r{i}\\[#>}
|
34
30
|
a<-1
|
35
31
|
}
|
36
|
-
|
37
|
-
|
38
|
-
[#>]{#img]plot(rnorm(10))[#}
|
39
|
-
|
40
|
-
|
41
|
-
[#adoc>]
|
42
|
-
== First Section
|
43
|
-
|
44
|
-
IMPORTANT: When upgrading to Asciidoctor 1.5.0, please refer to the {uri-migration}[migration guide] for details about how to migrate your content.
|
45
|
-
|
46
|
-
|
47
|
-
[source,ruby]
|
48
|
-
----
|
49
|
-
require 'sinatra' // <1>
|
50
|
-
|
51
|
-
get '/hi' do // <2>
|
52
|
-
"Hello World!" // <3>
|
53
|
-
end
|
54
|
-
----
|
55
|
-
<1> Library import
|
56
|
-
<2> URL mapping
|
57
|
-
<3> Content for response
|
58
|
-
|
59
|
-
image::http://asciidoctor.org/images/octocat.jpg[GitHub mascot]
|
60
|
-
|
61
|
-
* Every list item has at least one paragraph of content,
|
62
|
-
which may be wrapped, even using a hanging indent.
|
63
|
-
+
|
64
|
-
Additional paragraphs or blocks are adjoined by putting
|
65
|
-
a list continuation on a line adjacent to both blocks.
|
66
|
-
+
|
67
|
-
list continuation:: a plus sign (`{plus}`) on a line by itself
|
68
|
-
|
69
|
-
* A literal paragraph does not require a list continuation.
|
70
|
-
|
71
|
-
$ gem install asciidoctor
|
72
|
-
|
73
|
-
* AsciiDoc lists may contain any complex content.
|
74
|
-
+
|
75
|
-
[cols="2", options="header"]
|
76
|
-
||===
|
77
|
-
||Application
|
78
|
-
||Language
|
79
|
-
|
80
|
-
||AsciiDoc
|
81
|
-
||Python
|
82
|
-
|
83
|
-
||Asciidoctor
|
84
|
-
||Ruby
|
85
|
-
||===
|
86
|
-
|
87
|
-
- [*] checked
|
88
|
-
- [x] also checked
|
89
|
-
- [ ] not checked
|
90
|
-
- normal list item
|
91
|
-
|
92
|
-
. level 1
|
93
|
-
.. level 2
|
94
|
-
... level 3
|
95
|
-
.... level 4
|
96
|
-
..... level 5
|
97
|
-
. level 1
|
98
|
-
|
99
|
-
[cols="2", options="header"]
|
100
|
-
||===
|
101
|
-
||Application
|
102
|
-
||Language
|
103
|
-
|
104
|
-
||AsciiDoc
|
105
|
-
||Python
|
106
|
-
|
107
|
-
||Asciidoctor
|
108
|
-
||Ruby
|
109
|
-
||===
|
@@ -0,0 +1,101 @@
|
|
1
|
+
[#md>]# dyndoc project
|
2
|
+
|
3
|
+
TODO: DESCRIPTION
|
4
|
+
|
5
|
+
## Install
|
6
|
+
|
7
|
+
__EXIT__
|
8
|
+
|
9
|
+
[#txtl>]h1. test
|
10
|
+
|
11
|
+
"dyndoc":http://dyndoc.upmf-grenoble.fr
|
12
|
+
|
13
|
+
[#rb<]p Dyndoc.cfg_dyn[:root_doc]
|
14
|
+
|
15
|
+
|
16
|
+
[#rb<]nn=15;n2=3
|
17
|
+
(1..10).map do |i| #
|
18
|
+
i*2
|
19
|
+
end
|
20
|
+
|
21
|
+
[#R>>]rnorm(:{nn})
|
22
|
+
log(-1)
|
23
|
+
a<-c(1,3,2)
|
24
|
+
|
25
|
+
[#>]
|
26
|
+
|
27
|
+
titi
|
28
|
+
|
29
|
+
{#rverb]rnorm(20)[#rverb}
|
30
|
+
|
31
|
+
[#rb>]
|
32
|
+
(1..10).each do |i| #
|
33
|
+
{#>]elt:{i}\\[#>}
|
34
|
+
a=1
|
35
|
+
end
|
36
|
+
|
37
|
+
[#R>]
|
38
|
+
for(i in 1:5) {
|
39
|
+
{#>]eltR:r{i}\\[#>}
|
40
|
+
a<-1
|
41
|
+
}
|
42
|
+
|
43
|
+
[#>]{#img]plot(rnorm(10))[#}
|
44
|
+
|
45
|
+
[#adoc>]
|
46
|
+
== First Section
|
47
|
+
|
48
|
+
IMPORTANT: When upgrading to Asciidoctor 1.5.0, please refer to the {uri-migration}[migration guide] for details about how to migrate your content.
|
49
|
+
|
50
|
+
|
51
|
+
[source,ruby]
|
52
|
+
----
|
53
|
+
require 'sinatra' // <1>
|
54
|
+
|
55
|
+
get '/hi' do // <2>
|
56
|
+
"Hello World!" // <3>
|
57
|
+
end
|
58
|
+
----
|
59
|
+
<1> Library import
|
60
|
+
<2> URL mapping
|
61
|
+
<3> Content for response
|
62
|
+
|
63
|
+
image::http://asciidoctor.org/images/octocat.jpg[GitHub mascot]
|
64
|
+
|
65
|
+
* Every list item has at least one paragraph of content,
|
66
|
+
which may be wrapped, even using a hanging indent.
|
67
|
+
+
|
68
|
+
Additional paragraphs or blocks are adjoined by putting
|
69
|
+
a list continuation on a line adjacent to both blocks.
|
70
|
+
+
|
71
|
+
list continuation:: a plus sign (`{plus}`) on a line by itself
|
72
|
+
|
73
|
+
* A literal paragraph does not require a list continuation.
|
74
|
+
|
75
|
+
$ gem install asciidoctor
|
76
|
+
|
77
|
+
* AsciiDoc lists may contain any complex content.
|
78
|
+
+
|
79
|
+
[cols="2", options="header"]
|
80
|
+
||===
|
81
|
+
||Application
|
82
|
+
||Language
|
83
|
+
|
84
|
+
||AsciiDoc
|
85
|
+
||Python
|
86
|
+
|
87
|
+
||Asciidoctor
|
88
|
+
||Ruby
|
89
|
+
||===
|
90
|
+
|
91
|
+
- [*] checked
|
92
|
+
- [x] also checked
|
93
|
+
- [ ] not checked
|
94
|
+
- normal list item
|
95
|
+
|
96
|
+
. level 1
|
97
|
+
.. level 2
|
98
|
+
... level 3
|
99
|
+
.... level 4
|
100
|
+
..... level 5
|
101
|
+
. level 1
|
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: 0.5.
|
4
|
+
version: 0.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CQLS
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: R4rb
|
@@ -106,11 +106,13 @@ files:
|
|
106
106
|
- bin/dpm
|
107
107
|
- bin/dyn
|
108
108
|
- bin/dyn-cli
|
109
|
+
- bin/dyn-env
|
109
110
|
- bin/dyn-forever
|
110
111
|
- bin/dyn-init
|
111
112
|
- bin/dyn-srv
|
112
113
|
- lib/dyndoc/srv/interactive-server.rb
|
113
114
|
- share/demo/first.dyn
|
115
|
+
- share/demo/firstAsciidoc.dyn
|
114
116
|
- share/demo/second.dyn
|
115
117
|
- share/demo/simple.dyn
|
116
118
|
- share/demo/simple_lib.dyn
|