jsus 0.1.11 → 0.1.12

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.
data/Gemfile CHANGED
@@ -8,4 +8,4 @@ gem "activesupport"
8
8
  gem "json_pure"
9
9
  gem "rgl"
10
10
  gem "choice"
11
-
11
+ gem "murdoc"
@@ -5,12 +5,22 @@ GEM
5
5
  choice (0.1.4)
6
6
  diff-lcs (1.1.2)
7
7
  git (1.2.5)
8
+ haml (3.0.24)
8
9
  jeweler (1.5.1)
9
10
  bundler (~> 1.0.0)
10
11
  git (>= 1.2.5)
11
12
  rake
12
13
  json_pure (1.4.6)
14
+ murdoc (0.1.3)
15
+ haml (~> 3.0.0)
16
+ haml (~> 3.0.0)
17
+ jeweler
18
+ rdiscount (~> 1.6.5)
19
+ rdiscount (~> 1.6.5)
20
+ rspec (~> 2.1.0)
21
+ sass (~> 3.1.0)
13
22
  rake (0.8.7)
23
+ rdiscount (1.6.5)
14
24
  rgl (0.4.0)
15
25
  rake
16
26
  stream (>= 0.5)
@@ -22,6 +32,7 @@ GEM
22
32
  rspec-expectations (2.1.0)
23
33
  diff-lcs (~> 1.1.2)
24
34
  rspec-mocks (2.1.0)
35
+ sass (3.1.0.alpha.39)
25
36
  stream (0.5)
26
37
 
27
38
  PLATFORMS
@@ -33,5 +44,6 @@ DEPENDENCIES
33
44
  choice
34
45
  jeweler
35
46
  json_pure
47
+ murdoc
36
48
  rgl
37
49
  rspec
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.11
1
+ 0.1.12
data/bin/jsus CHANGED
@@ -1,9 +1,10 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'rubygems'
3
3
  require 'jsus'
4
- start_time = Time.now
4
+ require "fileutils"
5
+ require "murdoc"
5
6
  require 'choice'
6
-
7
+ start_time = Time.now
7
8
 
8
9
  Choice.options do
9
10
  option 'input_directory', :required => true do
@@ -51,6 +52,13 @@ Choice.options do
51
52
  "compile the package"
52
53
  end
53
54
 
55
+ option "docs_classes", :required => false do
56
+ default []
57
+ long "--generate-docs *CLASSES"
58
+ desc "Generate documentation for classes via murdoc, e.g.: lsd-* mootools-*"
59
+
60
+ end
61
+
54
62
  end
55
63
 
56
64
  compile_start_time = Time.now
@@ -82,7 +90,29 @@ if Choice.choices[:generate_includes]
82
90
  end
83
91
  end
84
92
 
93
+ # Generate documentation
94
+ unless Choice.choices[:docs_classes].empty?
95
+ documented_sources = Jsus::Container.new
96
+ sources = pool ? pool.sources : package.source_files
97
+ Choice.choices[:docs_classes].each do |expr|
98
+ regex = Regexp.new("^" + expr.gsub("*", ".*") + "$", Regexp::IGNORECASE)
99
+ sources.each {|s| documented_sources << s if s.provides.any? {|provided| provided.to_s =~ regex } }
100
+ end
85
101
 
