Skip to content

Commit

Permalink
Merge pull request #11032 from strzalek/extract-actionview
Browse files Browse the repository at this point in the history
Extract ActionView to separate directory
  • Loading branch information
drogus committed Jun 20, 2013
2 parents 7c69a82 + d6b1caa commit a29f746
Show file tree
Hide file tree
Showing 337 changed files with 1,040 additions and 66 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -6,7 +6,7 @@ rvm:
- 2.0.0 - 2.0.0
env: env:
- "GEM=railties" - "GEM=railties"
- "GEM=ap,am,amo,as" - "GEM=ap,am,amo,as,av"
- "GEM=ar:mysql" - "GEM=ar:mysql"
- "GEM=ar:mysql2" - "GEM=ar:mysql2"
- "GEM=ar:sqlite3" - "GEM=ar:sqlite3"
Expand Down
37 changes: 2 additions & 35 deletions actionpack/CHANGELOG.md
@@ -1,38 +1,5 @@
* Use a case insensitive URI Regexp for #asset_path. * ActionView extracted from ActionPack


This fix a problem where the same asset path using different case are generating *Piotr Sarnacki*, *Łukasz Strzałkowski*
different URIs.

Before:

image_tag("HTTP://google.com")
# => "<img alt=\"Google\" src=\"/assets/HTTP://google.com\" />"
image_tag("http://google.com")
# => "<img alt=\"Google\" src=\"http://google.com\" />"

After:

image_tag("HTTP://google.com")
# => "<img alt=\"Google\" src=\"HTTP://google.com\" />"
image_tag("http://google.com")
# => "<img alt=\"Google\" src=\"http://google.com\" />"

*David Celis*

* Element of the `collection_check_boxes` and `collection_radio_buttons` can
optionally contain html attributes as the last element of the array.

*Vasiliy Ermolovich*

* Update the HTML `BOOLEAN_ATTRIBUTES` in `ActionView::Helpers::TagHelper`
to conform to the latest HTML 5.1 spec. Add attributes `allowfullscreen`,
`default`, `inert`, `sortable`, `truespeed`, `typemustmatch`. Fix attribute
`seamless` (previously misspelled `seemless`).

*Alex Peattie*

* Fix an issue where partials with a number in the filename weren't being digested for cache dependencies.

*Bryan Ricker*


Please check [4-0-stable](https://github.com/rails/rails/blob/4-0-stable/actionpack/CHANGELOG.md) for previous changes. Please check [4-0-stable](https://github.com/rails/rails/blob/4-0-stable/actionpack/CHANGELOG.md) for previous changes.
19 changes: 3 additions & 16 deletions actionpack/Rakefile
Expand Up @@ -7,14 +7,14 @@ task :default => :test
# Run the unit tests # Run the unit tests


desc "Run all unit tests" desc "Run all unit tests"
task :test => [:test_action_pack, :test_active_record_integration] task :test => [:test_action_pack]


Rake::TestTask.new(:test_action_pack) do |t| Rake::TestTask.new(:test_action_pack) do |t|
t.libs << 'test' t.libs << 'test'


# make sure we include the tests in alphabetical order as on some systems # make sure we include the tests in alphabetical order as on some systems
# this will not happen automatically and the tests (as a whole) will error # this will not happen automatically and the tests (as a whole) will error
t.test_files = Dir.glob('test/{abstract,controller,dispatch,template,assertions,journey}/**/*_test.rb').sort t.test_files = Dir.glob('test/{abstract,controller,dispatch,assertions,journey}/**/*_test.rb').sort


t.warning = true t.warning = true
t.verbose = true t.verbose = true
Expand All @@ -23,25 +23,12 @@ end
namespace :test do namespace :test do
task :isolated do task :isolated do
ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME')) ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME'))
Dir.glob("test/{abstract,controller,dispatch,template}/**/*_test.rb").all? do |file| Dir.glob("test/{abstract,controller,dispatch}/**/*_test.rb").all? do |file|
sh(ruby, '-Ilib:test', file) sh(ruby, '-Ilib:test', file)
end or raise "Failures" end or raise "Failures"
end end
end end


namespace :test do
Rake::TestTask.new(:template) do |t|
t.libs << 'test'
t.pattern = 'test/template/**/*.rb'
end
end

desc 'ActiveRecord Integration Tests'
Rake::TestTask.new(:test_active_record_integration) do |t|
t.libs << 'test'
t.test_files = Dir.glob("test/activerecord/*_test.rb")
end

