dev 1.0.131 → 1.0.132

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/dev/Project.rb +5 -3
  2. data/lib/dev/Tasks.rb +32 -30
  3. metadata +1 -1
data/lib/dev/Project.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  puts_debug "read " + __FILE__.foreground(:green)
2
2
  require 'semver'
3
+ require 'rake'
3
4
 
4
5
  UNITTESTS=Array.new
5
6
  module Dev
@@ -19,7 +20,7 @@ class Project < Hash
19
20
  h={
20
21
  :src_glob => "**/{*.{rb,feature,spec,cs,c,cpp,h,hpp,csproj,vcproj,snk,vcxproj,sln,filters,xaml,xml,resx,settings,txt,png,bmp,ico},Jamfile,.semver,Gemfile,README,LICENSE}",
21
22
  :name => get_default_value_name,
22
- :group => get_default_group_name,
23
+ :group => get_default_value_group,
23
24
  :directory => Rake.original_dir(),
24
25
  :type => get_default_value_type,
25
26
  :version => "#{SemVer.find.major}.#{SemVer.find.minor}.#{SemVer.find.patch}",
@@ -47,7 +48,7 @@ class Project < Hash
47
48
  end
48
49
 
49
50
  def get_default_value_name
50
- dirs=Rake.original_dir().split('/')
51
+ dirs=::Rake.original_dir().split('/')
51
52
  return dirs[dirs.length-2] if(dirs.length > 3)
52
53
  return nil
53
54
  end
@@ -523,4 +524,5 @@ class Project < Hash
523
524
  end
524
525
  end # module Dev
525
526
 
526
- PROJECT=Dev::Project.new(nil,true)
527
+ PROJECT=Dev::Project.new(nil,true)
528
+ PROJECT.update_default_values
data/lib/dev/Tasks.rb CHANGED
@@ -20,11 +20,11 @@ task :info do
20
20
  PROJECT.info
21
21
  end
22
22
 
23
- desc "add files defined by src_glob to source code management"
24
- task :add do
25
- task_start("add")
26
- PROJECT.add
27
- end
23
+ #desc "add files defined by src_glob to source code management"
24
+ #task :add do
25
+ # task_start("add")
26
+ # PROJECT.add
27
+ #end
28
28
 
29
29
  desc "commit changes to source code management"
30
30
  task :commit do
@@ -36,7 +36,7 @@ require 'rake/clean'
36
36
  CLEAN.include('doc','*.gem','*.taskstamp*','**/*.{suo,sdf}')
37
37
  CLOBBER.include('bin','obj')
38
38
 
39
- def generate_tasks(project)
39
+ def generate_task_hash(project)
40
40
  task_hash = {
41
41
  #:add=> { :desc=> 'add files defined by src_glob to source code management' },
42
42
  #:info=> { :desc=> 'display information about the rakefile' },
@@ -50,34 +50,36 @@ def generate_tasks(project)
50
50
  :check=> { :desc=> 'checks if the project default task may be skipped' },
51
51
  :update=> { :desc=> 'updates changes from source code management' }
52
52
  }
53
+ if(project[:scm_type]=="svn" || project[:scm_type]=="git")
54
+ task_hash[:add]={ :desc=> 'add files defined by src_glob to source code management' }
55
+ end
53
56
  if project[:type]=="gem" || project[:type]=="ruby"
54
57
  task_hash[:features] = { :desc=> 'tests cucumber features' }
55
58
  end
56
-
57
- if("#{RUBY_VERSION}">"1.9.1")
58
- task_hash.each do |k,v|
59
- name=k.to_s
60
- desc=nil
61
- desc=v[:desc] if v.has_key?(:desc)
62
- ruby="task :#{name} do; task_start '#{name}'; PROJECT.#{name}; end"
63
- ruby="desc '#{desc}'; " + ruby unless desc.nil?
64
- unless Rake::Task.task_defined?(name)
65
- puts_debug "defining task " + name
66
- eval(ruby)
67
- end
59
+ return task_hash
60
+ end
61
+
62
+ def generate_tasks(project)
63
+ hash=generate_task_hash project
64
+
65
+ hash.each do |k,v|
66
+ name=k.to_s
67
+ desc=nil
68
+ desc=v[:desc] if v.has_key?(:desc)
69
+ ruby="task :#{name} do; task_start '#{name}'; PROJECT.#{name}; end"
70
+ ruby="desc '#{desc}'; " + ruby unless desc.nil?
71
+ #unless Rake::Task.task_defined?(name)
72
+ if !task_exists?(name)
73
+ puts_debug "defining task " + name
74
+ eval(ruby)
68
75
  end
69
76
  end
70
77
  end
71
78
 
72
- if("#{RUBY_VERSION}"<="1.9.1")
73
- #task :add do; task_start('add'); PROJECT.add; end
74
- task :check do; task_start('check'); PROJECT.check; end
75
- task :update do; task_start('update'); PROJECT.update; end
76
- task :setup do; task_start('setup'); PROJECT.setup; end
77
- task :compile do; task_start('compile'); PROJECT.compile; end
78
- task :test do; task_start('test'); PROJECT.test; end
79
- #task :commit do; task_start('commit'); PROJECT.commit; end
80
- task :replace do; task_start('replace'); PROJECT.replace; end
81
- task :loc do; task_start('loc'); PROJECT.loc; end
82
- #task :info do; task_start('info'); PROJECT.info; end
83
- end
79
+ def task_exists?(name)
80
+ if("#{RUBY_VERSION}">"1.9.1")
81
+ return Rake::Task.task_defined?(name)
82
+ else
83
+ return false
84
+ end
85
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dev
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.131
4
+ version: 1.0.132
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: