core_ex 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/SPEC.dyn.yml CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:OpenStruct
2
2
  table:
3
- :date: "Fri, 03 Jun 2005"
3
+ :date: "Sun, 05 Jun 2005"
4
4
  :version: !ruby/object:Version
5
- build: 2
5
+ build: 3
6
6
  major: 0
7
7
  minor: 1
8
- revision: 276
8
+ revision: 281
9
9
  :version_id: ''
10
10
  :url: svn://svn.feydakins.org/ruby_ex/trunk/core_ex
data/SPEC.gemspec ADDED
@@ -0,0 +1,15 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = %q{core_ex}
3
+ s.version = "0.1.3"
4
+ s.date = %q{2005-06-06}
5
+ s.summary = %q{CoreEx is a proposal for a standard library extension.}
6
+ s.email = ["nicolas.despres@gmail.com", "ertai@feydakins.org"]
7
+ s.homepage = %q{http://api.feydakins.org/core_ex}
8
+ s.rubyforge_project = %q{core_ex}
9
+ s.description = %q{CoreEx is designed to provides a simple but quite useful extension of the standard library of Ruby. So some classes and modules like Pathname, Time, Enumerable, Exception, FileUtils, String, and YAML are extended. There is also some new features like attr_once, DTime, TempPath, Version, embedded_tests, filelist (almost from rake), a common Rakefile, and an extension of the require system.}
10
+ s.has_rdoc = true
11
+ s.authors = ["Nicolas Despr\350s", "Nicolas Pouillard"]
12
+ s.files = ["lib/core_ex.rb", "lib/core_ex/attr_once.rb", "lib/core_ex/dtime.rb", "lib/core_ex/embedded_tests.rb", "lib/core_ex/enumerable.rb", "lib/core_ex/exception.rb", "lib/core_ex/filelist.rb", "lib/core_ex/fileutils.rb", "lib/core_ex/pathname.rb", "lib/core_ex/rakefile_base.rf", "lib/core_ex/require.rb", "lib/core_ex/string.rb", "lib/core_ex/temp_path.rb", "lib/core_ex/time.rb", "lib/core_ex/version.rb", "lib/core_ex/yaml.rb", "lib/core_ex/test/unit/ui/yaml/testrunner.rb", "test/check-core_ex.yml", "test/check-pkg-core_ex.yml", "test/resources", "test/sanity", "test/sanity-suite.yml", "test/test-unit-setup.rb", "test/unit-suite.yml", "test/resources/require", "test/resources/use-from-gems.rb", "test/resources/yaml_testrunner", "test/resources/require/test_require", "test/resources/require/test_require_rb.rb", "test/resources/require/test_require_so.so", "test/resources/yaml_testrunner/unit_test.rb", "test/sanity/multiple-requires.yml", "test/sanity/single-requires.yml", "AUTHORS", "NEWS", "Rakefile", "README", "SPEC.dyn.yml", "SPEC.gemspec", "SPEC.yml"]
13
+ s.rdoc_options = ["--inline-source", "--main", "README", "--title", "CoreEx -- A proposal for a standard library extension.", "-T", "html"]
14
+ s.extra_rdoc_files = ["README", "AUTHORS", "NEWS", "lib/core_ex.rb", "lib/core_ex/attr_once.rb", "lib/core_ex/dtime.rb", "lib/core_ex/embedded_tests.rb", "lib/core_ex/enumerable.rb", "lib/core_ex/exception.rb", "lib/core_ex/filelist.rb", "lib/core_ex/fileutils.rb", "lib/core_ex/pathname.rb", "lib/core_ex/require.rb", "lib/core_ex/string.rb", "lib/core_ex/temp_path.rb", "lib/core_ex/time.rb", "lib/core_ex/version.rb", "lib/core_ex/yaml.rb", "lib/core_ex/test/unit/ui/yaml/testrunner.rb"]
15
+ end
@@ -1,7 +1,7 @@
1
1
  # Copyright:: Copyright (c) 2005 Nicolas Pouillard. All rights reserved.
2
2
  # Author:: Nicolas Pouillard <ertai@lrde.epita.fr>.
3
3
  # License:: Gnu General Public License.
4
- # Revision:: $Id: rakefile_base.rf 276 2005-06-03 00:53:59Z ertai $
4
+ # Revision:: $Id: rakefile_base.rf 280 2005-06-05 20:52:26Z ertai $
5
5
 
6
6
  require 'core_ex'
7
7
  require 'ostruct'
@@ -20,7 +20,7 @@ require 'highline/import'
20
20
  AUTHORS = Pathname.new('AUTHORS')
21
21
  SPEC_YML = Pathname.new('SPEC.yml')
22
22
  SPEC_DYN_YML = Pathname.new('SPEC.dyn.yml')
23
- GEM_SPEC = Pathname.new("SPEC.gem.yml")
23
+ GEM_SPEC = Pathname.new("SPEC.gemspec")
24
24
  RakefileBase = __FILE__
25
25
  EDITOR = ENV['EDITOR'] || 'vi'
26
26
 
@@ -237,13 +237,13 @@ file GEM_SPEC.to_s => [ :spec, :dyn_spec, :rdoc_spec ] do
237
237
 
238
238
  authors_file = YAML::load(AUTHORS.read).values.first
239
239
  list = authors_file.map { |x| /^(.*?)\s*<(.*)>/.match(x.keys.first)[1..2] }
240
- s.authors = list.map { |x| x.first }
241
240
  s.author = s.authors
241
+ s.authors = list.map { |x| x.first }
242
242
  s.email = list.map { |x| x.last }
243
243
  s.homepage = SPEC.homepage
244
244
  s.rubyforge_project = s.name
245
245
  end
246
- GEM_SPEC.open('w') { |out| out.puts spec.to_yaml }
246
+ GEM_SPEC.open('w') { |out| out.puts spec.to_ruby }
247
247
  end
248
248
 
249
249
 
@@ -257,7 +257,7 @@ end
257
257
 
258
258
  # desc 'Load the GEM spec and create tasks for packages'
259
259
  task :gem_spec => [ GEM_SPEC.to_s ] do
260
- spec = YAML::load(GEM_SPEC.read)
260
+ spec = eval(GEM_SPEC.read)
261
261
 
262
262
  gtask = Rake::GemPackageTask.new(spec) do |p|
263
263
  p.gem_spec = spec
@@ -530,7 +530,6 @@ task :publish_package => [ :spec, :package ] do
530
530
  end
531
531
 
532
532
  if first_file then
533
- puts release_response.body
534
533
  release_id = release_response.body[/release_id=(\d+)/, 1]
535
534
  raise("Couldn't get release id") unless release_id
536
535
  end
@@ -1,7 +1,7 @@
1
1
  # Copyright:: Copyright (c) 2005 Nicolas Pouillard. All rights reserved.
2
2
  # Author:: Nicolas Pouillard <ertai@lrde.epita.fr>.
3
3
  # License:: Gnu General Public License.
4
- # Revision:: $Id: require.rb 252 2005-05-31 23:41:42Z ertai $
4
+ # Revision:: $Id: require.rb 278 2005-06-05 16:30:48Z ertai $
5
5
 
6
6
  require 'core_ex/pathname'
7
7
  require 'set'
@@ -26,17 +26,18 @@ class RequireSystem
26
26
  @include_dirs = Set.new
27
27
  @loaded = Set.new
28
28
  # @autoloads = {} FIXME AUTOLOAD
29
- @required = Set.new
30
29
  self.class.enable
31
30
  Kernel.kernel_require_system = self
32
31
  Module.module_require_system = self
32
+ adds = []
33
33
  $".each do |file|
34
34
  feature = file.to_path.expand_path_with($:, EXTENSIONS)
35
35
  raise "file not found #{file}" if feature.nil?
36
- @required << feature
36
+ adds << feature.to_s unless feature.to_s == file
37
37
  end
38
38
  feature = $0.to_path.expand_path_with($:, EXTENSIONS)
39
- @required << feature unless feature.nil?
39
+ adds << feature.to_s unless feature.nil?
40
+ $".replace(($" + adds).uniq)
40
41
  end
