merb-gen 1.0.7 → 1.0.7.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -49,6 +49,10 @@ module Gem
49
49
  end
50
50
 
51
51
  class MultiSourceIndex
52
+ # Used by merb.thor to confirm; not needed when MSI is in use
53
+ def load_gems_in(*args)
54
+ end
55
+
52
56
  def search(*args)
53
57
  try = MAIN_INDEX.search(*args)
54
58
  return try unless try.empty?
@@ -1,8 +1,6 @@
1
1
  require "erb"
2
2
 
3
3
  Gem.pre_install_hooks.push(proc do |installer|
4
- $INSTALLING << installer.spec
5
-
6
4
  unless File.file?(installer.bin_dir / "common.rb")
7
5
  FileUtils.mkdir_p(installer.bin_dir)
8
6
  FileUtils.cp(File.dirname(__FILE__) / "common.rb", installer.bin_dir / "common.rb")
@@ -14,7 +12,7 @@ Gem.pre_install_hooks.push(proc do |installer|
14
12
  dep = Gem::Dependency.new(name, versions)
15
13
  unless dep.version_requirements.satisfied_by?(installer.spec.version)
16
14
  error "Cannot install #{installer.spec.full_name} " \
17
- "for #{$INSTALLING.map {|x| x.full_name}.join(", ")}; " \
15
+ "for #{$INSTALLING}; " \
18
16
  "you required #{dep}"
19
17
  ::Thor::Tasks::Merb::Gem.rollback_trans
20
18
  exit!
@@ -58,7 +56,6 @@ class ::Gem::Uninstaller
58
56
  end
59
57
 
60
58
  Gem.post_install_hooks.push(proc do |installer|
61
- $INSTALLING.pop
62
59
  source_index = installer.instance_variable_get("@source_index")
63
60
  ::Gem::Uninstaller._uninstall_others(
64
61
  source_index, installer.spec.name, installer.spec.version
@@ -84,7 +81,11 @@ class ::Gem::SpecFetcher
84
81
  def fetch(dependency, all = false, matching_platform = true)
85
82
  idx = Gem::SourceIndex.from_installed_gems
86
83
 
87
- dep = idx.search(dependency).sort.last
84
+ reqs = dependency.version_requirements.requirements
85
+
86
+ if reqs.size == 1 && reqs[0][0] == "="
87
+ dep = idx.search(dependency).sort.last
88
+ end
88
89
 
89
90
  if dep
90
91
  file = dep.loaded_from.dup
@@ -119,7 +119,7 @@ module Merb
119
119
  end
120
120
 
121
121
  rescue_failures do
122
- $INSTALLING = []
122
+ $INSTALLING = dep
123
123
  _install(dep)
124
124
  end
125
125
  end
@@ -10,7 +10,7 @@ module Merb
10
10
  end
11
11
 
12
12
  def destination_root
13
- File.join(@destination_root, 'tasks')
13
+ File.join(@destination_root)
14
14
  end
15
15
 
16
16
  def common_templates_dir
@@ -18,9 +18,14 @@ module Merb
18
18
  'templates', 'application', 'common'))
19
19
  end
20
20
 
21
+ file :common_file do |file|
22
+ file.source = File.join(common_templates_dir, "merb_thor", "common.rb")
23
+ file.destination = File.join("bin", "common.rb")
24
+ end
25
+
21
26
  directory :thor_file do |directory|
22
27
  directory.source = File.join(common_templates_dir, "merb_thor")
23
- directory.destination = File.join("merb.thor")
28
+ directory.destination = File.join("tasks", "merb.thor")
24
29
  end
25
30
  end
26
31
  add :thor, ThorGenerator
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: merb-gen
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Nicklas
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-12-28 00:00:00 -08:00
12
+ date: 2008-12-31 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 1.0.7
23
+ version: 1.0.7.1
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: templater