Permalink
Browse files

Release 0.1.4

  • Loading branch information...
1 parent 69fb0c8 commit d6f00d92c5263e61e59979d5434a9da01981857e @nando nando committed Oct 30, 2009
View
@@ -1,3 +1,8 @@
+== 0.1.4 2009-10-30
+* Added generator mundo_pepino_steps like mundo_pepino but creating a copy
+ of the step definitions in features/step_definitions.
+* Regexp fragment declarations wrapped in MundoPepino::Matchers::Bites
+
== 0.1.3 2009-10-27
* path_to method sensitivity: if present, url_mappings are disabled
* Configuration as Rails teach me: MundoPepino.configure
View
@@ -7,10 +7,14 @@ init.rb
lib/mundo_pepino.rb
lib/mundo_pepino/base.rb
lib/mundo_pepino/config.rb
-lib/mundo_pepino/definitions/en_US.rb
-lib/mundo_pepino/definitions/es_ES.rb
lib/mundo_pepino/en_US.rb
+lib/mundo_pepino/en_US/definitions.rb
+lib/mundo_pepino/en_US/mappings.rb
+lib/mundo_pepino/en_US/matchers.rb
lib/mundo_pepino/es_ES.rb
+lib/mundo_pepino/es_ES/definitions.rb
+lib/mundo_pepino/es_ES/mappings.rb
+lib/mundo_pepino/es_ES/matchers.rb
lib/mundo_pepino/implementations.rb
lib/mundo_pepino/implementations_api.rb
lib/mundo_pepino/resources_history.rb
@@ -23,3 +27,7 @@ rails_generators/mundo_pepino/USAGE
rails_generators/mundo_pepino/mundo_pepino_generator.rb
rails_generators/mundo_pepino/templates/mundo_pepino.rake
rails_generators/mundo_pepino/templates/mundo_pepino_es_ES.rb
+rails_generators/mundo_pepino_steps/USAGE
+rails_generators/mundo_pepino_steps/mundo_pepino_steps_generator.rb
+rails_generators/mundo_pepino_steps/templates/mundo_pepino.rake
+rails_generators/mundo_pepino_steps/templates/mundo_pepino_es_ES.rb
View
@@ -40,9 +40,11 @@ En este punto deberíamos obtener dos errores, ambos debidos a que el *scaffold*
Ahora sí, los escenarios deberían ser válidos, sin errores ni definiciones pendientes.
+El generador mundo_pepino nos prepara el entorno para utilizar las definiciones de MundoPepino sin copiarnos las mismas en ''features/steps_definitions'', cargándolas directemente desde su código. Existe otro generador equivalente llamado **mundo_pepino_steps** que hace lo mismo pero copiando dichas definiciones dentro de ''features/steps_definitions''.
+
La intención del generador de características es más didáctica que pragmática. Ofrece un ejemplo simple que podemos toquetear para probar el plugin. Por otro lado se limita a hacer exactamente lo mismo que hace `generate feature` exceptuando el hecho de que no genera un fichero de **definiciones específicas** para la nueva *caracteristica* (ya que las utilizadas están comprendidas dentro de las **definiciones genéricas** ya implementadas en MundoPepino).
-Dentro del plugin, en `features/support/app` está la aplicación que el MundoPepino utiliza para probarse a si mismo. En particular la característica `features/mundo-pepino.feature` pretente ser un compendio de escenarios que muestren las posibilidades que ofrece.
+Dentro del código de MundoPepino, en `features/support/app` está la aplicación que el MundoPepino utiliza para probarse a si mismo. En particular la característica `features/mundo-pepino.feature` pretente ser un compendio de escenarios que muestren las posibilidades que ofrece.
## Instalación
@@ -1,2 +1,4 @@
require 'mundo_pepino'
+require 'mundo_pepino/en_US/mappings'
+require 'mundo_pepino/en_US/matchers'
require 'mundo_pepino/en_US/definitions'
@@ -1,45 +1,9 @@
# MundoPepino's step definitions in en_US
-module MundoPepino
- class << self
- def language_specific_mappings
- String.add_mapper(:real_value, {
- /^tru(e|th)$/i => true,
- /^false$/i => false
- }) { |value| value } # "true".to_real_value # => true
- String.add_mapper(:field, {:nombre => :name})
-
- String.add_mapper(:number, {
- /^an?$/i => 1,
- /^one$/i => 1,
- /^first?$/i => 1,
- /^two$/i => 2,
- /^second$/i => 2,
- /^three$/i => 3,
- /^third$/i => 3,
- /^four$/i => 4,
- /^fourth$/i => 4,
- /^five$/i => 5,
- /^fifth$/i => 5}) { |string| string.to_i }
- String.add_mapper(:crud_action,
- /^creation$/i => 'new',
- /^changes?$/i => 'edit',
- /^modifications?$/i => 'edit',
- /^editions?$/i => 'edit') { |action| action }
- String.add_mapper(:month) { |month| month.capitalize }
- unless self.world.respond_to? :path_to
- String.url_mappings[/^the home\s?page/i] = self.world.root_path
- end
- end
- end
-end
-
-match_number = 'a|an|one|two|three|four|five|six|seven|eight|nine|ten|\d+'
-which = '(?:which|that have as)'
# Simple creation w/ optional name/s
-Given /^(?:that we have )?(#{match_number}) (?!.+ #{which})(.+?)(?: (?:called )?['"](.+)["'])?$/i do |number, model, name|
+Given /^(?:that we have )?(#{_number_}) (?!.+ #{_which_})(.+?)(?: (?:called )?['"](.+)["'])?$/i do |number, model, name|
given_we_have_a_number_of_instances_called number, model, name
end
-Then /^we have (#{match_number}) ([^ ]+)(?: (?:called )?['"](.+)["'])? in our database$/ do |number, model, names|
+Then /^we have (#{_number_}) ([^ ]+)(?: (?:called )?['"](.+)["'])? in our database$/ do |number, model, names|
then_we_have_a_number_of_instances_in_our_database number, model, names
end
@@ -0,0 +1,39 @@
+module MundoPepino
+ class << self
+ def language_specific_mappings
+ String.add_mapper(:real_value, {
+ /^tru(e|th)$/i => true,
+ /^false$/i => false
+ }) { |value| value } # "true".to_real_value # => true
+ String.add_mapper(:field, {:nombre => :name})
+
+ String.add_mapper(:number, {
+ /^an?$/i => 1,
+ /^one$/i => 1,
+ /^first?$/i => 1,
+ /^two$/i => 2,
+ /^second$/i => 2,
+ /^three$/i => 3,
+ /^third$/i => 3,
+ /^four$/i => 4,
+ /^fourth$/i => 4,
+ /^five$/i => 5,
+ /^fifth$/i => 5,
+ /^six$/i => 6,
+ /^seven$/i => 7,
+ /^eight$/i => 8,
+ /^nine$/i => 9,
+ /^ten$/i => 10
+ }) { |string| string.to_i }
+ String.add_mapper(:crud_action,
+ /^creation$/i => 'new',
+ /^changes?$/i => 'edit',
+ /^modifications?$/i => 'edit',
+ /^editions?$/i => 'edit') { |action| action }
+ String.add_mapper(:month) { |month| month.capitalize }
+ unless self.world.respond_to? :path_to
+ String.url_mappings[/^the home\s?page/i] = self.world.root_path
+ end
+ end
+ end
+end
@@ -0,0 +1,19 @@
+module MundoPepino
+ module Matchers
+ class Bites
+ class << self
+ def _number_
+ 'a|an|one|two|three|four|five|six|seven|eight|nine|ten|\d+'
+ end
+ def _which_
+ '(?:which|that have as)'
+ end
+ end
+ end
+ end
+end
+
+class << self
+ delegate :_number_, :_which_, :to => 'MundoPepino::Matchers::Bites'
+end
+
@@ -17,7 +17,13 @@ def language_specific_mappings
:cuatro => 4,
/^cuart[ao]/i => 4,
:cinco => 5,
- /^quint[ao]/i => 5}) { |string| string.to_i }
+ /^quint[ao]/i => 5,
+ :seis => 6,
+ :siete => 7,
+ :ocho => 8,
+ :nueve => 9,
+ :diez => 10
+ }) { |string| string.to_i }
String.add_mapper(:crud_action,
/^alta$/i => 'new',
/^creaci[óo]n$/i => 'new',
@@ -2,7 +2,7 @@ module MundoPepino #:nodoc:
class VERSION #:nodoc:
MAJOR = 0
MINOR = 1
- TINY = 3
+ TINY = 4
PATCH = nil # Set to nil for official release
STRING = [MAJOR, MINOR, TINY, PATCH].compact.join('.')
View
@@ -2,15 +2,15 @@
Gem::Specification.new do |s|
s.name = %q{mundo-pepino}
- s.version = "0.1.3"
+ s.version = "0.1.4"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Fernando Garc\303\255a Samblas"]
- s.date = %q{2009-10-27}
+ s.date = %q{2009-10-30}
s.description = %q{}
s.email = ["fernando.garcia@the-cocktail.com"]
s.extra_rdoc_files = ["History.txt", "Manifest.txt"]
- s.files = ["COPYING", "History.txt", "Manifest.txt", "README.markdown", "README_es.markdown", "init.rb", "lib/mundo_pepino.rb", "lib/mundo_pepino/definitions/en_US.rb", "lib/mundo_pepino/definitions/es_ES.rb", "lib/mundo_pepino/implementations.rb", "lib/mundo_pepino/resources_history.rb", "lib/mundo_pepino/version.rb", "lib/mundo_pepino/visits_history.rb", "lib/mundo_pepino/en_US.rb", "lib/mundo_pepino/es_ES.rb", "rails_generators/caracteristica/USAGE", "rails_generators/caracteristica/caracteristica_generator.rb", "rails_generators/caracteristica/templates/caracteristica.erb", "rails_generators/mundo_pepino/USAGE", "rails_generators/mundo_pepino/mundo_pepino_generator.rb", "rails_generators/mundo_pepino/templates/mundo_pepino.rake", "rails_generators/mundo_pepino/templates/mundo_pepino_es_ES.rb"]
+ s.files = ["COPYING", "History.txt", "Manifest.txt", "README.markdown", "README_es.markdown", "init.rb", "lib/mundo_pepino.rb", "lib/mundo_pepino/base.rb", "lib/mundo_pepino/config.rb", "lib/mundo_pepino/en_US.rb", "lib/mundo_pepino/en_US/definitions.rb", "lib/mundo_pepino/en_US/mappings.rb", "lib/mundo_pepino/en_US/matchers.rb", "lib/mundo_pepino/es_ES.rb", "lib/mundo_pepino/es_ES/definitions.rb", "lib/mundo_pepino/es_ES/mappings.rb", "lib/mundo_pepino/es_ES/matchers.rb", "lib/mundo_pepino/implementations.rb", "lib/mundo_pepino/implementations_api.rb", "lib/mundo_pepino/resources_history.rb", "lib/mundo_pepino/version.rb", "lib/mundo_pepino/visits_history.rb", "rails_generators/caracteristica/USAGE", "rails_generators/caracteristica/caracteristica_generator.rb", "rails_generators/caracteristica/templates/caracteristica.erb", "rails_generators/mundo_pepino/USAGE", "rails_generators/mundo_pepino/mundo_pepino_generator.rb", "rails_generators/mundo_pepino/templates/mundo_pepino.rake", "rails_generators/mundo_pepino/templates/mundo_pepino_es_ES.rb", "rails_generators/mundo_pepino_steps/USAGE", "rails_generators/mundo_pepino_steps/mundo_pepino_steps_generator.rb", "rails_generators/mundo_pepino_steps/templates/mundo_pepino.rake", "rails_generators/mundo_pepino_steps/templates/mundo_pepino_es_ES.rb"]
s.homepage = %q{http://github.com/nando/mundo-pepino}
s.rdoc_options = ["--main", "README.rdoc"]
s.require_paths = ["lib"]

0 comments on commit d6f00d9

Please sign in to comment.