rubygems-tasks 0.2.4 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +0 -1
  3. data/.travis.yml +9 -0
  4. data/ChangeLog.md +8 -0
  5. data/LICENSE.txt +1 -1
  6. data/README.md +22 -12
  7. data/Rakefile +4 -49
  8. data/gemspec.yml +10 -4
  9. data/lib/rubygems/tasks.rb +140 -2
  10. data/lib/rubygems/tasks/build/gem.rb +0 -2
  11. data/lib/rubygems/tasks/build/tar.rb +0 -2
  12. data/lib/rubygems/tasks/build/task.rb +9 -14
  13. data/lib/rubygems/tasks/console.rb +0 -3
  14. data/lib/rubygems/tasks/install.rb +1 -1
  15. data/lib/rubygems/tasks/project.rb +3 -3
  16. data/lib/rubygems/tasks/push.rb +2 -2
  17. data/lib/rubygems/tasks/sign/checksum.rb +3 -2
  18. data/lib/rubygems/tasks/sign/pgp.rb +1 -1
  19. data/lib/rubygems/tasks/sign/task.rb +13 -17
  20. data/lib/rubygems/tasks/task.rb +7 -7
  21. data/rubygems-tasks.gemspec +38 -87
  22. data/spec/console_spec.rb +10 -14
  23. data/spec/install_spec.rb +1 -1
  24. data/spec/project_spec.rb +30 -27
  25. data/spec/projects/bundler-project/.gitignore +17 -0
  26. data/spec/projects/bundler-project/Gemfile +4 -0
  27. data/spec/projects/bundler-project/LICENSE +22 -0
  28. data/spec/projects/bundler-project/README.md +29 -0
  29. data/spec/projects/bundler-project/Rakefile +2 -0
  30. data/spec/projects/bundler-project/bundler-project.gemspec +19 -0
  31. data/spec/projects/bundler-project/lib/bundler-project.rb +7 -0
  32. data/spec/projects/bundler-project/lib/bundler-project/version.rb +5 -0
  33. data/spec/projects/rubygems-multi-project/.gitignore +17 -0
  34. data/spec/projects/rubygems-multi-project/LICENSE.txt +22 -0
  35. data/spec/projects/rubygems-multi-project/README.md +21 -0
  36. data/spec/projects/rubygems-multi-project/lib/rubygems/project/version.rb +5 -0
  37. data/spec/projects/rubygems-multi-project/rubygems-project-lite.gemspec +19 -0
  38. data/spec/projects/rubygems-multi-project/rubygems-project.gemspec +19 -0
  39. data/spec/projects/rubygems-project/.gitignore +17 -0
  40. data/spec/projects/rubygems-project/LICENSE.txt +22 -0
  41. data/spec/projects/rubygems-project/README.md +21 -0
  42. data/spec/projects/rubygems-project/lib/rubygems/project/version.rb +5 -0
  43. data/spec/projects/rubygems-project/rubygems-project.gemspec +19 -0
  44. data/spec/push_spec.rb +2 -2
  45. data/spec/rake_context.rb +1 -3
  46. data/spec/scm/push_spec.rb +7 -7
  47. data/spec/scm/status_spec.rb +6 -6
  48. data/spec/scm/tag_spec.rb +18 -18
  49. data/spec/sign/pgp_spec.rb +1 -1
  50. data/spec/spec_helper.rb +25 -8
  51. data/spec/tasks_spec.rb +195 -55
  52. metadata +89 -83
  53. data/lib/rubygems/tasks/tasks.rb +0 -147
@@ -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