spec = eval(File.read('actionpack.gemspec')) spec = eval(File.read('actionpack.gemspec'))


Gem::PackageTask.new(spec) do |p| Gem::PackageTask.new(spec) do |p|
Expand Down
4 changes: 2 additions & 2 deletions actionpack/actionpack.gemspec
Expand Up @@ -20,10 +20,10 @@ Gem::Specification.new do |s|
s.requirements << 'none' s.requirements << 'none'


s.add_dependency 'activesupport', version s.add_dependency 'activesupport', version
s.add_dependency 'builder', '~> 3.1.0' s.add_dependency 'actionview', version

s.add_dependency 'rack', '~> 1.5.2' s.add_dependency 'rack', '~> 1.5.2'
s.add_dependency 'rack-test', '~> 0.6.2' s.add_dependency 'rack-test', '~> 0.6.2'
s.add_dependency 'erubis', '~> 2.7.0'


s.add_development_dependency 'activemodel', version s.add_development_dependency 'activemodel', version
s.add_development_dependency 'tzinfo', '~> 0.3.37' s.add_development_dependency 'tzinfo', '~> 0.3.37'
Expand Down
1 change: 0 additions & 1 deletion actionpack/test/controller/caching_test.rb
@@ -1,6 +1,5 @@
require 'fileutils' require 'fileutils'
require 'abstract_unit' require 'abstract_unit'
require 'active_record_unit'


CACHE_DIR = 'test_cache' CACHE_DIR = 'test_cache'
# Don't change '/../temp/' cavalierly or you might hose something you don't want hosed # Don't change '/../temp/' cavalierly or you might hose something you don't want hosed
Expand Down
42 changes: 42 additions & 0 deletions actionview/CHANGELOG.md
@@ -0,0 +1,42 @@
* Use a case insensitive URI Regexp for #asset_path.

This fix a problem where the same asset path using different case are generating
different URIs.

Before:

image_tag("HTTP://google.com")
# => "<img alt=\"Google\" src=\"/assets/HTTP://google.com\" />"
image_tag("http://google.com")
# => "<img alt=\"Google\" src=\"http://google.com\" />"

After:

image_tag("HTTP://google.com")
# => "<img alt=\"Google\" src=\"HTTP://google.com\" />"
image_tag("http://google.com")
# => "<img alt=\"Google\" src=\"http://google.com\" />"

*David Celis*

* Element of the `collection_check_boxes` and `collection_radio_buttons` can
optionally contain html attributes as the last element of the array.

*Vasiliy Ermolovich*

* Update the HTML `BOOLEAN_ATTRIBUTES` in `ActionView::Helpers::TagHelper`
to conform to the latest HTML 5.1 spec. Add attributes `allowfullscreen`,
`default`, `inert`, `sortable`, `truespeed`, `typemustmatch`. Fix attribute
`seamless` (previously misspelled `seemless`).

*Alex Peattie*

* Fix an issue where partials with a number in the filename weren't being digested for cache dependencies.

*Bryan Ricker*

* First release, ActionView extracted from ActionPack

*Piotr Sarnacki*, *Łukasz Strzałkowski*

