da_funk 0.7.2 → 0.7.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 930a189b540743666f8fb89fa0334522e4e2d5cc
4
- data.tar.gz: e2c45f3c8619148e87f9a88311be9faf72e46662
3
+ metadata.gz: c3c811383a895b6f570aff6a6fc1ddef9f913b74
4
+ data.tar.gz: e658fda25cc08e9833f87a22edec99c1ca411ae1
5
5
  SHA512:
6
- metadata.gz: bde6c054a7c8b3e1d7816ccd7d65ae59f4a81b22d1bdb9f8c8785fa2f867d01d9e6245cb91f300cba2e9f24fd322321f52c37a6db02146e2be7100e0ac7b2a08
7
- data.tar.gz: 6b0cfed0a466a17420e7b7c921d394f13c7e824f0d65509b148493aa7384c0955279a4c1d2452957c472c94c9ccfa1497c857a57c2e36a8b4a5c76ba7ed4a80b
6
+ metadata.gz: 84a36363e0377b8482c59d446d485765594e41cff1ebc5e3485509b86abf8f6d24022a941af9ca1939631969a21a2183f101586258a62e534217386d227512ab
7
+ data.tar.gz: 88119e6f2b45f177ffb925a4003ddab086a8b4ac4dc13bd772c50ad678961e6ead4017b4aabcbe2c19e6baddbe339208cccf84efc97ee571ad1701289c4e5d60
data/.gitignore CHANGED
@@ -6,4 +6,6 @@ rdoc/*
6
6
  coverage/*
7
7
  stats
8
8
  stats/*
9
- out/da_funk/*
9
+ out/da_funk.mrb
10
+ out/da_funk/*
11
+ out/*
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- da_funk (0.7.2)
4
+ da_funk (0.7.3)
5
5
  bundler (~> 1.7)
6
6
  cloudwalk_handshake (~> 0.5)
7
7
  posxml_parser (~> 0.6)
@@ -1,5 +1,12 @@
1
1
  # DaFunk
2
2
 
3
+ ### 0.7.3 - 2016-04-15 - Small changes
4
+
5
+ - Implement NilClass#to_big.
6
+ - Load I18n main file if try to use.
7
+ - String#integer? return true if string[0] is “0”.
8
+ - On Notification implement force parameter to create fiber when fiber is dead.
9
+
3
10
  ### 0.7.2 - 2016-03-30 - gemspec problem
4
11
 
5
12
  - Fix gemspec problem on the list of files.
data/Rakefile CHANGED
@@ -10,6 +10,7 @@ FileUtils.cd DA_FUNK_ROOT
10
10
 
11
11
  FILES = FileList[
12
12
  "lib/ext/kernel.rb",
13
+ "lib/ext/nil.rb",
13
14
  "lib/ext/string.rb",
14
15
  "lib/ext/array.rb",
15
16
  "lib/ext/hash.rb",
@@ -1,5 +1,9 @@
1
1
  class I18n
2
2
  include DaFunk::Helper
3
+
4
+ DEFAULT_LOCALE = "en"
5
+ DEFAULT_APPLICATION = "main"
6
+
3
7
  class << self
4
8
  attr_accessor :locale, :hash, :block_parse, :klasses
5
9
  end
@@ -17,7 +21,7 @@ class I18n
17
21
  "./#{klass}/i18n.json"
18
22
  end
19
23
 
20
- def self.configure(klass, locale)
24
+ def self.configure(klass = DEFAULT_APPLICATION, locale = DEFAULT_LOCALE)
21
25
  raise I18nError.new("File not found") if (! File.exists?(filepath(klass)))
22
26
  self.parse(klass)
23
27
  @locale = locale
@@ -43,6 +47,7 @@ class I18n
43
47
  end
44
48
 
45
49
  def self.language
50
+ configure unless @hash
46
51
  @hash[@locale]
47
52
  end
48
53
 
@@ -1,4 +1,4 @@
1
1
  module DaFunk
2
- VERSION="0.7.2"
2
+ VERSION="0.7.3"
3
3
  end
4
4
 
@@ -48,8 +48,8 @@ class Device
48
48
  end
49
49
  end
50
50
 
51
- def self.create_fiber?
52
- (! Device::Setting.company_name.empty?) && (! Device::Setting.logical_number.empty?) && self.valid_creation_interval?
51
+ def self.create_fiber?(force = false)
52
+ (! Device::Setting.company_name.empty?) && (! Device::Setting.logical_number.empty?) && (force || self.valid_creation_interval?)
53
53
  end
54
54
 
55
55
  def self.valid_creation_interval?
@@ -76,12 +76,13 @@ class Device
76
76
  if (notification = @fiber.resume)
77
77
  Notification.execute(NotificationEvent.new(notification))
78
78
  end
79
- @last_check = Time.now
80
- if Device::Notification.create_fiber?
79
+ else
80
+ if Device::Notification.create_fiber?(true)
81
81
  self.close
82
82
  @fiber = create_fiber
83
83
  end
84
84
  end
85
+ @last_check = Time.now
85
86
  end
86
87
  end
87
88
 
@@ -74,7 +74,7 @@ class Device
74
74
  self.environment == "staging"
75
75
  end
76
76
 
77
- def self.to_production!
77
+ def self.to_production!
78
78
  if self.environment != "production"
79
79
  @file.update_attributes("company_name" => "", "environment" => "production", "host" => HOST_PRODUCTION)
80
80
  return true
@@ -0,0 +1,5 @@
1
+ class NilClass
2
+ def to_big(*args)
3
+ 0
4
+ end
5
+ end
@@ -11,6 +11,7 @@ class String
11
11
  end
12
12
 
13
13
  def integer?
14
+ return true if self[0] == "0"
14
15
  !!Integer(self)
15
16
  rescue ArgumentError
16
17
  return false
Binary file
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.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thiago Scalone
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-30 00:00:00.000000000 Z
11
+ date: 2016-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -150,6 +150,7 @@ files:
150
150
  - lib/ext/array.rb
151
151
  - lib/ext/hash.rb
152
152
  - lib/ext/kernel.rb
153
+ - lib/ext/nil.rb
153
154
  - lib/ext/string.rb
154
155
  - lib/file_db.rb
155
156
  - lib/iso8583/bitmap.rb