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 +1 -1
- data/lib/the_force/capistrano/internal/rails.rb +4 -2
- data/lib/the_force/ruby_version.rb +19 -0
- data/test/test_helper.rb +2 -0
- data/test/unit/test_keep_trying.rb +1 -6
- data/test/unit/test_memoize.rb +1 -2
- data/test/unit/test_object_support.rb +1 -2
- data/test/unit/test_rails_support.rb +4 -4
- data/test/unit/test_ruby_version.rb +34 -0
- metadata +6 -3
data/Rakefile
CHANGED
@@ -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 '
|
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 '
|
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,9 +1,4 @@
|
|
1
|
-
require '
|
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
|
data/test/unit/test_memoize.rb
CHANGED
@@ -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
|
-
-
|
9
|
-
version: 0.3.
|
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-
|
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
|