This repository was archived by the owner on Nov 1, 2017. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-13
lines changed
Expand file tree Collapse file tree 2 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -22,27 +22,27 @@ e.g. bundle exec script/enterprise-cutter 2014-07-08 11.10.340
2222 abort error
2323end
2424
25- date = ARGV [ 0 ] . dup # yyyy-mm-dd, like, 2014-07-08
26- version = ARGV [ 1 ] . dup # like, 11.10.340
25+ DATE = ARGV [ 0 ] . dup # yyyy-mm-dd, like, 2014-07-08
26+ VERSION = ARGV [ 1 ] . dup # like, 11.10.340
2727
28- BRANCH_NAME = "add-#{ version } -docs"
28+ BRANCH_NAME = "add-#{ VERSION } -docs"
2929
3030Dir . glob ( 'tasks/*.rake' ) . each { |r | load r }
3131
3232setup
3333
3434temp_dir = Dir . mktmpdir
3535begin
36- %x(git checkout `git rev-list -n 1 --before="#{ date } " gh-pages`)
36+ %x(git checkout `git rev-list -n 1 --before="#{ DATE } " gh-pages`)
3737 `cp -r * #{ temp_dir } `
3838 `git checkout #{ BRANCH_NAME } `
39- FileUtils . mkdir_p ( "enterprise/#{ version } " )
40- `cp -r #{ temp_dir } /* enterprise/#{ version } `
39+ FileUtils . mkdir_p ( "enterprise/#{ VERSION } " )
40+ `cp -r #{ temp_dir } /* enterprise/#{ VERSION } `
4141
42- rewrite_content ( "enterprise/#{ version } " )
42+ rewrite_content ( "enterprise/#{ VERSION } " )
4343
4444 `git add enterprise`
45- `git commit -m "Added enterprise-#{ version } files"`
45+ `git commit -m "Added enterprise-#{ VERSION } files"`
4646ensure
4747 FileUtils . remove_entry_secure temp_dir
4848end
Original file line number Diff line number Diff line change @@ -17,19 +17,19 @@ def rewrite_content(path)
1717 body . set_attribute ( 'class' , classes . push ( 'enterprise' ) . uniq . join ( ' ' ) )
1818
1919 doc . css ( 'a' ) . each do |a |
20- a [ 'href' ] = "/enterprise/#{ version } #{ a [ 'href' ] } " if a [ 'href' ] =~ /^\/ /
20+ a [ 'href' ] = "/enterprise/#{ VERSION } #{ a [ 'href' ] } " if a [ 'href' ] =~ /^\/ /
2121 end
2222
2323 doc . css ( 'link' ) . each do |link |
24- link [ 'href' ] = "/enterprise/#{ version } #{ link [ 'href' ] } " if link [ 'href' ] =~ /^\/ /
24+ link [ 'href' ] = "/enterprise/#{ VERSION } #{ link [ 'href' ] } " if link [ 'href' ] =~ /^\/ /
2525 end
2626
2727 doc . css ( 'script' ) . each do |script |
28- script [ 'src' ] = "/enterprise/#{ version } #{ script [ 'src' ] } " if script [ 'src' ] =~ /^\/ /
28+ script [ 'src' ] = "/enterprise/#{ VERSION } #{ script [ 'src' ] } " if script [ 'src' ] =~ /^\/ /
2929 end
3030
3131 doc . css ( 'img' ) . each do |img |
32- img [ 'src' ] = "/enterprise/#{ version } #{ img [ 'src' ] } " if img [ 'src' ] =~ /^\/ /
32+ img [ 'src' ] = "/enterprise/#{ VERSION } #{ img [ 'src' ] } " if img [ 'src' ] =~ /^\/ /
3333 end
3434
3535 doc . search ( '//*[@class="not-enterprise"]' ) . remove
@@ -38,7 +38,7 @@ def rewrite_content(path)
3838
3939 Dir . glob ( "#{ path } /**/*.css" ) do |css_file |
4040 contents = File . read ( css_file )
41- contents . gsub! ( /url\( \/ shared/ , "url(/enterprise/#{ version } /shared" )
41+ contents . gsub! ( /url\( \/ shared/ , "url(/enterprise/#{ VERSION } /shared" )
4242 File . open ( css_file , 'w' ) { |file | file . write ( contents ) }
4343 end
4444end
You can’t perform that action at this time.
0 commit comments