any2tmx 1.1.0 → 2.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dfbf800c45d800fa53efa6f1f142f154e6ea2be6
4
- data.tar.gz: 19c4b39b0252af8fb49cbeb4fc994c14f5c79571
3
+ metadata.gz: f65c112bbd60ad3b4dff17f240b2869830ee9ac2
4
+ data.tar.gz: a8b80040a9af84996b59e9cb7afc88554bfc770b
5
5
  SHA512:
6
- metadata.gz: e2a67b0fce2c98fe75e198f12822df3567138a4a11f2abae9b8255836c0a724a719912fa3db011b0b6c26f9036ddeee7e197fbb1cd87b564009dfcb5b0e29820
7
- data.tar.gz: 19e26011be1125aa387c05b6cc7ae388ef1ff04766bee422f9341e8fd630d602a635f03067ca10f8545a34cbb61a281ef94d9d4a5275a5ca304e3153c4b76804
6
+ metadata.gz: 708c01b89eaa7af3dcc58069ae5fe74233636197940ae7c7c9e4f36afbcc41fc84fc4f22dab819ba97597a60ca232533e878f3f542719448dc7ee1956b820341
7
+ data.tar.gz: 94bad25c5c90ede45c717cd776e79400970f398b41e7c3ea12761d582715d32ac4d2f36de012d39f7ecedfa61ab83e5e8e690eb5fa65e938ae7c16f93a507738
@@ -1,3 +1,8 @@
1
+ == 2.0.0
2
+
3
+ * Add support for txt files.
4
+ * Remove individual executables (yaml2tmx, json2tmx, etc) in favor of a single executable (any2tmx).
5
+
1
6
  == 1.1.0
2
7
 
3
8
  * Depend on Abroad for parsing, which removes a lot of code.
@@ -17,9 +17,7 @@ Gem::Specification.new do |s|
17
17
  s.add_dependency 'nokogiri', '~> 1.6'
18
18
  s.add_dependency 'xml-write-stream', '~> 1.0'
19
19
 
20
- s.executables << 'android2tmx'
21
- s.executables << 'json2tmx'
22
- s.executables << 'yaml2tmx'
20
+ s.executables << 'any2tmx'
23
21
 
24
22
  s.require_path = 'lib'
25
23
  s.files = Dir["{lib,spec}/**/*", 'Gemfile', 'History.txt', 'README.md', 'Rakefile', 'any2tmx.gemspec']
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'any2tmx'
4
4
 
5
- options = Any2Tmx::Options.new('yaml2tmx')
5
+ options = Any2Tmx::Options.new('any2tmx')
6
6
 
7
7
  unless options.valid?
8
8
  puts options.errors.first
@@ -83,7 +83,7 @@ module Any2Tmx
83
83
 
84
84
  def validate_source
85
85
  unless File.exist?(source[:file])
86
- errors << 'Source file does not exist.'
86
+ errors << "Source file #{source[:file]} does not exist."
87
87
  end
88
88
 
89
89
  unless source[:locale]
@@ -94,7 +94,7 @@ module Any2Tmx
94
94
  def validate_targets
95
95
  targets.each do |target|
96
96
  unless File.exist?(target[:file])
97
- errors << 'Target file does not exist.'
97
+ errors << "Target file #{target[:file]} does not exist."
98
98
  end
99
99
 
100
100
  unless target[:locale]
@@ -5,7 +5,8 @@ module Any2Tmx
5
5
  EXTRACTOR_EXTENSIONS = {
6
6
  '.yml' => 'yaml/rails',
7
7
  '.json' => 'json/key-value',
8
- '.xml' => 'android/xml'
8
+ '.xml' => 'android/xml',
9
+ '.txt' => 'txt/lines'
9
10
  }
10
11
 
11
12
  attr_reader :options
@@ -1,3 +1,3 @@
1
1
  module Any2Tmx
2
- VERSION = '1.1.0'
2
+ VERSION = '2.0.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: any2tmx
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Dutro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-07 00:00:00.000000000 Z
11
+ date: 2016-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: abroad
@@ -57,9 +57,7 @@ description: A command-line tool to convert certain file types to the standard T
57
57
  email:
58
58
  - camertron@gmail.com
59
59
  executables:
60
- - android2tmx
61
- - json2tmx
62
- - yaml2tmx
60
+ - any2tmx
63
61
  extensions: []
64
62
  extra_rdoc_files: []
65
63
  files:
@@ -67,9 +65,7 @@ files:
67
65
  - History.txt
68
66
  - Rakefile
69
67
  - any2tmx.gemspec
70
- - bin/android2tmx
71
- - bin/json2tmx
72
- - bin/yaml2tmx
68
+ - bin/any2tmx
73
69
  - lib/any2tmx.rb
74
70
  - lib/any2tmx/options.rb
75
71
  - lib/any2tmx/tmx_writer.rb
@@ -1,30 +0,0 @@
1
- #! /usr/bin/env ruby
2
-
3
- require 'any2tmx'
4
-
5
- options = Any2Tmx::Options.new('android2tmx')
6
-
7
- unless options.valid?
8
- puts options.errors.first
9
- exit 1
10
- end
11
-
12
- if options.help?
13
- options.print_help
14
- exit 0
15
- end
16
-
17
- transform = Any2Tmx::Transformer.new(options)
18
- result = transformer.transform
19
-
20
- stream = if options.output
21
- File.open(options.output, 'w+')
22
- else
23
- STDOUT
24
- end
25
-
26
- Any2Tmx::TmxWriter.write(result, options, stream)
27
-
28
- if options.output
29
- STDERR.write("Wrote #{options.output}\n")
30
- end
@@ -1,30 +0,0 @@
1
- #! /usr/bin/env ruby
2
-
3
- require 'any2tmx'
4
-
5
- options = Any2Tmx::Options.new('json2tmx')
6
-
7
- unless options.valid?
8
- puts options.errors.first
9
- exit 1
10
- end
11
-
12
- if options.help?
13
- options.print_help
14
- exit 0
15
- end
16
-
17
- transform = Any2Tmx::Transformer.new(options)
18
- result = transformer.transform
19
-
20
- stream = if options.output
21
- File.open(options.output, 'w+')
22
- else
23
- STDOUT
24
- end
25
-
26
- Any2Tmx::TmxWriter.write(result, options, stream)
27
-
28
- if options.output
29
- STDERR.write("Wrote #{options.output}\n")
30
- end