w2tags 0.9.67 → 0.9.68

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.67
1
+ 0.9.68
data/bin/w2tags CHANGED
@@ -7,18 +7,18 @@
7
7
  # OR
8
8
  # w2tags [file1,file2,file3] [-b] [-d:*opt*]
9
9
  #
10
- # example:
11
- # 1. w2tags -a #=> translate all file with ext: w2erb
12
- # 2. w2tags *.w2erb -a #=> translate all file with ext: w2erb
13
- # 3. w2tags file1.w2erb #=> translate a file
14
- # 4. w2tags file1.w2erb -b #=> translate a file with no initialize/finalize
15
- # 5. w2tags file1.w2erb -d:parser #=> translate with debug parser
16
- # 6. w2tags file1.w2erb -d:constanta #=> translate with debug constanta
17
- # 7. w2tags file1.w2erb -d:stack #=> translate with debug stack indentation
18
- # 8. w2tags -try #=> Test W2tags using Sinatra http://localhost:4567/
19
- # 9. w2tags -irb #=> Start IRB with WH as instance object of W2Tags
20
- # 10. w2tags -rails #=> Copy w2scaffold Rails and set environment.rb
21
- # 11.w2tags -tags2w #=> Parsing erb to w2tags
10
+ # example:
11
+ # 1. w2tags -a #=> translate all file with ext: w2erb
12
+ # 2. w2tags *.w2erb -a #=> translate all file with ext: w2erb
13
+ # 3. w2tags fl.w2erb #=> translate a file
14
+ # 4. w2tags fl.w2erb -b #=> translate a file with no initialize/finalize
15
+ # 5. w2tags fl.w2erb -d:parse #=> translate with debug parser
16
+ # 6. w2tags fl.w2erb -d:const #=> translate with debug constanta
17
+ # 7. w2tags fl.w2erb -d:stack #=> translate with debug stack indentation
18
+ # 8. w2tags -try #=> Test W2tags using Sinatra http://localhost:4567/
19
+ # 9. w2tags -irb #=> Start IRB with W2 as instance object of W2Tags
20
+ # 10.w2tags -rails #=> Copy w2scaffold Rails and set environment.rb
21
+ # 11.w2tags -tags2w #=> Parsing erb to w2tags
22
22
  #
23
23
  # Enjoy...
24
24
 
@@ -37,17 +37,17 @@ OR
37
37
  w2tags [file1,file2,file3] [-b] [-d:*opt*]
38
38
 
39
39
  example:
40
- 1. w2tags -a #=> translate all file with ext: w2erb
41
- 2. w2tags *.w2erb -a #=> translate all file with ext: w2erb
42
- 3. w2tags file1.w2erb #=> translate a file
43
- 4. w2tags file1.w2erb -b #=> translate a file with no initialize/finalize
44
- 5. w2tags file1.w2erb -d:parser #=> translate with debug parser
45
- 6. w2tags file1.w2erb -d:constanta #=> translate with debug constanta
46
- 7. w2tags file1.w2erb -d:stack #=> translate with debug stack indentation
47
- 8. w2tags -try #=> Test W2tags using Sinatra http://localhost:4567/
48
- 9. w2tags -irb #=> Start IRB with WH as instance object of W2Tags
49
- 10. w2tags -rails #=> Copy w2scaffold Rails and set environment.rb
50
- 11.w2tags -tags2w #=> Parsing erb to w2tags
40
+ 1. w2tags -a #=> translate all file with ext: w2erb
41
+ 2. w2tags *.w2erb -a #=> translate all file with ext: w2erb
42
+ 3. w2tags fl.w2erb #=> translate a file
43
+ 4. w2tags fl.w2erb -b #=> translate a file with no initialize/finalize
44
+ 5. w2tags fl.w2erb -d:parse #=> translate with debug parser
45
+ 6. w2tags fl.w2erb -d:const #=> translate with debug constanta
46
+ 7. w2tags fl.w2erb -d:stack #=> translate with debug stack indentation
47
+ 8. w2tags -try #=> Test W2tags using Sinatra http://localhost:4567/
48
+ 9. w2tags -irb #=> Start IRB with W2 as instance object of W2Tags
49
+ 10.w2tags -rails #=> Copy w2scaffold Rails and set environment.rb
50
+ 11.w2tags -tags2w #=> Parsing erb to w2tags
51
51
 
52
52
  Enjoy...
53
53
  END
@@ -60,15 +60,15 @@ if arg.size>0
60
60
  puts 'ARGV : '+arg.join(" ")
61
61
  puts arg[1]
62
62
 
