Permalink
Browse files

Added +extcore+ as a javascript option in project generator

  • Loading branch information...
imm committed Apr 5, 2010
1 parent 4d671de commit 43fb57dd39fa9d860873c14840e68281e314abb8
View
@@ -1,5 +1,9 @@
= CHANGES
== My Changes
* Added +extcore+ as a javascript option in project generator
== 0.9.10 (Unreleased)
* Updated jquery to v1.4.2
View
@@ -42,7 +42,7 @@ test:: rspec (default), bacon, shoulda, cucumber, testspec, riot
renderer:: haml (default), erb
stylesheet:: sass (default), less
mock:: none (default), mocha, rr
script:: none (default), jquery, prototype, mootools, rightjs
script:: none (default), jquery, prototype, mootools, rightjs, extcore
orm:: none (default), mongomapper, mongoid, activerecord, sequel, couchrest
To learn more about the project generator, check out the guide to
@@ -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.
@@ -0,0 +1,15 @@
module Padrino
module Generators
module Components
module Scripts
module ExtcoreGen
def setup_script
copy_file('templates/scripts/ext-core.js', destination_root("/public/javascripts/ext-core.js"))
create_file(destination_root('/public/javascripts/application.js'), "// Put your application scripts here")
end
end # ExtCoreGen
end # Scripts
end # Components
end # Generators
end # Padrino
@@ -28,7 +28,7 @@ def self.banner; "padrino-gen project [name] [options]"; end
component_option :orm, "database engine", :aliases => '-d', :choices => [:activerecord, :datamapper, :mongomapper, :mongoid, :sequel, :couchrest], :default => :none
component_option :test, "testing framework", :aliases => '-t', :choices => [:rspec, :shoulda, :cucumber, :bacon, :testspec, :riot], :default => :rspec
component_option :mock, "mocking library", :aliases => '-m', :choices => [:mocha, :rr], :default => :none
component_option :script, "javascript library", :aliases => '-s', :choices => [:jquery, :prototype, :rightjs, :mootools], :default => :none
component_option :script, "javascript library", :aliases => '-s', :choices => [:jquery, :prototype, :rightjs, :mootools, :extcore], :default => :none
component_option :renderer, "template engine", :aliases => '-e', :choices => [:haml, :erb], :default => :haml
component_option :stylesheet, "stylesheet engine", :aliases => '-c', :choices => [:less, :sass], :default => :none
@@ -76,4 +76,4 @@ def finish
end
end # Project
end # Generators
end # Padrino
end # Padrino

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -45,6 +45,7 @@ Gem::Specification.new do |s|
"lib/padrino-gen/generators/components/orms/sequel_gen.rb",
"lib/padrino-gen/generators/components/renderers/erb_gen.rb",
"lib/padrino-gen/generators/components/renderers/haml_gen.rb",
"lib/padrino-gen/generators/components/scripts/extcore_gen.rb",
"lib/padrino-gen/generators/components/scripts/jquery_gen.rb",
"lib/padrino-gen/generators/components/scripts/mootools_gen.rb",
"lib/padrino-gen/generators/components/scripts/prototype_gen.rb",
@@ -76,6 +77,7 @@ Gem::Specification.new do |s|
"lib/padrino-gen/generators/templates/helper.rb.tt",
"lib/padrino-gen/generators/templates/mailer.rb.tt",
"lib/padrino-gen/generators/templates/mailer_initializer.rb.tt",
"lib/padrino-gen/generators/templates/scripts/ext-core.js",
"lib/padrino-gen/generators/templates/scripts/jquery.js",
"lib/padrino-gen/generators/templates/scripts/lowpro.js",
"lib/padrino-gen/generators/templates/scripts/mootools-core.js",
@@ -194,6 +194,13 @@ def setup
assert_file_exists('/tmp/sample_project/public/javascripts/right.js')
assert_file_exists('/tmp/sample_project/public/javascripts/application.js')
end
should "properly generate for ext-core" do
buffer = silence_logger { @project.start(['sample_project', '--root=/tmp', '--script=extcore']) }
assert_match /Applying.*?extcore.*?script/, buffer
assert_file_exists('/tmp/sample_project/public/javascripts/ext-core.js')
assert_file_exists('/tmp/sample_project/public/javascripts/application.js')
end
end
context "the generator for test component" do

0 comments on commit 43fb57d

Please sign in to comment.