41
42
 
42
43
 
@@ -145,10 +146,9 @@ class RequireSystem
145
146
  cannot_found(aPathname) if abs.nil?
146
147
  feature = aPathname.to_s
147
148
  feature += abs.extname if aPathname.extname.empty?
148
- if $".include? feature or @required.include? abs
149
+ if $".include? feature or $".include? abs.to_s
149
150
  return false
150
151
  else
151
- @required << abs
152
152
  if abs.extname =~ /^(\.rb)?$/
153
153
  $" << feature
154
154
  res = Kernel.__load__(abs)
@@ -156,6 +156,7 @@ class RequireSystem
156
156
  res = Kernel.__require__(abs.extsplit.first.to_s)
157
157
  $" << feature unless $".include? feature
158
158
  end
159
+ $" << abs.to_s
159
160
  return true
160
161
  end
161
162
  end
@@ -163,8 +164,7 @@ class RequireSystem
163
164
 
164
165
  def include_dir ( aPathname )
165
166
  unless abs = include_dir?(aPathname)
166
- $: << aPathname.to_s
167
- $: << abs.to_s
167
+ $: << aPathname.to_s << abs.to_s
168
168
  @include_dirs << abs
169
169
  end
170
170
  self
@@ -186,7 +186,7 @@ class RequireSystem
186
186
  cannot_found(aPathname) if abs.nil?