Please check [4-0-stable (ActionPack's CHANGELOG)](https://github.com/rails/rails/blob/4-0-stable/actionpack/CHANGELOG.md) for previous changes.
21 changes: 21 additions & 0 deletions actionview/MIT-LICENSE
@@ -0,0 +1,21 @@
Copyright (c) 2004-2012 David Heinemeier Hansson

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

31 changes: 31 additions & 0 deletions actionview/README.rdoc
@@ -0,0 +1,31 @@
= Action View



== Download and installation

The latest version of Action View can be installed with RubyGems:

% [sudo] gem install actionview

Source code can be downloaded as part of the Rails project on GitHub

* https://github.com/rails/rails/tree/master/actionview


== License

Action View is released under the MIT license:

* http://www.opensource.org/licenses/MIT


== Support

API documentation is at

* http://api.rubyonrails.org

Bug reports and feature requests can be filed with the rest for the Ruby on Rails project here:

* https://github.com/rails/rails/issues
27 changes: 27 additions & 0 deletions actionview/RUNNING_UNIT_TESTS
@@ -0,0 +1,27 @@
== Running with Rake

The easiest way to run the unit tests is through Rake. The default task runs
the entire test suite for all classes. For more information, checkout the
full array of rake tasks with "rake -T"

Rake can be found at http://rake.rubyforge.org

== Running by hand

To run a single test suite

rake test TEST=path/to/test.rb

which can be further narrowed down to one test:

rake test TEST=path/to/test.rb TESTOPTS="--name=test_something"

== Dependency on Active Record and database setup

Test cases in the test/active_record/ directory depend on having
activerecord and sqlite installed. If Active Record is not in
actionview/../activerecord directory, or the sqlite rubygem is not installed,
these tests are skipped.

Other tests are runnable from a fresh copy of actionview without any configuration.

79 changes: 79 additions & 0 deletions actionview/Rakefile
@@ -0,0 +1,79 @@
require 'rake/testtask'
require 'rake/packagetask'
require 'rubygems/package_task'

desc "Default Task"
task :default => :test

# Run the unit tests

desc "Run all unit tests"
task :test => [:test_action_view, :test_active_record_integration]

Rake::TestTask.new(:test_action_view) do |t|
t.libs << 'test'

# make sure we include the tests in alphabetical order as on some systems
# this will not happen automatically and the tests (as a whole) will error
t.test_files = Dir.glob('test/template/**/*_test.rb').sort

t.warning = true
t.verbose = true
end

namespace :test do
task :isolated do
ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME'))
Dir.glob("test/{active_record,template}/**/*_test.rb").all? do |file|
sh(ruby, '-Ilib:test', file)
end or raise "Failures"
end

Rake::TestTask.new(:template) do |t|
t.libs << 'test'
t.pattern = 'test/template/**/*.rb'
end
end

desc 'ActiveRecord Integration Tests'
Rake::TestTask.new(:test_active_record_integration) do |t|
t.libs << 'test'
t.test_files = Dir.glob("test/activerecord/*_test.rb")
end

spec = eval(File.read('actionview.gemspec'))

Gem::PackageTask.new(spec) do |p|
p.gem_spec = spec
end

desc "Release to gemcutter"
task :release => :package do
require 'rake/gemcutter'
Rake::Gemcutter::Tasks.new(spec).define
Rake::Task['gem:push'].invoke
end

task :lines do
lines, codelines, total_lines, total_codelines = 0, 0, 0, 0

FileList["lib/**/*.rb"].each do |file_name|
next if file_name =~ /vendor/
File.open(file_name, 'r') do |f|
while line = f.gets
lines += 1
next if line =~ /^\s*$/
next if line =~ /^\s*#/
codelines += 1
end
end
puts "L: #{sprintf("%4d", lines)}, LOC #{sprintf("%4d", codelines)} | #{file_name}"

total_lines += lines
total_codelines += codelines

lines, codelines = 0, 0
end

puts "Total: Lines #{total_lines}, LOC #{total_codelines}"
end
29 changes: 29 additions & 0 deletions actionview/actionview.gemspec
@@ -0,0 +1,29 @@
version = File.read(File.expand_path("../../RAILS_VERSION", __FILE__)).strip

Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'actionview'
s.version = version
s.summary = 'Rendering framework putting the V in MVC (part of Rails).'
s.description = ''

s.required_ruby_version = '>= 1.9.3'

s.license = 'MIT'

s.author = 'David Heinemeier Hansson'
s.email = 'david@loudthinking.com'
s.homepage = 'http://www.rubyonrails.org'

s.files = Dir['CHANGELOG.md', 'README.rdoc', 'MIT-LICENSE', 'lib/**/*']
s.require_path = 'lib'
s.requirements << 'none'

s.add_dependency 'activesupport', version
s.add_dependency 'activemodel', version

s.add_dependency 'builder', '~> 3.1.0'
s.add_dependency 'erubis', '~> 2.7.0'

s.add_development_dependency 'actionpack', version
end
Expand Up @@ -23,7 +23,6 @@


require 'active_support' require 'active_support'
require 'active_support/rails' require 'active_support/rails'
require 'action_pack'


module ActionView module ActionView
extend ActiveSupport::Autoload extend ActiveSupport::Autoload
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,4 +1,3 @@
require 'action_dispatch/http/mime_type'
require 'erubis' require 'erubis'


module ActionView module ActionView
Expand Down
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions actionview/lib/action_view/version.rb
@@ -0,0 +1,11 @@
module ActionView
# Returns the version of the currently loaded ActionView as a Gem::Version
def self.version
Gem::Version.new "4.1.0.beta"
end

module VERSION #:nodoc:
MAJOR, MINOR, TINY, PRE = ActionView.version.segments
STRING = ActionView.version.to_s
end
end

0 comments on commit a29f746

Please sign in to comment.