ore-tasks 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog.md CHANGED
@@ -1,3 +1,12 @@
1
+ ### 0.4.3 / 2011-02-18
2
+
3
+ * Added {Ore::Tasks#install_dependency}.
4
+ * Make sure that `install:deps` only installs dependencies if they are not
5
+ found in `Gem.source_index`.
6
+ * Added a missing description to the `sync` task in {Ore::SCM::Tasks::Git}.
7
+ * Fixed a typo in {Ore::SCM::Tasks::Git#define_scm_tasks} which caused
8
+ commits/tags to not be pushed.
9
+
1
10
  ### 0.4.2 / 2011-02-15
2
11
 
3
12
  * Moved SCM specific logic into {Ore::SCM::Tasks}.
data/gemspec.yml CHANGED
@@ -1,9 +1,10 @@
1
1
  name: ore-tasks
2
- version: 0.4.2
2
+ version: 0.4.3
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
6
6
  with Ore.
7
+
7
8
  authors: Postmodern
8
9
  email: postmodern.mod3@gmail.com
9
10
  homepage: http://github.com/ruby-ore/ore-tasks
@@ -14,16 +14,17 @@ module Ore
14
14
  # Defines the [Git](http://www.git-scm.com) specific tasks.
15
15
  #
16
16
  def define_scm_tasks
17
- @remote = `git remote`.empty?
17
+ @has_remote = !(`git remote`.empty?)
18
18
 
19
+ desc 'Updates the remote repository'
19
20
  task :sync do
20
- run 'git', 'push' if @remote
21
+ run 'git', 'push' if @has_remote
21
22
  end
22
23
 
23
24
  desc 'Tags a release and pushes the tag'
24
25
  task :tag do
25
26
  run 'git', 'tag', "v#{@project.version}"
26
- run 'git', 'push', '--tags' if @remote
27
+ run 'git', 'push', '--tags' if @has_remote
27
28
  end
28
29
  end
29
30
 
data/lib/ore/tasks.rb CHANGED
@@ -119,21 +119,13 @@ module Ore
119
119
  namespace :install do
120
120
  desc 'Installs dependencies of the Gem'
121
121
  task :deps do
122
- install_dependency = lambda { |dep|
123
- arguments = []
124
-
125
- # enable install pre-releases
126
- arguments << '--prerelease' if dep.prerelease?
127
-
128
- # specify the version requirements
129
- dep.versions.each { |v| arguments << '--version' << v }
130
-
131
- gem('install',dep.name,*arguments)
122
+ install_missing_dependency = lambda { |dep|
123
+ install_dependency(dep) unless Gem.source_index.search(dep)
132
124
  }
133
125
 
134
- @project.dependencies.each(&install_dependency)
135
- @project.runtime_dependencies.each(&install_dependency)
136
- @project.development_dependencies.each(&install_dependency)
126
+ @project.dependencies.each(&install_missing_dependency)
127
+ @project.runtime_dependencies.each(&install_missing_dependency)
128
+ @project.development_dependencies.each(&install_missing_dependency)
137
129
  end
138
130
  end
139
131
  end
@@ -193,6 +185,29 @@ module Ore
193
185
  run(RUBY,'-S','gem',*arguments)
194
186
  end
195
187
 
188
+ #
189
+ # Installs a dependency.
190
+ #
191
+ # @param [Gem::Dependency] dep
192
+ # The RubyGems dependency to be installed.
193
+ #
194
+ # @return [true]
195
+ # Specifies that the dependency was successfully installed.
196
+ #
197
+ # @since 0.4.3
198
+ #
199
+ def install_dependency(dep)
200
+ arguments = []
201
+
202
+ # enable install pre-releases
203
+ arguments << '--prerelease' if dep.prerelease?
204
+
205
+ # specify the version requirements
206
+ dep.versions.each { |v| arguments << '--version' << v }
207
+
208
+ gem('install',dep.name,*arguments)
209
+ end
210
+
196
211
  #
197
212
  # Lists the modified files within the project.
198
213
  #
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: ore-tasks
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.4.2
5
+ version: 0.4.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Postmodern
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-02-15 00:00:00 -08:00
13
+ date: 2011-02-18 00:00:00 -08:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency