android-xml 1.3.2 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 116b00e3b218d57210b245664cdba74ad0547f0c
4
- data.tar.gz: 5ab7355d8a8a2f23c9c2761a9605d9278ba17fa7
3
+ metadata.gz: 9b8025ef9a58fec7a0fd571fe4ad6c4249414cbf
4
+ data.tar.gz: b6b0e83e9a032f9dc5f397ac798fd0b6dc45817e
5
5
  SHA512:
6
- metadata.gz: a20f4da341b687a4e74aaa756090a24327bb71ac7ab977c2ee03c85b8598a6e0edbc2a371a234c8e63ee9bf686681558979069996e389235808cd0f0b55378c7
7
- data.tar.gz: a1b3d59da9a73fc2ea24d80460f94898420fbfb585a2322fea6ec3e543b54e66e154781546bc299af392fe8e2c15fca4c8099ba8a94d6106152334e24896c62f
6
+ metadata.gz: 08507c5e5c6329582a356157bebe54c1fa2ecf84821057aacd32d364e6cf56f9a106ff3929b88ced21532d6df133592bdad6738684ebafaa11b3d143ed617bdb
7
+ data.tar.gz: c5775a43022a8cf501f745405c197042b5fb9a1e381aedaf19862f2e29155fe8136e6406a22b794499af3f97469f67930d7308715b148f337010f5d1f95c9b60
data/README.md CHANGED
@@ -15,9 +15,7 @@ AndroidXml.file('res/values/strings.xml') do
15
15
  end
16
16
  end
17
17
 
18
- AndroidXml.write_all
19
- AndroidXml.clean_up 'res/'
20
- AndroidXml.missing_strings?
18
+ AndroidXml.run
21
19
  ```
22
20
 
23
21
  > ruby generate_xml.rb
@@ -85,6 +83,8 @@ AndroidXml.clean_up 'res/'
85
83
  # Outputs any missing string tags (looks for @string/name attributes and
86
84
  # <string name="name"> tags)
87
85
  AndroidXml.missing_strings?
86
+
87
+ # Calling AndroidXml.run will call write_all, clean_up, and missing_strings?
88
88
  ```
89
89
 
90
90
  # Setup / Helpers
@@ -215,6 +215,9 @@ end
215
215
 
216
216
  # Rakefile to build the XML files
217
217
 
218
+ Generates all files that are in the `./android-xml` folder.
219
+
220
+ ###### Rakefile
218
221
  ```ruby
219
222
  require 'rake'
220
223
  require 'android-xml'
@@ -226,12 +229,9 @@ task :default => :generate
226
229
 
227
230
  desc 'Generate XML files'
228
231
  task :generate do
229
- Dir.glob('generate/*.rb') do |file_name|
230
- require_relative file_name
231
- end
232
-
233
- AndroidXml.write_all
234
- AndroidXml.clean_up 'res/'
232
+ # the :in option can point to a folder of AndroidXml files (subdirectories
233
+ # are included)
234
+ AndroidXml.run(in: 'android-xml')
235
235
  end
236
236
  ```
237
237
 
@@ -1,6 +1,25 @@
1
1
  module AndroidXml
2
2
  module_function
3
3
 
4
+ def run(opts={})
5
+ folder = opts[:in]
6
+ clean_up = opts.fetch(:clean_up, true)
7
+
8
+ if folder
9
+ xml_location = File.join(Dir.getwd, folder, '**/*.rb')
10
+ p xml_location
11
+ Dir.glob(xml_location) do |file_name|
12
+ require_relative file_name
13
+ end
14
+ end
15
+
16
+ AndroidXml.write_all
17
+ if clean_up
18
+ AndroidXml.clean_up('res/')
19
+ end
20
+ AndroidXml.missing_strings?
21
+ end
22
+
4
23
  def file(filename, &block)
5
24
  XmlFile.new(filename, &block)
6
25
  end
@@ -1,3 +1,3 @@
1
1
  module AndroidXml
2
- Version = '1.3.2'
2
+ Version = '1.4.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: android-xml
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Colin T.A. Gray
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-24 00:00:00.000000000 Z
11
+ date: 2014-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec