From a757e173f93bf1d42bb41e92757e53b446e3d76d Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 27 Sep 2012 22:53:04 +0200 Subject: moving dev documentation to toplevel --- Development.md | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++ core/Development.md | 90 ----------------------------------------------------- 2 files changed, 90 insertions(+), 90 deletions(-) create mode 100644 Development.md delete mode 100644 core/Development.md diff --git a/Development.md b/Development.md new file mode 100644 index 0000000..53942bb --- /dev/null +++ b/Development.md @@ -0,0 +1,90 @@ +Leap Web Core +============ + +This gem provides the generic helpers shared across the different engines that make up leap_web. + + +Creating a new engine +=================== + +Rails plugin new +---------------- + +Create the basic tree structure for an engine using + +rails plugin new ENGINE_NAME -O --full + + +'''-O''' will skip active record and not add a dev dependency on sqlite. +'''-full''' will create a directory structure with config/routes and app and a basic engine file. + +See http://guides.rubyonrails.org/engines.html for more general info about engines. + +Require Leap Web Core +--------------------- + +You need to add leap_web_core to your .gemspec: + + Gem::Specification.new do |s| + ... + s.add_dependency "rails" ... + s.add_dependency "leap_web_core", "~> 0.0.1" + end + + +You also need to require it before you define your engine in lib/my_engine/engine.rb: + +require "leap_web_core" + +module MyEngine + class Engine < ::Rails::Engine + ... + end +end + + +Require UI Gems +--------------- + +Leap Web Core provides a basic set of UI gems that should be used accross the engines. These include haml, sass, coffeescript, uglifier, bootstrap-sass, jquery and simple_form. + +Do you want to add views, javascript and the like to your engine? Then you should use the common gems. In order to do so you need to add them to your gemspec: + + + require "my_engine/version" + require "leap_web_core/dependencies" + + ... + + Gem::Specification.new do |s| + ... + s.add_dependency "rails" ... + s.add_dependency "leap_web_core", "~> 0.0.1" + + LeapWebCore::Dependencies.add_ui_gems_to_spec(s) + end + + +You also need to require them before you define your engine in lib/my_engine/engine.rb: + +require "leap_web_core" +LeapWebCore::Dependencies.require_ui_gems + +module MyEngine + class Engine < ::Rails::Engine + ... + end +end + + + +Creating Models +=============== + +You can use the normal rails generators to create models. Since you required the leap_web_core gem you will be using CouchRest::Model. So your models inherit from CouchRest::Model::Base. +http://www.couchrest.info/model/definition.html has some good first steps for setting up the model. +CouchRest Model behaved strangely when using a model without a design block. So make sure to define an initial view: http://www.couchrest.info/model/view_objects.html . + +From that point on you should be able to use the standart persistance and querying methods such as create, find, destroy and so on. + + diff --git a/core/Development.md b/core/Development.md deleted file mode 100644 index 53942bb..0000000 --- a/core/Development.md +++ /dev/null @@ -1,90 +0,0 @@ -Leap Web Core -============ - -This gem provides the generic helpers shared across the different engines that make up leap_web. - - -Creating a new engine -=================== - -Rails plugin new ----------------- - -Create the basic tree structure for an engine using - -rails plugin new ENGINE_NAME -O --full - - -'''-O''' will skip active record and not add a dev dependency on sqlite. -'''-full''' will create a directory structure with config/routes and app and a basic engine file. - -See http://guides.rubyonrails.org/engines.html for more general info about engines. - -Require Leap Web Core ---------------------- - -You need to add leap_web_core to your .gemspec: - - Gem::Specification.new do |s| - ... - s.add_dependency "rails" ... - s.add_dependency "leap_web_core", "~> 0.0.1" - end - - -You also need to require it before you define your engine in lib/my_engine/engine.rb: - -require "leap_web_core" - -module MyEngine - class Engine < ::Rails::Engine - ... - end -end - - -Require UI Gems ---------------- - -Leap Web Core provides a basic set of UI gems that should be used accross the engines. These include haml, sass, coffeescript, uglifier, bootstrap-sass, jquery and simple_form. - -Do you want to add views, javascript and the like to your engine? Then you should use the common gems. In order to do so you need to add them to your gemspec: - - - require "my_engine/version" - require "leap_web_core/dependencies" - - ... - - Gem::Specification.new do |s| - ... - s.add_dependency "rails" ... - s.add_dependency "leap_web_core", "~> 0.0.1" - - LeapWebCore::Dependencies.add_ui_gems_to_spec(s) - end - - -You also need to require them before you define your engine in lib/my_engine/engine.rb: - -require "leap_web_core" -LeapWebCore::Dependencies.require_ui_gems - -module MyEngine - class Engine < ::Rails::Engine - ... - end -end - - - -Creating Models -=============== - -You can use the normal rails generators to create models. Since you required the leap_web_core gem you will be using CouchRest::Model. So your models inherit from CouchRest::Model::Base. -http://www.couchrest.info/model/definition.html has some good first steps for setting up the model. -CouchRest Model behaved strangely when using a model without a design block. So make sure to define an initial view: http://www.couchrest.info/model/view_objects.html . - -From that point on you should be able to use the standart persistance and querying methods such as create, find, destroy and so on. - - -- cgit v1.2.3