dolores-cml 0.3.2 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.3
1
+ 0.3.4
data/cml.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{cml}
5
- s.version = "0.3.2"
5
+ s.version = "0.3.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Chris Van Pelt"]
9
- s.date = %q{2009-08-27}
9
+ s.date = %q{2009-09-02}
10
10
  s.description = %q{CML let's you easily create form elements and custom interfaces for the CrowdFlower Croud Labor platform}
11
11
  s.email = %q{vanpelt@doloreslabs.com}
12
12
  s.extra_rdoc_files = [
@@ -36,6 +36,7 @@ module CML
36
36
 
37
37
  def tag(tag, val, opts = {})
38
38
  val = Array(val)
39
+ return "" unless val[0]
39
40
  parts = val[0].split("|")
40
41
  key = parts[0].sub(/^[_#*^~]?\+?/,'')
41
42
  label = label(parts[0])
@@ -54,4 +54,21 @@ describe "JSAwesome Converter" do
54
54
  <cml:meta name="rando" gold="so_cool"/>
55
55
  HTML
56
56
  end
57
+
58
+ it "Gets all complex" do
59
+ json = '[[["#w_forth_st",""],[["city",""],["stateprovince",""]],[["zippostal_code",""],["country",""]],["#extra_address_information",""],["^any_issues",["No address could be found even after checking the url or searching the web|searching_the_web"]]],{"w_forth_st":{"label":"Street address (eg. 35 W Forth St.)","required":true},"city":{"required":true},"stateprovince":{"label":"State\/Province"},"any_issues":{"label":"Any issues?"},"country":{"required":true},"zippostal_code":{"validation":["^[\\d-]*$","Postal code must only be numbers and dashes"],"label":"Zip\/Postal Code"},"extra_address_information":{"label":"Any extra company or address information?"}}]'
60
+ @c = Converters::JSAwesome.new(json)
61
+ puts Parser.escape @c.convert
62
+ @c.convert.should sorta_match(<<-HTML)
63
+ <cml:textarea label="Street address (eg. 35 W Forth St.)" name="w_forth_st" validates="required"/>
64
+ <cml:text label="City" validates="required"/>
65
+ <cml:text label="State/Province" name="stateprovince"/>
66
+ <cml:text label="Zip/Postal Code" name="zippostal_code"/>
67
+ <cml:text label="Country" validates="required"/>
68
+ <cml:textarea label="Any extra company or address information?" name="extra_address_information"/>
69
+ <cml:checkboxes label="Any issues?" name="any_issues">
70
+ <cml:checkbox label="No address could be found even after checking the url or searching the web" name="searching_the_web"/>
71
+ </cml:checkboxes>
72
+ HTML
73
+ end
57
74
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dolores-cml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Van Pelt
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-08-27 00:00:00 -07:00
12
+ date: 2009-09-02 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -97,7 +97,6 @@ files:
97
97
  - spec/validation_spec.rb
98
98
  has_rdoc: false
99
99
  homepage: http://github.com/dolores/cml
100
- licenses:
101
100
  post_install_message:
102
101
  rdoc_options:
103
102
  - --charset=UTF-8
@@ -118,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
117
  requirements: []
119
118
 
120
119
  rubyforge_project:
121
- rubygems_version: 1.3.5
120
+ rubygems_version: 1.2.0
122
121
  signing_key:
123
122
  specification_version: 3
124
123
  summary: CML is CrowdFlower Markup Language