Railsæ¬ä½ã®ãtestãå®è¡ãã(5) çªå¤ç·¨
http://d.hatena.ne.jp/kouji0625/20130615/p1 ã®ç¶ãã§ãTravis CIãè¨å®ãã¦ã¿ã¾ãããï¼ãã¨è¡ãããã£ãã®ã§ããã¾ã£ããè¨å®ã§ãã¾ããã§ãããä»äººã®ããã¸ã§ã¯ããTravis CIã§è¨å®ããã®ã¯ã ãºããããã¤ãã¯ã§ãããã©ããã¾ã§ã¯ããã¾ããï¼ããªã
ã¨ãããã¨ã§ãå°ãå¤åçã¨ãã¦ãRailsã®ããã±ã¼ã¸ã³ã°ããã¦ã¿ã¾ããããã§ã¯ãä»æ¥ãã¯ããã£ã¦ãã£ã¦ã¿ããâª
ããã±ã¼ã¸ã³ã°
ã¨ãã£ã¦ããrake packageãå®è¡ããã ãã§ãwww
ãã°ããããã¨ã以ä¸ã®gemãã¡ã¤ã«ãçæããã¾ãã
- ./actionmailer/pkg/actionmailer-3.0.3.gem
- ./actionpack/pkg/actionpack-3.0.3.gem
- ./activemodel/pkg/activemodel-3.0.3.gem
- ./activerecord/pkg/activerecord-3.0.3.gem
- ./activeresource/pkg/activeresource-3.0.3.gem
- ./activesupport/pkg/activesupport-3.0.3.gem
- ./pkg/rails-3.0.3.gem
- ./railties/pkg/railties-3.0.3.gem
å 容ã®ç¢ºèª
ãã£ããã§ãã®ã§ããããã RubyGems.org ã§é
å¸ããã¦ããå
¬å¼ã®ããã±ã¼ã¸ã¨å¤ããããªããã¨ã確èªãã¦ã¿ã¾ãããã
äºåã«ä»¥ä¸ã®ã³ãã³ãã§ãªãªã¸ãã«ã® gem ãåå¾ãã¦ããã¾ãã
$ gem install -r rails -v 3.0.3 (以ä¸ãæ³å®ããå®è¡çµæ) Successfully installed activesupport-3.0.3 Successfully installed activemodel-3.0.3 Successfully installed actionpack-3.0.3 Successfully installed activerecord-3.0.3 Successfully installed activeresource-3.0.3 Successfully installed actionmailer-3.0.3 Successfully installed railties-3.0.3 Successfully installed rails-3.0.3 8 gems installed
å°ãé·ããã©ã確èªã¯ä»¥ä¸ã®ã³ãã³ãã§è¡ã£ãã
$ for f in `find . -name \*.gem`; do echo $f; mkdir -p tmp/orig tmp/mine; (tar xf $f -C tmp/mine 2> /dev/null; cd tmp/mine; tar xzf data.tar.gz 2> /dev/null; rm data.tar.gz; gzip -d metadata.gz; sed -i -e 's/date:.*$/date: 2010-11-16 00:00:00 -06:00/' metadata); (cd tmp/orig; tar xf `rvm gemdir`/cache/`basename $f` 2> /dev/null; tar xzf data.tar.gz 2> /dev/null; rm data.tar.gz; gzip -d metadata.gz) && (cd tmp; diff -rNu orig mine); rm -rf tmp; done (以ä¸ãæ³å®ããå®è¡çµæ) ./actionmailer/pkg/actionmailer-3.0.3.gem ./actionpack/pkg/actionpack-3.0.3.gem diff -rNu orig/lib/action_view/testing/resolvers.rb mine/lib/action_view/testing/resolvers.rb --- orig/lib/action_view/testing/resolvers.rb 1970-01-01 09:00:00.000000000 +0900 +++ mine/lib/action_view/testing/resolvers.rb 1970-01-01 09:00:00.000000000 +0900 @@ -22,10 +22,11 @@ end templates = [] - @hash.select { |k,v| k =~ /^#{query}$/ }.each do |path, source| - handler, format = extract_handler_and_format(path, formats) - templates << Template.new(source, path, handler, - :virtual_path => path, :format => format) + @hash.each do |_path, source| + next unless _path =~ /^#{query}$/ + handler, format = extract_handler_and_format(_path, formats) + templates << Template.new(source, _path, handler, + :virtual_path => _path, :format => format) end templates.sort_by {|t| -t.identifier.match(/^#{query}$/).captures.reject(&:blank?).size } ./activemodel/pkg/activemodel-3.0.3.gem ./activerecord/pkg/activerecord-3.0.3.gem diff -rNu orig/lib/active_record/relation/calculations.rb mine/lib/active_record/relation/calculations.rb --- orig/lib/active_record/relation/calculations.rb 1970-01-01 09:00:00.000000000 +0900 +++ mine/lib/active_record/relation/calculations.rb 1970-01-01 09:00:00.000000000 +0900 @@ -166,7 +166,7 @@ if operation == "count" column_name ||= (select_for_count || :all) - if arel.joins(arel) =~ /LEFT OUTER/i + if arel.join_sql =~ /LEFT OUTER/i distinct = true column_name = @klass.primary_key if column_name == :all end diff -rNu orig/lib/active_record/relation/finder_methods.rb mine/lib/active_record/relation/finder_methods.rb --- orig/lib/active_record/relation/finder_methods.rb 1970-01-01 09:00:00.000000000 +0900 +++ mine/lib/active_record/relation/finder_methods.rb 1970-01-01 09:00:00.000000000 +0900 @@ -194,7 +194,7 @@ def construct_relation_for_association_calculations including = (@eager_load_values + @includes_values).uniq - join_dependency = ActiveRecord::Associations::ClassMethods::JoinDependency.new(@klass, including, arel.joins(arel)) + join_dependency = ActiveRecord::Associations::ClassMethods::JoinDependency.new(@klass, including, arel.join_sql) relation = except(:includes, :eager_load, :preload) apply_join_dependency(relation, join_dependency) end diff -rNu orig/lib/active_record/relation/query_methods.rb mine/lib/active_record/relation/query_methods.rb --- orig/lib/active_record/relation/query_methods.rb 1970-01-01 09:00:00.000000000 +0900 +++ mine/lib/active_record/relation/query_methods.rb 1970-01-01 09:00:00.000000000 +0900 @@ -168,7 +168,7 @@ arel.join(join) end - arel.joins(arel) + arel.join_sql end def build_arel diff -rNu orig/lib/active_record/relation.rb mine/lib/active_record/relation.rb --- orig/lib/active_record/relation.rb 1970-01-01 09:00:00.000000000 +0900 +++ mine/lib/active_record/relation.rb 1970-01-01 09:00:00.000000000 +0900 @@ -376,7 +376,7 @@ def references_eager_loaded_tables? # always convert table names to downcase as in Oracle quoted table names are in uppercase - joined_tables = (tables_in_string(arel.joins(arel)) + [table.name, table.table_alias]).compact.map{ |t| t.downcase }.uniq + joined_tables = (tables_in_string(arel.join_sql) + [table.name, table.table_alias]).compact.map{ |t| t.downcase }.uniq (tables_in_string(to_sql) - joined_tables).any? end ./activeresource/pkg/activeresource-3.0.3.gem ./activesupport/pkg/activesupport-3.0.3.gem ./pkg/rails-3.0.3.gem ./railties/pkg/railties-3.0.3.gem
æ³å®éãã®çµæã«ãªã£ããããã§ãªã¬ãªã¬Railsãã§ãã¾ããã
ãã¨ã¯ Travis CI ã®è¨å®ãã§ããã°ãããã ãã©...ãã°ãããããããã§ãorz
--- åèURL
--- PRåºå
è¨äºãèªãã§ãã ããããããã¨ããããã¾ãããããããããã°ããã®è¨äºã®èè
ãæä¾ãã¦ããç¡æã®ãµã¼ãã¹ãããã£ã¦ãï¼ããã試ããã ããã
- ããã£ã¦ãï¼: http://cocktailq.herokuapp.com/