str2duck 1.4.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +18 -0
- data/Gemfile.lock +1 -5
- data/README.md +3 -3
- data/VERSION +1 -1
- data/examples/sample.rb +0 -2
- data/lib/str2duck/parser.rb +8 -0
- data/str2duck.gemspec +1 -3
- metadata +3 -3
- data/files.rb +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4425555775cd4480163150346432cad485303aa
|
4
|
+
data.tar.gz: f5ea181be5fe5dfcc5447d9b5afb800f58a9eafc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49d18a74d0b21f305ebef57448d16e39eb75b6559f7967292c2cc1dc8aa8c45301d84ebfb437a1ae99ca4f3240c9f52c042def6e36dbbbbd48db56585697331e
|
7
|
+
data.tar.gz: a1af2ac332daa6e88dbb2d018d847d323e33bbce9345761caa3141c9e94593417ac5a1375f23bacf2a5add2892731a61d7426f4055db7a1d4f90b009709baf96
|
data/.gitignore
ADDED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -29,12 +29,12 @@ Possible bug source, not yet been tested is the american time format.
|
|
29
29
|
Str2Duck.parse("123.123") #> Float obj
|
30
30
|
```
|
31
31
|
|
32
|
-
it is possible ot extend the Duck flexibility be
|
32
|
+
it is possible ot extend the Duck flexibility be installing Active Supports for it's time extension,
|
33
33
|
|
34
|
-
simple like
|
34
|
+
simple like this in Gemfile:
|
35
35
|
|
36
36
|
```ruby
|
37
|
-
|
37
|
+
gem 'activesupport'
|
38
38
|
```
|
39
39
|
|
40
40
|
This will give you even more flexibility in terms of use :)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.5.0
|
data/examples/sample.rb
CHANGED
data/lib/str2duck/parser.rb
CHANGED
@@ -1,9 +1,17 @@
|
|
1
1
|
#encoding: UTF-8
|
2
2
|
module Str2Duck
|
3
3
|
|
4
|
+
def self.activesupport
|
5
|
+
require File.join 'active_support','time'
|
6
|
+
rescue LoadError
|
7
|
+
return false
|
8
|
+
end
|
9
|
+
|
4
10
|
def self.parse str
|
5
11
|
raise(ArgumentError,"invalid input, must be string like") unless str.class <= String
|
6
12
|
|
13
|
+
@@activesupport ||= activesupport
|
14
|
+
|
7
15
|
var= nil
|
8
16
|
[ :datetime, :date, :time, :true, :false, :float, :integer, :json, :yaml ].each do |method_name|
|
9
17
|
if ::Str2Duck::Config.__send__(method_name)
|
data/str2duck.gemspec
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
|
-
require File.expand_path(File.join(File.dirname(__FILE__),"files.rb"))
|
4
|
-
|
5
3
|
### Specification for the new Gem
|
6
4
|
Gem::Specification.new do |spec|
|
7
5
|
|
@@ -14,7 +12,7 @@ Gem::Specification.new do |spec|
|
|
14
12
|
spec.homepage = "https://github.com/adamluzsi/str2duck"
|
15
13
|
spec.license = "MIT"
|
16
14
|
|
17
|
-
spec.files =
|
15
|
+
spec.files = `git ls-files`.split($/)
|
18
16
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
18
|
spec.require_paths = ["lib"]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: str2duck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Luzsi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: " Parse string into obj "
|
14
14
|
email:
|
@@ -17,6 +17,7 @@ executables: []
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
+
- ".gitignore"
|
20
21
|
- Gemfile
|
21
22
|
- Gemfile.lock
|
22
23
|
- LICENSE
|
@@ -25,7 +26,6 @@ files:
|
|
25
26
|
- VERSION
|
26
27
|
- examples/sample.rb
|
27
28
|
- examples/test.rb
|
28
|
-
- files.rb
|
29
29
|
- lib/str2duck.rb
|
30
30
|
- lib/str2duck/config.rb
|
31
31
|
- lib/str2duck/format.rb
|
data/files.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
### Get Files from dir
|
2
|
-
begin
|
3
|
-
|
4
|
-
module Str2Duck
|
5
|
-
@@spec_files = []
|
6
|
-
end
|
7
|
-
|
8
|
-
Dir[File.expand_path(File.join(File.dirname(__FILE__),"**","*"))].sort.uniq.each do |one_file_name|
|
9
|
-
one_file_name = File.expand_path one_file_name
|
10
|
-
file_name = one_file_name[(File.expand_path(File.dirname(__FILE__)).to_s.length+1)..(one_file_name.length-1)]
|
11
|
-
|
12
|
-
if !one_file_name.include?("pkg")
|
13
|
-
if !File.directory? file_name
|
14
|
-
|
15
|
-
Str2Duck.class_variable_get("@@spec_files").push file_name
|
16
|
-
STDOUT.puts file_name if $DEBUG
|
17
|
-
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
22
|
-
|
23
|
-
end
|