187
187
  feature = aPathname.to_s
188
188
  feature += abs.extname if aPathname.extname.empty?
189
- return $".include?(feature) || @required.include?(abs)
189
+ return $".include?(feature) || $".include?(abs)
190
190
  end
191
191
 
192
192
 
@@ -3,7 +3,7 @@
3
3
  # License: Gnu General Public License.
4
4
 
5
5
  # $LastChangedBy: ertai $
6
- # $Id: temp_path.rb 271 2005-06-02 23:46:36Z ertai $
6
+ # $Id: temp_path.rb 283 2005-06-05 23:02:30Z ertai $
7
7
 
8
8
  require 'core_ex'
9
9
  require 'tempfile'
@@ -82,7 +82,7 @@ class TempPath < Pathname
82
82
  begin
83
83
  return block[tmp.dup]
84
84
  ensure
85
- clean
85
+ tmp.clean
86
86
  end
87
87
  end
88
88
 
data/lib/core_ex/time.rb CHANGED
@@ -1,11 +1,10 @@
1
1
  # Author:: Nicolas Pouillard <ertai@lrde.epita.fr>.
2
2
  # Copyright:: Copyright (c) 2005 Nicolas Pouillard. All rights reserved.
3
3
  # License:: GNU General Public License (GPL).
4
- # Revision:: $Id: time.rb 252 2005-05-31 23:41:42Z ertai $
4
+ # Revision:: $Id: time.rb 281 2005-06-05 21:39:51Z ertai $
5
5
 
6
- require 'time'
7
6
  require 'core_ex'
8
- require 'core_ex/dtime'
7
+ require 'time'
9
8
 
10
9
  class Time
11
10
 
data/lib/core_ex.rb CHANGED
@@ -1,14 +1,14 @@
1
1
  # Copyright:: Copyright (c) 2005 Nicolas Pouillard. All rights reserved.
2
2
  # Author:: Nicolas Pouillard <ertai@lrde.epita.fr>.
3
3
  # License:: Gnu General Public License.
4
- # Revision:: $Id: core_ex.rb 252 2005-05-31 23:41:42Z ertai $
4
+ # Revision:: $Id: core_ex.rb 278 2005-06-05 16:30:48Z ertai $
5
5
 
6
6
  require 'pathname'
7
7
 
8
8
  module CoreEx
9
9
  @@dir = Pathname.new(__FILE__).dirname.expand_path
10
10
  $: << @@dir.to_s
11
- $" << 'core_ex.rb'
11
+ $" << 'core_ex.rb' unless $".include? 'core_ex.rb'
12
12
 
13
13
  @@core_ex = @@dir + 'core_ex'
14
14
 
@@ -1,6 +1,12 @@
1
+ #!/usr/bin/env ruby
1
2
  require 'pathname'
2
- require 'core_ex/embedded_tests'
3
- args = ARGV.inject(nil) { |accu, x| (accu)? accu << x : ((x == '--')? [] : accu) }
3
+ unless defined? CoreEx
4
+ $: << Pathname.new(__FILE__).dirname.parent + 'lib'
5
+ require 'core_ex'
6
+ else
7
+ require 'core_ex/embedded_tests'
8
+ end
9
+ args = ARGV.inject(nil) { |accu, x| (accu)? accu << x : ((x == '--')? [] : accu) } || ARGV
4
10
  path = Pathname.new(args[0]).expand_path.cleanpath
5
11
  test_mode Regexp.new(path)
6
12
  require path.to_s
data/test/unit-suite.yml CHANGED
@@ -12,3 +12,5 @@ CoreEx Unit Test Suite:
12
12
  strategy: RUnit
13
13
  unit_file: <<pwd>>/test-unit-setup.rb
14
14
  args: <<path>>
15
+ verbose: true
16
+ core_ex: true
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.10
3
3
  specification_version: 1
4
4
  name: core_ex
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.1.2
7
- date: 2005-06-03
6
+ version: 0.1.3
7
+ date: 2005-06-06
8
8
  summary: CoreEx is a proposal for a standard library extension.
9
9
  require_paths:
10
10
  - lib
@@ -32,9 +32,8 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
32
32
  version:
33
33
  platform: ruby
34
34
  authors:
35
- -
36
- - Nicolas Despr�s
37
- - Nicolas Pouillard
35
+ - Nicolas Despr�s
36
+ - Nicolas Pouillard
38
37
  files:
39
38
  - lib/core_ex.rb
40
39
  - lib/core_ex/attr_once.rb