102
+ doc_dir = Choice.choices[:output_directory] + "/docs"
103
+ FileUtils.mkdir_p(doc_dir)
104
+ template = File.dirname(__FILE__) + "/../markup/template.haml"
105
+ documented_sources.each do |source|
106
+ content = source.original_content.gsub(/\A\s*\/\*.*?\*\//m, "") # deleting initial comment
107
+ annotator = Murdoc::Annotator.new(content, :javascript, :highlight_source => true)
108
+ header = source.header
109
+ File.open("#{doc_dir}/#{File.basename(source.filename)}.html", "w+") do |f|
110
+ f.puts Murdoc::Formatter.new(template).render(:paragraphs => annotator.paragraphs, :header => header, :source => source)
111
+ end
112
+ end
113
+
114
+ FileUtils.cp(File.dirname(__FILE__) + "/../markup/stylesheet.css", doc_dir)
115
+ end
86
116
 
87
117
  finish_time = Time.now
88
118
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{jsus}
8
- s.version = "0.1.11"
8
+ s.version = "0.1.12"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Mark Abramov"]
@@ -41,6 +41,8 @@ Gem::Specification.new do |s|
41
41
  "lib/jsus/pool.rb",
42
42
  "lib/jsus/source_file.rb",
43
43
  "lib/jsus/tag.rb",
44
+ "markup/stylesheet.css",
45
+ "markup/template.haml",
44
46
  "spec/data/Basic/README",
45
47
  "spec/data/Basic/app/javascripts/Orwik/Source/Library/Color.js",
46
48
  "spec/data/Basic/app/javascripts/Orwik/Source/Widget/Input/Input.Color.js",
@@ -126,6 +128,7 @@ Gem::Specification.new do |s|
126
128
  s.add_runtime_dependency(%q<json_pure>, [">= 0"])
127
129
  s.add_runtime_dependency(%q<rgl>, [">= 0"])
128
130
  s.add_runtime_dependency(%q<choice>, [">= 0"])
131
+ s.add_runtime_dependency(%q<murdoc>, [">= 0"])
129
132
  s.add_runtime_dependency(%q<activesupport>, [">= 0"])
130
133
  s.add_runtime_dependency(%q<json_pure>, [">= 0"])
131
134
  s.add_runtime_dependency(%q<rgl>, [">= 0"])
@@ -138,6 +141,7 @@ Gem::Specification.new do |s|
138
141
  s.add_dependency(%q<json_pure>, [">= 0"])
139
142
  s.add_dependency(%q<rgl>, [">= 0"])
140
143
  s.add_dependency(%q<choice>, [">= 0"])
144
+ s.add_dependency(%q<murdoc>, [">= 0"])
141
145
  s.add_dependency(%q<activesupport>, [">= 0"])
142
146
  s.add_dependency(%q<json_pure>, [">= 0"])
143
147
  s.add_dependency(%q<rgl>, [">= 0"])
@@ -151,6 +155,7 @@ Gem::Specification.new do |s|
151
155
  s.add_dependency(%q<json_pure>, [">= 0"])
152
156
  s.add_dependency(%q<rgl>, [">= 0"])
153
157
  s.add_dependency(%q<choice>, [">= 0"])
158
+ s.add_dependency(%q<murdoc>, [">= 0"])
154
159
  s.add_dependency(%q<activesupport>, [">= 0"])
155
160
  s.add_dependency(%q<json_pure>, [">= 0"])
156
161
  s.add_dependency(%q<rgl>, [">= 0"])
@@ -218,6 +218,10 @@ module Jsus
218
218
  [@content, extensions.map {|e| e.content}].flatten.compact.join("\n")
219
219
  end
220
220
 
221
+ def original_content # :nodoc:
222
+ @content
223
+ end
224
+
221
225
  # Assigns an instance of Jsus::Pool to the source file.
222
226
  # Also performs push to that pool.
223
227
  def pool=(new_value)
@@ -0,0 +1,241 @@
1
+ html, body {
2
+ min-height: 100%; }
3
+
4
+ p, h1, h2, h3, ol, li, ol, ul, dt, dd, dl, body, html {
5
+ padding: 0;
6
+ margin: 0; }
7
+
8
+ body {
9
+ width: 45%;
10
+ padding-left: 2.5%;
11
+ padding-right: 2.5%;
12
+ background: #7ba32d;
13
+ font-family: Helvetica; }
14
+ body:after {
15
+ content: ".";
16
+ font-size: 0.01em;
17
+ line-height: 0.01em;
18
+ display: block;
19
+ clear: both; }
20
+
21
+ body > * {
22
+ padding-left: 6%;
23
+ padding-right: 6%; }
24
+
25
+ html {
26
+ background: #094201; }
27
+
28
+ header {
29
+ background: rgba(255, 255, 255, 0.1);
30
+ padding-top: 1em;
31
+ display: block; }
32
+ header dl {
33
+ margin-top: 1.125em;
34
+ font-size: 0.75em; }
35
+ header dl dt {
36
+ width: 5em;
37
+ font-weight: bold; }
38
+
39
+ p, dl, li {
40
+ color: #c4eeff;
41
+ font-weight: normal; }
42
+
43
+ a {
44
+ color: #a41717; }
45
+
46
+ p {
47
+ margin-top: 1.5em; }
48
+
49
+ h1 {
50
+ font-size: 2em; }
51
+
52
+ h2 {
53
+ font-size: 1em;
54
+ line-height: 2em; }
55
+
56
+ h1, h2, h3 {
57
+ color: #a41717; }
58
+
59
+ ol, li {
60
+ margin-left: 1em; }
61
+
62
+ body > div.paragraph, body > h1, body > h2 {
63
+ clear: both; }
64
+
65
+ header {
66
+ padding-bottom: 1em;
67
+ overflow: hidden; }
68
+
69
+ pre {
70
+ margin-top: 0;
71
+ }
72
+
73
+ dl {
74
+ clear: left; }
75
+ dl dt, dl dd {
76
+ float: left; }
77
+ dl dt {
78
+ clear: left; }
79
+ dl dd {
80
+ margin-left: 1em; }
81
+
82
+ section {
83
+ clear: both;
84
+ }
85
+
86
+ figure {
87
+ display: block;
88
+ float: right;
89
+ margin-right: -112.5%;
90
+ width: 95%;
91
+ clear: right;
92
+ padding: 2.5em 5% 3em; }
93
+ figure > ol {
94
+ width: 7.5%;
95
+ text-align: right;
96
+ float: left;
97
+ font-size: 0.8em;
98
+ color: #7ba32d;
99
+ -webkit-border-radius: 0.2em;
100
+ background: rgba(255, 255, 255, 0.1);
101
+ border: 1px solid rgba(0, 0, 0, 0.3);
102
+ list-style: none;
103
+ margin-left: -11.25%; }
104
+ figure > ol li {
105
+ margin: 0; }
106
+ figure pre {
107
+ background: rgba(255, 255, 255, 0.5);
108
+ border: 1px solid rgba(0, 0, 0, 0.3);
109
+ border-left: none;
110
+ margin-bottom: 0;
111
+ padding-bottom: 0;
112
+ }
113
+ figure > code, figure > ol {
114
+ font-size: 1em;
115
+ font-family: monospace; }
116
+ figure ~ figure {
117
+ padding-top: 1.5em; }
118
+
119
+ body .hll {
120
+ background-color: #ffffcc; }
121
+ body .c {
122
+ color: #408080;
123
+ font-style: italic; }
124
+ body .err {
125
+ border: 1px solid red; }
126
+ body .k {
127
+ color: #954121; }
128
+ body .o {
129
+ color: #666666; }
130
+ body .cm {
131
+ color: #408080;
132
+ font-style: italic; }
133
+ body .cp {
134
+ color: #bc7a00; }
135
+ body .c1, body .cs {
136
+ color: #408080;
137
+ font-style: italic; }
138
+ body .gd {
139
+ color: #a00000; }
140
+ body .ge {
141
+ font-style: italic; }
142
+ body .gr {
143
+ color: red; }
144
+ body .gh {
145
+ color: navy;
146
+ font-weight: bold; }
147
+ body .gi {
148
+ color: #00a000; }
149
+ body .go {
150
+ color: gray; }
151
+ body .gp {
152
+ color: navy;
153
+ font-weight: bold; }
154
+ body .gs {
155
+ font-weight: bold; }
156
+ body .gu {
157
+ color: purple;
158
+ font-weight: bold; }
159
+ body .gt {
160
+ color: #0040d0; }
161
+ body .kc {
162
+ color: #954121; }
163
+ body .kd, body .kn {
164
+ color: #954121;
165
+ font-weight: bold; }
166
+ body .kp {
167
+ color: #954121; }
168
+ body .kr {
169
+ color: #954121;
170
+ font-weight: bold; }
171
+ body .kt {
172
+ color: #b00040; }
173
+ body .m {
174
+ color: #666666; }
175
+ body .s {
176
+ color: #219161; }
177
+ body .na {
178
+ color: #7d9029; }
179
+ body .nb {
180
+ color: #954121; }
181
+ body .nc {
182
+ color: blue;
183
+ font-weight: bold; }
184
+ body .no {
185
+ color: #880000; }
186
+ body .nd {
187
+ color: #aa22ff; }
188
+ body .ni {
189
+ color: #999999;
190
+ font-weight: bold; }
191
+ body .ne {
192
+ color: #d2413a;
193
+ font-weight: bold; }
194
+ body .nf {
195
+ color: blue; }
196
+ body .nl {
197
+ color: #a0a000; }
198
+ body .nn {
199
+ color: blue;
200
+ font-weight: bold; }
201
+ body .nt {
202
+ color: #954121;
203
+ font-weight: bold; }
204
+ body .nv {
205
+ color: #19469d; }
206
+ body .ow {
207
+ color: #aa22ff;
208
+ font-weight: bold; }
209
+ body .w {
210
+ color: #bbbbbb; }
211
+ body .mf, body .mh, body .mi, body .mo {
212
+ color: #666666; }
213
+ body .sb, body .sc {
214
+ color: #219161; }
215
+ body .sd {
216
+ color: #219161;
217
+ font-style: italic; }
218
+ body .s2 {
219
+ color: #219161; }
220
+ body .se {
221
+ color: #bb6622;
222
+ font-weight: bold; }
223
+ body .sh {
224
+ color: #219161; }
225
+ body .si {
226
+ color: #bb6688;
227
+ font-weight: bold; }
228
+ body .sx {
229
+ color: #954121; }
230
+ body .sr {
231
+ color: #bb6688; }
232
+ body .s1 {
233
+ color: #219161; }
234
+ body .ss {
235
+ color: #19469d; }
236
+ body .bp {
237
+ color: #954121; }
238
+ body .vc, body .vg, body .vi {
239
+ color: #19469d; }
240
+ body .il {
241
+ color: #666666; }
@@ -0,0 +1,47 @@
1
+ !!!
2
+ %html
3
+ %head
4
+ %title Documentaiton for #{header["script"]}
5
+ %link{:rel => "stylesheet", :href => "stylesheet.css"}
6
+ %body
7
+ %figure
8
+ - if header["requires"]
9
+ %h2 Requires
10
+ %ul
11
+ - [header["requires"]].flatten.each do |r|
12
+ %li #{r}
13
+ - if header["provides"]
14
+ %h2 Provides
15
+ %ul
16
+ - [header["provides"]].flatten.each do |p|
17
+ %li #{p}
18
+
19
+ %header
20
+ - if header["script"]
21
+ %h1 #{header["script"]}
22
+ - if header["description"]
23
+ %p #{header["description"]}
24
+
25
+ %dl
26
+ - if header["license"]
27
+ %dt License:
28
+ %dd #{header["license"]}
29
+
30
+ - if header["authors"]
31
+ %dt Authors:
32
+ %dd #{header["authors"].join(", ")}
33
+ - if header["author"]
34
+ %dt Author:
35
+ %dd #{header["author"]}
36
+
37
+
38
+ - paragraphs.each do |paragraph|
39
+ - unless paragraph.annotation.empty?
40
+ %section
41
+ = paragraph.formatted_annotation
42
+ - unless paragraph.source.empty?
43
+ %figure
44
+ %ol
45
+ - 1.upto(paragraph.source.split("\n").size) do |line|
46
+ %li #{line + paragraph.starting_line}
47
+ %code<= paragraph.formatted_source
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 11
9
- version: 0.1.11
8
+ - 12
9
+ version: 0.1.12
10
10
  platform: ruby
11
11
  authors:
12
12
  - Mark Abramov
@@ -109,7 +109,7 @@ dependencies:
109
109
  prerelease: false
110
110
  version_requirements: *id007
111
111
  - !ruby/object:Gem::Dependency
112
- name: activesupport
112
+ name: murdoc
113
113
  requirement: &id008 !ruby/object:Gem::Requirement
114
114
  none: false
115
115
  requirements:
@@ -122,7 +122,7 @@ dependencies:
122
122
  prerelease: false
123
123
  version_requirements: *id008
124
124
  - !ruby/object:Gem::Dependency
125
- name: json_pure
125
+ name: activesupport
126
126
  requirement: &id009 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
@@ -135,7 +135,7 @@ dependencies:
135
135
  prerelease: false
136
136
  version_requirements: *id009
137
137
  - !ruby/object:Gem::Dependency
138
- name: rgl
138
+ name: json_pure
139
139
  requirement: &id010 !ruby/object:Gem::Requirement
140
140
  none: false
141
141
  requirements:
@@ -148,7 +148,7 @@ dependencies:
148
148
  prerelease: false
149
149
  version_requirements: *id010
150
150
  - !ruby/object:Gem::Dependency
151
- name: choice
151
+ name: rgl
152
152
  requirement: &id011 !ruby/object:Gem::Requirement
153
153
  none: false
154
154
  requirements:
@@ -160,6 +160,19 @@ dependencies:
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: *id011
163
+ - !ruby/object:Gem::Dependency
164
+ name: choice
165
+ requirement: &id012 !ruby/object:Gem::Requirement
166
+ none: false
167
+ requirements:
168
+ - - ">="
169
+ - !ruby/object:Gem::Version
170
+ segments:
171
+ - 0
172
+ version: "0"
173
+ type: :runtime
174
+ prerelease: false
175
+ version_requirements: *id012
163
176
  description: Javascript packager and dependency resolver
164
177
  email: markizko@gmail.com
165
178
  executables:
@@ -192,6 +205,8 @@ files:
192
205
  - lib/jsus/pool.rb
193
206
  - lib/jsus/source_file.rb
194
207
  - lib/jsus/tag.rb
208
+ - markup/stylesheet.css
209
+ - markup/template.haml
195
210
  - spec/data/Basic/README
196
211
  - spec/data/Basic/app/javascripts/Orwik/Source/Library/Color.js
197
212
  - spec/data/Basic/app/javascripts/Orwik/Source/Widget/Input/Input.Color.js
@@ -262,7 +277,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
262
277
  requirements:
263
278
  - - ">="
264
279
  - !ruby/object:Gem::Version
265
- hash: 1053208983668858724
280
+ hash: 1278848259045300436
266
281
  segments:
267
282
  - 0
268
283
  version: "0"