rubygems-tasks 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +0 -1
- data/.travis.yml +9 -0
- data/ChangeLog.md +8 -0
- data/LICENSE.txt +1 -1
- data/README.md +22 -12
- data/Rakefile +4 -49
- data/gemspec.yml +10 -4
- data/lib/rubygems/tasks.rb +140 -2
- data/lib/rubygems/tasks/build/gem.rb +0 -2
- data/lib/rubygems/tasks/build/tar.rb +0 -2
- data/lib/rubygems/tasks/build/task.rb +9 -14
- data/lib/rubygems/tasks/console.rb +0 -3
- data/lib/rubygems/tasks/install.rb +1 -1
- data/lib/rubygems/tasks/project.rb +3 -3
- data/lib/rubygems/tasks/push.rb +2 -2
- data/lib/rubygems/tasks/sign/checksum.rb +3 -2
- data/lib/rubygems/tasks/sign/pgp.rb +1 -1
- data/lib/rubygems/tasks/sign/task.rb +13 -17
- data/lib/rubygems/tasks/task.rb +7 -7
- data/rubygems-tasks.gemspec +38 -87
- data/spec/console_spec.rb +10 -14
- data/spec/install_spec.rb +1 -1
- data/spec/project_spec.rb +30 -27
- data/spec/projects/bundler-project/.gitignore +17 -0
- data/spec/projects/bundler-project/Gemfile +4 -0
- data/spec/projects/bundler-project/LICENSE +22 -0
- data/spec/projects/bundler-project/README.md +29 -0
- data/spec/projects/bundler-project/Rakefile +2 -0
- data/spec/projects/bundler-project/bundler-project.gemspec +19 -0
- data/spec/projects/bundler-project/lib/bundler-project.rb +7 -0
- data/spec/projects/bundler-project/lib/bundler-project/version.rb +5 -0
- data/spec/projects/rubygems-multi-project/.gitignore +17 -0
- data/spec/projects/rubygems-multi-project/LICENSE.txt +22 -0
- data/spec/projects/rubygems-multi-project/README.md +21 -0
- data/spec/projects/rubygems-multi-project/lib/rubygems/project/version.rb +5 -0
- data/spec/projects/rubygems-multi-project/rubygems-project-lite.gemspec +19 -0
- data/spec/projects/rubygems-multi-project/rubygems-project.gemspec +19 -0
- data/spec/projects/rubygems-project/.gitignore +17 -0
- data/spec/projects/rubygems-project/LICENSE.txt +22 -0
- data/spec/projects/rubygems-project/README.md +21 -0
- data/spec/projects/rubygems-project/lib/rubygems/project/version.rb +5 -0
- data/spec/projects/rubygems-project/rubygems-project.gemspec +19 -0
- data/spec/push_spec.rb +2 -2
- data/spec/rake_context.rb +1 -3
- data/spec/scm/push_spec.rb +7 -7
- data/spec/scm/status_spec.rb +6 -6
- data/spec/scm/tag_spec.rb +18 -18
- data/spec/sign/pgp_spec.rb +1 -1
- data/spec/spec_helper.rb +25 -8
- data/spec/tasks_spec.rb +195 -55
- metadata +89 -83
- data/lib/rubygems/tasks/tasks.rb +0 -147
data/lib/rubygems/tasks/tasks.rb
DELETED
@@ -1,147 +0,0 @@
|
|
1
|
-
require 'rubygems/tasks/console'
|
2
|
-
require 'rubygems/tasks/build'
|
3
|
-
require 'rubygems/tasks/install'
|
4
|
-
require 'rubygems/tasks/scm'
|
5
|
-
require 'rubygems/tasks/push'
|
6
|
-
require 'rubygems/tasks/release'
|
7
|
-
require 'rubygems/tasks/sign'
|
8
|
-
|
9
|
-
require 'rake/tasklib'
|
10
|
-
require 'ostruct'
|
11
|
-
|
12
|
-
module Gem
|
13
|
-
#
|
14
|
-
# Defines basic Rake tasks for managing and releasing projects:
|
15
|
-
#
|
16
|
-
# * {Build::Gem build:gem}
|
17
|
-
# * {Build::Tar build:tar}
|
18
|
-
# * {Build::Zip build:zip}
|
19
|
-
# * {SCM::Status scm:status}
|
20
|
-
# * {SCM::Push scm:push}
|
21
|
-
# * {SCM::Tag scm:tag}
|
22
|
-
# * {Console console}
|
23
|
-
# * {Install install}
|
24
|
-
# * {Push push}
|
25
|
-
# * {Release release}
|
26
|
-
# * {Sign::Checksum sign:checksum}
|
27
|
-
# * {Sign::PGP sign:pgp}
|
28
|
-
#
|
29
|
-
class Tasks
|
30
|
-
|
31
|
-
#
|
32
|
-
# The `build` tasks.
|
33
|
-
#
|
34
|
-
# @return [OpenStruct]
|
35
|
-
# The collection of `build` tasks.
|
36
|
-
#
|
37
|
-
attr_reader :build
|
38
|
-
|
39
|
-
#
|
40
|
-
# The `scm` tasks.
|
41
|
-
#
|
42
|
-
# @return [OpenStruct]
|
43
|
-
# The collection of `scm` tasks.
|
44
|
-
#
|
45
|
-
attr_reader :scm
|
46
|
-
|
47
|
-
#
|
48
|
-
# The `sign` tasks.
|
49
|
-
#
|
50
|
-
# @return [OpenStruct]
|
51
|
-
# The collection of `sign` tasks.
|
52
|
-
#
|
53
|
-
attr_reader :sign
|
54
|
-
|
55
|
-
# The {Console console} task.
|
56
|
-
attr_reader :console
|
57
|
-
|
58
|
-
# The {Install install} task.
|
59
|
-
attr_reader :install
|
60
|
-
|
61
|
-
# The {Push push} task.
|
62
|
-
attr_reader :push
|
63
|
-
|
64
|
-
# The {Release release} task.
|
65
|
-
attr_reader :release
|
66
|
-
|
67
|
-
#
|
68
|
-
# Initializes the project tasks.
|
69
|
-
#
|
70
|
-
# @param [Hash{Symbol => Hash}] options
|
71
|
-
# Enables or disables individual tasks.
|
72
|
-
#
|
73
|
-
# @option options [Hash{Symbol => Boolean}] :build
|
74
|
-
# Enables or disables the `build` tasks.
|
75
|
-
#
|
76
|
-
# @option options [Hash{Symbol => Boolean}] :scm
|
77
|
-
# Enables or disables the `scm` tasks.
|
78
|
-
#
|
79
|
-
# @option options [Boolean] :console (true)
|
80
|
-
# Enables or disables the {Console console} task.
|
81
|
-
#
|
82
|
-
# @option options [Boolean] :install (true)
|
83
|
-
# Enables or disables the {Install install} task.
|
84
|
-
#
|
85
|
-
# @option options [Boolean] :push (true)
|
86
|
-
# Enables or disables the {Push push} task.
|
87
|
-
#
|
88
|
-
# @option options [Boolean] :release (true)
|
89
|
-
# Enables or disables the {Release release} task.
|
90
|
-
#
|
91
|
-
# @option options [Hash{Symbol => Boolean}] :sign
|
92
|
-
# Enables or disables the `sign` tasks.
|
93
|
-
#
|
94
|
-
# @yield [tasks]
|
95
|
-
# If a block is given, it will be passed the newly created tasks,
|
96
|
-
# before they are fully defined.
|
97
|
-
#
|
98
|
-
# @yieldparam [Tasks] tasks
|
99
|
-
# The newly created tasks.
|
100
|
-
#
|
101
|
-
# @example Enables building of `.gem` and `.tar.gz` packages:
|
102
|
-
# Gem::Tasks.new(:build => {:gem => true, :tar => true})
|
103
|
-
#
|
104
|
-
# @example Disables pushing `.gem` packages to [rubygems.org](rubygems.org):
|
105
|
-
# Gem::Tasks.new(:push => false)
|
106
|
-
#
|
107
|
-
# @example Configures the version tag format:
|
108
|
-
# Gem::Tasks.new do |tasks|
|
109
|
-
# tasks.scm.tag.format = "release-%s"
|
110
|
-
# end
|
111
|
-
#
|
112
|
-
def initialize(options={})
|
113
|
-
build_options = options.fetch(:build,{})
|
114
|
-
scm_options = options.fetch(:scm,{})
|
115
|
-
sign_options = options.fetch(:sign,{})
|
116
|
-
|
117
|
-
@scm = OpenStruct.new
|
118
|
-
@build = OpenStruct.new
|
119
|
-
@sign = OpenStruct.new
|
120
|
-
|
121
|
-
if build_options
|
122
|
-
@build.gem = (Build::Gem.new if build_options.fetch(:gem,true))
|
123
|
-
@build.tar = (Build::Tar.new if build_options[:tar])
|
124
|
-
@build.zip = (Build::Zip.new if build_options[:zip])
|
125
|
-
end
|
126
|
-
|
127
|
-
if scm_options
|
128
|
-
@scm.status = (SCM::Status.new if scm_options.fetch(:status,true))
|
129
|
-
@scm.tag = (SCM::Tag.new if scm_options.fetch(:tag,true))
|
130
|
-
@scm.push = (SCM::Push.new if scm_options.fetch(:push,true))
|
131
|
-
end
|
132
|
-
|
133
|
-
if sign_options
|
134
|
-
@sign.checksum = (Sign::Checksum.new if sign_options[:checksum])
|
135
|
-
@sign.pgp = (Sign::PGP.new if sign_options[:pgp])
|
136
|
-
end
|
137
|
-
|
138
|
-
@console = (Console.new if options.fetch(:console,true))
|
139
|
-
@install = (Install.new if options.fetch(:install,true))
|
140
|
-
@push = (Push.new if options.fetch(:push,true))
|
141
|
-
@release = (Release.new if options.fetch(:release,true))
|
142
|
-
|
143
|
-
yield self if block_given?
|
144
|
-
end
|
145
|
-
|
146
|
-
end
|
147
|
-
end
|