63
- WH = W2Tags::Parser.new
63
+ W2 = W2Tags::Parser.new
64
64
 
65
65
  x = arg.select {|s|s[0,3]=='-d:'}
66
- #WH.dbg[:stack] = (x.size==0)
66
+ # W2.dbg[:stack] = (x.size==0)
67
67
  x.each do |s|
68
- WH.dbg[:parse] = true if s=='-d:parser'
69
- WH.dbg[:stack] = true if s=='-d:stack'
70
- WH.dbg[:constanta] = true if s=='-d:constanta'
71
- WH.dbg[:show_hot] = true if s=='-d:show_hot'
68
+ W2.dbg[:parse] = true if s=='-d:parse'
69
+ W2.dbg[:stack] = true if s=='-d:stack'
70
+ W2.dbg[:const] = true if s=='-d:const'
71
+ W2.dbg[:show_hot] = true if s=='-d:show_hot'
72
72
  end
73
73
 
74
74
  if arg[0]=='-try'
@@ -79,19 +79,29 @@ if arg.size>0
79
79
  ARGV.shift
80
80
 
81
81
  class Object
82
- def wh(str)
83
- rtn = WH.parse_line(str)
82
+ def w2(str)
83
+ rtn = W2.parse_line(str)
84
84
  puts rtn
85
- rtn
86
85
  end
87
86
  end
88
87
 
89
88
  require 'irb'
90
- puts "Your W2Tags instance object stored in WH..."
91
- puts 'Ex: puts WH.parse_line "#content\\n %span Hello"'
92
- puts 'Shortcut wh() => puts WH.parse_line()'
93
- puts ''
94
-
89
+
90
+ puts <<EOF
91
+ Your W2Tags instance object stored in W2
92
+ Ex: puts W2.parse_line "#content\\n %span.say Hello"
93
+ Shortcut w2, example:
94
+ 1.9.3p125 :001 > w2 <<EOF
95
+ 1.9.3p125 :002 > #content
96
+ 1.9.3p125 :003 > %span.say Hello
97
+ 1.9.3p125 :004 > EOF
98
+ =>/Users/wharsojo/.rvm/gems/ruby-1.9.3-p125@gems/gems/w2tags-0.9.68/hot/erb.hot
99
+ <div id="content">
100
+ <span class="say">Hello</span>
101
+ </div>
102
+ => nil
103
+ EOF
104
+
95
105
  IRB.start
96
106
  elsif arg[0]=='-rails'
97
107
  if !File.exist?('vendor/plugins')
@@ -171,10 +181,10 @@ END
171
181
  when '-a' ;
172
182
  fls = Dir["./**/views/**/#{arg[0]}"]
173
183
  fls = Dir["./**/#{arg[0]}"] if fls==[]
174
- #WH.parse_files(Dir["*.#{arg[0]}*"])
175
- WH.parse_files(fls)
176
- when '-b' ;WH.parse_files(arg[0].split(','),false)
177
- else ;WH.parse_files(arg[0].split(','))
184
+ # W2.parse_files(Dir["*.#{arg[0]}*"])
185
+ W2.parse_files(fls)
186
+ when '-b' ; W2.parse_files(arg[0].split(','),false)
187
+ else ; W2.parse_files(arg[0].split(','))
178
188
  end
179
189
  end
180
190
  else
@@ -2,6 +2,14 @@
2
2
 
3
3
  Below is a complete list of changes for each revision of W2TAGS.
4
4
 
5
+ == 0.9.68
6
+
7
+ === Command line
8
+ * refactor the command paramters
9
+ * shortcut change from WH => W2
10
+ * shortcut change from w2 => w2
11
+ * shortcut w2 return nil
12
+
5
13
  == 0.9.67
6
14
 
7
15
  === Parser
@@ -102,3 +102,23 @@ module W2Tags
102
102
  end
103
103
  end
104
104
  require 'w2tags/parser'
105
+
106
+ if Object.const_defined?(:Rails) &&
107
+ Rails.version.match(/^3/) &&
108
+ Rails.env == "development"
109
+ puts 'W2Tags Hooked on Rails 3.x !'
110
+
111
+ module ActionView
112
+ class PathResolver
113
+ alias :w2query :query
114
+ W2TAGS = W2Tags::Parser.new('rails')
115
+
116
+ def query(path, details, formats)
117
+ tpl = "app/views/#{path}.#{formats[0]}.w2erb"
118
+ W2TAGS.parse_file(tpl, true, true)
119
+ w2query(path, details, formats)
120
+ end
121
+ end
122
+ end
123
+
124
+ end
@@ -1,6 +1,6 @@
1
1
  module ActionView
