Class: Rake::SVN::ProjectTask

Inherits:
TaskLib
  • Object
show all
Defined in:
lib/svn/rake/svntask.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = :svn) ⇒ ProjectTask

Create an SVN task named svn. Default task name is svn.



18
19
20
21
22
23
24
25
26
27
# File 'lib/svn/rake/svntask.rb', line 18

def initialize(name=:svn)  # :yield: self
  @name = name
  if block_given?
    @svn = ::SVN::Project.new { |s| yield(s) }
  else
    @svn = ::SVN::Project.new
  end
  
  define()
end

Instance Attribute Details

#nameObject

Name of the main, top level task. (default is :svn)



13
14
15
# File 'lib/svn/rake/svntask.rb', line 13

def name
  @name
end

#svnObject

Returns the value of attribute svn.



15
16
17
# File 'lib/svn/rake/svntask.rb', line 15

def svn
  @svn
end

Instance Method Details

#defineObject

Create the tasks defined by this task lib.



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/svn/rake/svntask.rb', line 34

def define
  namespace :svn do
    namespace :project do

      desc "Displays URL for project"
      task :url do
        puts svn.project_url
      end

      desc "Display URL for the project's TRUNK dir"
      task :trunk_url do
        puts svn.trunk_url
      end

      desc "Display URL for the project's TAGS dir"
      task :tags_url do
        puts svn.tags_url
      end

      desc "Display most current version of the project"
      task :current_version do
        puts svn.current_version
      end
    end

    namespace :tags do 
      desc "Create tag for a fix release"
      task :create_fix do
        svn.create_fix_tag
        puts "Created #{svn.current_tag.name} tag"
      end

      desc "Create tag for a minor release"
      task :create_minor do
        svn.create_minor_tag
        puts "Created #{svn.current_tag.name} tag"
      end

      desc "Create tag for a major release"
      task :create_major do
        svn.create_major_tag
        puts "Created #{svn.current_tag.name} tag"
      end

      desc "Current release tag"
      task :current do
        puts svn.current_tag
      end

      desc "Display next major release tag"
      task :next_major do
        puts svn.next_major_tag
      end

      desc "Display next minor release tag"
      task :next_minor do
        puts svn.next_minor_tag
      end

      desc "Display next fix release tag"
      task :next_fix do
        puts svn.next_fix_tag
      end

      desc "Display all tags in the tags dir"
      task :list_all do
        puts svn.list_all_tags
      end

      desc "Display all release tags in the tags dir"
      task :ls do
        puts svn.list_tags
      end

      desc "Display all release tags in the tags dir"
      task :list_releases do
        puts svn.list_release_tags
      end

      desc "Display all release tags in the tags dir"
      task :list do
        puts svn.list_tags
      end
    end
  end

  self
end

#svn_projectObject



29
30
31
# File 'lib/svn/rake/svntask.rb', line 29

def svn_project
  @svn
end