the_force 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -7,7 +7,7 @@ exclude_file_globs = []
7
7
 
8
8
  spec = Gem::Specification.new do |s|
9
9
  s.name = "the_force"
10
- s.version = '0.3.1'
10
+ s.version = '0.3.2'
11
11
  s.author = "Ryan Ziegler"
12
12
  s.email = "info@symbolforce.com"
13
13
  s.homepage = "http://www.symbolforce.com"
@@ -6,11 +6,13 @@
6
6
  # - to deploy on a new box, first cap deploy:setup, then add database.yml on the server in shared, then deploy:cold
7
7
  #
8
8
  # - nov 4 - putting capistrano recipe into the_force, use like this
9
- # require '/Users/ry/apps/the_force/lib/the_force/capistrano/internal/defaults'
9
+ # require 'rubygems'
10
+ # require 'the_force'
11
+ # require 'the_force/lib/the_force/capistrano/internal/defaults'
10
12
  # set :application, "amie"
11
13
  # set :shared_dirs, %w(public/system log db/sqlite)
12
14
  # set :shared_files, %w(config/database.yml config/cdn.yml)
13
- # require '/Users/ry/apps/the_force/lib/the_force/capistrano/internal/rails'
15
+ # require 'the_force/lib/the_force/capistrano/internal/rails'
14
16
 
15
17
  require 'highline'
16
18
 
@@ -0,0 +1,19 @@
1
+ require 'ostruct'
2
+
3
+ module TheForce
4
+ def self.ruby_version
5
+ v = OpenStruct.new
6
+ v.major, v.minor, v.point = *(RUBY_VERSION.split('.').map{|n| n.to_i})
7
+ v.patch = RUBY_PATCHLEVEL
8
+
9
+ def v.tiny
10
+ self.point
11
+ end
12
+
13
+ def v.is19?
14
+ [major, minor] == [1,9]
15
+ end
16
+
17
+ v.freeze
18
+ end
19
+ end
data/test/test_helper.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  #require 'active_support/testing/assertions'
2
2
 
3
+ require 'test/unit'
4
+ require 'pp'
3
5
  begin
4
6
  require 'redgreen'
5
7
  rescue LoadError
@@ -1,9 +1,4 @@
1
- require 'test/unit'
2
- begin
3
- require File.join(File.dirname(__FILE__), '../../lib/the_force/keep_trying.rb')
4
- rescue LoadError
5
- require File.expand_path('../../../lib/the_force/keep_trying.rb', __FILE__)
6
- end
1
+ require 'the_force/keep_trying'
7
2
 
8
3
  class TestKeepTrying < Test::Unit::TestCase
9
4
  def test_defaults_to_three_tries
@@ -1,5 +1,4 @@
1
- require 'test/unit'
2
- require 'memoize'
1
+ require 'the_force/memoize'
3
2
 
4
3
  class Memoizer
5
4
  def initialize
@@ -1,5 +1,4 @@
1
- require 'test/unit'
2
- require 'object_support'
1
+ require 'the_force/object_support'
3
2
 
4
3
  begin
5
4
  require 'active_support'
@@ -1,8 +1,8 @@
1
- require 'test/unit'
2
- require 'rails_support'
1
+ require 'the_force/rails_support'
2
+ require 'rails'
3
3
 
4
4
  class TestRailsSupport < Test::Unit::TestCase
5
- def test_rails_support
6
- assert false
5
+ def test_collect_column
6
+ assert false, "PENDING"
7
7
  end
8
8
  end
@@ -0,0 +1,34 @@
1
+ require 'the_force/ruby_version'
2
+
3
+ #CRZ - don't have test surface for changing RUBY_PATCHLEVEL and RUBY_VERSION inside TheForce
4
+ # thus we rely on rvm rake test for completeness
5
+
6
+ class TestRubyVersion < Test::Unit::TestCase
7
+ def setup
8
+ @v = TheForce.ruby_version
9
+ end
10
+
11
+ def test_returns_numbers_not_strings
12
+ assert [@v.major, @v.minor, @v.point, @v.patch].all? {|x| x.is_a? Integer}
13
+ end
14
+
15
+ def test_ruby_version_is_correct
16
+ assert_equal RUBY_VERSION, [@v.major, @v.minor, @v.point].join('.')
17
+ end
18
+
19
+ def test_patchlevel_is_correct
20
+ assert_equal RUBY_PATCHLEVEL, @v.patch
21
+ end
22
+
23
+ def test_tiny_and_patch_are_the_same
24
+ assert_equal @v.tiny, @v.point
25
+ end
26
+
27
+ def test_is19?
28
+ assert_equal [@v.major, @v.minor] == [1,9], @v.is19?
29
+ end
30
+
31
+ def test_is_frozen
32
+ assert @v.frozen?
33
+ end
34
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 1
9
- version: 0.3.1
8
+ - 2
9
+ version: 0.3.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ryan Ziegler
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-11-05 00:00:00 -04:00
17
+ date: 2010-11-07 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies: []
20
20
 
@@ -38,6 +38,7 @@ files:
38
38
  - lib/the_force/object_support.rb
39
39
  - lib/the_force/rails_support.rb
40
40
  - lib/the_force/remote_includes.rb
41
+ - lib/the_force/ruby_version.rb
41
42
  - lib/the_force/thread_pool.rb
42
43
  - lib/the_force/timer.rb
43
44
  - lib/the_force.rb
@@ -46,6 +47,7 @@ files:
46
47
  - test/unit/test_memoize.rb
47
48
  - test/unit/test_object_support.rb
48
49
  - test/unit/test_rails_support.rb
50
+ - test/unit/test_ruby_version.rb
49
51
  has_rdoc: true
50
52
  homepage: http://www.symbolforce.com
51
53
  licenses: []
@@ -85,3 +87,4 @@ test_files:
85
87
  - test/unit/test_memoize.rb
86
88
  - test/unit/test_object_support.rb
87
89
  - test/unit/test_rails_support.rb
90
+ - test/unit/test_ruby_version.rb