confetti 0.7.14 → 0.7.15

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- confetti (0.7.14)
4
+ confetti (0.7.15)
5
5
  mustache (~> 0.11.2)
6
6
 
7
7
  GEM
@@ -161,6 +161,10 @@ module Confetti
161
161
  @preference_set.detect { |pref| pref.name == name }
162
162
  end
163
163
 
164
+ def feature name
165
+ @feature_set.detect { |feature| feature.name == name }
166
+ end
167
+
164
168
  def full_access?
165
169
  @access_set.detect { |a| a.origin == '*' }
166
170
  end
@@ -31,7 +31,11 @@ module Confetti
31
31
  end
32
32
 
33
33
  def description
34
- @config.description
34
+ if @config.description && @config.description.length >= 250
35
+ @config.description[0..247]
36
+ else
37
+ @config.description
38
+ end
35
39
  end
36
40
 
37
41
  def version
@@ -1,3 +1,3 @@
1
1
  module Confetti
2
- VERSION = "0.7.14"
2
+ VERSION = "0.7.15"
3
3
  end
@@ -521,6 +521,25 @@ describe Confetti::Config do
521
521
  end
522
522
  end
523
523
 
524
+ describe "feature accessor" do
525
+ before do
526
+ @camera_uri = "http://api.phonegap.com/1.0/camera"
527
+ @network_uri = "http://api.phonegap.com/1.0/network"
528
+
529
+ @config = Confetti::Config.new
530
+ @feature = Confetti::Config::Feature.new @camera_uri, "true"
531
+ @config.feature_set << @feature
532
+ end
533
+
534
+ it "should be nil when the feature is not there" do
535
+ @config.feature(@network_uri).should be_nil
536
+ end
537
+
538
+ it "should return the feature if it's there" do
539
+ @config.feature(@camera_uri).should == @feature
540
+ end
541
+ end
542
+
524
543
  describe "full_access?" do
525
544
  before do
526
545
  @config = Confetti::Config.new
