Skip to content

Commit

Permalink
Updated changes and whitespaces fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
DAddYE committed Jul 12, 2010
1 parent 1c0156d commit d65b377
Show file tree
Hide file tree
Showing 41 changed files with 58 additions and 59 deletions.
5 changes: 4 additions & 1 deletion CHANGES.rdoc
Expand Up @@ -2,14 +2,17 @@

== 0.9.15 (Unreleased)

* Added Before/After load hooks
* Fixes DataMapper.finalize
* Fixes issue with invalid class on form fields [Thanks RichGuk!]
* Enhances Datamapper database creation (Thanks lusis!)
* Adds a span around 'required' note for form fields
* Fixes padrino bin command to properly display help
* Stores component file in project after choices are validated
* Added Ohm support [Thanks to lusis]
* Updated require_dependencies to take a version
* fixes app destroy option
* Fixes app destroy option

== 0.9.14

* Application generator should create public subfolder
Expand Down
2 changes: 1 addition & 1 deletion padrino-admin/LICENSE
Expand Up @@ -17,4 +17,4 @@ 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.
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2 changes: 1 addition & 1 deletion padrino-admin/lib/padrino-admin/generators/orm.rb
Expand Up @@ -94,4 +94,4 @@ def destroy
end # Orm
end # Generators
end # Admin
end # Padrino
end # Padrino
Expand Up @@ -99,4 +99,4 @@ def login_from_session
end # AuthenticationHelpers
end # Helpers
end # Admin
end # Padrino
end # Padrino
2 changes: 1 addition & 1 deletion padrino-cache/LICENSE
Expand Up @@ -17,4 +17,4 @@ 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.
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2 changes: 1 addition & 1 deletion padrino-core/LICENSE
Expand Up @@ -17,4 +17,4 @@ 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.
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2 changes: 1 addition & 1 deletion padrino-core/bin/padrino
Expand Up @@ -7,4 +7,4 @@ $:.unshift(padrino_core_path) if File.directory?(padrino_core_path) && !$:.inclu

# We load our cli
require 'padrino-core/cli/base'
Padrino::Cli::Base.start(ARGV)
Padrino::Cli::Base.start(ARGV)
2 changes: 1 addition & 1 deletion padrino-core/lib/padrino-core/loader.rb
Expand Up @@ -163,4 +163,4 @@ def set_load_paths(*paths)
$:.uniq!
end
end # self
end # Padrino
end # Padrino
2 changes: 1 addition & 1 deletion padrino-core/lib/padrino-core/version.rb
Expand Up @@ -12,4 +12,4 @@ module Padrino
def self.version
VERSION
end
end # Padrino
end # Padrino
2 changes: 1 addition & 1 deletion padrino-core/test/test_application.rb
Expand Up @@ -51,4 +51,4 @@ def teardown
assert_equal "Foo in html", body
end
end
end
end
1 change: 0 additions & 1 deletion padrino-core/test/test_dependencies.rb
Expand Up @@ -23,5 +23,4 @@ class TestDependencies < Test::Unit::TestCase
assert_equal ["C", "B"], B_result
end
end

end
2 changes: 1 addition & 1 deletion padrino-core/test/test_mounter.rb
Expand Up @@ -147,4 +147,4 @@ class ::TwoApp < Padrino::Application
assert_equal "Im Demo 2", body
end
end
end
end
1 change: 0 additions & 1 deletion padrino-core/test/test_rendering.rb
Expand Up @@ -365,5 +365,4 @@ def is; "IS."; end
assert_equal 'THIS. IS. SPARTA!', body
end
end

end
2 changes: 1 addition & 1 deletion padrino-gen/LICENSE
Expand Up @@ -17,4 +17,4 @@ 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.
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2 changes: 1 addition & 1 deletion padrino-gen/README.rdoc
Expand Up @@ -145,4 +145,4 @@ To learn more about the mailer generator, check out the guide to

== Copyright

