gemmer 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/src/gemmer.rb +18 -10
  2. metadata +6 -8
@@ -1,6 +1,6 @@
1
- require 'rake/gempackagetask'
2
- require 'rake/rdoctask'
3
- require 'active_support/core_ext'
1
+ require 'rubygems/package_task'
2
+ require 'rdoc/task'
3
+ require 'date'
4
4
 
5
5
  # Deprecated. Don't use.
6
6
  def gemmer(gem_name)
@@ -25,10 +25,12 @@ module Gemmer #:nodoc:
25
25
  # t.release_via :scatter, :to => 'my_host_group'
26
26
  # end
27
27
  class Tasks
28
- attr_accessor_with_default(:gemspec_file) { "#{@gem_name}.gemspec" }
29
- attr_accessor_with_default(:gemspec_erb_file) { "#{gemspec_file}.erb" }
30
- attr_accessor_with_default :package_path, "pkg"
28
+ include Rake::DSL
31
29
 
30
+ attr_accessor :gemspec_file
31
+ attr_writer :gemspec_erb_file
32
+ attr_accessor :package_path
33
+
32
34
  # contains the Gem::Specification instance
33
35
  attr_reader :spec
34
36
 
@@ -41,12 +43,18 @@ module Gemmer #:nodoc:
41
43
  # gemspec_erb_file:: relative path of an erb template for generating the gemspec file. Use this only if you need to (e.g. Github did not allow Dir.glob in gemspec files, so a workaround was to use an erb file to glob for the files locally and generate the gemspec file from that.)
42
44
  # package_path:: relative path under which the built gem is stored. Defaults to pkg
43
45
  def initialize(gem_name)
44
- @gem_name = gem_name
46
+ @gem_name = gem_name
47
+ @gemspec_file = "#{@gem_name}.gemspec"
48
+ @package_path = 'pkg'
45
49
  @release_destinations = {}
46
50
  yield self if block_given?
47
51
  define
48
52
  end
49
-
53
+
54
+ def gemspec_erb_file
55
+ @gemspec_erb_file ||= "#{gemspec_file}.erb"
56
+ end
57
+
50
58
  # Add another release method. Available release methods are:
51
59
  #
52
60
  # - rubygems: Release the gem to rubygems.org
@@ -74,7 +82,7 @@ module Gemmer #:nodoc:
74
82
  end
75
83
 
76
84
  def define_gem_tasks
77
- Rake::GemPackageTask.new(@spec) do |pkg|
85
+ Gem::PackageTask.new(@spec) do |pkg|
78
86
  pkg.need_tar = true
79
87
  end
80
88
 
@@ -158,7 +166,7 @@ module Gemmer #:nodoc:
158
166
  task options[:to] => @package do
159
167
  ssh_string = "#{options[:username]}@#{options[:host] || options[:to]}"
160
168
  sh "scp #{@package} #{ssh_string}:/tmp/"
161
- sh "ssh #{ssh_string} #{options[:use_sudo]} gem install /tmp/#{@file_name}"
169
+ sh "ssh #{ssh_string} #{options[:use_sudo] ? 'sudo' : ''} gem install /tmp/#{@file_name}"
162
170
  end
163
171
  end
164
172
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gemmer
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
5
- prerelease: false
4
+ hash: 31
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Thomas Kadauke
@@ -15,8 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-09 00:00:00 +02:00
19
- default_executable:
18
+ date: 2013-01-28 00:00:00 Z
20
19
  dependencies: []
21
20
 
22
21
  description:
@@ -30,7 +29,6 @@ extra_rdoc_files:
30
29
  files:
31
30
  - src/gemmer.rb
32
31
  - README.rdoc
33
- has_rdoc: true
34
32
  homepage: http://www.imedo.de/
35
33
  licenses: []
36
34
 
@@ -60,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
58
  requirements: []
61
59
 
62
60
  rubyforge_project:
63
- rubygems_version: 1.3.7
61
+ rubygems_version: 1.8.24
64
62
  signing_key:
65
63
  specification_version: 3
66
64
  summary: Simple rake tasks for gems