Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Updated one failing test (yay, not code!) for Rails 3 compatibility.

  • Loading branch information...
commit 61e41e336fe030df42de506bc5a1925fc24c9536 1 parent 1a5bbd8
Colin MacKenzie IV authored
5  .document
... ...
@@ -0,0 +1,5 @@
  1
+README.rdoc
  2
+lib/**/*.rb
  3
+bin/*
  4
+features/**/*.feature
  5
+LICENSE
23  .gitignore
... ...
@@ -1,5 +1,24 @@
1 1
 .idea
2  
-pkg
  2
+coverage.data
  3
+
  4
+## MAC OS
  5
+.DS_Store
  6
+
  7
+## TEXTMATE
  8
+*.tmproj
  9
+tmtags
  10
+
  11
+## EMACS
3 12
 *~
  13
+\#*
  14
+.\#*
  15
+
  16
+## VIM
4 17
 *.swp
5  
-docs
  18
+
  19
+## PROJECT::GENERAL
  20
+coverage
  21
+rdoc
  22
+pkg
  23
+
  24
+## PROJECT::SPECIFIC
6  History.txt
... ...
@@ -1,8 +1,4 @@
1  
-=== 1.2.0 2010-04-30
2  
-* Added some methods to Hash:
3  
-  * #stringify_values!
4  
-  * #stringify_values
5  
-  * #keys?
  1
+
6 2
 
7 3
 === 1.1.0 2010-03-30
8 4
 
20  LICENSE
... ...
@@ -0,0 +1,20 @@
  1
+Copyright (c) 2009 Colin MacKenzie IV
  2
+
  3
+Permission is hereby granted, free of charge, to any person obtaining
  4
+a copy of this software and associated documentation files (the
  5
+"Software"), to deal in the Software without restriction, including
  6
+without limitation the rights to use, copy, modify, merge, publish,
  7
+distribute, sublicense, and/or sell copies of the Software, and to
  8
+permit persons to whom the Software is furnished to do so, subject to
  9
+the following conditions:
  10
+
  11
+The above copyright notice and this permission notice shall be
  12
+included in all copies or substantial portions of the Software.
  13
+
  14
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  15
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  16
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  17
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  18
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  19
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  20
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35  README.rdoc
Source Rendered
@@ -11,31 +11,24 @@ requiring this as a dependency.
11 11
 
12 12
 * ActiveSupport 2.3.5+
13 13
 
14  
-== INSTALL:
  14
+== RAILS 3 COMPATIBILITY:
15 15
 
16  
-* sudo gem install sc-core-ext
  16
+This library has passed its tests with ActiveSupport 3.0.0.beta4.
17 17
 
18  
-== LICENSE:
  18
+== INSTALL:
19 19
 
20  
-(The MIT License)
  20
+* sudo gem install sc-core-ext
21 21
 
22  
-Copyright (c) 2010 FIXME Colin MacKenzie IV
  22
+== Note on Patches/Pull Requests
23 23
 
24  
-Permission is hereby granted, free of charge, to any person obtaining
25  
-a copy of this software and associated documentation files (the
26  
-'Software'), to deal in the Software without restriction, including
27  
-without limitation the rights to use, copy, modify, merge, publish,
28  
-distribute, sublicense, and/or sell copies of the Software, and to
29  
-permit persons to whom the Software is furnished to do so, subject to
30  
-the following conditions:
  24
+* Fork the project.
  25
+* Make your feature addition or bug fix.
  26
+* Add tests for it. This is important so I don't break it in a
  27
+  future version unintentionally.
  28
+* Commit, do not mess with rakefile, version, or history.
  29
