gemtronics 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/bin/gemtronics CHANGED
@@ -26,6 +26,37 @@ when 'install'
26
26
  path = ARGV[2] || File.join('config', 'gemtronics.rb')
27
27
  Gemtronics.load(path)
28
28
  Gemtronics.install_gems(ARGV[1] || 'everything!')
29
+ when 'dump'
30
+ gem_list = `gem list`
31
+
32
+ gems = {}
33
+
34
+ gem_list.each do |line|
35
+ defs = line.scan(/([^\s\(\)\,]+)/).flatten
36
+ gems[defs.first] = defs[1..defs.size]
37
+ end
38
+
39
+ groups = []
40
+
41
+ gems.each do |name, versions|
42
+ versions.each_with_index do |version, i|
43
+ groups[i] ||= {}
44
+ groups[i][name] = {:name => name, :version => version}
45
+ end
46
+ end
47
+
48
+ out = ''
49
+
50
+ groups.each_with_index do |gems, i|
51
+ out << "group(:group_#{i}) do |g|\n"
52
+ gems.each do |name, gemdef|
53
+ out << " g.add('#{name}', :version => #{gemdef[:version]})\n"
54
+ end
55
+ out << "end\n"
56
+ end
57
+
58
+ puts out
59
+ File.open('system_gemtronics.rb', 'w') {|f| f.write out}
29
60
  when 'generate'
30
61
  path = ARGV[1] || 'config'
31
62
  FileUtils.mkdir_p(path)
@@ -59,7 +59,12 @@ module Gemtronics
59
59
  # gd.version = '2.3.0'
60
60
  # gd.install_command #=> 'gem install configatron --source=http://gems.rubyforge.org --version=2.3.0'
61
61
  def install_command
62
- cmd = "gem install #{self.name} --source=#{self.source}"
62
+ cmd = "gem install #{self.name}"
63
+
64
+ if self.source
65
+ cmd << " --source=#{self.source}"
66
+ end
67
+
63
68
  unless self.ri?
64
69
  cmd << ' --no-ri'
65
70
  end
@@ -121,7 +126,7 @@ module Gemtronics
121
126
 
122
127
  build_method(:name)
123
128
  build_method(:version, '>=0.0.0')
124
- build_method(:source, 'http://gems.rubyforge.org')
129
+ build_method(:source, nil)
125
130
  build_method(:load?, true, :load)
126
131
  build_method(:ri?, false, :ri)
127
132
  build_method(:rdoc?, false, :rdoc)
@@ -5,7 +5,7 @@ module Gemtronics
5
5
  # A Hash of the default options that are applied to all the gems.
6
6
  # These options can be overidden at both the group and the individual
7
7
  # gem level.
8
- GLOBAL_DEFAULT_OPTIONS = {:load => true, :version => '>=0.0.0', :source => 'http://gems.rubyforge.org', :ri => false, :rdoc => false}
8
+ GLOBAL_DEFAULT_OPTIONS = {:load => true, :version => '>=0.0.0', :ri => false, :rdoc => false}
9
9
 
10
10
  # A Hash of all the groups that have been defined.
11
11
  attr_accessor :groups
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gemtronics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - markbates
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-02 00:00:00 -04:00
12
+ date: 2009-09-04 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies: []
15
15