confetti 0.9.2 → 0.9.3

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/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- confetti (0.9.2)
4
+ confetti (0.9.3)
5
5
  mustache (~> 0.11.2)
6
6
 
7
7
  GEM
@@ -5,11 +5,8 @@ module Confetti
5
5
  include VersionHelper
6
6
 
7
7
  def app_id
8
- if @config
9
- if is_java_package_id(@config.package)
10
- @config.package
11
- end
12
- end
8
+ pkg = convert_to_java_package_id(@config.package).downcase
9
+ pkg.gsub(/[^0-9a-z.]/,'')
13
10
  end
14
11
 
15
12
  def app_name
@@ -1,3 +1,3 @@
1
1
  module Confetti
2
- VERSION = "0.9.2"
2
+ VERSION = "0.9.3"
3
3
  end
@@ -49,10 +49,6 @@ describe Confetti::Template::WebosAppinfo do
49
49
  @template = @template_class.new(@config)
50
50
  end
51
51
 
52
- it "should set app_id correctly" do
53
- @template.app_id.should == "com.whoever.awesome.app"
54
- end
55
-
56
52
  it "should set class_name correctly" do
57
53
  @template.app_name.should == "Awesome App"
58
54
  end
@@ -65,6 +61,27 @@ describe Confetti::Template::WebosAppinfo do
65
61
  @template.render.should == File.read("#{ fixture_dir }/webos/webos_appinfo_spec.json")
66
62
  end
67
63
 
64
+ describe "app id" do
65
+ it "should set app_id correctly" do
66
+ @template.app_id.should == "com.whoever.awesome.app"
67
+ end
68
+
69
+ it "should convert nonsense to a real package" do
70
+ @config.package = "whatever"
71
+ @template.app_id.should == "com.whatever"
72
+ end
73
+
74
+ it "should downcase the package name" do
75
+ @config.package = "com.WhatEver"
76
+ @template.app_id.should == "com.whatever"
77
+ end
78
+
79
+ it "should only allow numbers and digits" do
80
+ @config.package = "com.What_Ever"
81
+ @template.app_id.should == "com.whatever"
82
+ end
83
+ end
84
+
68
85
  describe "#version method" do
69
86
  it "should return the default (0.0.1) when version_string is not set" do
70
87
  @config.version_string = nil
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 9
8
- - 2
9
- version: 0.9.2
8
+ - 3
9
+ version: 0.9.3
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-09-10 00:00:00 -07:00
19
+ date: 2012-09-11 00:00:00 -07:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency