larva 1.1.1 → 1.1.2

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: 6603ec7b02a5966db861472294968ca2e60ed348
4
- data.tar.gz: f29cacd33ecd001af79e74fd227465fd8ebe9148
3
+ metadata.gz: cfaa4b9a6ff919d5f0aa1612a1c10f5b4f79f80a
4
+ data.tar.gz: ea1caa084a630cd2d8397e6621f6c1f2ce6e80f6
5
5
  SHA512:
6
- metadata.gz: 20f218161bd113a72174de7aceb16084bff21cc55251946ffb279e9f2d6138f176cba8af5ff2124c26f180ffc60cb0730a1a947ea5e57db1a2a556bf82428ef3
7
- data.tar.gz: 51469b5b51547101e48d9db38e36e7532aca2ed10e881611ac68798d7db4470b066726a6287be94d83043aca091876b993f807df953930246ff51b87c492b82e
6
+ metadata.gz: 1dd87a1aee18fa7fe46afd0d40d5e80366bef6543bb1fdb088924c8f9f9ca3626f888212a82ac4a72dc72a89f461d17fe83b290342d6accbf4d0b4a8b1e6c080
7
+ data.tar.gz: 3801c9bad24bb8d427eb28297b8051c5f7e76072e6e37f96ade3dd26c9dda4d7bbea5a52de1205fde404437959c6558eb0fac0931fcb09a05e57adc695df720d
@@ -1,3 +1,6 @@
1
+ # 1.1.2 / 2015-01-30
2
+ * [BUGFIX] Fix issue with daemon creator failing due to lack of inflector support from ActiveSupport.
3
+
1
4
  # 1.1.1 / 2015-01-30
2
5
  * [BUGFIX] Fix issue with daemon creator failing if ActiveSupport was not present
3
6
 
@@ -3,3 +3,26 @@ class Object
3
3
  respond_to?(:empty?) ? !!empty? : !self
4
4
  end
5
5
  end
6
+
7
+ class String
8
+ def camelize(first_letter = :upper)
9
+ case first_letter
10
+ when :upper
11
+ Larva::Utils.camelize(self, true)
12
+ when :lower
13
+ Larva::Utils.camelize(self, false)
14
+ end
15
+ end
16
+ end
17
+
18
+ module Larva
19
+ module Utils
20
+ def self.camelize(term, uppercase_first_letter = true)
21
+ string = term.to_s
22
+ string = string.sub(/^[a-z\d]*/) { $&.capitalize }
23
+ string.gsub!(/(?:_|(\/))([a-z\d]*)/) { "#{$1}#{$2.capitalize}" }
24
+ string.gsub!('/', '::')
25
+ string
26
+ end
27
+ end
28
+ end
@@ -1,3 +1,3 @@
1
1
  module Larva
2
- VERSION = '1.1.1'
2
+ VERSION = '1.1.2'
3
3
  end
@@ -0,0 +1,19 @@
1
+ require File.expand_path('../test_helper', __FILE__)
2
+
3
+ module Larva
4
+ class UtilsTest < Minitest::Test
5
+ def test_blank?
6
+ assert "".blank?
7
+ assert nil.blank?
8
+ refute "foobar".blank?
9
+ refute 0.blank?
10
+ end
11
+
12
+ def test_camelize
13
+ assert_equal "Foobar", "foobar".camelize
14
+ assert_equal "FooBar", "foo_bar".camelize
15
+ assert_equal "Foo::Bar", "foo/bar".camelize
16
+ end
17
+ end
18
+ end
19
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: larva
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - iHiD
@@ -151,6 +151,7 @@ files:
151
151
  - test/mocker_test.rb
152
152
  - test/processor_test.rb
153
153
  - test/test_helper.rb
154
+ - test/utils_test.rb
154
155
  - test/worker_pool_test.rb
155
156
  homepage: https://github.com/meducation/larva
156
157
  licenses:
@@ -187,5 +188,6 @@ test_files:
187
188
  - test/mocker_test.rb
188
189
  - test/processor_test.rb
189
190
  - test/test_helper.rb
191
+ - test/utils_test.rb
190
192
  - test/worker_pool_test.rb
191
193
  has_rdoc: