l5m-tools 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -1,8 +1,24 @@
1
- = l5m-tools
1
+ ### l5m-tools
2
2
 
3
- Description goes here.
3
+ * This is a tool set for Lake 5 Media and Qinghe Tech Programmer.
4
+ * It includes make-app for creating a new app.
4
5
 
5
- == Contributing to l5m-tools
6
+ ### Usage
7
+ * first please install svn and git
8
+ * please add the following sys env variables
9
+ * WORKSPACE
10
+ * CATALINA_HOME
11
+ * SVN_USER
12
+ * SENDER_EMAIL
13
+ * PAKAGES #common;qhtcommon;customtags;rem
14
+ * DEV_HOST
15
+ * `$l5m make` or `$make-app`# to create a new app
16
+ * `$l5m dup file.csv original new` or `$duplicate-app file.csv original new` #duplicate a app with the files in file.csv, and use new to replace original
17
+ * `$l5m svn status` #ls all uncommitted files
18
+ * `$l5m svn log` #ls all today's commits
19
+ * `$l5m svn update packs` #update all packges.
20
+
21
+ ### Contributing to l5m-tools
6
22
 
7
23
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
8
24
  * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
@@ -12,8 +28,7 @@ Description goes here.
12
28
  * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
29
  * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
30
 
15
- == Copyright
31
+ ### Copyright
16
32
 
17
- Copyright (c) 2013 Ronghai. See LICENSE.txt for
18
- further details.
33
+ Copyright (c) 2013 RONGHAI. See LICENSE.txt for further details.
19
34
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
data/l5m-tools.gemspec CHANGED
@@ -5,25 +5,23 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "l5m-tools"
8
- s.version = "0.0.3"
8
+ s.version = "0.0.4"
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 = "2013-02-09"
12
+ s.date = "2013-02-12"
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"]
16
16
  s.extra_rdoc_files = [
17
17
  "LICENSE.txt",
18
- "README",
19
- "README.rdoc"
18
+ "README"
20
19
  ]
21
20
  s.files = [
22
21
  ".document",
23
22
  "Gemfile",
24
23
  "LICENSE.txt",
25
24
  "README",
26
- "README.rdoc",
27
25
  "Rakefile",
28
26
  "VERSION",
29
27
  "bin/duplicate-app",
@@ -21,15 +21,15 @@ module L5MTools
21
21
  '!REPLACE_ME_FILE!' => application,
22
22
  '!REPLACE_STYLE!' => package
23
23
  }
24
- copy_silently( use_base_worker ? (TEMPLATE_DIR+"TemplateBaseAbstractWorker.java") : (TEMPLATE_DIR+"TemplateWorker.java") ,
24
+ copy_with_replace( use_base_worker ? (TEMPLATE_DIR+"TemplateBaseAbstractWorker.java") : (TEMPLATE_DIR+"TemplateWorker.java") ,
25
25
  "#{WORKSPACE}/#{package}/src/com/l5m/#{package}/engine/worker/#{application}Worker.java" , replacements )
26
- copy_silently( TEMPLATE_DIR+"TemplateServicerImpl.java" ,
26
+ copy_with_replace( TEMPLATE_DIR+"TemplateServicerImpl.java" ,
27
27
  "#{WORKSPACE}/#{package}/src/com/l5m/#{package}/engine/servicer/#{application}ServicerImpl.java" , replacements )
28
28
  if File.exist?( TEMPLATE_DIR+"#{package}.jsp")
29
- copy_silently( TEMPLATE_DIR+"#{package}.jsp" ,
29
+ copy_with_replace( TEMPLATE_DIR+"#{package}.jsp" ,
30
30
  "#{WORKSPACE}/#{package}/src/jsp/#{application}.jsp" , replacements )
31
31
  else
32
- copy_silently( TEMPLATE_DIR+"Template.jsp" ,
32
+ copy_with_replace( TEMPLATE_DIR+"Template.jsp" ,
33
33
  "#{WORKSPACE}/#{package}/src/jsp/#{application}.jsp" , replacements )
34
34
  end
35
35
  block.call(Time.now, package, application, use_base_worker) if block_given?
data/lib/l5m-tools/svn.rb CHANGED
@@ -95,7 +95,7 @@ module L5MTools
95
95
  cmd = args.shift if 'svn' == cmd
96
96
  args , svn_args = args[0..(args.index '--')], args[((args.index '--')+1)..-1] if args.index '--'
97
97
 
98
- options = {username:(args.option! '--user' || SVN_USER), reverse:(args.delete('-r')), date: (args.option!('--date')), mail:(args.delete('-e') || args.delete('--email')) }
98
+ options = {username:((args.option! '--user') || SVN_USER), reverse:(args.delete('-r')), date: (args.option!('--date')), mail:(args.delete('-e') || args.delete('--email')) }
99
99
  options[:sendto] = args.option!('-s') || SENDER_EMAIL
100
100
  options[:title] = args.option!('--title') || "svn #{cmd} @#{Time.now.strftime("%F %T")}"
101
101
 
@@ -28,7 +28,8 @@ module L5MTools
28
28
  File.open(in_file, 'w') { | io | io.puts(contents) }
29
29
  return changed
30
30
  end
31
- def copy_silently(from, to, replacements)
31
+ def copy_with_replace(from, to, replacements)
32
+ FileUtils.mkdir_p File.dirname(to)
32
33
  copy(from, to)
33
34
  replace(to, replacements)
34
35
  end
@@ -55,13 +56,13 @@ module L5MTools
55
56
  def duplicate_and_replace(file, replacements = {})
56
57
  to = to_file(file, replacements)
57
58
  yield to if block_given?
58
- copy_silently(file, to, replacements)
59
+ copy_with_replace(file, to, replacements)
59
60
  end
60
61
 
62
+ alias :copy_silently :copy_with_replace
61
63
 
62
64
  def user_home
63
- require 'etc'
64
- Etc.getpwuid.dir
65
+ File.expand_path('~')
65
66
  end
66
67
 
67
68
  #module_function :send_mail, :replace, :copy_silently, :change_directory, :ask
data/lib/l5m-tools.rb CHANGED
@@ -3,6 +3,13 @@ require 'l5m-tools/string'
3
3
  require 'l5m-tools/svn'
4
4
 
5
5
  module L5MTools
6
+ module Tools
7
+ alias :copy_with_replace_without_puts :copy_with_replace
8
+ def copy_with_replace(from, to, replacements)
9
+ puts to
10
+ copy_with_replace_without_puts(from, to, replacements)
11
+ end
12
+ end
6
13
  class Application
7
14
  alias old_make_app make_app
8
15
  def make_app(*args, &block)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: l5m-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-09 00:00:00.000000000 Z
12
+ date: 2013-02-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: shoulda
16
- requirement: &70303796216800 !ruby/object:Gem::Requirement
16
+ requirement: &70176294116400 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70303796216800
24
+ version_requirements: *70176294116400
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rdoc
27
- requirement: &70303796216200 !ruby/object:Gem::Requirement
27
+ requirement: &70176294115660 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '3.12'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70303796216200
35
+ version_requirements: *70176294115660
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: bundler
38
- requirement: &70303796215540 !ruby/object:Gem::Requirement
38
+ requirement: &70176294115060 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 1.2.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70303796215540
46
+ version_requirements: *70176294115060
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: jeweler
49
- requirement: &70303796214660 !ruby/object:Gem::Requirement
49
+ requirement: &70176294114400 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: 1.8.4
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70303796214660
57
+ version_requirements: *70176294114400
58
58
  description: A tool set for Lake5Media and QingheTech developer
59
59
  email: ronghai.wei@outlook.com
60
60
  executables:
@@ -67,13 +67,11 @@ extensions: []
67
67
  extra_rdoc_files:
68
68
  - LICENSE.txt
69
69
  - README
70
- - README.rdoc
71
70
  files:
72
71
  - .document
73
72
  - Gemfile
74
73
  - LICENSE.txt
75
74
  - README
76
- - README.rdoc
77
75
  - Rakefile
78
76
  - VERSION
79
77
  - bin/duplicate-app
@@ -117,7 +115,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
117
115
  version: '0'
118
116
  segments:
119
117
  - 0
120
- hash: 721439122422149435
118
+ hash: -3583198773900833122
121
119
  required_rubygems_version: !ruby/object:Gem::Requirement
122
120
  none: false
123
121
  requirements:
data/README.rdoc DELETED
@@ -1,19 +0,0 @@
1
- = l5m-tools
2
-
3
- Description goes here.
4
-
5
- == Contributing to l5m-tools
6
-
7
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
8
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
9
- * Fork the project.
10
- * Start a feature/bugfix branch.
11
- * Commit and push until you are happy with your contribution.
12
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
-
15
- == Copyright
16
-
17
- Copyright (c) 2013 Ronghai. See LICENSE.txt for
18
- further details.
19
-