da_funk 0.24.0 → 0.25.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: 4fac3205066356f8b41b2431b4c6f96df61fe7e7
4
- data.tar.gz: da69c76d8ef5ccfaa155085bf028abdd334cceb9
3
+ metadata.gz: 53fd7622f5a4d484264edac8de0abc27cd2bdd0f
4
+ data.tar.gz: de2f8af3786ffb4db312bf84ca35782bb429c427
5
5
  SHA512:
6
- metadata.gz: 48d02755608798e3e8e12069d5a621c37032a652028677e9758844edbf796c11acdb04fa33eef779a808a1c62ad744344f28d0ac1e49f36620bb6ac52fb82f70
7
- data.tar.gz: 5aeb16022193c6ea69210209ad2c27cca3785b3ddc80d1fde50821bdf80ef7676576d7c5892d5aac0189525e1e1e168905aef67e3fa3cd8e293791866a5c3a34
6
+ metadata.gz: af4f59167c184a01fee0aeadf4ce8d4a4edf21019f9aa7d6904018453e74fb6b8c8ae9aabf769a3c3de98902aa9efd63aa67c7fadeb5b4b1e1a2f556086f0788
7
+ data.tar.gz: 6ede4f0ebbc62f92315a2ef000e84b264bb5b616cd78635ffafd520d714ebb40143bd8593333cc93e303f5e9163fd200535d058daa45abf9c8de90e17afdbf39
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- da_funk (0.24.0)
4
+ da_funk (0.25.0)
5
5
  archive-zip (~> 0.5)
6
6
  bundler (~> 1.7)
7
7
  cloudwalk_handshake (~> 0.6)
@@ -20,10 +20,10 @@ GEM
20
20
  funky-simplehttp (0.4.4)
21
21
  funky-tlv (0.2.3)
22
22
  io-like (0.3.0)
23
- posxml_parser (0.26.0)
23
+ posxml_parser (0.27.0)
24
24
  funky-emv (~> 0.3)
25
25
  rake (10.5.0)
26
- yard (0.9.9)
26
+ yard (0.9.12)
27
27
 
28
28
  PLATFORMS
29
29
  ruby
data/RELEASE_NOTES.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # DaFunk
2
2
 
3
+ ### 0.25.0 - 2017-11-27
4
+
5
+ - I18n, check if the current language was already configure to perform the merge options.
6
+ - Add Support tests.
7
+ - Implement String#snakecase.
8
+
3
9
  ### 0.24.0 - 2017-11-08
4
10
 
5
11
  - Update ext/float.rb to compilation.
data/lib/da_funk/i18n.rb CHANGED
@@ -22,10 +22,16 @@ class I18n
22
22
  end
23
23
 
24
24
  def self.configure(klass = DEFAULT_APPLICATION, locale = DEFAULT_LOCALE)
25
- raise I18nError.new("File not found") if (! File.exists?(filepath(klass)))
26
- self.parse(klass)
27
25
  @locale = locale
28
- raise I18nError.new("Locale not found") unless language
26
+ unless self.configured?
27
+ raise I18nError.new("File not found") if (! File.exists?(filepath(klass)))
28
+ self.parse(klass)
29
+ raise I18nError.new("Locale not found") unless language
30
+ end
31
+ end
32
+
33
+ def self.configured?
34
+ @hash && language
29
35
  end
30
36
 
31
37
  def self.parse(klass)
@@ -1,4 +1,4 @@
1
1
  module DaFunk
2
- VERSION="0.24.0"
2
+ VERSION="0.25.0"
3
3
  end
4
4
 
data/lib/ext/string.rb CHANGED
@@ -37,5 +37,14 @@ class String
37
37
  self.to_i(*args)
38
38
  end
39
39
  end
40
+
41
+ def snakecase
42
+ dup.bytes.inject("") do |str, ch|
43
+ if ch <= 90 && ! str.empty?
44
+ str << "_"
45
+ end
46
+ str << ch.chr.downcase
47
+ end
48
+ end
40
49
  end
41
50
 
data/out/da_funk.mrb CHANGED
Binary file
@@ -0,0 +1,25 @@
1
+
2
+ class CwAsdfsafAsfsXml
3
+ end
4
+
5
+ class DaFunkSupportTest < DaFunk::Test.case
6
+ def test_remove_extension
7
+ assert_equal "cw_asdfsaf_asfs", Device::Support.remove_extension("asdfas/asfasf/cw_asdfsaf_asfs.posxml")
8
+ end
9
+
10
+ def test_camelize
11
+ name = Device::Support.remove_extension("asdfas/asfasf/cw_asdfsaf_asfs.posxml")
12
+ assert_equal "CwAsdfsafAsfs", Device::Support.camelize(name)
13
+ end
14
+
15
+ def test_constantize
16
+ name = Device::Support.remove_extension("asdfas/asfasf/cw_asdfsaf_asfs.posxml")
17
+ camel = Device::Support.camelize(name) + "Xml"
18
+ assert_equal CwAsdfsafAsfsXml, Device::Support.constantize(camel)
19
+ end
20
+
21
+ def test_klass_to_file
22
+ assert_equal "cw_asdfsaf_asfs_xml", CwAsdfsafAsfsXml.to_s.snakecase
23
+ end
24
+ end
25
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: da_funk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.24.0
4
+ version: 0.25.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thiago Scalone
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-08 00:00:00.000000000 Z
11
+ date: 2017-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -222,6 +222,7 @@ files:
222
222
  - test/test_helper.rb
223
223
  - test/unit/da_funk/event_listener_test.rb
224
224
  - test/unit/da_funk/struct_test.rb
225
+ - test/unit/da_funk/support_test.rb
225
226
  - test/unit/device/application_test.rb
226
227
  - test/unit/device/display_test.rb
227
228
  - test/unit/device/helper_test.rb
@@ -270,6 +271,7 @@ test_files:
270
271
  - test/test_helper.rb
271
272
  - test/unit/da_funk/event_listener_test.rb
272
273
  - test/unit/da_funk/struct_test.rb
274
+ - test/unit/da_funk/support_test.rb
273
275
  - test/unit/device/application_test.rb
274
276
  - test/unit/device/display_test.rb
275
277
  - test/unit/device/helper_test.rb