ore-tasks 0.3.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,12 @@
1
+ ### 0.4.0 / 2011-02-12
2
+
3
+ * Added {Ore::Tasks#gem}.
4
+ * Added {Ore::Tasks#define_rubygem_tasks}.
5
+ * Properly invoke the `gem` command with the current `ruby` interpeter.
6
+ * Fixes the `install` and `push` tasks on Rubinius.
7
+ * Added the `install:deps` task which only installs the dependencies of
8
+ non-Bundler projects.
9
+
1
10
  ### 0.3.0 / 2010-11-14
2
11
 
3
12
  * Added ore-core ~> 0.3.0 as a runtime dependency.
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010 Hal Brodigan
1
+ Copyright (c) 2010-2011 Hal Brodigan
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  * [Source](http://github.com/ruby-ore/ore-tasks)
4
4
  * [Issues](http://github.com/ruby-ore/ore-tasks/issues)
5
+ * [Email](mailto:postmodern.mod3 at gmail.com)
5
6
  * IRC: irc.freenode.net #ruby-ore
6
- * Postmodern (postmodern.mod3 at gmail.com)
7
7
 
8
8
  ## Description
9
9
 
@@ -15,12 +15,12 @@ project.
15
15
  * Provides tasks to build, install and push Gems to
16
16
  [rubygems.org](http://rubygems.org/).
17
17
  * Provides optional Git tasks.
18
- * Provides the `console` task for digging right into your code.
18
+ * Provides the `console` task for jumping right into your code.
19
19
  * **Does not** automatically modify or commit changes to your code.
20
20
 
21
21
  ## Requirements
22
22
 
23
- * [ore-core](http://github.com/ruby-ore/ore-core) ~> 0.1.0
23
+ * [ore-core](http://github.com/ruby-ore/ore-core) ~> 0.1.3
24
24
 
25
25
  ## Install
26
26
 
@@ -37,6 +37,7 @@ project.
37
37
  rake console[script] # Start IRB with all runtime dependencies loaded
38
38
  rake gem # Alias to the 'build' task
39
39
  rake install # Builds and installs a Gem
40
+ rake install:deps # Installs dependencies of the Gem
40
41
  rake push # Builds and pushes a Gem
41
42
  rake release # Builds and Pushes a new Gem / Build, Tags and Pushe...
42
43
  rake tag # Tags a release and pushes the tag
@@ -44,6 +45,6 @@ project.
44
45
 
45
46
  ## Copyright
46
47
 
47
- Copyright (c) 2010 Hal Brodigan
48
+ Copyright (c) 2010-2011 Hal Brodigan
48
49
 
49
50
  See {file:LICENSE.txt} for details.
data/Rakefile CHANGED
@@ -7,8 +7,17 @@ $LOAD_PATH << lib_dir unless $LOAD_PATH.include?(lib_dir)
7
7
  require 'ore/tasks'
8
8
  Ore::Tasks.new
9
9
 
10
- require 'rspec/core/rake_task'
11
- RSpec::Core::RakeTask.new
10
+ begin
11
+ gem 'rspec', '~> 2.4.0'
12
+ require 'rspec/core/rake_task'
13
+
14
+ RSpec::Core::RakeTask.new
15
+ rescue LoadError
16
+ task :spec do
17
+ abort "Please run `gem install rspec` to install RSpec."
18
+ end
19
+ end
20
+ task :test => :spec
12
21
  task :default => :spec
13
22
 
14
23
  begin
@@ -1,5 +1,5 @@
1
1
  name: ore-tasks
2
- version: 0.3.0
2
+ version: 0.4.1
3
3
  summary: Rake tasks for managing and releasing RubyGems using Ore.
4
4
  description:
5
5
  Simple Rake tasks for managing and releasing a RubyGem project generated
@@ -10,8 +10,8 @@ homepage: http://github.com/ruby-ore/ore-tasks
10
10
  has_yard: true
11
11
 
12
12
  dependencies:
13
- ore-core: ~> 0.1.0
13
+ ore-core: ~> 0.1.3
14
14
 
15
15
  development_dependencies:
16
- rspec: ~> 2.0.0
16
+ rspec: ~> 2.4.0
17
17
  yard: ~> 0.6.0
@@ -42,7 +42,7 @@ module Ore
42
42
  pkg = @project.pkg_file
43
43
 
44
44
  if File.file?(pkg)
45
- run "gem install #{pkg}"
45
+ gem 'install', pkg
46
46
  else
47
47
  abort "Could not find #{pkg}!"
48
48
  end
@@ -53,7 +53,7 @@ module Ore
53
53
  pkg = @project.pkg_file
54
54
 
55
55
  if File.file?(pkg)
56
- run "gem push #{pkg}"
56
+ gem 'push', pkg
57
57
  else
58
58
  abort "Could not find #{pkg}!"
59
59
  end
@@ -104,19 +104,45 @@ module Ore
104
104
  #
105
105
  def define_git_tasks
106
106
  task :sync do
107
- run "git push"
107
+ run 'git', 'push'
108
108
  end
109
109
 
110
110
  desc 'Tags a release and pushes the tag'
111
111
  task :tag do
112
- run "git tag v#{@project.version}"
113
- run "git push --tags"
112
+ run 'git', 'tag', "v#{@project.version}"
113
+ run 'git', 'push', '--tags'
114
114
  end
115
115
 
116
116
  @release_tasks.unshift('sync')
117
117
  @release_tasks.push('tag')
118
118
  end
119
119
 
120
+ #
121
+ # Defines the RubyGems specific tasks.
122
+ #
123
+ def define_rubygem_tasks
124
+ namespace :install do
125
+ desc 'Installs dependencies of the Gem'
126
+ task :deps do
127
+ install_dependency = lambda { |dep|
128
+ arguments = []
129
+
130
+ # enable install pre-releases
131
+ arguments << '--prerelease' if dep.prerelease?
132
+
133
+ # specify the version requirements
134
+ dep.versions.each { |v| arguments << '--version' << v }
135
+
136
+ gem('install',dep.name,*arguments)
137
+ }
138
+
139
+ @project.dependencies.each(&install_dependency)
140
+ @project.runtime_dependencies.each(&install_dependency)
141
+ @project.development_dependencies.each(&install_dependency)
142
+ end
143
+ end
144
+ end
145
+
120
146
  #
121
147
  # Defines the Ore tasks.
122
148
  #
@@ -127,6 +153,10 @@ module Ore
127
153
  when :git
128
154
  define_git_tasks
129
155
  end
156
+
157
+ unless @project.bundler?
158
+ define_rubygem_tasks
159
+ end
130
160
  end
131
161
 
132
162
  #
@@ -151,5 +181,22 @@ module Ore
151
181
  return true
152
182
  end
153
183
 
184
+ #
185
+ # Runs a RubyGems command.
186
+ #
187
+ # @param [Array<String>]
188
+ # The arguments to pass to RubyGems.
189
+ #
190
+ # @return [true]
191
+ # The command was executed successfully.
192
+ #
193
+ # @see #run
194
+ #
195
+ # @since 0.3.1
196
+ #
197
+ def gem(*arguments)
198
+ run(RUBY,'-S','gem',*arguments)
199
+ end
200
+
154
201
  end
155
202
  end
@@ -5,6 +5,11 @@ begin
5
5
  # custom logic here
6
6
  end
7
7
  rescue NameError
8
- STDERR.puts "The 'ore-tasks.gemspec' file requires Ore."
9
- STDERR.puts "Run `gem install ore-core` to install Ore."
8
+ begin
9
+ require 'ore/specification'
10
+ retry
11
+ rescue LoadError
12
+ STDERR.puts "The '#{__FILE__}' file requires Ore."
13
+ STDERR.puts "Run `gem install ore-core` to install Ore."
14
+ end
10
15
  end
@@ -1,4 +1,4 @@
1
- gem 'rspec', '~> 2.0.0'
1
+ gem 'rspec', '~> 2.4.0'
2
2
  require 'rspec'
3
3
  require 'ore/tasks/version'
4
4
 
metadata CHANGED
@@ -1,12 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ore-tasks
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 3
8
- - 0
9
- version: 0.3.0
4
+ prerelease:
5
+ version: 0.4.1
10
6
  platform: ruby
11
7
  authors:
12
8
  - Postmodern
@@ -14,7 +10,7 @@ autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
12
 
17
- date: 2010-11-14 00:00:00 -08:00
13
+ date: 2011-02-12 00:00:00 -08:00
18
14
  default_executable:
19
15
  dependencies:
20
16
  - !ruby/object:Gem::Dependency
@@ -25,11 +21,7 @@ dependencies:
25
21
  requirements:
26
22
  - - ~>
27
23
  - !ruby/object:Gem::Version
28
- segments:
29
- - 0
30
- - 1
31
- - 0
32
- version: 0.1.0
24
+ version: 0.1.3
33
25
  type: :runtime
34
26
  version_requirements: *id001
35
27
  - !ruby/object:Gem::Dependency
@@ -40,11 +32,7 @@ dependencies:
40
32
  requirements:
41
33
  - - ~>
42
34
  - !ruby/object:Gem::Version
43
- segments:
44
- - 2
45
- - 0
46
- - 0
47
- version: 2.0.0
35
+ version: 2.4.0
48
36
  type: :development
49
37
  version_requirements: *id002
50
38
  - !ruby/object:Gem::Dependency
@@ -55,15 +43,12 @@ dependencies:
55
43
  requirements:
56
44
  - - ~>
57
45
  - !ruby/object:Gem::Version
58
- segments:
59
- - 0
60
- - 6
61
- - 0
62
46
  version: 0.6.0
63
47
  type: :development
64
48
  version_requirements: *id003
65
49
  description: Simple Rake tasks for managing and releasing a RubyGem project generated with Ore.
66
- email: postmodern.mod3@gmail.com
50
+ email:
51
+ - postmodern.mod3@gmail.com
67
52
  executables: []
68
53
 
69
54
  extensions: []
@@ -84,7 +69,7 @@ files:
84
69
  - lib/ore/tasks.rb
85
70
  - ore-tasks.gemspec
86
71
  - spec/spec_helper.rb
87
- has_rdoc: yard
72
+ has_rdoc: true
88
73
  homepage: http://github.com/ruby-ore/ore-tasks
89
74
  licenses: []
90
75
 
@@ -98,21 +83,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
98
83
  requirements:
99
84
  - - ">="
100
85
  - !ruby/object:Gem::Version
101
- segments:
102
- - 0
103
86
  version: "0"
104
87
  required_rubygems_version: !ruby/object:Gem::Requirement
105
88
  none: false
106
89
  requirements:
107
90
  - - ">="
108
91
  - !ruby/object:Gem::Version
109
- segments:
110
- - 0
111
92
  version: "0"
112
93
  requirements: []
113
94
 
114
95
  rubyforge_project: ore-tasks
115
- rubygems_version: 1.3.7
96
+ rubygems_version: 1.5.0
116
97
  signing_key:
117
98
  specification_version: 3
118
99
  summary: Rake tasks for managing and releasing RubyGems using Ore.