swifty 0.0.14 → 0.0.15
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 +1 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f88bce0f7ad71b6583b4717728616180c19d1166
|
4
|
+
data.tar.gz: 3d6621155140d386832c8e3dc9c61af1c695056d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87d9d995683a77ff021c754a70a311046c139d6da56188e664842f952202e5e74c10614f120476e3302538d761656ce93c0892512270c97aed1f6c455dbd71ac
|
7
|
+
data.tar.gz: f340f9e4e5f1d9c1075297c6d956498a1a9bc22962ba130ecfcc1c5ac77234ac380cb0543bc61c05494437de14a22c34a39554402ecb0ef4df283928a275bc17
|
data/lib/swifty.rb
CHANGED
@@ -4,8 +4,6 @@ require 'choice'
|
|
4
4
|
require 'pp'
|
5
5
|
require 'yaml'
|
6
6
|
|
7
|
-
NoFile = Class.new(StandardError)
|
8
|
-
|
9
7
|
Cmxl.config[:statement_separator] = /-\}/m
|
10
8
|
Cmxl.config[:raise_line_format_errors] = true
|
11
9
|
|
@@ -44,6 +42,7 @@ module Swifty
|
|
44
42
|
attr_reader :content, :options, :statement
|
45
43
|
|
46
44
|
def initialize(content, **options)
|
45
|
+
content = File.read(content) if File.exists?(content)
|
47
46
|
@options = options
|
48
47
|
@content = content.is_a?(File) ? content.read : content
|
49
48
|
@statement ||= Cmxl.parse(content, encoding: options[:encoding]).first
|