ore-tasks 0.4.4 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog.md +10 -0
- data/README.md +9 -0
- data/gemspec.yml +1 -1
- data/lib/ore/tasks.rb +91 -41
- metadata +16 -45
data/ChangeLog.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
### 0.5.0 / 2011-02-24
|
2
|
+
|
3
|
+
* Support releasing Gems to alternate
|
4
|
+
[gemcutter](http://github.com/rubygems/gemcutter#readme) servers, besides
|
5
|
+
[rubygems.org](http://rubygems.org/).
|
6
|
+
* Support disabling releasing Gems.
|
7
|
+
* Split `Ore::Tasks#define_core_tasks` into
|
8
|
+
{Ore::Tasks#define_development_tasks} and
|
9
|
+
{Ore::Tasks#define_release_tasks}.
|
10
|
+
|
1
11
|
### 0.4.4 / 2011-02-18
|
2
12
|
|
3
13
|
* Use `Gem.available?` in the `install:deps` task.
|
data/README.md
CHANGED
@@ -31,6 +31,15 @@ project.
|
|
31
31
|
require 'ore/tasks'
|
32
32
|
Ore::Tasks.new
|
33
33
|
|
34
|
+
Enable pushing gems to an in-house
|
35
|
+
[gemcutter](http://github.com/rubygems/gemcutter#readme) server:
|
36
|
+
|
37
|
+
Ore::Tasks.new(:gemcutter => 'internal.example.com')
|
38
|
+
|
39
|
+
Disable pushing gems:
|
40
|
+
|
41
|
+
Ore::Tasks.new(:gemcutter => false)
|
42
|
+
|
34
43
|
## Synopsis
|
35
44
|
|
36
45
|
rake build # Only builds a Gem
|
data/gemspec.yml
CHANGED
data/lib/ore/tasks.rb
CHANGED
@@ -13,23 +13,55 @@ module Ore
|
|
13
13
|
# The tasks to perform when releasing a new version
|
14
14
|
attr_reader :release_tasks
|
15
15
|
|
16
|
+
# The Ore project.
|
17
|
+
attr_reader :project
|
18
|
+
|
19
|
+
# Specifies the [gemcutter](http://github.com/rubygems/gemcutter#readme)
|
20
|
+
# host or if pushing gems to [rubygems.org](http://rubygems.org/)
|
21
|
+
# is enabled.
|
22
|
+
attr_accessor :gemcutter
|
23
|
+
|
16
24
|
#
|
17
25
|
# Initializes the Ore tasks.
|
18
26
|
#
|
19
|
-
# @param [
|
27
|
+
# @param [Hash] options
|
28
|
+
# Additional options for the tasks.
|
29
|
+
#
|
30
|
+
# @option options [String] :root (Dir.pwd)
|
20
31
|
# The optional root directory for the project.
|
21
32
|
#
|
22
|
-
|
33
|
+
# @option options [String, Boolean] :gemcutter (true)
|
34
|
+
# Specifies the
|
35
|
+
# [gemcutter](http://github.com/rubygems/gemcutter#readme)
|
36
|
+
# server to push built Gems to. If `:gemcutter` is a Boolean value, it
|
37
|
+
# will enable or disable pushing to
|
38
|
+
# [rubygems.org](http://rubygems.org/).
|
39
|
+
#
|
40
|
+
# @yield [tasks]
|
41
|
+
# If a block is given, it will be passed the newly created tasks,
|
42
|
+
# before they are fully defined.
|
43
|
+
#
|
44
|
+
# @yieldparam [Tasks] tasks
|
45
|
+
# The newly created tasks.
|
46
|
+
#
|
47
|
+
def initialize(options={})
|
48
|
+
root = options.fetch(:root,Dir.pwd)
|
49
|
+
|
23
50
|
@project = Project.find(root)
|
24
|
-
@release_tasks = [
|
51
|
+
@release_tasks = []
|
52
|
+
@gemcutter = options.fetch(:gemcutter,true)
|
53
|
+
|
54
|
+
yield self if block_given?
|
25
55
|
|
26
56
|
define
|
27
57
|
end
|
28
58
|
|
29
59
|
#
|
30
|
-
# Defines
|
60
|
+
# Defines tasks used during development.
|
31
61
|
#
|
32
|
-
|
62
|
+
# @since 0.5.0
|
63
|
+
#
|
64
|
+
def define_development_tasks
|
33
65
|
task :status do
|
34
66
|
changes = dirty_files
|
35
67
|
|
@@ -42,41 +74,6 @@ module Ore
|
|
42
74
|
end
|
43
75
|
end
|
44
76
|
|
45
|
-
desc "Only builds a Gem"
|
46
|
-
task :build => :status do
|
47
|
-
@project.build!
|
48
|
-
end
|
49
|
-
|
50
|
-
desc "Alias to the 'build' task"
|
51
|
-
task :gem => :build
|
52
|
-
|
53
|
-
desc "Builds and installs a Gem"
|
54
|
-
task :install => :build do
|
55
|
-
pkg = @project.pkg_file
|
56
|
-
|
57
|
-
if File.file?(pkg)
|
58
|
-
gem 'install', pkg
|
59
|
-
else
|
60
|
-
abort "Could not find #{pkg}!"
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
desc "Builds and pushes a Gem"
|
65
|
-
task :push => :build do
|
66
|
-
pkg = @project.pkg_file
|
67
|
-
|
68
|
-
if File.file?(pkg)
|
69
|
-
gem 'push', pkg
|
70
|
-
else
|
71
|
-
abort "Could not find #{pkg}!"
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
desc "Builds and Pushes a new Gem"
|
76
|
-
task :release do
|
77
|
-
@release_tasks.each { |task| Rake::Task[task].invoke }
|
78
|
-
end
|
79
|
-
|
80
77
|
desc 'Displays the current version'
|
81
78
|
task :version do
|
82
79
|
puts @project.version
|
@@ -110,6 +107,58 @@ module Ore
|
|
110
107
|
!(original_load_path.include?(path))
|
111
108
|
end
|
112
109
|
end
|
110
|
+
|
111
|
+
desc "Only builds a Gem"
|
112
|
+
task :build => :status do
|
113
|
+
@project.build!
|
114
|
+
end
|
115
|
+
|
116
|
+
desc "Alias to the 'build' task"
|
117
|
+
task :gem => :build
|
118
|
+
|
119
|
+
desc "Builds and installs a Gem"
|
120
|
+
task :install => :build do
|
121
|
+
pkg = @project.pkg_file
|
122
|
+
|
123
|
+
if File.file?(pkg)
|
124
|
+
gem 'install', pkg
|
125
|
+
else
|
126
|
+
abort "Could not find #{pkg}!"
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
#
|
132
|
+
# Defines the tasks used for releases.
|
133
|
+
#
|
134
|
+
# @since 0.5.0
|
135
|
+
#
|
136
|
+
def define_release_tasks
|
137
|
+
if @gemcutter
|
138
|
+
desc "Builds and pushes a Gem"
|
139
|
+
task :push => :build do
|
140
|
+
pkg = @project.pkg_file
|
141
|
+
|
142
|
+
unless File.file?(pkg)
|
143
|
+
abort "Could not find #{pkg}!"
|
144
|
+
end
|
145
|
+
|
146
|
+
arguments = []
|
147
|
+
|
148
|
+
if @gemcutter.kind_of?(String)
|
149
|
+
arguments << '--host' << @gemcutter
|
150
|
+
end
|
151
|
+
|
152
|
+
gem('push',pkg,*arguments)
|
153
|
+
end
|
154
|
+
|
155
|
+
@release_tasks.push('push')
|
156
|
+
end
|
157
|
+
|
158
|
+
desc "Builds and Pushes a new Gem"
|
159
|
+
task :release do
|
160
|
+
@release_tasks.each { |task| Rake::Task[task].invoke }
|
161
|
+
end
|
113
162
|
end
|
114
163
|
|
115
164
|
#
|
@@ -134,7 +183,8 @@ module Ore
|
|
134
183
|
# Defines the Ore tasks.
|
135
184
|
#
|
136
185
|
def define
|
137
|
-
|
186
|
+
define_development_tasks
|
187
|
+
define_release_tasks
|
138
188
|
|
139
189
|
if (scm_tasks = SCM::Tasks::SUPPORTED[@project.scm])
|
140
190
|
extend scm_tasks
|
metadata
CHANGED
@@ -1,13 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ore-tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 7
|
5
4
|
prerelease:
|
6
|
-
|
7
|
-
- 0
|
8
|
-
- 4
|
9
|
-
- 4
|
10
|
-
version: 0.4.4
|
5
|
+
version: 0.5.0
|
11
6
|
platform: ruby
|
12
7
|
authors:
|
13
8
|
- Postmodern
|
@@ -15,7 +10,7 @@ autorequire:
|
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
12
|
|
18
|
-
date: 2011-02-
|
13
|
+
date: 2011-02-24 00:00:00 -08:00
|
19
14
|
default_executable:
|
20
15
|
dependencies:
|
21
16
|
- !ruby/object:Gem::Dependency
|
@@ -26,50 +21,32 @@ dependencies:
|
|
26
21
|
requirements:
|
27
22
|
- - ~>
|
28
23
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 9
|
30
|
-
segments:
|
31
|
-
- 0
|
32
|
-
- 1
|
33
24
|
version: "0.1"
|
34
25
|
- - ">="
|
35
26
|
- !ruby/object:Gem::Version
|
36
|
-
hash: 29
|
37
|
-
segments:
|
38
|
-
- 0
|
39
|
-
- 1
|
40
|
-
- 3
|
41
27
|
version: 0.1.3
|
42
28
|
type: :runtime
|
43
29
|
version_requirements: *id001
|
44
30
|
- !ruby/object:Gem::Dependency
|
45
|
-
name:
|
31
|
+
name: rspec
|
46
32
|
prerelease: false
|
47
33
|
requirement: &id002 !ruby/object:Gem::Requirement
|
48
34
|
none: false
|
49
35
|
requirements:
|
50
36
|
- - ~>
|
51
37
|
- !ruby/object:Gem::Version
|
52
|
-
|
53
|
-
segments:
|
54
|
-
- 0
|
55
|
-
- 6
|
56
|
-
- 0
|
57
|
-
version: 0.6.0
|
38
|
+
version: "2.4"
|
58
39
|
type: :development
|
59
40
|
version_requirements: *id002
|
60
41
|
- !ruby/object:Gem::Dependency
|
61
|
-
name:
|
42
|
+
name: yard
|
62
43
|
prerelease: false
|
63
44
|
requirement: &id003 !ruby/object:Gem::Requirement
|
64
45
|
none: false
|
65
46
|
requirements:
|
66
47
|
- - ~>
|
67
48
|
- !ruby/object:Gem::Version
|
68
|
-
|
69
|
-
segments:
|
70
|
-
- 2
|
71
|
-
- 4
|
72
|
-
version: "2.4"
|
49
|
+
version: 0.6.0
|
73
50
|
type: :development
|
74
51
|
version_requirements: *id003
|
75
52
|
description: Simple Rake tasks for managing and releasing a RubyGem project generated with Ore.
|
@@ -81,23 +58,23 @@ extensions: []
|
|
81
58
|
|
82
59
|
extra_rdoc_files:
|
83
60
|
- README.md
|
84
|
-
- LICENSE.txt
|
85
61
|
- ChangeLog.md
|
62
|
+
- LICENSE.txt
|
86
63
|
files:
|
87
|
-
-
|
88
|
-
- ore-tasks.gemspec
|
89
|
-
- gemspec.yml
|
64
|
+
- .document
|
90
65
|
- .rspec
|
91
66
|
- .yardopts
|
67
|
+
- ChangeLog.md
|
68
|
+
- LICENSE.txt
|
69
|
+
- README.md
|
70
|
+
- Rakefile
|
71
|
+
- gemspec.yml
|
72
|
+
- lib/ore/scm/tasks.rb
|
92
73
|
- lib/ore/scm/tasks/git.rb
|
93
74
|
- lib/ore/scm/tasks/tasks.rb
|
94
|
-
- lib/ore/scm/tasks.rb
|
95
|
-
- Rakefile
|
96
|
-
- README.md
|
97
|
-
- LICENSE.txt
|
98
75
|
- lib/ore/tasks.rb
|
99
|
-
- .
|
100
|
-
-
|
76
|
+
- ore-tasks.gemspec
|
77
|
+
- spec/spec_helper.rb
|
101
78
|
has_rdoc: true
|
102
79
|
homepage: http://github.com/ruby-ore/ore-tasks
|
103
80
|
licenses: []
|
@@ -112,18 +89,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
112
89
|
requirements:
|
113
90
|
- - ">="
|
114
91
|
- !ruby/object:Gem::Version
|
115
|
-
hash: 3
|
116
|
-
segments:
|
117
|
-
- 0
|
118
92
|
version: "0"
|
119
93
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
94
|
none: false
|
121
95
|
requirements:
|
122
96
|
- - ">="
|
123
97
|
- !ruby/object:Gem::Version
|
124
|
-
hash: 3
|
125
|
-
segments:
|
126
|
-
- 0
|
127
98
|
version: "0"
|
128
99
|
requirements: []
|
129
100
|
|