mgem 0.1.7 → 0.2.0

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.
Files changed (4) hide show
  1. checksums.yaml +7 -0
  2. data/bin/mgem +27 -13
  3. data/lib/mgem.rb +24 -21
  4. metadata +7 -9
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: aff684b1b46f4cf20be41e70a3eea1fcb0c6f91d
4
+ data.tar.gz: 805ea401404c9e967a7f1fda87ef242af759639b
5
+ SHA512:
6
+ metadata.gz: c3d32755ba98a56d7cf341af1a04c9d0cce8068d7d793d14054354961d7052bdd01b776e7001cc0405b33a10d815f6e516ff95d2d2da99ec8353863bbd4f156e
7
+ data.tar.gz: afd0bf3783f5b994b462aab96a9567f1af8f162a67942e9fb5b3baabbace9f3864fd3b8a22d263965e62bb724ef4b2b28fb797cea227c8d3a44b2abff754a77e
data/bin/mgem CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "#{File.dirname(__FILE__)}/../lib/mgem"
4
+ extend Mrbgem
4
5
 
5
6
  gems = load_gems unless ARGV[0] == 'help'
6
7
 
@@ -65,30 +66,43 @@ def get_binaries
65
66
  puts
66
67
  print 'Compile mrbc? (Y/n): '
67
68
  mrbc = STDIN.gets.chomp
68
- print 'Compile mruby? (Y/n): '
69
- mruby = STDIN.gets.chomp
70
- print 'Compile mirb? (Y/n): '
71
- mirb = STDIN.gets.chomp
72
69
 
73
70
  binaries = []
74
71
  binaries << 'mrbc' unless mrbc == 'n'
75
- binaries << 'mruby' unless mruby == 'n'
76
- binaries << 'mirb' unless mirb == 'n'
77
72
 
78
73
  binaries.join ' '
79
74
  end
80
75
 
