swifty 0.0.1 → 0.0.2.alpha
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/swifty.rb +10 -7
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: babd98ede59a2b1ba2eaa523b90deea2039f8d02
|
4
|
+
data.tar.gz: d7d95e9889664bc5be426385d1b18974533a1bc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73cfc83423a1e1dca3e6e5f207ab08c75871e48edf1da57002b1ebfa6261d183ddcf9cea08ca449498937bf113de5d2a9951846b470e0eb25c83dbf8dd99c0d6
|
7
|
+
data.tar.gz: 5700c57a11e8f2cb6ebd3dff5ff270ec0055629b08fc053df0c299c312da6607f96d70dfc1baa2400ee2e54e2f1a75bf25bbd470ff831730275f04a7229d91ec
|
data/lib/swifty.rb
CHANGED
@@ -12,16 +12,19 @@ require 'yaml'
|
|
12
12
|
require 'exceptions'
|
13
13
|
|
14
14
|
class Swifty
|
15
|
-
attr_reader :content, :options
|
15
|
+
attr_reader :content, :options, :statement
|
16
16
|
|
17
|
-
def initialize(
|
17
|
+
def initialize(content, **options)
|
18
18
|
@options = options
|
19
|
-
@content =
|
19
|
+
@content = content.is_a?(File) ? content.read : content
|
20
|
+
@statement ||= Cmxl.parse(content, encoding: options[:encoding]).first
|
20
21
|
end
|
21
22
|
|
22
|
-
|
23
|
+
def to_hash
|
24
|
+
statement.to_hash
|
25
|
+
end
|
23
26
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
+
def to_yaml
|
28
|
+
to_hash.to_yml
|
29
|
+
end
|
27
30
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swifty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2.alpha
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emil Kampp
|
@@ -32,9 +32,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
32
32
|
version: '0'
|
33
33
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
34
34
|
requirements:
|
35
|
-
- - "
|
35
|
+
- - ">"
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
37
|
+
version: 1.3.1
|
38
38
|
requirements: []
|
39
39
|
rubyforge_project:
|
40
40
|
rubygems_version: 2.4.8
|