rubyexts 0.0.2.1 → 0.1.pre

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/Rakefile CHANGED
@@ -1,79 +1,28 @@
1
- #!/usr/bin/env rake1.9
2
1
  # encoding: utf-8
3
2
 
4
- # http://support.runcoderun.com/faqs/builds/how-do-i-run-rake-with-trace-enabled
5
- Rake.application.options.trace = true
6
-
7
- task :setup => ["submodules:init"]
8
-
9
- namespace :submodules do
10
- desc "Init submodules"
11
- task :init do
12
- sh "git submodule init"
13
- end
14
-
15
- desc "Update submodules"
16
- task :update do
17
- Dir["vendor/*"].each do |path|
18
- if File.directory?(path) && File.directory?(File.join(path, ".git"))
19
- Dir.chdir(path) do
20
- puts "=> #{path}"
21
- puts %x[git reset --hard]
22
- puts %x[git fetch]
23
- puts %x[git reset origin/master --hard]
24
- puts
25
- end
26
- end
27
- end
28
- end
29
- end
30
-
31
- task :gem do
32
- sh "gem build rubyexts.gemspec"
33
- end
3
+ require_relative "lib/rubyexts/version"
34
4
 
35
- namespace :gem do
36
- task :prerelease do
37
- require_relative "lib/rubyexts"
38
- gemspec = Dir["*.gemspec"].first
39
- content = File.read(gemspec)
40
- prename = "#{gemspec.split(".").first}.pre.gemspec"
41
- version = RubyExts::VERSION.sub(/^(\d+)\.(\d+)\.\d+$/) { "#$1.#{$1.to_i + 1}" }
42
- File.open(prename, "w") do |file|
43
- file.puts(content.gsub(/(\w+::VERSION)/, "'#{version}.pre'"))
44
- end
45
- sh "gem build #{prename}"
46
- rm prename
47
- end
48
- end
5
+ # ENV setup for external commands
6
+ ENV["RUBYLIB"] = Dir["vendor/*/lib"].join(":")
7
+ $LOAD_PATH.clear.push(*Dir["vendor/*/lib"])
49
8
 
50
- desc "Release new version of rubyexts"
51
- task release: ["release:tag", "release:gemcutter"]
9
+ # encoding
10
+ Encoding.default_internal = "utf-8"
11
+ Encoding.default_external = "utf-8"
52
12
 
53
- namespace :release do
54
- desc "Create Git tag"
55
- task :tag do
56
- require_relative "lib/rubyexts"
57
- puts "Creating new git tag #{RubyExts::VERSION} and pushing it online ..."
58
- sh "git tag -a -m 'Version #{RubyExts::VERSION}' #{RubyExts::VERSION}"
59
- sh "git push --tags"
60
- puts "Tag #{RubyExts::VERSION} was created and pushed to GitHub."
61
- end
13
+ # http://support.runcoderun.com/faqs/builds/how-do-i-run-rake-with-trace-enabled
14
+ Rake.application.options.trace = true
62
15
 
63
- desc "Push gem to Gemcutter"
64
- task :gemcutter do
65
- puts "Pushing to Gemcutter ..."
66
- sh "gem push #{Dir["*.gem"].last}"
16
+ # default task for RunCodeRun.com
17
+ task :default => ["submodules:init", :spec]
18
+
19
+ # load tasks
20
+ Dir["tasks/*.rake"].each do |taskfile|
21
+ begin
22
+ load File.join(Dir.pwd, taskfile)
23
+ rescue Exception => exception
24
+ puts "Exception #{exception.class} occured during loading #{taskfile}:"
25
+ puts exception.message
26
+ puts exception.backtrace
67
27
  end
68
-
69
- desc "Create and push prerelease gem"
70
- task :pre => ["gem:prerelease", :gemcutter]
71
- end
72
-
73
- desc "Run specs"
74
- task :default => :setup do
75
- rubylib = (ENV["RUBYLIB"] || String.new).split(":")
76
- libdirs = Dir["vendor/*/lib"]
77
- ENV["RUBYLIB"] = (libdirs + rubylib).join(":")
78
- exec "./script/spec --options spec/spec.opts spec"
79
28
  end