@@ -0,0 +1,60 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <widget xmlns = "http://www.w3.org/ns/widgets"
3
+ xmlns:gap = "http://phonegap.com/ns/1.0"
4
+ id = "com.alunny.confetti"
5
+ version = "1.0.0">
6
+
7
+ <name>Confetti Sample App</name>
8
+
9
+ <description>
10
+ Bacon ipsum dolor sit amet prosciutto meatball rump frankfurter corned beef venison. Boudin rump shank ribeye ham hock, hamburger swine shankle jowl corned beef speck salami t-bone. Short ribs pork belly shoulder strip steak, turkey pancetta shank ribeye jowl speck. Swine boudin t-bone pork belly, tri-tip filet mignon shankle. Turkey prosciutto bresaola, venison meatloaf pork chop leberkas speck. Fatback strip steak speck boudin pork frankfurter, tongue pig shank meatball biltong beef jowl shankle. Jerky rump boudin, fatback short loin pork belly filet mignon turkey turducken capicola.
11
+
12
+ Rump corned beef swine hamburger, flank pork loin beef sirloin meatloaf chuck sausage andouille meatball. Sausage jerky frankfurter bacon hamburger pork loin spare ribs biltong shoulder, filet mignon capicola kielbasa bresaola. Capicola meatball pork belly leberkas hamburger, brisket speck turducken jowl strip steak rump kielbasa tri-tip chicken. Leberkas chicken beef ribs, ball tip meatloaf jerky turducken pork drumstick. Frankfurter ham hock drumstick hamburger ribeye andouille swine fatback turkey beef pork chop chicken. Jerky ham cow short ribs leberkas, ribeye salami turkey tail pork belly ball tip short loin.
13
+
14
+ Beef ribs ham flank pork loin. Fatback chicken pig, ribeye jerky kielbasa prosciutto cow chuck boudin short ribs capicola. Tenderloin pork chop pig, ham ribeye speck swine sirloin bacon. Hamburger shank tri-tip, ham hock ground round corned beef pork belly bresaola brisket kielbasa. Boudin beef short loin, capicola pig filet mignon meatball speck pork. Beef jowl tri-tip, tail bacon fatback chuck pork chop sirloin swine strip steak ham kielbasa.
15
+
16
+ Pork belly ham pork loin short loin ribeye. Tongue ham hock swine, bacon hamburger jerky turducken meatball shoulder drumstick cow ground round pastrami. Corned beef flank filet mignon ham hock tongue beef ribs, beef frankfurter tri-tip short loin turducken pork loin fatback. Biltong sausage beef ribs speck, bresaola turkey pork chop capicola ball tip. Sausage corned beef tongue beef tenderloin pork.
17
+
18
+ T-bone spare ribs rump, brisket biltong ball tip filet mignon hamburger turducken tri-tip tongue. Ham hock meatloaf pancetta, strip steak beef bacon brisket chuck bresaola drumstick. Pancetta leberkas biltong spare ribs pork, ground round ball tip brisket short loin drumstick ham jerky boudin. Pig hamburger spare ribs, frankfurter meatloaf pork belly tail sirloin chicken boudin turkey venison. Spare ribs salami frankfurter, tail pork belly brisket chuck. Ground round pancetta ham, sausage shoulder leberkas cow venison turkey meatloaf speck pork loin corned beef strip steak.
19
+ </description>
20
+
21
+ <license href="http://www.opensource.org/licenses/mit-license.php">The MIT License
22
+
23
+ Copyright (c) 2011 Andrew Lunny
24
+
25
+ Permission is hereby granted, free of charge, to any person obtaining a copy
26
+ of this software and associated documentation files (the &quot;Software&quot;), to deal
27
+ in the Software without restriction, including without limitation the rights
28
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
29
+ copies of the Software, and to permit persons to whom the Software is
30
+ furnished to do so, subject to the following conditions:
31
+
32
+ The above copyright notice and this permission notice shall be included in
33
+ all copies or substantial portions of the Software.
34
+
35
+ THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
36
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
37
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
38
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
39
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
40
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
41
+ THE SOFTWARE.</license>
42
+
43
+ <author href="http://alunny.github.com"
44
+ email="alunny@gmail.com">
45
+ Andrew Lunny
46
+ </author>
47
+
48
+ <icon src="icon.png" height="150" width="200" />
49
+
50
+ <gap:splash src="mainsplash.png" height="480" width="360" />
51
+
52
+ <preference name="universal" value="true"/>
53
+ <preference name="phonegap-version" value="1.3.0"/>
54
+
55
+ <feature name="http://api.phonegap.com/1.0/geolocation" required="true"/>
56
+ <feature name="http://api.phonegap.com/1.0/camera" required="true"/>
57
+ <feature name="http://api.phonegap.com/1.0/notification" required="true"/>
58
+
59
+ <access origin="*" />
60
+ </widget>
@@ -130,4 +130,15 @@ describe Confetti::Template::WindowsPhone7Manifest do
130
130
  lambda { @template.render }.should_not raise_error
131
131
  end
132
132
  end
133
+
134
+ describe "description" do
135
+ before do
136
+ @config = Confetti::Config.new "#{fixture_dir}/config-long-desc.xml"
137
+ @template = @template_class.new(@config)
138
+ end
139
+
140
+ it "should truncate the description to < 250 characters" do
141
+ @template.description.length.should be < 250
142
+ end
143
+ end
133
144
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 7
8
- - 14
9
- version: 0.7.14
8
+ - 15
9
+ version: 0.7.15
10
10
  platform: ruby
11
11
  authors:
12
12
  - Andrew Lunny
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-05-10 00:00:00 -07:00
19
+ date: 2012-05-15 00:00:00 -07:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -119,6 +119,7 @@ files:
119
119
  - spec/fixtures/config-icons-custom-attribs-extended.xml
120
120
  - spec/fixtures/config-icons-custom-attribs.xml
121
121
  - spec/fixtures/config-icons.xml
122
+ - spec/fixtures/config-long-desc.xml
122
123
  - spec/fixtures/config.xml
123
124
  - spec/fixtures/config_fullscreen.xml
124
125
  - spec/fixtures/config_legacy.xml
@@ -210,6 +211,7 @@ test_files:
210
211
  - spec/fixtures/config-icons-custom-attribs-extended.xml
211
212
  - spec/fixtures/config-icons-custom-attribs.xml
212
213
  - spec/fixtures/config-icons.xml
214
+ - spec/fixtures/config-long-desc.xml
213
215
  - spec/fixtures/config.xml
214
216
  - spec/fixtures/config_fullscreen.xml
215
217
  - spec/fixtures/config_legacy.xml