urbane 0.1.0 → 0.2.0

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.
@@ -5,3 +5,7 @@
5
5
  The first working version. Rough around the edges. Assumes a certain
6
6
  structure of the google spreadsheet and only supports one output format
7
7
  in JSON.
8
+
9
+ ## v0.2.0
10
+
11
+ Support for more formats, including apple strings file format
data/README.md CHANGED
@@ -30,6 +30,7 @@ directory as JSON files. It uses the googles JSON api as opposed to the XML api.
30
30
  Urbane::Generator.new({
31
31
  :spreadsheet_id => spreadsheet_id,
32
32
  :target_dir => target_dir,
33
+ :format => :json,
33
34
  :file_name => file_name,
34
35
  :languages => languages,
35
36
  :fallback_language => :english
@@ -37,7 +38,9 @@ directory as JSON files. It uses the googles JSON api as opposed to the XML api.
37
38
 
38
39
  ## Output format
39
40
 
40
- Support for YAML, JSON and XML
41
+ Support for YAML, JSON, XML and Apple Strings Files
42
+
43
+ VALID_FORMATS = [:json, :yaml, :xml, :apple_strings]
41
44
 
42
45
  ## Output structure
43
46
 
@@ -21,7 +21,14 @@ module Urbane
21
21
  end
22
22
  end
23
23
  builder.to_xml(:indent => 2, :encoding => 'UTF-8')
24
- end
24
+ end,
25
+ :apple_strings => lambda do |content|
26
+ output = ""
27
+ content.each do |key, translation|
28
+ output << "\"#{key}\" = \"#{translation}\";\n"
29
+ end
30
+ output
31
+ end
25
32
  }
26
33
 
27
34
  def initialize(options)
@@ -1,3 +1,3 @@
1
1
  module Urbane
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -87,5 +87,14 @@ class Urbane::GeneratorTest < Test::Unit::TestCase
87
87
  Urbane::Generator.new(@options).run
88
88
  assert Nokogiri::XML(read_file(File.join('en', 'text_ids.xml')));
89
89
  end
90
+
91
+ should 'support apples localization format' do
92
+ @options[:format] = :apple_strings
93
+ @options[:file_name] = 'text_ids.strings'
94
+ Urbane::Generator.new(@options).run
95
+ expected_first_line = '"sun_intro_step2" = "Build another one…";'
96
+ actual_first_line = read_file(File.join('en', 'text_ids.strings')).split("\n")[0]
97
+ assert_equal expected_first_line, actual_first_line
98
+ end
90
99
  end
91
100
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: urbane
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-07 00:00:00.000000000 Z
12
+ date: 2012-03-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mocha
16
- requirement: &70150065933880 !ruby/object:Gem::Requirement
16
+ requirement: &70341728707740 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70150065933880
24
+ version_requirements: *70341728707740
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: shoulda-context
27
- requirement: &70150065933200 !ruby/object:Gem::Requirement
27
+ requirement: &70341728706900 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70150065933200
35
+ version_requirements: *70341728706900
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: fakeweb
38
- requirement: &70150065932440 !ruby/object:Gem::Requirement
38
+ requirement: &70341728706300 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70150065932440
46
+ version_requirements: *70341728706300
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
- requirement: &70150065931700 !ruby/object:Gem::Requirement
49
+ requirement: &70341728705360 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70150065931700
57
+ version_requirements: *70341728705360
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: json
60
- requirement: &70150065930840 !ruby/object:Gem::Requirement
60
+ requirement: &70341728704360 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - =
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 1.6.1
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70150065930840
68
+ version_requirements: *70341728704360
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: nokogiri
71
- requirement: &70150065930040 !ruby/object:Gem::Requirement
71
+ requirement: &70341728703420 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - =
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: 1.5.0
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70150065930040
79
+ version_requirements: *70341728703420
80
80
  description: Read google spreadsheet and generate translation files out of it
81
81
  email:
82
82
  - patrick.huesler@gmail.com
@@ -117,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
117
  version: '0'
118
118
  requirements: []
119
119
  rubyforge_project: urbane
120
- rubygems_version: 1.8.6
120
+ rubygems_version: 1.8.11
121
121
  signing_key:
122
122
  specification_version: 3
123
123
  summary: Read google spreadsheet and generate translation files out of it