2
- if Object::RAILS_ENV != "development"
3
- puts 'W2Tags Only RUN on (RAILS_ENV == "development")'
2
+ if Object::Rails.env != "development"
3
+ puts 'W2Tags Only RUN on (Rails.env == "development")'
4
4
  else
5
5
  puts 'W2Tags Hooked on Rails 3.x !'
6
6
  class PathResolver
@@ -17,7 +17,7 @@ PROJ = OpenStruct.new(
17
17
  :authors => 'Widi Harsojo',
18
18
  :email => 'wharsojo@gmail.com',
19
19
  :url => "\000",
20
- :version => ENV['VERSION'] || '0.9.67',
20
+ :version => `cat VERSION`,
21
21
  :exclude => %w(tmp$ bak$ ~$ CVS \.svn/ \.git/ ^pkg/),
22
22
  :release_name => ENV['RELEASE'],
23
23
 
metadata CHANGED
@@ -1,31 +1,24 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: w2tags
3
- version: !ruby/object:Gem::Version
4
- hash: 189
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 9
9
- - 67
10
- version: 0.9.67
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.9.68
5
+ prerelease:
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - widi harsojo
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-01-05 00:00:00 +07:00
19
- default_executable:
12
+ date: 2012-09-22 00:00:00.000000000 Z
20
13
  dependencies: []
21
-
22
- description: w2tags is the way to tags, a short cut / macros. when it do it use some patern define in files (HOT file) to produce tags from minimal code to become full fledge tags
14
+ description: w2tags is the way to tags, a short cut / macros. when it do it use some
15
+ patern define in files (HOT file) to produce tags from minimal code to become full
16
+ fledge tags
23
17
  email: wharsojo@gmail.com
24
- executables:
18
+ executables:
25
19
  - w2tags
26
20
  extensions: []
27
-
28
- extra_rdoc_files:
21
+ extra_rdoc_files:
29
22
  - README.rdoc
30
23
  - doc/W2TAGS.rdoc
31
24
  - doc/ERB.HOT.rdoc
@@ -104,7 +97,7 @@ extra_rdoc_files:
104
97
  - lib/w2tags/try/views/index.erb
105
98
  - lib/w2tags/try/views/layout.erb
106
99
  - lib/w2tags/try/views/parse.erb
107
- files:
100
+ files:
108
101
  - Manifest.txt
109
102
  - README.rdoc
110
103
  - Rakefile
@@ -257,12 +250,10 @@ files:
257
250
  - plugins/w2tags/generators/w2scaffold/templates/view_new.html.w2erb
258
251
  - plugins/w2tags/generators/w2scaffold/templates/view_show.html.erb
259
252
  - plugins/w2tags/generators/w2scaffold/templates/view_show.html.w2erb
260
- has_rdoc: true
261
253
  homepage: http://w2tags.rubyforge.org
262
254
  licenses: []
263
-
264
255
  post_install_message:
265
- rdoc_options:
256
+ rdoc_options:
266
257
  - --line-numbers
267
258
  - --inline-source
268
259
  - -A cattr_accessor=object
@@ -271,32 +262,24 @@ rdoc_options:
271
262
  - --all
272
263
  - --main
273
264
  - README.rdoc
274
- require_paths:
265
+ require_paths:
275
266
  - lib
276
- required_ruby_version: !ruby/object:Gem::Requirement
267
+ required_ruby_version: !ruby/object:Gem::Requirement
277
268
  none: false
278
- requirements:
279
- - - ">="
280
- - !ruby/object:Gem::Version
281
- hash: 3
282
- segments:
283
- - 0
284
- version: "0"
285
- required_rubygems_version: !ruby/object:Gem::Requirement
269
+ requirements:
270
+ - - ! '>='
271
+ - !ruby/object:Gem::Version
272
+ version: '0'
273
+ required_rubygems_version: !ruby/object:Gem::Requirement
286
274
  none: false
287
- requirements:
288
- - - ">="
289
- - !ruby/object:Gem::Version
290
- hash: 3
291
- segments:
292
- - 0
293
- version: "0"
275
+ requirements:
276
+ - - ! '>='
277
+ - !ruby/object:Gem::Version
278
+ version: '0'
294
279
  requirements: []
295
-
296
280
  rubyforge_project: w2tags
297
- rubygems_version: 1.3.7
281
+ rubygems_version: 1.8.24
298
282
  signing_key:
299
283
  specification_version: 3
300
284
  summary: Its Way to Tags
301
285
  test_files: []
302
-