freighthopper 0.1.3 → 0.1.4

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.
@@ -0,0 +1,30 @@
1
+ require 'digest/sha1'
2
+
3
+ # DO NOT MODIFY THIS FILE
4
+ module Bundler
5
+ FINGERPRINT = "588b0e9a1b6bf1d427a36ed6551864812cf2fd9d"
6
+ LOAD_PATHS = ["/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib", "/Library/Ruby/Gems/1.8/gems/shoulda-2.10.3/lib", "/Library/Ruby/Gems/1.8/gems/test-rig-0.0.3/lib"]
7
+ AUTOREQUIRES = {:test=>["test_rig", "shoulda"], :default=>["active_support"]}
8
+
9
+ def self.match_fingerprint
10
+ print = Digest::SHA1.hexdigest(File.read(File.expand_path('../../Gemfile', __FILE__)))
11
+ unless print == FINGERPRINT
12
+ abort 'Gemfile changed since you last locked. Please `bundle lock` to relock.'
13
+ end
14
+ end
15
+
16
+ def self.setup(*groups)
17
+ match_fingerprint
18
+ LOAD_PATHS.each { |path| $LOAD_PATH.unshift path }
19
+ end
20
+
21
+ def self.require(*groups)
22
+ groups = [:default] if groups.empty?
23
+ groups.each do |group|
24
+ (AUTOREQUIRES[group] || []).each { |file| Kernel.require file }
25
+ end
26
+ end
27
+
28
+ # Setup bundle when it's required.
29
+ setup
30
+ end
data/Gemfile CHANGED
@@ -1,4 +1,6 @@
1
- only 'test' do
2
- gem "test-rig", '0.0.1', :require_as => "test_rig"
1
+ gem 'activesupport', :require => 'active_support'
2
+
3
+ group :test do
4
+ gem "test-rig", '0.0.3', :require => "test_rig"
3
5
  gem 'shoulda'
4
6
  end
data/Gemfile.lock ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ specs:
3
+ - activesupport:
4
+ version: 2.3.5
5
+ - shoulda:
6
+ version: 2.10.3
7
+ - test-rig:
8
+ version: 0.0.3
9
+ hash: 588b0e9a1b6bf1d427a36ed6551864812cf2fd9d
10
+ sources: []
11
+
12
+ dependencies:
13
+ - activesupport: ">= 0"
14
+ - test-rig: = 0.0.3
15
+ - shoulda: ">= 0"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{freighthopper}
8
- s.version = "0.1.3"
8
+ s.version = "0.1.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jacob Rothstein"]
12
- s.date = %q{2010-02-04}
12
+ s.date = %q{2010-02-19}
13
13
  s.default_executable = %q{convert_to_should_syntax}
14
14
  s.description = %q{More core ext}
15
15
  s.email = %q{github@jacobrothstein.com}
@@ -19,8 +19,10 @@ Gem::Specification.new do |s|
19
19
  "README"
20
20
  ]
21
21
  s.files = [
22
- ".gitignore",
22
+ ".bundle/environment.rb",
23
+ ".gitignore",
23
24
  "Gemfile",
25
+ "Gemfile.lock",
24
26
  "LICENSE",
25
27
  "README",
26
28
  "Rakefile",
@@ -39,11 +41,8 @@ Gem::Specification.new do |s|
39
41
  "test/object_test.rb",
40
42
  "test/string_test.rb",
41
43
  "test/test_helper.rb",
42
- "vendor/gems/cache/shoulda-2.10.2.gem",
43
- "vendor/gems/cache/test-rig-0.0.1.gem",
44
- "vendor/gems/doc/.gitkeep",
45
- "vendor/gems/gems/.gitkeep",
46
- "vendor/gems/specifications/.gitkeep"
44
+ "vendor/cache/shoulda-2.10.3.gem",
45
+ "vendor/cache/test-rig-0.0.3.gem"
47
46
  ]
48
47
  s.homepage = %q{http://github.com/jbr/freighthopper}
49
48
  s.rdoc_options = ["--charset=UTF-8"]
data/lib/freighthopper.rb CHANGED
@@ -32,7 +32,7 @@ class Object
32
32
  end
33
33
 
34
34
  def is_one_of?(*args)
35
- args.flatten.any?{|klass| is_a? klass}
35
+ args.flatten.any?{|arg| arg === self }
36
36
  end
37
37
 
38
38
  def eval_with_options(*args, &blk)
@@ -82,7 +82,8 @@ end
82
82
 
83
83
  require 'pp'
84
84
  module Kernel
85
- mattr_accessor :trace_output
85
+ def trace_output() @@trace_output end
86
+ def trace_output=(t) @@trace_output = t end
86
87
  %w(pp p puts).each do |method|
87
88
  define_and_alias method, :source_and_passthrough do |*args|
88
89
  puts_without_source_and_passthrough caller.first if Kernel.trace_output
data/test/object_test.rb CHANGED
@@ -53,16 +53,28 @@ class ObjectTest < Test::Unit::TestCase
53
53
  end
54
54
 
55
55
  context 'is_one_of?' do
56
- should 'check if the object is one of the arguments' do
57
- assert "hello".is_one_of?(Fixnum, Symbol, Proc, String)
58
- end
56
+ context 'with is_a? functionality' do
57
+ should 'check if the object is one of the arguments' do
58
+ assert "hello".is_one_of?(Fixnum, Symbol, Proc, String)
59
+ end
60
+
61
+ should 'work with an array as well' do
62
+ assert :symbol.is_one_of?([Fixnum, Symbol])
63
+ end
59
64
 
60
- should 'work with an array as well' do
61
- assert :symbol.is_one_of?([Fixnum, Symbol])
65
+ should 'return false if there is no match' do
66
+ assert_not :symbol.is_one_of?(Proc, String)
67
+ end
62
68
  end
63
69
 
64
- should 'return false if there is no match' do
65
- assert_not :symbol.is_one_of?(Proc, String)
70
+ context 'with threequal functionality' do
71
+ should 'check if the object is equal to one of the arguments' do
72
+ assert "hello".is_one_of?("dear", "world", "hello")
73
+ end
74
+
75
+ should 'work with a regular expression as well' do
76
+ assert "hello".is_one_of?(/h.{3}o/, /h/)
77
+ end
66
78
  end
67
79
  end
68
80
  end
data/test/test_helper.rb CHANGED
@@ -1,15 +1,18 @@
1
+ require 'test/unit'
2
+
1
3
  begin
2
- require File.instance_eval { expand_path join(dirname(__FILE__), '..', 'vendor', 'gems', 'environment')}
4
+ # Try to require the preresolved locked set of gems.
5
+ require File.expand_path('../../.bundle/environment', __FILE__)
3
6
  rescue LoadError
4
- puts "Bundling Gems\n\nHang in there, this only has to happen once...\n\n"
5
- system 'gem bundle'
6
- retry
7
+ # Fall back on doing an unlocked resolve at runtime.
8
+ require "rubygems"
9
+ require "bundler"
10
+ Bundler.setup
7
11
  end
8
12
 
9
- Bundler.require_env :test
13
+ Bundler.require :default, :test
10
14
 
11
15
  $:.unshift File.instance_eval { expand_path join(dirname(__FILE__), "..", "lib") }
12
- require 'test/unit'
13
16
 
14
17
 
15
18
  class Test::Unit::TestCase
Binary file
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: freighthopper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jacob Rothstein
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-04 00:00:00 -08:00
12
+ date: 2010-02-19 00:00:00 -08:00
13
13
  default_executable: convert_to_should_syntax
14
14
  dependencies: []
15
15
 
@@ -23,8 +23,10 @@ extra_rdoc_files:
23
23
  - LICENSE
24
24
  - README
25
25
  files:
26
+ - .bundle/environment.rb
26
27
  - .gitignore
27
28
  - Gemfile
29
+ - Gemfile.lock
28
30
  - LICENSE
29
31
  - README
30
32
  - Rakefile
@@ -43,11 +45,8 @@ files:
43
45
  - test/object_test.rb
44
46
  - test/string_test.rb
45
47
  - test/test_helper.rb
46
- - vendor/gems/cache/shoulda-2.10.2.gem
47
- - vendor/gems/cache/test-rig-0.0.1.gem
48
- - vendor/gems/doc/.gitkeep
49
- - vendor/gems/gems/.gitkeep
50
- - vendor/gems/specifications/.gitkeep
48
+ - vendor/cache/shoulda-2.10.3.gem
49
+ - vendor/cache/test-rig-0.0.3.gem
51
50
  has_rdoc: true
52
51
  homepage: http://github.com/jbr/freighthopper
53
52
  licenses: []
Binary file
Binary file