w2tags 0.9.52 → 0.9.53

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/bin/w2tags +20 -19
  2. data/lib/w2tags/parser.rb +6 -5
  3. data/tasks/setup.rb +1 -1
  4. metadata +3 -3
data/bin/w2tags CHANGED
@@ -24,6 +24,7 @@
24
24
  require File.expand_path(
25
25
  File.join(File.dirname(__FILE__),%w[.. lib w2tags]))
26
26
  wpath= File.dirname(__FILE__).gsub(/bin$/,'')
27
+
27
28
  def howto_w2tags
28
29
  puts <<END
29
30
 
@@ -53,22 +54,22 @@ end
53
54
 
54
55
  arg = ARGV
55
56
  if arg.size>0
56
- arg = ['w2erb'] + arg if arg.size==1 && arg[0]=='-a'
57
- puts 'ARGV : '+arg.join(" ")
58
- puts arg[1]
59
-
60
- WH = W2Tags::Parser.new
57
+ arg = ['w2erb'] + arg if arg.size==1 && arg[0]=='-a'
58
+ puts 'ARGV : '+arg.join(" ")
59
+ puts arg[1]
60
+
61
+ WH = W2Tags::Parser.new
61
62
 
62
- x = arg.select {|s|s[0,3]=='-d:'}
63
- #WH.dbg[:stack] = (x.size==0)
64
- x.each do |s|
65
- WH.dbg[:parse] = true if s=='-d:parser'
66
- WH.dbg[:stack] = true if s=='-d:stack'
67
- WH.dbg[:constanta] = true if s=='-d:constanta'
68
- WH.dbg[:show_hot] = true if s=='-d:show_hot'
69
- end
70
-
71
- if arg[0]=='-irb'
63
+ x = arg.select {|s|s[0,3]=='-d:'}
64
+ #WH.dbg[:stack] = (x.size==0)
65
+ x.each do |s|
66
+ WH.dbg[:parse] = true if s=='-d:parser'
67
+ WH.dbg[:stack] = true if s=='-d:stack'
68
+ WH.dbg[:constanta] = true if s=='-d:constanta'
69
+ WH.dbg[:show_hot] = true if s=='-d:show_hot'
70
+ end
71
+
72
+ if arg[0]=='-irb'
72
73
  ARGV.shift
73
74
 
74
75
  class Object
@@ -84,7 +85,7 @@ if arg.size>0
84
85
  puts ''
85
86
 
86
87
  IRB.start
87
- elsif arg[0]=='-rails'
88
+ elsif arg[0]=='-rails'
88
89
  if !File.exist?('vendor/plugins')
89
90
  puts 'No Folder: vendor/plugins...'
90
91
  elsif !File.exist?('config/environment.rb')
@@ -134,7 +135,7 @@ script/server
134
135
 
135
136
  END
136
137
  end
137
- elsif arg[0]=='-tags2w'
138
+ elsif arg[0]=='-tags2w'
138
139
  require 'tags2w'
139
140
  t2t = MakeTag.new
140
141
  t2w = Tags2w.new
@@ -167,7 +168,7 @@ END
167
168
  when '-b' ;WH.parse_files(arg[0].split(','),false)
168
169
  else ;WH.parse_files(arg[0].split(','))
169
170
  end
170
- end
171
+ end
171
172
  else
172
- howto_w2tags
173
+ howto_w2tags
173
174
  end
@@ -327,7 +327,7 @@ module W2Tags
327
327
  #in gem/hot and merging the HOT, this command can have multiple
328
328
  #file HOT separate with ";"
329
329
  def merge_hot
330
- if(/!hot! *([\w;]+)([`\n])/ =~ @row;@rgx = $~)
330
+ if(/!hot! *([\w;]+)([\n])/ =~ @row;@rgx = $~)
331
331
  hots= @rgx[1].split(';').collect {|x|x+'.'+@hot}
332
332
  rpl = ['']
333
333
  hots.each do |hot|
@@ -350,12 +350,12 @@ module W2Tags
350
350
  #it will include / replace current row from file include, and after
351
351
  #parser will try to get current row after merging to be evaluate
352
352
  def merge_w2x
353
- if(/!inc! *([\/\w._]+)([`\n])/ =~ @row;@rgx = $~)
353
+ if(/!inc! *([\/\w._]+)([\n])/ =~ @row;@rgx = $~)
354
354
  mac = @src_path+'/'+$1
355
355
  src = $~.to_s #;p mac
356
356
  if File.exist?(mac)
357
357
  pop = $~.captures.pop
358
- new = IO.read(mac).delete("\r").gsub("\n","\n"+@spc) + ( pop=='`' ? "\n"+@spc : '' )
358
+ new = IO.read(mac).delete("\r").gsub("\n","\n"+@spc)
359
359
  @doc_src= @row.gsub(src,new).split("\n")+@doc_src
360
360
  @row= @doc_src.shift+"\n"
361
361
  parse_spc
@@ -445,10 +445,11 @@ module W2Tags
445
445
  classs.sub!(/=$/,'') if classs
446
446
  clsmlt = classs.to_s.split(';')
447
447
  clscnt = clsmlt.length
448
+ clsmlt+= clscnt==1 ? clsmlt*prms.length : ['']*prms.length
448
449
  prms.each_with_index do |x,i|
449
450
  line = rpt+x #tmp<< @new.gsub(new_prms[0],x)
450
- #implement multi class params ^.d;.g canggh;bow
451
- line.gsub!(classs,(clscnt>i ? clsmlt[i] : '')) if classs
451
+ #implement multi class params ^.d;.g canggh;bow
452
+ line.gsub!(classs,clsmlt[i]) if classs
452
453
  tmp<< line
453
454
  tmp<< "\n#{@spc}" if i+1<prms.size
454
455
  end
@@ -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.52',
20
+ :version => ENV['VERSION'] || '0.9.53',
21
21
  :exclude => %w(tmp$ bak$ ~$ CVS \.svn/ \.git/ ^pkg/),
22
22
  :release_name => ENV['RELEASE'],
23
23
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: w2tags
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.52
4
+ version: 0.9.53
5
5
  platform: ruby
6
6
  authors:
7
7
  - widi harsojo
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-30 00:00:00 -07:00
12
+ date: 2009-10-27 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -155,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
155
  requirements: []
156
156
 
157
157
  rubyforge_project: w2tags
158
- rubygems_version: 1.3.4
158
+ rubygems_version: 1.3.5
159
159
  signing_key:
160
160
  specification_version: 3
161
161
  summary: Its Way to Tags