81
- DEFAULT_GEMS = {
76
+ CORE_GEMS = {
77
+ 'irb Executable' => 'bin-mirb',
78
+ 'mruby Executable' => 'bin-mruby',
79
+ 'Array ext' => 'array-ext',
80
+ 'Enumeration ext' => 'enum-ext',
81
+ 'eval' => 'eval',
82
+ 'exit' => 'exit',
83
+ 'Fiber' => 'fiber',
84
+ 'Hash ext' => 'hash-ext',
82
85
  'Math' => 'math',
86
+ 'Numeric ext' => 'numeric-ext',
87
+ 'Object ext' => 'object-ext',
88
+ 'ObjectSpace' => 'objectspace',
89
+ 'print' => 'print',
90
+ 'Proc ext' => 'proc-ext',
91
+ 'random' => 'random',
92
+ 'Range ext' => 'range-ext',
93
+ 'sprintf' => 'sprintf',
94
+ 'String ext' => 'string-ext',
95
+ 'String UTF8' => 'string-utf8',
83
96
  'Struct' => 'struct',
97
+ 'Symbol ext' => 'symbol-ext',
84
98
  'Time' => 'time',
85
- 'sprintf' => 'sprintf'
99
+ 'Toplevel ext' => 'toplevel-ext'
86
100
  }
87
101
 
88
102
  def get_default_gems
89
103
  puts
90
104
  gems = []
91
- DEFAULT_GEMS.each do |gem, path|
105
+ CORE_GEMS.each do |gem, path|
92
106
  print "Include '#{gem}' GEM? (Y/n): "
93
107
  question = STDIN.gets.chomp
94
108
  unless question == 'n'
@@ -137,8 +151,8 @@ elsif ARGV[0] == 'update'
137
151
  elsif ARGV[0] == 'config'
138
152
  if ARGV[1] == 'default'
139
153
  toolchain = 'gcc'
140
- binaries = 'mrbc mruby mirb'
141
- default_gems = DEFAULT_GEMS.each_value.to_a
154
+ binaries = 'mrbc'
155
+ default_gems = CORE_GEMS.each_value.to_a
142
156
  else
143
157
  toolchain = get_toolchain
144
158
  binaries = get_binaries
@@ -170,7 +184,7 @@ MRuby::Build.new do |conf|
170
184
 
171
185
  conf.bins = %w(#{binaries})
172
186
 
173
- # mruby's default GEMs
187
+ # mruby's Core GEMs
174
188
  #{default_gem_command}
175
189
 
176
190
  # user-defined GEMs
@@ -182,7 +196,7 @@ end
182
196
  __CONFIG__
183
197
  else
184
198
  puts <<INFO
185
- mgem (Version #{MGEM_VERSION}) is a library manager for mruby
199
+ mgem (Version #{Mrbgem::MGEM_VERSION}) is a library manager for mruby
186
200
 
187
201
  Usage:
188
202
  mgem size How many GEMs are available?
@@ -2,33 +2,36 @@ require 'yaml'
2
2
  require 'fileutils'
3
3
  require "stringio"
4
4
 
5
- MGEM_VERSION = '0.1.7'
5
+ module Mrbgem
6
+ MGEM_VERSION = '0.2.0'
6
7
 
7
- MGEM_DIR = '.mgem'
8
- GEMS_ACTIVE = 'GEMS_ACTIVE.lst'
9
- GEMS_LIST = 'mgem-list'
10
- GEMS_REPO = 'https://github.com/bovi/mgem-list.git'
8
+ MGEM_HOME = ENV['MGEM_HOME'] ||= ENV['HOME']
9
+ MGEM_DIR = '.mgem'
10
+ GEMS_ACTIVE = 'GEMS_ACTIVE.lst'
11
+ GEMS_LIST = 'mgem-list'
12
+ GEMS_REPO = 'https://github.com/mruby/mgem-list.git'
11
13
 
12
- def load_gems
13
- config = {}
14
- config[:mgem_dir] = [ENV["HOME"], MGEM_DIR].join File::SEPARATOR
15
- config[:mgem_active] = [config[:mgem_dir], GEMS_ACTIVE].join File::SEPARATOR
16
- config[:mgem_list] = [config[:mgem_dir], GEMS_LIST].join File::SEPARATOR
14
+ def load_gems
15
+ config = {}
16
+ config[:mgem_dir] = [ENV["MGEM_HOME"], MGEM_DIR].join File::SEPARATOR
17
+ config[:mgem_active] = [config[:mgem_dir], GEMS_ACTIVE].join File::SEPARATOR
18
+ config[:mgem_list] = [config[:mgem_dir], GEMS_LIST].join File::SEPARATOR
17
19
 
18
- initialize_mgem_list(config)
20
+ initialize_mgem_list(config)
19
21
 
20
- MrbgemList.new(config)
21
- end
22
-
23
- def initialize_mgem_list(config = {})
24
- unless File.exists? config[:mgem_list]
25
- puts "Loading fresh GEM list..."
26
- `git clone #{GEMS_REPO} #{config[:mgem_list]}`
27
- puts "done!"
22
+ MrbgemList.new(config)
28
23
  end
29
24
 
30
- unless File.exists? config[:mgem_active]
31
- FileUtils.touch config[:mgem_active]
25
+ def initialize_mgem_list(config = {})
26
+ unless File.exists? config[:mgem_list]
27
+ puts "Loading fresh GEM list..."
28
+ `git clone #{GEMS_REPO} #{config[:mgem_list]}`
29
+ puts "done!"
30
+ end
31
+
32
+ unless File.exists? config[:mgem_active]
33
+ FileUtils.touch config[:mgem_active]
34
+ end
32
35
  end
33
36
  end
34
37
 
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mgem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
5
- prerelease:
4
+ version: 0.2.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Daniel Bovensiepen
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-03-04 00:00:00.000000000 Z
11
+ date: 2014-02-15 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: mgem helps you search and find GEMs specifically written for mruby. It
15
14
  also supports by creating a mruby build configuration.
@@ -24,26 +23,25 @@ files:
24
23
  homepage: http://github.com/bovi/mgem
25
24
  licenses:
26
25
  - MIT
26
+ metadata: {}
27
27
  post_install_message:
28
28
  rdoc_options: []
29
29
  require_paths:
30
30
  - lib
31
31
  required_ruby_version: !ruby/object:Gem::Requirement
32
- none: false
33
32
  requirements:
34
- - - ! '>='
33
+ - - '>='
35
34
  - !ruby/object:Gem::Version
36
35
  version: '0'
37
36
  required_rubygems_version: !ruby/object:Gem::Requirement
38
- none: false
39
37
  requirements:
40
- - - ! '>='
38
+ - - '>='
41
39
  - !ruby/object:Gem::Version
42
40
  version: '0'
43
41
  requirements: []
44
42
  rubyforge_project:
45
- rubygems_version: 1.8.23
43
+ rubygems_version: 2.0.3
46
44
  signing_key:
47
- specification_version: 3
45
+ specification_version: 4
48
46
  summary: A program to manage GEMs for mruby.
49
47
  test_files: []