@@ -74,7 +73,7 @@ files:
74
73
  - Rakefile
75
74
  - README
76
75
  - SPEC.dyn.yml
77
- - SPEC.gem.yml
76
+ - SPEC.gemspec
78
77
  - SPEC.yml
79
78
  test_files: []
80
79
  rdoc_options:
data/SPEC.gem.yml DELETED
@@ -1,111 +0,0 @@
1
- --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.10
3
- specification_version: 1
4
- name: core_ex
5
- version: !ruby/object:Gem::Version
6
- version: 0.1.2
7
- date: 2005-06-03
8
- summary: CoreEx is a proposal for a standard library extension.
9
- require_paths:
10
- - lib
11
- email:
12
- - nicolas.despres@gmail.com
13
- - ertai@feydakins.org
14
- homepage: http://api.feydakins.org/core_ex
15
- rubyforge_project: core_ex
16
- description: "CoreEx is designed to provides a simple but quite useful extension of the
17
- standard library of Ruby. So some classes and modules like Pathname, Time,
18
- Enumerable, Exception, FileUtils, String, and YAML are extended. There is
19
- also some new features like attr_once, DTime, TempPath, Version,
20
- embedded_tests, filelist (almost from rake), a common Rakefile, and an
21
- extension of the require system."
22
- autorequire:
23
- default_executable:
24
- bindir: bin
25
- has_rdoc: true
26
- required_ruby_version: !ruby/object:Gem::Version::Requirement
27
- requirements:
28
- -
29
- - ">"
30
- - !ruby/object:Gem::Version
31
- version: 0.0.0
32
- version:
33
- platform: ruby
34
- authors:
35
- -
36
- - Nicolas Despr�s
37
- - Nicolas Pouillard
38
- files:
39
- - lib/core_ex.rb
40
- - lib/core_ex/attr_once.rb
41
- - lib/core_ex/dtime.rb
42
- - lib/core_ex/embedded_tests.rb
43
- - lib/core_ex/enumerable.rb
44
- - lib/core_ex/exception.rb
45
- - lib/core_ex/filelist.rb
46
- - lib/core_ex/fileutils.rb
47
- - lib/core_ex/pathname.rb
48
- - lib/core_ex/rakefile_base.rf
49
- - lib/core_ex/require.rb
50
- - lib/core_ex/string.rb
51
- - lib/core_ex/temp_path.rb
52
- - lib/core_ex/time.rb
53
- - lib/core_ex/version.rb
54
- - lib/core_ex/yaml.rb
55
- - lib/core_ex/test/unit/ui/yaml/testrunner.rb
56
- - test/check-core_ex.yml
57
- - test/check-pkg-core_ex.yml
58
- - test/resources
59
- - test/sanity
60
- - test/sanity-suite.yml
61
- - test/test-unit-setup.rb
62
- - test/unit-suite.yml
63
- - test/resources/require
64
- - test/resources/use-from-gems.rb
65
- - test/resources/yaml_testrunner
66
- - test/resources/require/test_require
67
- - test/resources/require/test_require_rb.rb
68
- - test/resources/require/test_require_so.so
69
- - test/resources/yaml_testrunner/unit_test.rb
70
- - test/sanity/multiple-requires.yml
71
- - test/sanity/single-requires.yml
72
- - AUTHORS
73
- - NEWS
74
- - Rakefile
75
- - README
76
- - SPEC.dyn.yml
77
- - SPEC.gem.yml
78
- - SPEC.yml
79
- test_files: []
80
- rdoc_options:
81
- - "--inline-source"
82
- - "--main"
83
- - README
84
- - "--title"
85
- - "CoreEx -- A proposal for a standard library extension."
86
- - "-T"
87
- - html
88
- extra_rdoc_files:
89
- - README
90
- - AUTHORS
91
- - NEWS
92
- - lib/core_ex.rb
93
- - lib/core_ex/attr_once.rb
94
- - lib/core_ex/dtime.rb
95
- - lib/core_ex/embedded_tests.rb
96
- - lib/core_ex/enumerable.rb
97
- - lib/core_ex/exception.rb
98
- - lib/core_ex/filelist.rb
99
- - lib/core_ex/fileutils.rb
100
- - lib/core_ex/pathname.rb
101
- - lib/core_ex/require.rb
102
- - lib/core_ex/string.rb
103
- - lib/core_ex/temp_path.rb
104
- - lib/core_ex/time.rb
105
- - lib/core_ex/version.rb
106
- - lib/core_ex/yaml.rb
107
- - lib/core_ex/test/unit/ui/yaml/testrunner.rb
108
- executables: []
109
- extensions: []
110
- requirements: []
111
- dependencies: []