Copyright (c) 2010 Padrino. See LICENSE for details.
Copyright (c) 2010 Padrino. See LICENSE for details.
2 changes: 1 addition & 1 deletion padrino-gen/lib/padrino-gen/generators/actions.rb
Expand Up @@ -199,4 +199,4 @@ def available_choices_for(component)
end
end # Actions
end # Generators
end # Padrino
end # Padrino
Expand Up @@ -90,7 +90,7 @@ def setup_orm
else
ar.gsub! /!DB_DEVELOPMENT!/, SQLITE.gsub(/!DB_NAME!/,"Padrino.root('db', \"#{db}_development.db\")")
ar.gsub! /!DB_PRODUCTION!/, SQLITE.gsub(/!DB_NAME!/,"Padrino.root('db', \"#{db}_production.db\")")
ar.gsub! /!DB_TEST!/, SQLITE.gsub(/!DB_NAME!/,"Padrino.root('db', \"#{db}_test.db\")")
ar.gsub! /!DB_TEST!/, SQLITE.gsub(/!DB_NAME!/,"Padrino.root('db', \"#{db}_test.db\")")
require_dependencies 'sqlite3-ruby', :require => 'sqlite3'
end
require_dependencies 'activerecord', :require => 'active_record'
Expand Down
6 changes: 3 additions & 3 deletions padrino-gen/lib/padrino-gen/generators/components/orms/ohm.rb
Expand Up @@ -35,15 +35,15 @@ def setup_orm
class !NAME! < Ohm::Model
include Ohm::Timestamping
include Ohm::Typecast
# Examples:
# attribute :name
# reference :venue, Venue
# set :participants, Person
# counter :votes
#
#
# index :name
#
#
# def validate
# assert_present :name
# end
Expand Down
Expand Up @@ -11,7 +11,7 @@
def setup_orm
sequel = SEQUEL
db = @app_name.underscore
require_dependencies 'sequel'
require_dependencies 'sequel'
require_dependencies case options[:adapter]
when 'mysql'
sequel.gsub!(/!DB_DEVELOPMENT!/, "\"mysql://localhost/#{db}_development\"")
Expand Down Expand Up @@ -88,4 +88,4 @@ def create_migration_file(migration_name, name, columns)
:add => Proc.new { |field, kind| "add_column :#{field}, #{kind.camelize}" },
:remove => Proc.new { |field, kind| "drop_column :#{field}" }
)
end
end
Expand Up @@ -6,7 +6,7 @@
module CompassInitializer
def self.registered(app)
require 'sass/plugin/rack'
Compass.configuration do |config|
config.project_path = Padrino.root
config.sass_dir = "app/stylesheets"
Expand All @@ -17,10 +17,10 @@ def self.registered(app)
config.javascripts_dir = "public/javascripts"
config.output_style = :compressed
end
Compass.configure_sass_plugin!
Compass.handle_configuration_change!
app.use Sass::Plugin::Rack
end
end
Expand Down
Expand Up @@ -29,7 +29,7 @@ body.bp {
}

form.bp {
@include blueprint-form;
@include blueprint-form;
}

