mongo_mapper_ext 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/Rakefile +38 -40
  2. metadata +4 -4
data/Rakefile CHANGED
@@ -1,68 +1,66 @@
1
1
  require 'rake'
2
- require 'spec/rake/spectask'
2
+ require 'fileutils'
3
+ current_dir = File.expand_path(File.dirname(__FILE__))
4
+ Dir.chdir current_dir
3
5
 
4
- Dir.chdir File.dirname(__FILE__)
5
6
 
7
+ #
6
8
  # Specs
9
+ #
10
+ require 'spec/rake/spectask'
11
+
7
12
  task :default => :spec
8
13
 
9
14
  Spec::Rake::SpecTask.new('spec') do |t|
10
15
  t.spec_files = FileList["spec/**/*_spec.rb"].select{|f| f !~ /\/_/}
11
- t.libs = ['lib'].collect{|f| "#{File.dirname __FILE__}/#{f}"}
16
+ t.libs = ["#{current_dir}/lib"]
12
17
  end
13
18
 
19
+
20
+ #
14
21
  # Gem
22
+ #
15
23
  require 'rake/clean'
16
24
  require 'rake/gempackagetask'
17
- require 'fileutils'
18
25
 
26
+ gem_options = {
27
+ :name => "mongo_mapper_ext",
28
+ :version => "0.1.0",
29
+ :summary => "Extensions for MongoMapper",
30
+ :dependencies => %w(mongo_mapper)
31
+ }
32
+
33
+ gem_name = gem_options[:name]
19
34
  spec = Gem::Specification.new do |s|
20
- s.name = "mongo_mapper_ext"
21
- s.version = "0.0.1"
22
- s.summary = "Extensions for MongoMapper"
23
- s.description = "Extensions for MongoMapper"
24
- s.author = "Alexey Petrushin"
25
- # s.email = ""
26
- s.homepage = "http://github.com/alexeypetrushin/mongo_mapper_ext"
35
+ gem_options.delete(:dependencies).each{|d| s.add_dependency d}
36
+ gem_options.each{|k, v| s.send "#{k}=", v}
27
37
 
28
- s.platform = Gem::Platform::RUBY
29
- s.has_rdoc = true
30
- # s.extra_rdoc_files = ["README.rdoc"]
31
-
32
- # s.files = (%w{rakefile readme.md .gitignore} + Dir.glob("{app,lib,spec,.git}/**/*"))
33
- s.files = (['Rakefile', 'readme.md'] + Dir.glob("{lib,spec}/**/*"))
34
-
35
- s.require_paths = ["lib"]
36
-
37
- warn 'uncomment ruby_ext'
38
- [
39
- # 'ruby_ext',
40
- 'mongo_mapper',
41
- ].each{|name| s.add_dependency(name)}
42
-
38
+ s.name = gem_name
39
+ s.author = "Alexey Petrushin"
40
+ s.homepage = "http://github.com/alexeypetrushin/#{gem_options[:name]}"
41
+ s.require_path = "lib"
42
+ s.files = (%w{Rakefile readme.md} + Dir.glob("{lib,spec}/**/*"))
43
+
44
+ s.platform = Gem::Platform::RUBY
45
+ s.has_rdoc = true
43
46
  end
44
47
 
45
- PACKAGE_DIR = "#{File.expand_path File.dirname(__FILE__)}/build"
46
-
48
+ package_dir = "#{current_dir}/build"
47
49
  Rake::GemPackageTask.new(spec) do |p|
48
- package_dir = PACKAGE_DIR
49
- # FileUtils.mkdir package_dir unless File.exist? package_dir
50
- p.need_tar = true if RUBY_PLATFORM !~ /mswin/
51
- p.need_zip = true
52
- p.package_dir = package_dir
50
+ p.need_tar = true if RUBY_PLATFORM !~ /mswin/
51
+ p.need_zip = true
52
+ p.package_dir = package_dir
53
53
  end
54
54
 
55
- # CLEAN.include [ 'pkg', '*.gem']
56
-
57
55
  task :push do
58
- dir = Dir.chdir PACKAGE_DIR do
59
- gem_file = Dir.glob("mongo_mapper_ext*.gem").first
60
- system "gem push #{gem_file}"
61
- end
56
+ # dir = Dir.chdir package_dir do
57
+ gem_file = Dir.glob("#{package_dir}/#{gem_name}*.gem").first
58
+ system "gem push #{gem_file}"
59
+ # end
62
60
  end
63
61
 
64
62
  task :clean do
65
- system "rm -r #{PACKAGE_DIR}"
63
+ system "rm -r #{package_dir}"
66
64
  end
67
65
 
68
66
  task :release => [:gem, :push, :clean]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongo_mapper_ext
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 0
9
8
  - 1
10
- version: 0.0.1
9
+ - 0
10
+ version: 0.1.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Alexey Petrushin
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: "0"
33
33
  type: :runtime
34
34
  version_requirements: *id001
35
- description: Extensions for MongoMapper
35
+ description:
36
36
  email:
37
37
  executables: []
38
38