lazibi 0.1.13 → 0.1.14
Sign up to get free protection for your applications and to get access to all the features.
- data/.autotest +44 -2
- data/History.txt +10 -1
- data/Manifest.txt +114 -91
- data/README.txt +4 -125
- data/Rakefile +20 -10
- data/config/lazibi_config_template.rb +15 -0
- data/lib/core/beautify_engine.rb +10 -0
- data/lib/core/default_engine.rb +11 -0
- data/lib/core/engine_base.rb +74 -0
- data/lib/filter/beautify_filter.rb +148 -0
- data/lib/filter/filter_base.rb +19 -0
- data/lib/filter/optional_do_filter.rb +66 -0
- data/lib/filter/optional_end_filter.rb +124 -0
- data/lib/filter/syntax_guard_filter.rb +77 -0
- data/lib/helper/application_helper.rb +9 -0
- data/lib/helper/beautify_filter_helper.rb +52 -0
- data/lib/helper/filter_helper.rb +133 -0
- data/lib/helper/task_helper.rb +53 -45
- data/lib/lazibi.rb +1 -4
- data/lib/lazibi/version.rb +1 -1
- data/lib/task.rb +41 -32
- data/spec/core/beautify_engine_spec.rb +12 -0
- data/spec/core/default_engine_spec.rb +28 -0
- data/spec/core/engine_base_spec.rb +23 -0
- data/spec/filter/beautify_filter_spec.rb +64 -0
- data/spec/filter/filter_spec_helper.rb +9 -0
- data/spec/filter/optional_do_filter_spec.rb +56 -0
- data/spec/filter/optional_end_filter_spec.rb +84 -0
- data/spec/filter/syntax_guard_filter_spec.rb +35 -0
- data/spec/fixtures/beautify/metas/square_brackets.txt +6 -0
- data/{test/fixtures/functional/ruby → spec/fixtures/beautify/rbs}/square_brackets.txt +1 -1
- data/{test → spec}/fixtures/clean/comment_break.txt +0 -0
- data/{test → spec}/fixtures/clean/complex_string.txt +0 -0
- data/{test → spec}/fixtures/clean/end_concat.txt +0 -0
- data/{test → spec}/fixtures/clean/long_indent.txt +0 -0
- data/{test → spec}/fixtures/clean/mixed_re.txt +0 -0
- data/{test → spec}/fixtures/clean/only_if.txt +0 -0
- data/{test → spec}/fixtures/clean/re.txt +0 -0
- data/{test → spec}/fixtures/clean/semi_colon_after_end.txt +0 -0
- data/{test → spec}/fixtures/clean/sep_line.txt +0 -0
- data/{test → spec}/fixtures/clean/unless_problem.txt +0 -0
- data/{test → spec}/fixtures/meta/basic_class.txt +0 -0
- data/{test → spec}/fixtures/meta/case.txt +0 -0
- data/{test → spec}/fixtures/meta/class_with_def.txt +0 -0
- data/{test → spec}/fixtures/meta/comment.txt +0 -0
- data/{test → spec}/fixtures/meta/comment_after_end.txt +0 -0
- data/{test → spec}/fixtures/meta/eval_code.txt +0 -0
- data/{test → spec}/fixtures/meta/here_doc.txt +0 -0
- data/{test → spec}/fixtures/meta/inline_do_end.txt +0 -0
- data/{test → spec}/fixtures/meta/inline_end.txt +0 -0
- data/{test → spec}/fixtures/meta/loop.txt +0 -0
- data/{test → spec}/fixtures/meta/middle.txt +0 -0
- data/{test → spec}/fixtures/meta/multi_blocks.txt +0 -0
- data/{test → spec}/fixtures/meta/nested_comment.txt +0 -0
- data/{test → spec}/fixtures/meta/optional_do.txt +0 -0
- data/{test → spec}/fixtures/meta/optional_do_with_nasty_chars.txt +0 -0
- data/{test → spec}/fixtures/meta/partial_method.txt +0 -0
- data/{test → spec}/fixtures/meta/single_method.txt +0 -0
- data/{test → spec}/fixtures/meta/two_methods.txt +0 -0
- data/{test/fixtures/functional/simply → spec/fixtures/optional_do/metas}/brackets_block.txt +0 -0
- data/{test/fixtures/functional/simply → spec/fixtures/optional_do/metas}/classical.txt +0 -0
- data/{test/fixtures/functional/simply → spec/fixtures/optional_do/metas}/describe.txt +0 -0
- data/{test/fixtures/functional/simply → spec/fixtures/optional_do/metas}/do_block.txt +0 -0
- data/{test/fixtures/functional/simply → spec/fixtures/optional_do/metas}/lambda.txt +0 -0
- data/{test/fixtures/functional/simply → spec/fixtures/optional_do/metas}/square_brackets.txt +2 -2
- data/{test/fixtures/functional/ruby → spec/fixtures/optional_do/rbs}/brackets_block.txt +0 -0
- data/{test/fixtures/functional/ruby → spec/fixtures/optional_do/rbs}/classical.txt +0 -0
- data/{test/fixtures/functional/ruby → spec/fixtures/optional_do/rbs}/describe.txt +0 -0
- data/{test/fixtures/functional/ruby → spec/fixtures/optional_do/rbs}/do_block.txt +0 -0
- data/{test/fixtures/functional/ruby → spec/fixtures/optional_do/rbs}/lambda.txt +0 -0
- data/spec/fixtures/optional_do/rbs/square_brackets.txt +6 -0
- data/{test → spec}/fixtures/real/basic_class.txt +0 -0
- data/{test → spec}/fixtures/real/case.txt +0 -0
- data/{test → spec}/fixtures/real/class_with_def.txt +0 -0
- data/{test → spec}/fixtures/real/comment.txt +0 -0
- data/{test → spec}/fixtures/real/comment_after_end.txt +0 -0
- data/{test → spec}/fixtures/real/comment_after_end_expected.txt +0 -0
- data/{test → spec}/fixtures/real/comment_break.txt +0 -0
- data/{test → spec}/fixtures/real/complex_string.txt +0 -0
- data/{test → spec}/fixtures/real/end_concat.txt +0 -0
- data/{test → spec}/fixtures/real/eval_code.txt +0 -0
- data/{test → spec}/fixtures/real/general_eval.txt +0 -0
- data/{test → spec}/fixtures/real/here_doc.txt +0 -0
- data/{test → spec}/fixtures/real/inline_do_end.txt +0 -0
- data/{test → spec}/fixtures/real/inline_end.txt +0 -0
- data/{test → spec}/fixtures/real/javascript.txt +0 -0
- data/{test → spec}/fixtures/real/long_indent.txt +0 -0
- data/{test → spec}/fixtures/real/loop.txt +0 -0
- data/{test → spec}/fixtures/real/middle.txt +0 -0
- data/{test → spec}/fixtures/real/mixed_re.txt +0 -0
- data/{test → spec}/fixtures/real/multi_blocks.txt +0 -0
- data/{test → spec}/fixtures/real/nested_comment.txt +0 -0
- data/{test → spec}/fixtures/real/only_if.txt +0 -0
- data/{test → spec}/fixtures/real/optional_do.txt +0 -0
- data/{test → spec}/fixtures/real/optional_do_with_nasty_chars.txt +0 -0
- data/{test → spec}/fixtures/real/partial_method.txt +0 -0
- data/{test → spec}/fixtures/real/re.txt +0 -0
- data/{test → spec}/fixtures/real/semi_colon_after_end.txt +0 -0
- data/{test → spec}/fixtures/real/sep_line.txt +0 -0
- data/{test → spec}/fixtures/real/single_method.txt +0 -0
- data/{test → spec}/fixtures/real/strange_syntax_1.txt +0 -0
- data/{test → spec}/fixtures/real/two_methods.txt +0 -0
- data/{test → spec}/fixtures/real/unless_problem.txt +0 -0
- data/spec/helper/filter_helper_spec.rb +35 -0
- data/spec/helper/task_helper_spec.rb +21 -0
- data/spec/lazibi_spec.rb +22 -0
- data/spec/spec_helper.rb +16 -0
- data/webgen/src/code/examples/migration.py.rb +10 -0
- data/webgen/src/code/examples/rspec.py.rb +7 -0
- data/webgen/src/css/blossom_base.css +172 -0
- data/webgen/src/css/blossom_v05.css +48 -0
- data/webgen/src/css/code.css +32 -0
- data/webgen/src/css/hack.css +13 -0
- data/webgen/src/css/print.css +178 -0
- data/webgen/src/default.template +90 -0
- data/webgen/src/development.page +19 -0
- data/webgen/src/documentation.page +44 -0
- data/webgen/src/faq.page +42 -0
- data/webgen/src/images/cover_landscape.jpg +0 -0
- data/webgen/src/images/example_picture03.jpg +0 -0
- data/webgen/src/images/example_picture04.jpg +0 -0
- data/webgen/src/index.page +45 -0
- data/webgen/src/installation.page +17 -0
- metadata +214 -175
- data/coverage/index.html +0 -476
- data/coverage/lib-helper-parser_helper_rb.html +0 -718
- data/coverage/lib-helper-task_helper_rb.html +0 -684
- data/coverage/lib-lazibi-version_rb.html +0 -640
- data/coverage/lib-lazibi_rb.html +0 -664
- data/coverage/lib-parser_rb.html +0 -787
- data/coverage/lib-task_rb.html +0 -751
- data/lib/helper/app_helper.rb +0 -0
- data/lib/helper/parser_helper.rb +0 -92
- data/lib/parser.rb +0 -194
- data/lib/vendor/beautifier.rb +0 -278
- data/test/test_functional.rb +0 -75
- data/test/test_helper.rb +0 -7
- data/test/test_unit.rb +0 -151
- data/website/index.html +0 -234
- data/website/index.txt +0 -135
- data/website/javascripts/rounded_corners_lite.inc.js +0 -285
- data/website/stylesheets/screen.css +0 -140
- data/website/template.rhtml +0 -48
data/.autotest
CHANGED
@@ -1,2 +1,44 @@
|
|
1
|
-
require 'autotest/
|
2
|
-
|
1
|
+
require 'autotest/growl'
|
2
|
+
|
3
|
+
# Just like Autotest::Fixtures, but for specs
|
4
|
+
module Autotest::SpecFixtures
|
5
|
+
Autotest.add_hook :initialize do |at|
|
6
|
+
at.test_mappings['^spec/fixtures/(.*)s.yml'] = proc { |filename, matches|
|
7
|
+
at.files_matching(/spec\/\w+\/#{matches[1]}(_\w+)?.*_spec.rb$/)
|
8
|
+
}
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
# Just like Autotest::RedGreen, but for specs
|
13
|
+
module Autotest::SpecRedGreen
|
14
|
+
BAR = "=" * 80
|
15
|
+
|
16
|
+
Autotest.add_hook :ran_command do |at|
|
17
|
+
# TODO: submit a patch for RedGreen to make the match and code configurable
|
18
|
+
if at.results.last.match(/^(\d+) examples?, (\d+) failures?$/)
|
19
|
+
code = ($2 != "0") ? 31 : 32
|
20
|
+
puts "\e[#{code}m#{BAR}\e[0m\n\n"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
# Speak failures via Apple's speech synth
|
26
|
+
|
27
|
+
module Autotest::Speak
|
28
|
+
def self.speak message
|
29
|
+
# system %(osascript -e 'say "#{message}"')
|
30
|
+
end
|
31
|
+
|
32
|
+
Autotest.add_hook :red do |at|
|
33
|
+
failures = at.files_to_test.size
|
34
|
+
speak "#{failures} example#{failures == 0 || failures > 1 ? 's' : nil} failed."
|
35
|
+
end
|
36
|
+
|
37
|
+
# Autotest.add_hook :green do |at|
|
38
|
+
# speak "Specs passed."
|
39
|
+
# end
|
40
|
+
|
41
|
+
Autotest.add_hook :all_good do |at|
|
42
|
+
speak "All specs passed."
|
43
|
+
end
|
44
|
+
end
|
data/History.txt
CHANGED
@@ -1,10 +1,19 @@
|
|
1
|
+
== 0.1.14 2007-06-29
|
2
|
+
|
3
|
+
* Features
|
4
|
+
* Completely re-factored source code
|
5
|
+
* Move from unit test to rspec, reused _all_ the previous fixtures and test cases
|
6
|
+
* The engine can hook any filters with complete configuration
|
7
|
+
* Designed with future easy custom pre-processor filters plugin in mind
|
8
|
+
* Ruby based configuration file
|
9
|
+
|
1
10
|
== 0.1.13 2007-06-22
|
2
11
|
|
3
12
|
* Bugs
|
4
13
|
* {} and lambda syntax for optioanl_do
|
5
14
|
* correctly parse inline def; end
|
6
15
|
|
7
|
-
Features
|
16
|
+
* Features
|
8
17
|
* Passed all spec tests for RSpec with optional_do filter on
|
9
18
|
|
10
19
|
== 0.1.12 2007-06-21
|
data/Manifest.txt
CHANGED
@@ -5,100 +5,123 @@ Manifest.txt
|
|
5
5
|
README.txt
|
6
6
|
Rakefile
|
7
7
|
bin/lazibi
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
lib/
|
16
|
-
lib/
|
8
|
+
config/lazibi_config_template.rb
|
9
|
+
lib/core/beautify_engine.rb
|
10
|
+
lib/core/default_engine.rb
|
11
|
+
lib/core/engine_base.rb
|
12
|
+
lib/filter/beautify_filter.rb
|
13
|
+
lib/filter/filter_base.rb
|
14
|
+
lib/filter/optional_do_filter.rb
|
15
|
+
lib/filter/optional_end_filter.rb
|
16
|
+
lib/filter/syntax_guard_filter.rb
|
17
|
+
lib/helper/application_helper.rb
|
18
|
+
lib/helper/beautify_filter_helper.rb
|
19
|
+
lib/helper/filter_helper.rb
|
17
20
|
lib/helper/task_helper.rb
|
18
21
|
lib/lazibi.rb
|
19
22
|
lib/lazibi/version.rb
|
20
|
-
lib/parser.rb
|
21
23
|
lib/task.rb
|
22
|
-
lib/vendor/beautifier.rb
|
23
24
|
scripts/rdoc2html
|
24
25
|
scripts/txt2html
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
26
|
+
spec/core/beautify_engine_spec.rb
|
27
|
+
spec/core/default_engine_spec.rb
|
28
|
+
spec/core/engine_base_spec.rb
|
29
|
+
spec/filter/beautify_filter_spec.rb
|
30
|
+
spec/filter/filter_spec_helper.rb
|
31
|
+
spec/filter/optional_do_filter_spec.rb
|
32
|
+
spec/filter/optional_end_filter_spec.rb
|
33
|
+
spec/filter/syntax_guard_filter_spec.rb
|
34
|
+
spec/fixtures/beautify/metas/square_brackets.txt
|
35
|
+
spec/fixtures/beautify/rbs/square_brackets.txt
|
36
|
+
spec/fixtures/clean/comment_break.txt
|
37
|
+
spec/fixtures/clean/complex_string.txt
|
38
|
+
spec/fixtures/clean/end_concat.txt
|
39
|
+
spec/fixtures/clean/long_indent.txt
|
40
|
+
spec/fixtures/clean/mixed_re.txt
|
41
|
+
spec/fixtures/clean/only_if.txt
|
42
|
+
spec/fixtures/clean/re.txt
|
43
|
+
spec/fixtures/clean/semi_colon_after_end.txt
|
44
|
+
spec/fixtures/clean/sep_line.txt
|
45
|
+
spec/fixtures/clean/unless_problem.txt
|
46
|
+
spec/fixtures/meta/basic_class.txt
|
47
|
+
spec/fixtures/meta/case.txt
|
48
|
+
spec/fixtures/meta/class_with_def.txt
|
49
|
+
spec/fixtures/meta/comment.txt
|
50
|
+
spec/fixtures/meta/comment_after_end.txt
|
51
|
+
spec/fixtures/meta/eval_code.txt
|
52
|
+
spec/fixtures/meta/here_doc.txt
|
53
|
+
spec/fixtures/meta/inline_do_end.txt
|
54
|
+
spec/fixtures/meta/inline_end.txt
|
55
|
+
spec/fixtures/meta/loop.txt
|
56
|
+
spec/fixtures/meta/middle.txt
|
57
|
+
spec/fixtures/meta/multi_blocks.txt
|
58
|
+
spec/fixtures/meta/nested_comment.txt
|
59
|
+
spec/fixtures/meta/optional_do.txt
|
60
|
+
spec/fixtures/meta/optional_do_with_nasty_chars.txt
|
61
|
+
spec/fixtures/meta/partial_method.txt
|
62
|
+
spec/fixtures/meta/single_method.txt
|
63
|
+
spec/fixtures/meta/two_methods.txt
|
64
|
+
spec/fixtures/optional_do/metas/brackets_block.txt
|
65
|
+
spec/fixtures/optional_do/metas/classical.txt
|
66
|
+
spec/fixtures/optional_do/metas/describe.txt
|
67
|
+
spec/fixtures/optional_do/metas/do_block.txt
|
68
|
+
spec/fixtures/optional_do/metas/lambda.txt
|
69
|
+
spec/fixtures/optional_do/metas/square_brackets.txt
|
70
|
+
spec/fixtures/optional_do/rbs/brackets_block.txt
|
71
|
+
spec/fixtures/optional_do/rbs/classical.txt
|
72
|
+
spec/fixtures/optional_do/rbs/describe.txt
|
73
|
+
spec/fixtures/optional_do/rbs/do_block.txt
|
74
|
+
spec/fixtures/optional_do/rbs/lambda.txt
|
75
|
+
spec/fixtures/optional_do/rbs/square_brackets.txt
|
76
|
+
spec/fixtures/real/basic_class.txt
|
77
|
+
spec/fixtures/real/case.txt
|
78
|
+
spec/fixtures/real/class_with_def.txt
|
79
|
+
spec/fixtures/real/comment.txt
|
80
|
+
spec/fixtures/real/comment_after_end.txt
|
81
|
+
spec/fixtures/real/comment_after_end_expected.txt
|
82
|
+
spec/fixtures/real/comment_break.txt
|
83
|
+
spec/fixtures/real/complex_string.txt
|
84
|
+
spec/fixtures/real/end_concat.txt
|
85
|
+
spec/fixtures/real/eval_code.txt
|
86
|
+
spec/fixtures/real/general_eval.txt
|
87
|
+
spec/fixtures/real/here_doc.txt
|
88
|
+
spec/fixtures/real/inline_do_end.txt
|
89
|
+
spec/fixtures/real/inline_end.txt
|
90
|
+
spec/fixtures/real/javascript.txt
|
91
|
+
spec/fixtures/real/long_indent.txt
|
92
|
+
spec/fixtures/real/loop.txt
|
93
|
+
spec/fixtures/real/middle.txt
|
94
|
+
spec/fixtures/real/mixed_re.txt
|
95
|
+
spec/fixtures/real/multi_blocks.txt
|
96
|
+
spec/fixtures/real/nested_comment.txt
|
97
|
+
spec/fixtures/real/only_if.txt
|
98
|
+
spec/fixtures/real/optional_do.txt
|
99
|
+
spec/fixtures/real/optional_do_with_nasty_chars.txt
|
100
|
+
spec/fixtures/real/partial_method.txt
|
101
|
+
spec/fixtures/real/re.txt
|
102
|
+
spec/fixtures/real/semi_colon_after_end.txt
|
103
|
+
spec/fixtures/real/sep_line.txt
|
104
|
+
spec/fixtures/real/single_method.txt
|
105
|
+
spec/fixtures/real/strange_syntax_1.txt
|
106
|
+
spec/fixtures/real/two_methods.txt
|
107
|
+
spec/fixtures/real/unless_problem.txt
|
108
|
+
spec/helper/filter_helper_spec.rb
|
109
|
+
spec/helper/task_helper_spec.rb
|
110
|
+
spec/lazibi_spec.rb
|
111
|
+
spec/spec_helper.rb
|
112
|
+
webgen/src/code/examples/migration.py.rb
|
113
|
+
webgen/src/code/examples/rspec.py.rb
|
114
|
+
webgen/src/css/blossom_base.css
|
115
|
+
webgen/src/css/blossom_v05.css
|
116
|
+
webgen/src/css/code.css
|
117
|
+
webgen/src/css/hack.css
|
118
|
+
webgen/src/css/print.css
|
119
|
+
webgen/src/default.template
|
120
|
+
webgen/src/development.page
|
121
|
+
webgen/src/documentation.page
|
122
|
+
webgen/src/faq.page
|
123
|
+
webgen/src/images/cover_landscape.jpg
|
124
|
+
webgen/src/images/example_picture03.jpg
|
125
|
+
webgen/src/images/example_picture04.jpg
|
126
|
+
webgen/src/index.page
|
127
|
+
webgen/src/installation.page
|
data/README.txt
CHANGED
@@ -1,133 +1,12 @@
|
|
1
1
|
== Welcome to Lazibi
|
2
2
|
|
3
|
-
Lazibi is a
|
3
|
+
Lazibi is a pre-processor that allows one to use Python style indenting in Ruby.
|
4
4
|
|
5
|
-
|
6
|
-
the real directory for you in real time.
|
5
|
+
== Documentation
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
Sweeter RSpec [ Thanks Jay ]
|
11
|
-
|
12
|
-
describe Bowling
|
13
|
-
before(:each)
|
14
|
-
@bowling = Bowling.new
|
15
|
-
|
16
|
-
it "should score 0 for gutter game"
|
17
|
-
20.times { @bowling.hit(0) }
|
18
|
-
@bowling.score.should == 0
|
19
|
-
|
20
|
-
More DIY Rails controller
|
21
|
-
|
22
|
-
class AuctionsController < ApplicationController
|
23
|
-
|
24
|
-
def index
|
25
|
-
@auctions = Auction.paginate :page => params[:page]
|
26
|
-
|
27
|
-
respond_to do |format|
|
28
|
-
format.html # index.rhtml
|
29
|
-
format.xml { render :xml => @auctions.to_xml }
|
30
|
-
|
31
|
-
|
32
|
-
Even sexier migrations ( with sexy_migration Rails plugin )
|
33
|
-
|
34
|
-
class CreateOrders < ActiveRecord::Migration
|
35
|
-
def self.up
|
36
|
-
create_table :orders do
|
37
|
-
fkey :user
|
38
|
-
fkey :auction
|
39
|
-
integer :bid_type
|
40
|
-
timestamps!
|
41
|
-
|
42
|
-
def self.down
|
43
|
-
drop_table :orders
|
44
|
-
|
45
|
-
== Download
|
46
|
-
|
47
|
-
gem install lazibi
|
48
|
-
svn checkout svn://rubyforge.org/var/svn/lazibi/trunk lazibi
|
49
|
-
|
50
|
-
== Usage
|
51
|
-
|
52
|
-
Bootstrap
|
53
|
-
|
54
|
-
mkdir shiny_project
|
55
|
-
cd shiny_project
|
56
|
-
# put trunk in real
|
57
|
-
svn co $svn_path/shiny_project/trunk real
|
58
|
-
lazibi
|
59
|
-
|
60
|
-
Make sure everything still works
|
61
|
-
|
62
|
-
_start_a_new_terminal_
|
63
|
-
cd shiny_project/real
|
64
|
-
rake test / autotest
|
7
|
+
rake webgen
|
65
8
|
|
66
|
-
|
67
|
-
|
68
|
-
cd shiny_project
|
69
|
-
$your_editor meta
|
70
|
-
|
71
|
-
== Tips
|
72
|
-
|
73
|
-
=== Manually create meta files
|
74
|
-
|
75
|
-
* Bootstrap your project as usual, just don't run lazibi
|
76
|
-
|
77
|
-
* setup environment
|
78
|
-
|
79
|
-
mkdir .backup
|
80
|
-
mkdir meta
|
81
|
-
|
82
|
-
* run lazibi
|
83
|
-
|
84
|
-
* create .py.rb files in corresponding directories inside 'meta', .rb files will be created and updated in 'real' as usual
|
85
|
-
|
86
|
-
=== Prevent certain directories from being parsed during bootstrap ( default is ^vendor )
|
87
|
-
|
88
|
-
* Create .lazibi in project/real path
|
89
|
-
|
90
|
-
exclude:
|
91
|
-
- ^vendor
|
92
|
-
- ^tmp
|
93
|
-
- etc
|
94
|
-
|
95
|
-
=== RSpec taste
|
96
|
-
|
97
|
-
* Optional do is only enabled for spec directory. You can customize this behavior by editing .lazibi config file.
|
98
|
-
|
99
|
-
filters:
|
100
|
-
optional_do:
|
101
|
-
- ^spec
|
102
|
-
- ^test
|
103
|
-
- etc
|
104
|
-
|
105
|
-
* Personally I would not recommend using this filter outside the context of RSpec
|
106
|
-
* It's not well tested
|
107
|
-
* Anything more complex then simple description will get unreadable
|
108
|
-
|
109
|
-
== In Practice
|
110
|
-
|
111
|
-
Lazibi is written using Lazibi itself ( incrementally ). Personally I think autotest from http://www.zenspider.com/ZSS/Products/ZenTest/ is a must have, and Lazibi works pretty well using TDD.
|
112
|
-
|
113
|
-
A few projects are used as test code:
|
114
|
-
ActiveRecord, ActionMailer, ActionPack, ActiveSupport, Mongrel, RSpec, redMine.
|
115
|
-
|
116
|
-
Lazibi was used to generate .py.rb files from these projects, and then to .rb files back ( this is the default process ). Tests were then run to ensure compatibility.
|
117
|
-
|
118
|
-
== Known issues
|
119
|
-
|
120
|
-
Here docs, eval, javascript related libs, and complex string evaluation are currently not supported.
|
121
|
-
Ruby code with above syntax will be preserved as is. So your code should still works, just no parse. In other words, if you don't want your code to be parsed, simply add a dummy here doc string...
|
122
|
-
|
123
|
-
== Talk
|
124
|
-
|
125
|
-
http://groups.google.com/group/lazibi-talk
|
126
|
-
|
127
|
-
== To Do
|
128
|
-
|
129
|
-
* Maybe a custom filter for RSpec runner? Still learning though...
|
130
|
-
* Two way sync between real and meta
|
9
|
+
open webgen/output/index.html in your browser
|
131
10
|
|
132
11
|
== Author
|
133
12
|
* Jinjing (mailto:nfjinjing@gmail.com)
|
data/Rakefile
CHANGED
@@ -8,13 +8,14 @@ require 'rake/rdoctask'
|
|
8
8
|
require 'rake/contrib/rubyforgepublisher'
|
9
9
|
require 'fileutils'
|
10
10
|
require 'hoe'
|
11
|
+
require 'spec/rake/spectask'
|
11
12
|
|
12
13
|
include FileUtils
|
13
14
|
require File.join(File.dirname(__FILE__), 'lib', 'lazibi', 'version')
|
14
15
|
|
15
16
|
AUTHOR = 'Jinjing' # can also be an array of Authors
|
16
17
|
EMAIL = "nfjinjing@gmail.com"
|
17
|
-
DESCRIPTION = "Python like
|
18
|
+
DESCRIPTION = "Python like indenting for Ruby"
|
18
19
|
GEM_NAME = 'lazibi' # what ppl will type to install your gem
|
19
20
|
|
20
21
|
@config_file = "~/.rubyforge/user-config.yml"
|
@@ -44,7 +45,7 @@ REV = nil
|
|
44
45
|
# UNCOMMENT IF REQUIRED:
|
45
46
|
# REV = `svn info`.each {|line| if line =~ /^Revision:/ then k,v = line.split(': '); break v.chomp; else next; end} rescue nil
|
46
47
|
VERS = Lazibi::VERSION::STRING + (REV ? ".#{REV}" : "")
|
47
|
-
CLEAN.include ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store']
|
48
|
+
CLEAN.include ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store', 'webgen/output', 'coverage']
|
48
49
|
RDOC_OPTS = ['--quiet', '--title', 'lazibi documentation',
|
49
50
|
"--opname", "index.html",
|
50
51
|
"--line-numbers",
|
@@ -71,7 +72,7 @@ hoe = Hoe.new(GEM_NAME, VERS) do |p|
|
|
71
72
|
|
72
73
|
# == Optional
|
73
74
|
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
74
|
-
|
75
|
+
p.extra_deps = [ ['hoe', '>= 1.2.1'], ['webgen', '>= 0.4.4'], ['activesupport', '>=1.4.2']] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
|
75
76
|
#p.spec_extras = {} # A hash of extra values to set in the gemspec.
|
76
77
|
end
|
77
78
|
|
@@ -80,22 +81,21 @@ PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PRO
|
|
80
81
|
hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
|
81
82
|
|
82
83
|
desc 'Generate website files'
|
83
|
-
task :
|
84
|
-
|
85
|
-
|
86
|
-
end
|
84
|
+
task :webgen_main do
|
85
|
+
sh %{ rm -rf webgen/output}
|
86
|
+
sh %{ webgen -d webgen}
|
87
87
|
end
|
88
88
|
|
89
89
|
desc 'Upload website files to rubyforge'
|
90
90
|
task :website_upload do
|
91
91
|
host = "#{rubyforge_username}@rubyforge.org"
|
92
92
|
remote_dir = "/var/www/gforge-projects/#{PATH}/"
|
93
|
-
local_dir = '
|
93
|
+
local_dir = 'webgen/output'
|
94
94
|
sh %{rsync -aCv #{local_dir}/ #{host}:#{remote_dir}}
|
95
95
|
end
|
96
96
|
|
97
97
|
desc 'Generate and upload website files'
|
98
|
-
task :website => [:
|
98
|
+
task :website => [:webgen, :website_upload]
|
99
99
|
|
100
100
|
desc 'Release the website and new gem version'
|
101
101
|
task :deploy => [:check_version, :website, :release] do
|
@@ -107,7 +107,7 @@ task :deploy => [:check_version, :website, :release] do
|
|
107
107
|
end
|
108
108
|
|
109
109
|
desc 'Runs tasks website_generate and install_gem as a local deployment of the gem'
|
110
|
-
task :local_deploy => [:
|
110
|
+
task :local_deploy => [:webgen, :install_gem]
|
111
111
|
|
112
112
|
task :check_version do
|
113
113
|
unless ENV['VERSION']
|
@@ -121,3 +121,13 @@ task :check_version do
|
|
121
121
|
end
|
122
122
|
|
123
123
|
|
124
|
+
desc "Run all specs with RCov"
|
125
|
+
Spec::Rake::SpecTask.new('specs_with_rcov') do |t|
|
126
|
+
t.spec_files = FileList['spec/**/*.rb']
|
127
|
+
t.rcov = true
|
128
|
+
t.rcov_opts = ['--exclude', 'spec']
|
129
|
+
end
|
130
|
+
|
131
|
+
task :webgen => [:webgen_main, :specs_with_rcov] do
|
132
|
+
sh %{mv coverage webgen/output}
|
133
|
+
end
|