.two-col {
Expand Down
Expand Up @@ -102,4 +102,4 @@ def generate_controller_test(name)
def generate_model_test(name)
riot_contents = RIOT_MODEL_TEST.gsub(/!NAME!/, name.to_s.camelize)
create_file destination_root("test/models/#{name.to_s.underscore}_test.rb"), riot_contents, :skip => true
end
end
2 changes: 1 addition & 1 deletion padrino-gen/lib/padrino-gen/generators/project.rb
Expand Up @@ -84,4 +84,4 @@ def finish
end
end # Project
end # Generators
end # Padrino
end # Padrino
2 changes: 1 addition & 1 deletion padrino-gen/lib/padrino-gen/padrino-tasks/datamapper.rb
Expand Up @@ -96,4 +96,4 @@
desc "Create the database migrate and initialize with the seed data"
task :setup => [:create, :migrate, :seed]
end
end
end
4 changes: 2 additions & 2 deletions padrino-gen/test/helper.rb
Expand Up @@ -48,7 +48,7 @@ def assert_has_no_tag(name, attributes = {}, &block)
raise "Please specify a block!" if html.blank?
assert matcher.matches?(html), matcher.failure_message
end

# assert_file_exists('/tmp/app')
def assert_file_exists(file_path)
assert File.exist?(file_path), "File at path '#{file_path}' does not exist!"
Expand Down Expand Up @@ -89,4 +89,4 @@ def logger # :nodoc:
@logger = nil
end
end
end
end
6 changes: 3 additions & 3 deletions padrino-gen/test/test_app_generator.rb
Expand Up @@ -58,8 +58,8 @@ def setup
assert_match_in_file(/DemoApp.mailer :demo/m, '/tmp/sample_project/demo_app/mailers/demo.rb')
assert_dir_exists('/tmp/sample_project/demo_app/views/mailers/demo')
end
# only destroys what it generated.

# only destroys what it generated.
# hence, the folder will still exists if other changes were made to it.
should "destroys itself" do
silence_logger { generate(:project, 'sample_project','--root=/tmp') }
Expand All @@ -74,4 +74,4 @@ def setup
assert_no_match_in_file(/Padrino\.mount\("Demo"\).to\("\/demo"\)/,'/tmp/sample_project/config/apps.rb')
end
end
end
end
2 changes: 1 addition & 1 deletion padrino-gen/test/test_controller_generator.rb
Expand Up @@ -126,4 +126,4 @@ def setup
assert_no_file_exists('/tmp/sample_project/spec/controllers/demo_items_controller_spec.rb')
end
end
end
end
2 changes: 1 addition & 1 deletion padrino-gen/test/test_mailer_generator.rb
Expand Up @@ -51,4 +51,4 @@ def setup
assert_no_file_exists('/tmp/sample_project/app/mailers/demo.rb')
end
end
end
end
2 changes: 1 addition & 1 deletion padrino-gen/test/test_project_generator.rb
Expand Up @@ -449,4 +449,4 @@ def setup
assert_file_exists('/tmp/sample_project/app/stylesheets/partials/_base.scss')
end
end
end
end
2 changes: 1 addition & 1 deletion padrino-helpers/LICENSE
Expand Up @@ -17,4 +17,4 @@ 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.
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2 changes: 1 addition & 1 deletion padrino-helpers/lib/padrino-helpers/asset_tag_helpers.rb
Expand Up @@ -285,4 +285,4 @@ def parse_js_attributes(options)
end
end # AssetTagHelpers
end # Helpers
end # Padrino
end # Padrino
6 changes: 3 additions & 3 deletions padrino-helpers/test/test_asset_tag_helpers.rb
Expand Up @@ -131,7 +131,7 @@ def flash
end
should "display image tag relative link with options" do
time = stop_time_for_test
assert_has_tag('img.photo', :src => "/images/relative/pic.gif?#{time.to_i}") {
assert_has_tag('img.photo', :src => "/images/relative/pic.gif?#{time.to_i}") {
image_tag('relative/pic.gif', :class => 'photo') }
end
should "display image tag uri link with options" do
Expand All @@ -140,7 +140,7 @@ def flash
end
should "display image tag relative link with incorrect spacing" do
time = stop_time_for_test
assert_has_tag('img.photo', :src => "/images/relative/pic.gif?#{time.to_i}") {
assert_has_tag('img.photo', :src => "/images/relative/pic.gif?#{time.to_i}") {
image_tag(' relative/ pic.gif ', :class => 'photo') }
end
should "not use a timestamp if stamp setting is false" do
Expand Down Expand Up @@ -265,4 +265,4 @@ def flash
assert_has_tag('link', :type => 'my-type', :rel => 'my-rel', :href => "/blog/post.rss", :title => 'my-title') { feed_tag :rss, "/blog/post.rss", :type => "my-type", :rel => "my-rel", :title => "my-title" }
end
end
end
end
6 changes: 3 additions & 3 deletions padrino-helpers/test/test_form_builder.rb
Expand Up @@ -38,12 +38,12 @@ def standard_builder(object=@user)
assert_has_tag('form', :action => '/register', :method => 'post') { actual_html }
assert_has_tag('form input', :type => 'text', :name => 'outer-user_account[username]') { actual_html }
end

should "display correct form html with remote option" do
actual_html = form_for(@user, '/update', :remote => true) { "Demo" }
assert_has_tag('form', :action => '/update', :method => 'post', "data-remote" => 'true') { actual_html }
end

should "display correct form html with remote option and method put" do
actual_html = form_for(@user, '/update', :remote => true, :method => 'put') { "Demo" }
assert_has_tag('form', :method => 'post', "data-method" => 'put', "data-remote" => 'true') { actual_html }
Expand Down Expand Up @@ -665,4 +665,4 @@ def standard_builder(object=@user)
assert_have_selector '#demo2 p input', :type => 'image', :class => 'image', :src => "/images/buttons/ok.png?#{@stamp}"
end
end
end
end
11 changes: 5 additions & 6 deletions padrino-helpers/test/test_form_helpers.rb
Expand Up @@ -19,13 +19,13 @@ def app
actual_html = form_tag('/register', :class => 'test') { text_field_tag(:username) }
assert_has_tag('form input', :type => 'text', :name => "username") { actual_html }
end

should "display correct form with remote" do
actual_html = form_tag('/update', :class => 'put-form', :remote => true) { "Demo" }
assert_has_tag(:form, :class => "put-form", "data-remote" => 'true') { actual_html }
assert_has_no_tag(:form, "data-method" => 'post') { actual_html }
end

should "display correct form with remote and method is put" do
actual_html = form_tag('/update', :method => 'put', :remote => true) { "Demo" }
assert_has_tag(:form, "data-remote" => 'true', "data-method" => 'put') { actual_html }
Expand Down Expand Up @@ -131,7 +131,7 @@ def app
actual_html = label_tag(:username, :class => 'long-label', :caption => "Nickname")
assert_has_tag(:label, :for => 'username', :class => 'long-label', :content => "Nickname") { actual_html }
end

should "display label tag in ruby with required" do
actual_html = label_tag(:username, :caption => "Nickname", :required => true)
assert_has_tag(:label, :for => 'username', :content => 'Nickname') { actual_html }
Expand Down Expand Up @@ -351,7 +351,7 @@ def app
assert_has_tag('select option', :content => 'Blue', :value => 'blue1') { actual_html }
assert_has_tag('select option', :content => 'Black', :value => 'black1') { actual_html }
end

should "display options selected only for exact match" do
options = [['One', '1'], ['1', '10'], ['Two', "-1"]]
actual_html = select_tag(:range, :options => options, :selected => '-1')
Expand Down Expand Up @@ -446,5 +446,4 @@ def app
assert_have_selector 'form.advanced-form input[type=image]', :count => 1, :src => "/images/buttons/submit.png?#{@stamp}"
end
end

end
end
2 changes: 1 addition & 1 deletion padrino-helpers/test/test_format_helpers.rb
Expand Up @@ -192,4 +192,4 @@ def setup
assert_equal "<data-confirm=\\\"are you sure\\\">", js_escape_html("<data-confirm=\"are you sure\">")
end
end
end
end
2 changes: 1 addition & 1 deletion padrino-helpers/test/test_output_helpers.rb
Expand Up @@ -60,4 +60,4 @@ def app
assert_have_no_selector 'p', :content => "The ruby block passed in is a template", :class => 'is_template'
end
end
end
end
3 changes: 1 addition & 2 deletions padrino-helpers/test/test_render_helpers.rb
Expand Up @@ -46,5 +46,4 @@ def app
assert_have_selector 'p', :content => "Extra is bar"
end
end

end
end

0 comments on commit d65b377

Please sign in to comment.