@@ -0,0 +1,7 @@
1
+ # encoding: utf-8
2
+
3
+ # NOTE: Do not edit this file manually, this
4
+ # file is regenerated by task rake version:increase
5
+ module RubyExts
6
+ VERSION ||= "0.0.2.1"
7
+ end
data/lib/rubyexts.rb CHANGED
@@ -1,9 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
- module RubyExts
4
- VERSION ||= "0.0.2.1"
5
- end
6
-
7
3
  module Kernel
8
4
  # Require all files matching given glob relative to $:
9
5
  #
data/rubyexts.gemspec CHANGED
@@ -1,17 +1,9 @@
1
- #!/usr/bin/env gem1.9 build
1
+ #!/usr/bin/env gem build
2
2
  # encoding: utf-8
3
3
 
4
- Dir[File.join(File.dirname(__FILE__), "vendor", "*")].each do |path|
5
- if File.directory?(path) && Dir["#{path}/*"].empty?
6
- warn "Dependency #{File.basename(path)} in vendor seems to be empty. Run git submodule init && git submodule update to checkout it."
7
- elsif File.directory?(path) && File.directory?(File.join(path, "lib"))
8
- $:.unshift File.join(path, "lib")
9
- end
10
- end
11
-
12
4
  # Run thor package:gem or gem build rango.gemspec
13
5
  # NOTE: we can't use require_relative because when we run gem build, it use eval for executing this file
14
- require File.join(File.dirname(__FILE__), "lib", "rubyexts")
6
+ require File.join(File.dirname(__FILE__), "lib", "rubyexts", "version")
15
7
 
16
8
  Gem::Specification.new do |s|
