rubygems-mini_mirror 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,6 +16,7 @@ module Gem
16
16
 
17
17
  def gem(name, *reqs)
18
18
  options = reqs.extract_options!
19
+ options[:all] = options.has_key?(:all) ? options[:all] : true
19
20
  reqs.flatten!
20
21
  if reqs.empty?
21
22
  reqs = ['>=0']
@@ -10,6 +10,11 @@ module Gem
10
10
  @sources = srcs || Gem.sources
11
11
  @dependency = Gem::Dependency.new(name,requirements)
12
12
  @development = !! options[:development]
13
+ @all = !! options[:all]
14
+ end
15
+
16
+ def all?
17
+ @all
13
18
  end
14
19
 
15
20
  def development?
@@ -7,17 +7,21 @@ module Gem
7
7
  super()
8
8
  end
9
9
 
10
+ def fetch_deps(dep)
11
+ with_sources dep.sources do
12
+ found, errors = @spec_fetcher.fetch_with_errors dep, dep.respond_to?(:all) ? dep.all? : false , false
13
+ found.each do |spec,source_uri|
14
+ next if is_in_specs?(spec)
15
+ add_to_specs(spec,source_uri)
16
+ add_to_deps(*spec.runtime_dependencies)
17
+ add_to_deps(*spec.development_dependencies) if dep.development?
18
+ end
19
+ end
20
+ end
21
+
10
22
  def find_all_specs
11
23
  @dependencies.each do |dep|
12
- with_sources dep.sources do
13
- found, errors = @spec_fetcher.fetch_with_errors dep, true, false
14
- found.each do |spec,source_uri|
15
- next if is_in_specs?(spec)
16
- add_to_specs(spec,source_uri)
17
- add_to_deps(*spec.runtime_dependencies)
18
- add_to_deps(*spec.development_dependencies) if dep.development?
19
- end
20
- end
24
+ fetch_deps(dep)
21
25
  end
22
26
  end
23
27
 
@@ -33,7 +37,7 @@ module Gem
33
37
  def add_to_deps(*deps)
34
38
  deps.each do |dep|
35
39
  next if is_in_deps?(dep)
36
- dep = Gem::MiniMirror::Dependency.new(dep.name, dep.requirement,dep.respond_to?(:sources) ? dep.sources : Gem.sources, {:development => dep.respond_to?(:development?) ? dep.development? : false})
40
+ dep = Gem::MiniMirror::Dependency === dep ? dep : Gem::MiniMirror::Dependency.new(dep.name, dep.requirement,dep.respond_to?(:sources) ? dep.sources : Gem.sources, {:development => dep.respond_to?(:development?) ? dep.development? : false})
37
41
  @dependencies_list[dep.name.to_s][dep.requirement.to_s] = true
38
42
  @dependencies.push(dep)
39
43
  end
@@ -17,7 +17,7 @@ module Gem
17
17
  @resources = []
18
18
  @resources_signatures = {}
19
19
  @pool = Gem::MiniMirror::Pool.new(options[:pool_size] || Gem::MiniMirror::POOL_SIZE)
20
- @gems_dir = options[:gems_dir] || DEFAULT_GEMS_DIR
20
+ @gems_dir = File.expand_path(options[:gems_dir] || DEFAULT_GEMS_DIR)
21
21
  @fetcher = Gem::MiniMirror::Fetcher.new
22
22
  super
23
23
  end
@@ -41,7 +41,7 @@ module Gem
41
41
  end
42
42
 
43
43
  def existing_gems
44
- Dir[to('gems','.*gem')].entries.map{|f| File.basename(f)}
44
+ Dir[to('gems','*.gem')].entries.map{|f| File.basename(f)}
45
45
  end
46
46
 
47
47
  def gems_with_sources
@@ -102,8 +102,6 @@ module Gem
102
102
  find_all_specs
103
103
  end
104
104
 
105
-
106
-
107
105
  end
108
106
  end
109
107
  end
@@ -1,5 +1,5 @@
1
1
  module Gem
2
2
  module MiniMirror
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubygems-mini_mirror
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 0
10
- version: 1.0.0
9
+ - 1
10
+ version: 1.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ramihajamalala Hery
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-09-26 00:00:00 +02:00
18
+ date: 2011-09-27 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency