l5m-tools 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/l5m-tools.gemspec +3 -4
- data/lib/l5m-tools/application.rb +45 -10
- metadata +3 -5
- data/Gemfile +0 -15
- data/Rakefile +0 -54
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cce4207e5065c4048697d1c182a8b34d99a1b611
|
4
|
+
data.tar.gz: 3cefe72bacc9c898d345f8b8915739b3e125c993
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 966abb4d68be592ee267c5f6ecefe011b65ac798b32f5f2dad895dba530f20bd1ff740c7532beae2007965984680bac38f796ccba9e6a5aa400ff53dba96a068
|
7
|
+
data.tar.gz: 44ddc78b42cdf5135479da7be47dc9332fba1280514b008208bdce42643eea4b261f8db3cf53511e6a5ff5e927379c829b63728690e32acdf48c60ec54adfa4b
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/l5m-tools.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "l5m-tools"
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["RONGHAI"]
|
12
|
-
s.date = "2015-07-
|
12
|
+
s.date = "2015-07-08"
|
13
13
|
s.description = "A tool set for Lake5Media and QingheTech developer"
|
14
14
|
s.email = "ronghai.wei@outlook.com"
|
15
15
|
s.executables = ["duplicate-app", "l5m", "make-app", "set_env.sh", "svn.tool"]
|
@@ -19,10 +19,8 @@ Gem::Specification.new do |s|
|
|
19
19
|
]
|
20
20
|
s.files = [
|
21
21
|
".document",
|
22
|
-
"Gemfile",
|
23
22
|
"LICENSE.txt",
|
24
23
|
"README.md",
|
25
|
-
"Rakefile",
|
26
24
|
"VERSION",
|
27
25
|
"bin/duplicate-app",
|
28
26
|
"bin/l5m",
|
@@ -54,6 +52,7 @@ Gem::Specification.new do |s|
|
|
54
52
|
]
|
55
53
|
s.homepage = "http://github.com/RONGHAI/l5m-tools"
|
56
54
|
s.licenses = ["MIT"]
|
55
|
+
s.post_install_message = ""
|
57
56
|
s.require_paths = ["lib"]
|
58
57
|
s.rubygems_version = "2.0.14"
|
59
58
|
s.summary = "A tool set for Lake5Media and QingheTech developer"
|
@@ -3,10 +3,21 @@ require 'pathname'
|
|
3
3
|
|
4
4
|
module L5MTools
|
5
5
|
TEMPLATE_DIR = Pathname.new(__FILE__).parent + 'template'
|
6
|
-
|
6
|
+
puts TEMPLATE_DIR
|
7
7
|
class Application
|
8
8
|
require 'l5m-tools/tools'
|
9
|
-
include Tools
|
9
|
+
include Tools
|
10
|
+
|
11
|
+
#that is svn remove
|
12
|
+
def rm(file, options)
|
13
|
+
#FileUtils.rm(file, :force => true)
|
14
|
+
# remove file from svn
|
15
|
+
package = file[(WORKSPACE.length+1)..(-1)]
|
16
|
+
svnfile = package[(package.index(/[\/\\]/) + 1)..(-1)]
|
17
|
+
package = package[0...(package.index(/[\/\\]/))]
|
18
|
+
require 'l5m-tools/l5m-tools-module'
|
19
|
+
L5MTools.svn.delete([package], {}, [ "--force", svnfile])
|
20
|
+
end
|
10
21
|
def duplicate_app(*args)
|
11
22
|
delete = args.delete('-d')
|
12
23
|
replacements = {args[1] => args[2]}
|
@@ -20,7 +31,7 @@ module L5MTools
|
|
20
31
|
if line.length > 0 && line[0] != '#'
|
21
32
|
#duplicate_and_replace( line.chomp , replacements )
|
22
33
|
#FileUtils.rm(line, :force => true) if delete
|
23
|
-
|
34
|
+
rm(line, :force => true) if duplicate_and_replace( line.chomp , replacements )[1] != line && delete
|
24
35
|
end
|
25
36
|
end
|
26
37
|
end
|
@@ -37,19 +48,33 @@ module L5MTools
|
|
37
48
|
#puts line #File.basename(line, ".*")
|
38
49
|
unless(bn[application.length] =~ /[a-z0-9]/)
|
39
50
|
#puts line #File.basename(line, ".*")
|
40
|
-
|
51
|
+
rm(line, :force => true) if duplicate_and_replace( line.chomp , replacements )[1] != line && delete
|
41
52
|
end
|
42
53
|
}
|
43
54
|
end
|
44
55
|
|
56
|
+
def del_wo_csv(*args)
|
57
|
+
package = args[0]
|
58
|
+
application = args[1]
|
59
|
+
Dir.glob("#{WORKSPACE}/#{package}/{src,WebContent}/**/#{application}*.*", File::FNM_CASEFOLD).each{|line|
|
60
|
+
bn = File.basename(line, ".*")
|
61
|
+
unless(bn[application.length] =~ /[a-z0-9]/)
|
62
|
+
puts line
|
63
|
+
rm(line, :force => true)
|
64
|
+
end
|
65
|
+
}
|
66
|
+
end
|
45
67
|
#read file list from file and delete them
|
46
68
|
def del(*args)
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
69
|
+
unless File.exist?(args[0])
|
70
|
+
del_wo_csv(*args)
|
71
|
+
else
|
72
|
+
File.open(args[0], "r") do |infile|
|
73
|
+
while (line = infile.gets)
|
74
|
+
line = line.chomp.strip
|
75
|
+
if line.length > 0 && line[0] != '#'
|
76
|
+
rm(line, :force => true)
|
77
|
+
end
|
53
78
|
end
|
54
79
|
end
|
55
80
|
end
|
@@ -77,5 +102,15 @@ module L5MTools
|
|
77
102
|
end
|
78
103
|
block.call(Time.now, package, application, use_base_worker) if block_given?
|
79
104
|
end
|
105
|
+
|
106
|
+
def version
|
107
|
+
file = Pathname.new(__FILE__).parent.parent.parent.to_s + "/VERSION"
|
108
|
+
puts(File.exist?(file) ? File.read(file) : "")
|
109
|
+
end
|
110
|
+
def help
|
111
|
+
puts <<-EOF
|
112
|
+
Please go to https://github.com/RONGHAI/l5m-tools
|
113
|
+
EOF
|
114
|
+
end
|
80
115
|
end
|
81
116
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: l5m-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RONGHAI
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: shoulda
|
@@ -80,10 +80,8 @@ extra_rdoc_files:
|
|
80
80
|
- README.md
|
81
81
|
files:
|
82
82
|
- .document
|
83
|
-
- Gemfile
|
84
83
|
- LICENSE.txt
|
85
84
|
- README.md
|
86
|
-
- Rakefile
|
87
85
|
- VERSION
|
88
86
|
- bin/duplicate-app
|
89
87
|
- bin/l5m
|
@@ -116,7 +114,7 @@ homepage: http://github.com/RONGHAI/l5m-tools
|
|
116
114
|
licenses:
|
117
115
|
- MIT
|
118
116
|
metadata: {}
|
119
|
-
post_install_message:
|
117
|
+
post_install_message: ''
|
120
118
|
rdoc_options: []
|
121
119
|
require_paths:
|
122
120
|
- lib
|
data/Gemfile
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
source "http://rubygems.org"
|
2
|
-
# Add dependencies required to use your gem here.
|
3
|
-
# Example:
|
4
|
-
# gem "activesupport", ">= 2.3.5"
|
5
|
-
|
6
|
-
# Add dependencies to develop your gem here.
|
7
|
-
# Include everything needed to run rake, tests, features, etc.
|
8
|
-
group :development do
|
9
|
-
gem "shoulda", ">= 0"
|
10
|
-
gem "rdoc", "~> 3.12"
|
11
|
-
gem "bundler" #, "~> 1.2.0"
|
12
|
-
gem "jeweler", "~> 1.8.4"
|
13
|
-
#gem "etc"
|
14
|
-
#gem "rcov", ">= 0"
|
15
|
-
end
|
data/Rakefile
DELETED
@@ -1,54 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
require 'bundler'
|
5
|
-
begin
|
6
|
-
Bundler.setup(:default, :development)
|
7
|
-
rescue Bundler::BundlerError => e
|
8
|
-
$stderr.puts e.message
|
9
|
-
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
-
exit e.status_code
|
11
|
-
end
|
12
|
-
require 'rake'
|
13
|
-
|
14
|
-
require 'jeweler'
|
15
|
-
Jeweler::Tasks.new do |gem|
|
16
|
-
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
-
gem.name = "l5m-tools"
|
18
|
-
gem.homepage = "http://github.com/RONGHAI/l5m-tools"
|
19
|
-
gem.license = "MIT"
|
20
|
-
gem.summary = %Q{A tool set for Lake5Media and QingheTech developer }
|
21
|
-
gem.description = %Q{A tool set for Lake5Media and QingheTech developer}
|
22
|
-
gem.email = "ronghai.wei@outlook.com"
|
23
|
-
#gem.platform = Gem::Platform::Win32
|
24
|
-
gem.authors = ["RONGHAI"]
|
25
|
-
# dependencies defined in Gemfile
|
26
|
-
end
|
27
|
-
Jeweler::RubygemsDotOrgTasks.new
|
28
|
-
|
29
|
-
require 'rake/testtask'
|
30
|
-
Rake::TestTask.new(:test) do |test|
|
31
|
-
test.libs << 'lib' << 'test'
|
32
|
-
test.pattern = 'test/**/test_*.rb'
|
33
|
-
test.verbose = true
|
34
|
-
end
|
35
|
-
|
36
|
-
#require 'rcov/rcovtask'
|
37
|
-
#Rcov::RcovTask.new do |test|
|
38
|
-
# test.libs << 'test'
|
39
|
-
# test.pattern = 'test/**/test_*.rb'
|
40
|
-
# test.verbose = true
|
41
|
-
# test.rcov_opts << '--exclude "gems/*"'
|
42
|
-
#end
|
43
|
-
|
44
|
-
task :default => :test
|
45
|
-
|
46
|
-
require 'rdoc/task'
|
47
|
-
Rake::RDocTask.new do |rdoc|
|
48
|
-
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
49
|
-
|
50
|
-
rdoc.rdoc_dir = 'rdoc'
|
51
|
-
rdoc.title = "l5m-tools #{version}"
|
52
|
-
rdoc.rdoc_files.include('README*')
|
53
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
54
|
-
end
|