17
9
  s.name = "rubyexts"
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env gem build
2
+ # encoding: utf-8
3
+
4
+ # Run thor package:gem or gem build rango.gemspec
5
+ # NOTE: we can't use require_relative because when we run gem build, it use eval for executing this file
6
+ require File.join(File.dirname(__FILE__), "lib", "rubyexts", "version")
7
+
8
+ Gem::Specification.new do |s|
9
+ s.name = "rubyexts"
10
+ s.version = '0.1.pre'
11
+ s.authors = ["Jakub Šťastný aka Botanicus"]
12
+ s.homepage = "http://github.com/botanicus/rubyexts"
13
+ s.summary = "Tiny library with Ruby extensions"
14
+ s.description = "" # TODO: long description
15
+ s.cert_chain = nil
16
+ s.email = ["knava.bestvinensis", "gmail.com"].join("@")
17
+ s.has_rdoc = true
18
+
19
+ # files
20
+ s.files = Dir.glob("**/*") - Dir.glob("pkg/*")
21
+ s.require_paths = ["lib"]
22
+
23
+ # Ruby version
24
+ s.required_ruby_version = ::Gem::Requirement.new("~> 1.9")
25
+
26
+ # RubyForge
27
+ s.rubyforge_project = "rubyexts"
28
+ end
@@ -0,0 +1,11 @@
1
+ # encoding: utf-8
2
+
3
+ # http://github.com/somebee/rbench/tree/master
4
+ desc "Run all benchmarks"
5
+ task :bm do
6
+ abort "Benchmarks doesn't work at the moment"
7
+ require "rbench"
8
+ Dir["#{Dir.pwd}/benchmarks/bm/*.rb"].each do |benchmark|
9
+ load benchmark
10
+ end
11
+ end
data/tasks/gem.rake ADDED
@@ -0,0 +1,23 @@
1
+ # encoding: utf-8
2
+
3
+ desc "Build the gem"
4
+ task :build do
5
+ sh "gem build rubyexts.gemspec"
6
+ end
7
+
8
+ namespace :build do
9
+ desc "Build the prerelease gem"
10
+ task :prerelease do
11
+ gemspec = "rubyexts.gemspec"
12
+ content = File.read(gemspec)
13
+ prename = "#{gemspec.split(".").first}.pre.gemspec"
14
+ # 0.1.1 => 0.2
15
+ version = RubyExts::VERSION.sub(/^(\d+)\.(\d+).*$/) { "#$1.#{$2.to_i + 1}" }
16
+ puts "Current #{RubyExts::VERSION} => #{version} pre"
17
+ File.open(prename, "w") do |file|
18
+ file.puts(content.gsub(/(\w+::VERSION)/, "'#{version}.pre'"))
19
+ end
20
+ sh "gem build #{prename}"
21
+ rm prename
22
+ end
23
+ end
data/tasks/hooks.rake ADDED
@@ -0,0 +1,12 @@
1
+ # encoding: utf-8
2
+
3
+ desc "Install Git hooks"
4
+ task :hooks do
5
+ if Dir.exist?(".git/hooks")
6
+ abort "You must remove .git/hooks first"
7
+ else
8
+ # do not symlink them, otherwise git will add samples
9
+ # FIXME: permissions
10
+ cp_r "support/hooks", ".git/hooks"
11
+ end
12
+ end
@@ -0,0 +1,68 @@
1
+ # encoding: utf-8
2
+
3
+ desc "Release new version of rubyexts"
4
+ task release: ["deps.rip", "version:increase", "release:tag", "release:gemcutter"]
5
+
6
+ namespace :version do
7
+ task :increase do
8
+ puts "Which version are you just releasing (previous version is #{RubyExts::VERSION})"
9
+ version = STDIN.gets.chomp
10
+ File.open("lib/rubyexts/version.rb", "w") do |file|
11
+ file.puts <<-EOF
12
+ # encoding: utf-8
13
+
14
+ # NOTE: Do not edit this file manually, this
15
+ # file is regenerated by task rake version:increase
16
+ module RubyExts
17
+ VERSION ||= "#{version}"
18
+ end
19
+ EOF
20
+ end
21
+
22
+ RubyExts.const_set("VERSION", version) # so other release tasks will work
23
+ sh "git commit lib/rubyexts/version.rb -m 'Increased version to #{version}'"
24
+ end
25
+ end
26
+
27
+ namespace :release do
28
+ desc "Create Git tag"
29
+ task :tag do
30
+ puts "Creating new git tag #{RubyExts::VERSION} and pushing it online ..."
31
+ sh "git tag -a -m 'Version #{RubyExts::VERSION}' #{RubyExts::VERSION}"
32
+ sh "git push --tags"
33
+ puts "Tag #{RubyExts::VERSION} was created and pushed to GitHub."
34
+ end
35
+
36
+ desc "Push gem to Gemcutter"
37
+ task :gemcutter => :build do
38
+ puts "Pushing to Gemcutter ..."
39
+ sh "gem push #{Dir["*.gem"].last}"
40
+ end
41
+ end
42
+
43
+ desc "Create and push prerelease gem"
44
+ task :prerelease => "build:prerelease" do
45
+ puts "Pushing to Gemcutter ..."
46
+ sh "gem push #{Dir["*.pre.gem"].last}"
47
+ end
48
+
49
+ dependencies = FileList["vendor/*/.git"].sub(/\/\.git$/, "")
50
+
51
+ desc "Regenerate deps.rip"
52
+ file "deps.rip" => dependencies do
53
+ commits = Hash.new
54
+ commits = dependencies.inject(Hash.new) do |hash, path|
55
+ Dir.chdir(path) do
56
+ revision = %x(git show | head -1).chomp.sub("commit ", "")
57
+ hash[File.basename(path)] = revision
58
+ hash
59
+ end
60
+ end
61
+ template = File.read("deps.rip.rbe")
62
+ deps_rip = eval("%Q{#{template}}")
63
+ File.open("deps.rip", "w") do |file|
64
+ file.puts(deps_rip)
65
+ end
66
+ sh "chmod +x deps.rip"
67
+ sh "git commit deps.rip -m 'Updated deps.rip'"
68
+ end
data/tasks/spec.rake ADDED
@@ -0,0 +1,27 @@
1
+ # encoding: utf-8
2
+
3
+ desc "Run specs"
4
+ task :spec, :path do |task, args|
5
+ exec "./script/spec --options spec/spec.opts #{args.path || "spec"}"
6
+ end
7
+
8
+ desc "Create stubs of all library files."
9
+ task "spec:stubs" do
10
+ Dir.glob("lib/**/*.rb").each do |file|
11
+ specfile = file.sub(/^lib/, "spec").sub(/\.rb$/, '_spec.rb')
12
+ unless File.exist?(specfile)
13
+ %x[mkdir -p #{File.dirname(specfile)}]
14
+ %x[touch #{specfile}]
15
+ puts "Created #{specfile}"
16
+ end
17
+ end
18
+ (Dir.glob("spec/rubyexts/**/*.rb") + ["spec/rubyexts_spec.rb"]).each do |file|
19
+ libfile = file.sub(/spec/, "lib").sub(/_spec\.rb$/, '.rb')
20
+ if !File.exist?(libfile) && File.zero?(file)
21
+ %x[rm #{file}]
22
+ puts "Removed empty file #{file}"
23
+ elsif !File.exist?(libfile)
24
+ puts "File exists just in spec, not in lib: #{file}"
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,33 @@
1
+ # encoding: utf-8
2
+
3
+ # === Helpers === #
4
+ def submodules(&block)
5
+ File.foreach(File.join(File.dirname(__FILE__), "..", ".gitmodules")) do |line|
6
+ if line.match(%r{submodule "(.+)"})
7
+ block.call($1)
8
+ end
9
+ end
10
+ end
11
+
12
+ # === Tasks === #
13
+ namespace :submodules do
14
+ desc "Init submodules"
15
+ task :init do
16
+ sh "git submodule init"
17
+ end
18
+
19
+ desc "Update submodules"
20
+ task :update do
21
+ submodules do |path|
22
+ if File.directory?(path) && File.directory?(File.join(path, ".git"))
23
+ Dir.chdir(path) do
24
+ puts "=> #{path}"
25
+ sh "git reset --hard"
26
+ sh "git fetch"
27
+ sh "git reset origin/master --hard"
28
+ puts
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
data/tasks/yardoc.rake ADDED
@@ -0,0 +1,9 @@
1
+ # encoding: utf-8
2
+
3
+ # template, textile or rdoc or md
4
+ # -t: template [available: default, javadoc]
5
+ # -m: markup style used in documentation [available: textile, markdown, rdoc]
6
+ desc "Generate Yardoc documentation for rubyexts"
7
+ task :yardoc do
8
+ sh "yardoc -r README.textile lib/**/*.rb -t default"
9
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyexts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2.1
4
+ version: 0.1.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Jakub \xC5\xA0\xC5\xA5astn\xC3\xBD aka Botanicus"
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain:
11
- date: 2009-12-04 00:00:00 +00:00
11
+ date: 2010-01-01 00:00:00 +00:00
12
12
  default_executable:
13
13
  dependencies: []
14
14
 
@@ -22,62 +22,70 @@ extra_rdoc_files: []
22
22
 
23
23
  files:
24
24
  - CHANGELOG
25
- - lib/rubyexts/array.rb
26
- - lib/rubyexts/attribute.rb
25
+ - rubyexts.gemspec
27
26
  - lib/rubyexts/capture_io.rb
28
- - lib/rubyexts/class.rb
29
- - lib/rubyexts/colored_string.rb
30
- - lib/rubyexts/enumerable.rb
31
27
  - lib/rubyexts/file.rb
32
- - lib/rubyexts/hash.rb
33
- - lib/rubyexts/kernel.rb
34
- - lib/rubyexts/logger.rb
35
- - lib/rubyexts/mixins/chainable.rb
36
- - lib/rubyexts/mixins/hookable.rb
37
- - lib/rubyexts/mixins/import.rb
38
- - lib/rubyexts/mixins/strategy.rb
39
- - lib/rubyexts/module.rb
40
- - lib/rubyexts/object.rb
41
28
  - lib/rubyexts/object_space.rb
42
- - lib/rubyexts/os.rb
43
- - lib/rubyexts/platform.rb
29
+ - lib/rubyexts/array.rb
30
+ - lib/rubyexts/hash.rb
44
31
  - lib/rubyexts/random.rb
45
32
  - lib/rubyexts/string.rb
33
+ - lib/rubyexts/unique_array.rb
34
+ - lib/rubyexts/object.rb
46
35
  - lib/rubyexts/time.rb
36
+ - lib/rubyexts/module.rb
37
+ - lib/rubyexts/attribute.rb
38
+ - lib/rubyexts/logger.rb
47
39
  - lib/rubyexts/time_dsl.rb
48
- - lib/rubyexts/try.rb
40
+ - lib/rubyexts/platform.rb
49
41
  - lib/rubyexts/try_dup.rb
50
- - lib/rubyexts/unique_array.rb
42
+ - lib/rubyexts/colored_string.rb
43
+ - lib/rubyexts/enumerable.rb
44
+ - lib/rubyexts/try.rb
45
+ - lib/rubyexts/class.rb
46
+ - lib/rubyexts/version.rb
47
+ - lib/rubyexts/mixins/hookable.rb
48
+ - lib/rubyexts/mixins/strategy.rb
49
+ - lib/rubyexts/mixins/chainable.rb
50
+ - lib/rubyexts/mixins/import.rb
51
+ - lib/rubyexts/os.rb
52
+ - lib/rubyexts/kernel.rb
51
53
  - lib/rubyexts.rb
52
54
  - LICENSE
53
- - Rakefile
54
55
  - README.textile
55
- - rubyexts-0.0.2.1.gem
56
- - rubyexts.gemspec
56
+ - rubyexts.pre.gemspec
57
57
  - script/spec
58
- - spec/rubyexts/array_spec.rb
59
- - spec/rubyexts/attribute_spec.rb
60
- - spec/rubyexts/class_spec.rb
58
+ - tasks/benchmark.rake
59
+ - tasks/release.rake
60
+ - tasks/yardoc.rake
61
+ - tasks/hooks.rake
62
+ - tasks/gem.rake
63
+ - tasks/spec.rake
64
+ - tasks/submodules.rake
65
+ - Rakefile
66
+ - TODO.txt
67
+ - spec/rubyexts_spec.rb
68
+ - spec/spec_helper.rb
69
+ - spec/rubyexts/kernel_spec.rb
61
70
  - spec/rubyexts/cli_spec.rb
62
- - spec/rubyexts/colored_string_spec.rb
63
71
  - spec/rubyexts/enumerable_spec.rb
64
- - spec/rubyexts/file_spec.rb
65
- - spec/rubyexts/hash_spec.rb
66
- - spec/rubyexts/kernel_spec.rb
67
- - spec/rubyexts/module_spec.rb
68
- - spec/rubyexts/object_space_spec.rb
69
- - spec/rubyexts/object_spec.rb
70
- - spec/rubyexts/os_spec.rb
72
+ - spec/rubyexts/array_spec.rb
71
73
  - spec/rubyexts/platform_spec.rb
74
+ - spec/rubyexts/class_spec.rb
72
75
  - spec/rubyexts/random_spec.rb
73
- - spec/rubyexts/string_spec.rb
74
- - spec/rubyexts/time_dsl_spec.rb
76
+ - spec/rubyexts/hash_spec.rb
75
77
  - spec/rubyexts/time_spec.rb
78
+ - spec/rubyexts/attribute_spec.rb
79
+ - spec/rubyexts/object_spec.rb
80
+ - spec/rubyexts/time_dsl_spec.rb
81
+ - spec/rubyexts/colored_string_spec.rb
82
+ - spec/rubyexts/os_spec.rb
76
83
  - spec/rubyexts/unique_array_spec.rb
77
- - spec/rubyexts_spec.rb
84
+ - spec/rubyexts/object_space_spec.rb
85
+ - spec/rubyexts/file_spec.rb
86
+ - spec/rubyexts/string_spec.rb
87
+ - spec/rubyexts/module_spec.rb
78
88
  - spec/spec.opts
79
- - spec/spec_helper.rb
80
- - TODO.txt
81
89
  has_rdoc: true
82
90
  homepage: http://github.com/botanicus/rubyexts
83
91
  licenses: []
@@ -95,9 +103,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
95
103
  version:
96
104
  required_rubygems_version: !ruby/object:Gem::Requirement
97
105
  requirements:
98
- - - ">="
106
+ - - ">"
99
107
  - !ruby/object:Gem::Version
100
- version: "0"
108
+ version: 1.3.1
101
109
  version:
102
110
  requirements: []
103
111