+  (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
  30
+* Send me a pull request. Bonus points for topic branches.
31 31
 
32  
-The above copyright notice and this permission notice shall be
33  
-included in all copies or substantial portions of the Software.
  32
+== Copyright
34 33
 
35  
-THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
36  
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
37  
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
38  
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
39  
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
40  
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
41  
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  34
+Copyright (c) 2010 Colin MacKenzie IV. See LICENSE for details.
101  Rakefile
... ...
@@ -1,50 +1,51 @@
1  
-require 'rubygems'
2  
-gem 'hoe', '>= 2.1.0'
3  
-require 'hoe'
4  
-require 'fileutils'
5  
-require './lib/sc-core-ext'
6  
-
7  
-def rcov_opts
8  
-  IO.readlines("spec/rcov.opts").map {|l| l.chomp.split " "}.flatten
9  
-end
10  
-
11  
-Hoe.plugin :newgem
12  
-# Hoe.plugin :website
13  
-# Hoe.plugin :cucumberfeatures
14  
-
15  
-# Generate all the Rake tasks
16  
-# Run 'rake -T' to see list of generated tasks (from gem root directory)
17  
-$hoe = Hoe.spec 'sc-core-ext' do
18  
-  self.developer 'Colin MacKenzie IV', 'sinisterchipmunk@gmail.com'
19  
-  self.description = "A collection of core extensions that I have come to rely on in more than one package"
20  
-  self.readme_file = 'README.rdoc'
21  
-  self.extra_deps     = [['activesupport','>= 2.3.5']]
22  
-  self.extra_dev_deps = [['rspec','>=1.3.0'],['rcov','>=0.9.8']]
23  
-end
24  
-
25  
-Rake::RDocTask.new(:docs) do |rdoc|
26  
-  files = ['README.rdoc', # 'LICENSE', 'CHANGELOG',
27  
-           'lib/**/*.rb', 'doc/**/*.rdoc']#, 'spec/*.rb']
28  
-  rdoc.rdoc_files.add(files)
29  
-  rdoc.main = 'README.rdoc'
30  
-  rdoc.title = 'sc-core-ext'
31  
-  rdoc.rdoc_dir = 'doc'
32  
-  rdoc.options << '--line-numbers' << '--inline-source'
33  
-end
34  
-
35  
-namespace :spec do
36  
-  desc "Run all specs with rcov"
37  
-  Spec::Rake::SpecTask.new(:rcov) do |t|
38  
-    t.spec_files = FileList['spec/**/*_spec.rb']
39  
-    t.spec_opts = ['--options', 'spec/spec.opts']
40  
-    t.rcov = true
41  
-    t.rcov_dir = 'coverage'
42  
-    t.rcov_opts = rcov_opts
43  
-  end
44  
-end
45  
-
46  
-require 'newgem/tasks'
47  
-Dir['tasks/**/*.rake'].each { |t| load t }
48  
-
49  
-remove_task :default
50  
-task :default => :spec
  1
+require 'rubygems'
  2
+require 'rake'
  3
+require 'spec/rake/spectask'
  4
+
  5
+def rcov_opts
  6
+  IO.readlines("spec/rcov.opts").map {|l| l.chomp.split " "}.flatten
  7
+end
  8
+
  9
+begin
  10
+  require 'jeweler'
  11
+  Jeweler::Tasks.new do |gem|
  12
+    gem.name = "sc-core-ext"
  13
+    gem.summary = %Q{A collection of core extensions that I have come to rely on in more than one package}
  14
+    gem.description = %Q{A collection of core extensions that I have come to rely on in more than one package}
  15
+    gem.email = "sinisterchipmunk@gmail.com"
  16
+    gem.homepage = "http://github.com/sinisterchipmunk/sc-core-ext"
  17
+    gem.authors = ["Colin MacKenzie IV"]
  18
+    gem.add_dependency 'activesupport', '>= 2.3.5'
  19
+    gem.add_development_dependency 'rspec', '>=1.3.0'
  20
+    gem.add_development_dependency 'rcov',  '>=0.9.8'
  21
+  end
  22
+  Jeweler::GemcutterTasks.new
  23
+rescue LoadError
  24
+  puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
  25
+end
  26
+
  27
+Spec::Rake::SpecTask.new(:spec) do |t|
  28
+  t.spec_files = FileList['spec/**/*_spec.rb']
  29
+  t.spec_opts = ['--options', 'spec/spec.opts']
  30
+  t.rcov = false
  31
+end
  32
+
  33
+Spec::Rake::SpecTask.new(:rcov) do |t|
  34
+  t.spec_files = FileList['spec/**/*_spec.rb']
  35
+  t.spec_opts = ['--options', 'spec/spec.opts']
  36
+  t.rcov = true
  37
+  t.rcov_dir = 'coverage'
  38
+  t.rcov_opts = rcov_opts
  39
+end
  40
+
  41
+task :default => [:check_dependencies, :spec]
  42
+
  43
+require 'rake/rdoctask'
  44
+Rake::RDocTask.new do |rdoc|
  45
+  version = File.exist?('VERSION') ? File.read('VERSION') : ""
  46
+
  47
+  rdoc.rdoc_dir = 'rdoc'
  48
+  rdoc.title = "sc-core-ext #{version}"
  49
+  rdoc.rdoc_files.include('README*')
  50
+  rdoc.rdoc_files.include('lib/**/*.rb')
  51
+end
9  spec/sc-core-ext/active_support/ordered_hash_spec.rb
... ...
@@ -1,4 +1,5 @@
1 1
 require 'spec_helper'
  2
+require 'active_support/version'
2 3
 
3 4
 describe ActiveSupport::OrderedHash do
4 5
   context "#to_yaml" do
@@ -10,7 +11,13 @@
10 11
     end
11 12
 
12 13
     it "converts to yaml" do
13  
-      subject.to_yaml.should == "--- !map:ActiveSupport::OrderedHash \n:one: 1\n:two: 2\n"
  14
+      if ActiveSupport::VERSION::MAJOR >= 3
  15
+        yml = "--- !omap \n- :one: 1\n- :two: 2\n"
  16
+      else
  17
+        yml = "--- !map:ActiveSupport::OrderedHash \n:one: 1\n:two: 2\n"
  18
+      end
  19
+
  20
+      subject.to_yaml.should == yml
14 21
     end
15 22
   end
16 23
 end

0 notes on commit 61e41e3

Please sign in to comment.
Something went wrong with that request. Please try again.